/**
 * SOULÉPUREVANA — WhatsApp Floating Button Styles
 * ================================================
 * Luxury animated WhatsApp FAB: bottom-right fixed, glowing pulse,
 * contextual tooltip pill, smooth hover spring, reduced-motion safe.
 */

/* ── WRAPPER (positioning shell) ── */
#pv-wa-fab-wrap {
  --pv-wa-bottom: 100px;
  --pv-wa-right:  24px;

  position: fixed;
  bottom: var(--pv-wa-bottom);
  right:  var(--pv-wa-right);
  z-index: 99980;          /* Below cart drawer (99990) but above content */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;    /* Children opt back in */
}

/* ── MAIN FAB BUTTON ── */
#pv-wa-fab {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow:
    0 4px 18px rgba(37, 211, 102, 0.55),
    0 2px 6px  rgba(0, 0, 0, 0.20);
  transition:
    transform  280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  cursor: pointer;

  /* Entrance animation */
  animation: pvWaFabEntrance 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 1200ms; /* Delay entrance until page settles */
}

#pv-wa-fab:hover,
#pv-wa-fab:focus-visible {
  transform: scale(1.12);
  box-shadow:
    0 8px 28px rgba(37, 211, 102, 0.70),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

#pv-wa-fab:active {
  transform: scale(0.96);
}

/* ── WhatsApp SVG Icon ── */
.pv-wa-fab__icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* ── GLOW PULSE RING ── */
.pv-wa-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(37, 211, 102, 0.70);
  animation: pvWaPulse 2.4s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
  animation-delay: 1800ms;
  pointer-events: none;
}

/* Second pulse (staggered) */
.pv-wa-fab__pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.45);
  animation: pvWaPulse 2.4s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
  animation-delay: 2600ms;
}

/* ── CONTEXTUAL TOOLTIP PILL ── */
#pv-wa-tooltip {
  pointer-events: none;
  position: absolute;
  bottom: 50%;
  right: calc(100% + 14px);
  transform: translateY(50%) translateX(6px);
  opacity: 0;
  transition:
    opacity   220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

/* Repositioned relative to wrapper */
#pv-wa-fab-wrap {
  position: fixed;
}

#pv-wa-tooltip {
  position: absolute;
  bottom: 50%;
  right: calc(100% + 14px);
}

#pv-wa-tooltip.is-visible {
  opacity: 1;
  transform: translateY(50%) translateX(0px);
}

.pv-wa-fab__tooltip-text {
  display: block;
  background: #0B2318;
  color: #E8FFE8;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid rgba(37, 211, 102, 0.30);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(37, 211, 102, 0.08);

  /* Pointer arrow on right side */
  position: relative;
}

.pv-wa-fab__tooltip-text::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #0B2318;
}

/* ── ENTRANCE KEYFRAMES ── */
@keyframes pvWaFabEntrance {
  from {
    opacity: 0;
    transform: scale(0) rotate(-30deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ── PULSE KEYFRAMES ── */
@keyframes pvWaPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* ── MOBILE ADJUSTMENTS ── */
@media (max-width: 768px) {
  #pv-wa-fab-wrap {
    --pv-wa-bottom: 88px;  /* Clear mobile sticky purchase bar */
    --pv-wa-right:  16px;
  }

  #pv-wa-fab {
    width: 52px;
    height: 52px;
  }

  .pv-wa-fab__icon {
    width: 27px;
    height: 27px;
  }

  /* Move tooltip above button on small screens to avoid clipping */
  #pv-wa-tooltip {
    bottom: calc(100% + 10px);
    right: 0;
    transform: translateX(0) translateY(8px);
  }

  #pv-wa-tooltip.is-visible {
    transform: translateX(0) translateY(0);
  }

  .pv-wa-fab__tooltip-text::after {
    /* Arrow points down on mobile */
    right: 18px;
    top: 100%;
    transform: none;
    border-top: 8px solid #0B2318;
    border-bottom: none;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
  }
}

/* ── REDUCE MOTION RESPECT ── */
@media (prefers-reduced-motion: reduce) {
  #pv-wa-fab {
    animation: none;
  }

  .pv-wa-fab__pulse,
  .pv-wa-fab__pulse::after {
    animation: none;
  }

  #pv-wa-fab,
  #pv-wa-tooltip {
    transition: none;
  }
}
