/* ═══════════════════════════════════════════════════════════
   WHATSAPP FLOAT BUTTON (FAB)
   - Sempre visível canto inferior direito
   - Verde oficial do WhatsApp (#25D366)
   - Pulse sutil pra chamar atenção
   - Tooltip "Fale conosco" no hover (desktop)
   - Esconde durante scroll rápido, no hero ou modais abertos
   ═══════════════════════════════════════════════════════════ */

.whatsapp-float {
  position: fixed;
  bottom: calc(var(--safe-bottom, 0px) + var(--space-6));
  right: var(--space-5);
  z-index: 9997;            /* abaixo de modal/navbar/cookie-banner */

  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  background: #25D366;     /* verde oficial do WhatsApp */
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4),
              0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              bottom var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  pointer-events: none;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.55),
              0 4px 10px rgba(0, 0, 0, 0.2);
  outline: none;
}

.whatsapp-float:active {
  transform: scale(1.05);
  transition-duration: 100ms;
}

/* ─────────── Pulse sutil (chama atenção sem atrapalhar) ─────────── */
.whatsapp-float.is-pulsing::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  animation: waPulse 2s ease-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes waPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ─────────── Tooltip "Fale conosco" (desktop) ─────────── */
.whatsapp-float::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--color-deep-forest);
  color: var(--color-mint);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast),
              transform var(--duration-fast) var(--ease-out);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.whatsapp-float:hover::after,
.whatsapp-float:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ─────────── Estados de hide ─────────── */
.whatsapp-float.is-hidden {
  transform: translateY(80px) scale(0.8);
  opacity: 0;
  pointer-events: none;
}

/* No hero — fica menor + translúcido (não compete com CTAs do hero) */
.whatsapp-float.is-at-hero {
  transform: scale(0.85);
  opacity: 0.7;
}
.whatsapp-float.is-at-hero:hover {
  transform: scale(1) translateY(-2px);
  opacity: 1;
}

/* ─────────── Não sobrepor cookie banner ─────────── */
.cookie-banner.is-visible ~ .whatsapp-float {
  bottom: calc(var(--safe-bottom, 0px) + 120px);
}

/* ─────────── Esconde quando modal/menu aberto ─────────── */
body.is-modal-open .whatsapp-float,
body.is-menu-open .whatsapp-float {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ─────────── Mobile ─────────── */
@media (max-width: 480px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    right: var(--space-4);
    bottom: calc(var(--safe-bottom, 0px) + var(--space-5));
  }
  .whatsapp-float svg {
    width: 26px;
    height: 26px;
  }
  /* Tooltip não aparece no mobile (toque já navega) */
  .whatsapp-float::after {
    display: none;
  }
  /* Cookie banner empilha mais no mobile */
  .cookie-banner.is-visible ~ .whatsapp-float {
    bottom: calc(var(--safe-bottom, 0px) + 200px);
  }
}

/* ─────────── Reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float.is-pulsing::before {
    animation: none;
  }
}
