/* =============================================================
   ANDROLOGIA MOINHOS — ANIMAÇÕES E EFEITOS
   ============================================================= */

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Classes de animação com IntersectionObserver ────────── */
/* Estado inicial — invisível antes da animação */
.animate {
  opacity: 0;
}

/* Estado ativo — IntersectionObserver adiciona .is-visible */
.animate.is-visible {
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation-fill-mode: both;
  opacity: 1;
}

.animate--fade-up.is-visible      { animation-name: fadeInUp; }
.animate--fade-left.is-visible    { animation-name: fadeInLeft; }
.animate--fade-right.is-visible   { animation-name: fadeInRight; }
.animate--fade.is-visible         { animation-name: fadeIn; }

/* Delays */
.animate--delay-1 { animation-delay: 0.1s; }
.animate--delay-2 { animation-delay: 0.2s; }
.animate--delay-3 { animation-delay: 0.3s; }
.animate--delay-4 { animation-delay: 0.4s; }
.animate--delay-5 { animation-delay: 0.5s; }

/* ── WhatsApp flutuante ──────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 32px;
  right: 28px;
  z-index: var(--z-float);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
  animation: float 3s ease-in-out infinite;
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #25D366;
  animation: pulse-ring 2.5s ease-out infinite;
  z-index: -1;
}

.whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
  animation-play-state: paused;
}

.whatsapp-float:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: var(--color-white);
  flex-shrink: 0;
}

/* ── Respeitando prefers-reduced-motion ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .animate,
  .animate.is-visible {
    opacity: 1;
    animation: none;
  }

  .whatsapp-float {
    animation: none;
  }

  .whatsapp-float::before {
    animation: none;
  }

  .sobre__badge {
    animation: none;
  }
}
