/* Legacy page-level floating WhatsApp buttons (contact, bridal, makeup) */
body.site-has-wa-fab .ds-sticky-wa,
body.site-has-wa-fab .bb-float-wa,
body.site-has-wa-fab .lg-float-wa {
  display: none !important;
}

.global-wa-fab-wrap {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  top: auto;
  z-index: 1050;
  pointer-events: none;
}

.global-wa-fab-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.55rem;
  pointer-events: auto;
}

.global-wa-fab-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.global-wa-fab-chip {
  margin: 0;
  font-family: inherit;
}

.global-wa-fab-chip--hint {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ds-ink, #1a1416);
  background: var(--ds-accent-gradient-soft, linear-gradient(145deg, #fffdf9 0%, #f8f1e4 100%));
  border: 1px solid var(--ds-accent-border, rgba(201, 169, 98, 0.45));
  border-radius: 100px;
  padding: 0.45rem 0.85rem;
  box-shadow: 0 6px 18px rgba(26, 20, 22, 0.1);
  white-space: nowrap;
  cursor: pointer;
}

.global-wa-fab-chip--offer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem;
  background: var(--ds-accent-gradient-soft, linear-gradient(145deg, #fffdf9 0%, #f8f1e4 100%));
  border: 1px solid var(--ds-accent-border-soft, rgba(201, 169, 98, 0.38));
  border-radius: 12px;
  box-shadow:
    0 10px 26px rgba(var(--ds-ink-rgb, 26, 20, 22), 0.12),
    0 4px 14px rgba(var(--ds-accent-rgb, 201, 169, 98), 0.1);
  max-width: min(11rem, calc(100vw - 6rem));
}

.global-wa-fab-chip__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-accent-muted, #9a7b3a);
}

.global-wa-fab-chip__pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ds-accent-muted, #9a7b3a);
  line-height: 1.2;
}

.global-wa-fab-chip__code {
  font-size: 0.72rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
  color: var(--ds-ink, #1a1416);
  word-break: break-all;
  text-align: right;
  line-height: 1.25;
}

.global-wa-fab-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow:
    0 4px 14px rgba(37, 211, 102, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.global-wa-fab-btn .fab {
  font-size: 1.75rem;
  line-height: 1;
}

.global-wa-fab-btn:hover {
  color: #fff;
  background: #20bd5a;
  transform: scale(1.06);
  box-shadow:
    0 8px 22px rgba(37, 211, 102, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.global-wa-fab-bounce {
  display: flex;
  flex-shrink: 0;
  animation: global-wa-bounce 2.5s ease-in-out infinite;
  will-change: transform;
}

.global-wa-fab-bounce:has(.global-wa-fab-btn:hover),
.global-wa-fab-bounce:has(.global-wa-fab-btn:focus-visible) {
  animation: none;
}

@keyframes global-wa-bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.global-wa-fab-btn__ring {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--ds-accent-ring, linear-gradient(135deg, #a2ded8, #5a9e94));
  border: 2px solid #fff;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.global-wa-fab-btn.is-loading {
  opacity: 0.88;
  pointer-events: none;
}

.global-wa-fab-btn.is-loading .fab {
  opacity: 0.4;
}

.global-wa-fab-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: global-wa-spin 0.65s linear infinite;
}

@keyframes global-wa-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 1200px) {
  .global-wa-fab-wrap {
    right: max(1rem, env(safe-area-inset-right, 0px));
    left: auto;
  }

  .global-wa-fab-row {
    align-items: flex-end;
  }

  .global-wa-fab-actions {
    justify-content: flex-end;
  }

  .global-wa-fab-chip--offer {
    align-items: flex-end;
  }

  .global-wa-fab-chip__code {
    text-align: right;
  }

  body.site-has-svc-cart-desktop-inline .global-wa-fab-chip--offer {
    margin-bottom: 0.15rem;
  }

  body.site-has-svc-cart-desktop-inline .global-wa-fab-btn__ring[hidden] {
    display: none !important;
  }

  body.site-has-svc-cart-desktop-inline:has(.global-wa-fab-chip--offer:not([hidden])) .global-wa-fab-btn__ring:not([hidden]) {
    display: none !important;
  }

  /* Desktop — keep WhatsApp visible on every page (booking, services cart, modals). */
  .global-wa-fab-wrap {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
  }

  body:has(.booking-page--simple) .global-wa-fab-wrap,
  body.booking-modal-open .global-wa-fab-wrap,
  body.site-has-svc-cart-sticky .global-wa-fab-wrap {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
  }

  body.site-has-svc-cart-sticky .global-wa-fab-wrap {
    bottom: calc(var(--svc-cart-sticky-offset, 3.35rem) + max(1rem, env(safe-area-inset-bottom, 0px)));
  }

  body.is-offer-toast-visible .global-wa-fab-wrap {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
  }
}

@media (max-width: 991px) {
  .global-wa-fab-wrap {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .global-wa-fab-chip--offer,
  .global-wa-fab-chip--hint {
    display: none !important;
  }

  .global-wa-fab-btn__ring:not([hidden]) {
    display: inline-flex !important;
  }

  body.site-has-mobile-bottom-nav.site-has-svc-cart-sticky .global-wa-fab-btn__ring:not([hidden]) {
    display: inline-flex !important;
  }

  .global-wa-fab-btn {
    width: 3.35rem;
    height: 3.35rem;
  }

  .global-wa-fab-btn .fab {
    font-size: 1.6rem;
  }
}

@media (max-width: 380px) {
  .global-wa-fab-btn {
    width: 3.1rem;
    height: 3.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-wa-fab-bounce {
    animation: none;
  }
}
