/* ============================================================
   Social Float Bar Pro — Frontend CSS v1.3.0
   New: Group CTA support
   ============================================================ */

/*#sfb-wrap {*/
/*  position: fixed;*/
/*  z-index: 999999;*/
/*  display: flex;*/
/*  flex-direction: column;*/
/*  align-items: center;*/
/*  gap: 10px;*/
/*}*/

/* ── Button list ── */
.sfb-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Base button ── */
.sfb-btn {
  position: relative;
  width: var(--sfb-btn-size, 48px);
  height: var(--sfb-btn-size, 48px);
  border-radius: 50%;
  background: var(--btn-color, #333);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}
.sfb-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}
.sfb-btn:hover .sfb-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* ── Icon ── */
.sfb-icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--sfb-btn-size, 48px) * 0.46);
  height: calc(var(--sfb-btn-size, 48px) * 0.46);
}
.sfb-icon svg,
.sfb-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sfb-icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--sfb-btn-size, 48px) * 0.46);
  line-height: 1;
}

/* ── Hover label ── */
.sfb-label {
  position: absolute;
  right: calc(100% + var(--sfb-label-gap, 12px));
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--btn-color, #333);
  color: #fff;
  font-size: var(--sfb-label-font, 12px);
  font-weight: 600;
  padding: var(--sfb-label-pad-y, 4px) var(--sfb-label-pad-x, 10px);
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.sfb-pos-left .sfb-label {
  right: auto;
  left: calc(100% + var(--sfb-label-gap, 12px));
  transform: translateY(-50%) translateX(-6px);
}
.sfb-btn:hover .sfb-label {
  transform: translateY(-50%) translateX(0);
}

/* ── Ring pulse ── */
.sfb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--btn-color, #fff);
  opacity: 0;
  animation: sfb-ring 3s ease-out infinite;
}
.sfb-btn:nth-child(2) .sfb-ring {
  animation-delay: 0.35s;
}
.sfb-btn:nth-child(3) .sfb-ring {
  animation-delay: 0.7s;
}
.sfb-btn:nth-child(4) .sfb-ring {
  animation-delay: 1.05s;
}
.sfb-btn:nth-child(5) .sfb-ring {
  animation-delay: 1.4s;
}
@keyframes sfb-ring {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ============================================================
   GROUP CTA
   ============================================================ */
.sfb-group {
  position: relative;
  width: var(--sfb-btn-size, 48px);
  height: var(--sfb-btn-size, 48px);
}

.sfb-group-icon-close {
  display: none;
}
.sfb-group.is-open .sfb-group-icon-open {
  display: none;
}
.sfb-group.is-open .sfb-group-icon-close {
  display: flex;
}

.sfb-btn-group {
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}
.sfb-group.is-open .sfb-btn-group {
  transform: scale(1.06) rotate(45deg);
}

.sfb-group-children {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.sfb-group-child {
  position: absolute;
  top: 50%;
  left: 40%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.55);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
}

.sfb-group-child {
  --fan-step: calc(var(--sfb-btn-size, 39px) + 25px);
  --tx: 0px;
  --ty: 0px;
}

/* Cánh cung ôm quanh nút CTA chính */
.sfb-pos-right .sfb-group-child:nth-child(1) {
  --tx: calc(var(--fan-step) * -0.8);
  --ty: calc(var(--fan-step) * 0.5);
}

.sfb-pos-right .sfb-group-child:nth-child(2) {
  --tx: calc(var(--fan-step) * -1.2);
  --ty: calc(var(--fan-step) * -0.3);
}

.sfb-pos-right .sfb-group-child:nth-child(3) {
  --tx: calc(var(--fan-step) * -0.6);
  --ty: calc(var(--fan-step) * -1);
}

.sfb-pos-right .sfb-group-child:nth-child(4) {
  --tx: calc(var(--fan-step) * 0.34);
  --ty: calc(var(--fan-step) * -1.52);
}
.sfb-pos-right .sfb-group-child:nth-child(5) {
  --tx: calc(var(--fan-step) * 0.82);
  --ty: calc(var(--fan-step) * -0.88);
}
.sfb-pos-right .sfb-group-child:nth-child(6) {
  --tx: calc(var(--fan-step) * 0.92);
  --ty: calc(var(--fan-step) * -0.1);
}

.sfb-pos-left .sfb-group-child:nth-child(1) {
  --tx: calc(var(--fan-step) * 0.92);
  --ty: calc(var(--fan-step) * -0.1);
}
.sfb-pos-left .sfb-group-child:nth-child(2) {
  --tx: calc(var(--fan-step) * 0.82);
  --ty: calc(var(--fan-step) * -0.88);
}
.sfb-pos-left .sfb-group-child:nth-child(3) {
  --tx: calc(var(--fan-step) * 0.34);
  --ty: calc(var(--fan-step) * -1.52);
}
.sfb-pos-left .sfb-group-child:nth-child(4) {
  --tx: calc(var(--fan-step) * -0.34);
  --ty: calc(var(--fan-step) * -1.52);
}
.sfb-pos-left .sfb-group-child:nth-child(5) {
  --tx: calc(var(--fan-step) * -0.82);
  --ty: calc(var(--fan-step) * -0.88);
}
.sfb-pos-left .sfb-group-child:nth-child(6) {
  --tx: calc(var(--fan-step) * -0.92);
  --ty: calc(var(--fan-step) * -0.1);
}

.sfb-group.is-open .sfb-group-child {
  opacity: 1;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
}
.sfb-group.is-open .sfb-group-child:nth-child(1) {
  transition-delay: 0.03s;
}
.sfb-group.is-open .sfb-group-child:nth-child(2) {
  transition-delay: 0.06s;
}
.sfb-group.is-open .sfb-group-child:nth-child(3) {
  transition-delay: 0.09s;
}
.sfb-group.is-open .sfb-group-child:nth-child(4) {
  transition-delay: 0.12s;
}
.sfb-group.is-open .sfb-group-child:nth-child(5) {
  transition-delay: 0.15s;
}
.sfb-group.is-open .sfb-group-child:nth-child(6) {
  transition-delay: 0.18s;
}

.sfb-group-child .sfb-label {
  pointer-events: none;
}
.sfb-group-child:hover .sfb-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}
/* ============================================================
   Animations
   ============================================================ */
.sfb-anim-pulse .sfb-btn {
  animation: sfb-pulse 2s ease-in-out infinite;
}
.sfb-anim-bounce .sfb-btn {
  animation: sfb-bounce 1.8s ease-in-out infinite;
}
.sfb-anim-shake .sfb-btn {
  animation: sfb-shake 3s ease-in-out infinite;
}
.sfb-anim-glow .sfb-btn {
  animation: sfb-glow 1.6s ease-in-out infinite alternate;
}

/* Pause animations on group children when group is open */
.sfb-group.is-open .sfb-group-child {
  animation: none !important;
}

.sfb-anim-pulse .sfb-btn:nth-child(2),
.sfb-anim-bounce .sfb-btn:nth-child(2),
.sfb-anim-shake .sfb-btn:nth-child(2),
.sfb-anim-glow .sfb-btn:nth-child(2) {
  animation-delay: 0.18s;
}
.sfb-anim-pulse .sfb-btn:nth-child(3),
.sfb-anim-bounce .sfb-btn:nth-child(3),
.sfb-anim-shake .sfb-btn:nth-child(3),
.sfb-anim-glow .sfb-btn:nth-child(3) {
  animation-delay: 0.36s;
}
.sfb-anim-pulse .sfb-btn:nth-child(4),
.sfb-anim-bounce .sfb-btn:nth-child(4),
.sfb-anim-shake .sfb-btn:nth-child(4),
.sfb-anim-glow .sfb-btn:nth-child(4) {
  animation-delay: 0.54s;
}

@keyframes sfb-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.12),
      0 8px 22px rgba(0, 0, 0, 0.24);
  }
}
@keyframes sfb-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}
@keyframes sfb-shake {
  0%,
  90%,
  100% {
    transform: rotate(0);
  }
  92%,
  96% {
    transform: rotate(-10deg);
  }
  94%,
  98% {
    transform: rotate(10deg);
  }
}
@keyframes sfb-glow {
  from {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
  to {
    box-shadow: 0 0 18px var(--btn-color, var(--sfb-glow)),
      0 0 36px var(--btn-color, var(--sfb-glow));
  }
}

/* ── Scroll hide ── */
#sfb-wrap {
  transition: opacity 0.35s ease;
}
#sfb-wrap.sfb-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .sfb-label {
    display: none;
  }
}


/* Fix hiển thị icon Group CTA và icon ảnh trên frontend */
#sfb-wrap .sfb-icon,
#sfb-wrap .sfb-group-icon-open,
#sfb-wrap .sfb-group-icon-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    overflow: visible !important;
}

/* Ảnh icon custom */
#sfb-wrap .sfb-icon-image,
#sfb-wrap .sfb-icon img,
#sfb-wrap .sfb-group-icon-open img,
#sfb-wrap .sfb-group-icon-close img {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    object-fit: contain !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}


#sfb-wrap .sfb-group-icon-open svg, #sfb-wrap .sfb-group-icon-open.sfb-icon svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    flex: 0 0 22px !important;
    fill: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}