/* ==========================================================================
   Tierra Mate — Yerba Orgánica Premium
   Animations & Transitions — Complete
   ========================================================================== */

/* ── Bounce Animation for Scroll Indicator ── */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) rotate(45deg);
  }
  40% {
    transform: translateY(-8px) rotate(45deg);
  }
  60% {
    transform: translateY(-4px) rotate(45deg);
  }
}

/* ── WhatsApp Floating Button Pulse ── */
@keyframes wa-pulse {
  0% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3), 0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  70% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3), 0 0 0 18px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ── Cursor Glow Effect ── */
#cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(192, 90, 52, 0.08) 0%,
    rgba(190, 142, 67, 0.04) 35%,
    rgba(99, 103, 47, 0.02) 60%,
    rgba(0, 0, 0, 0) 75%
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0;
  transition: width 0.4s ease, height 0.4s ease, opacity 0.3s ease;
  will-change: left, top;
}

#cursor-glow.visible {
  opacity: 1;
}

#cursor-glow.hovering {
  width: 400px;
  height: 400px;
}

@media (max-width: 768px) {
  #cursor-glow {
    display: none !important;
  }
}

@media (pointer: coarse) {
  #cursor-glow {
    display: none !important;
  }
}

/* ── Scroll Reveal Base Styles ── */
.reveal-on-scroll {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reveal Directions */
.reveal-on-scroll.fade-in {
  transform: none;
}

.reveal-on-scroll.slide-up {
  transform: translateY(40px);
}

.reveal-on-scroll.slide-left {
  transform: translateX(-40px);
}

.reveal-on-scroll.slide-right {
  transform: translateX(40px);
}

.reveal-on-scroll.zoom-in {
  transform: scale(0.9);
}

/* Revealed Active State */
.reveal-on-scroll.revealed {
  opacity: 1;
  transform: none;
}

/* Staggered Delay Classes (for sibling animations) */
.reveal-delay-1 { transition-delay: 0.12s !important; }
.reveal-delay-2 { transition-delay: 0.24s !important; }
.reveal-delay-3 { transition-delay: 0.36s !important; }
.reveal-delay-4 { transition-delay: 0.48s !important; }
.reveal-delay-5 { transition-delay: 0.60s !important; }

/* ── Floating WhatsApp Button ── */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  background-color: #25D366;
  color: #FFFFFF !important;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background-color 0.3s ease;
  animation: wa-pulse 2s infinite;
  text-decoration: none;
}

.whatsapp-float:hover {
  background-color: #128C7E;
  transform: scale(1.1);
  color: #FFFFFF !important;
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }
}

/* ── Floating Leaf Animation for Parallax ── */
@keyframes float-gentle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-12px) rotate(2deg);
  }
  66% {
    transform: translateY(6px) rotate(-1deg);
  }
}

.hero-leaf {
  animation: float-gentle 12s ease-in-out infinite;
}

.hero-leaf--2 {
  animation-delay: -3s;
  animation-duration: 15s;
}

.hero-leaf--3 {
  animation-delay: -6s;
  animation-duration: 10s;
}

.hero-leaf--5 {
  animation-delay: -2s;
  animation-duration: 14s;
}

/* ── Header Scroll State ── */
.main-header.scrolled {
  background-color: rgba(249, 240, 226, 0.98);
  box-shadow: 0 4px 20px rgba(45, 31, 19, 0.08);
}

/* ── Card Hover Micro-animations ── */
.product-card,
.philosophy-card,
.step-card,
.testimonial-card {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Active Nav Link ── */
.nav-link.active {
  color: var(--color-terracota);
}

.nav-link.active::after {
  width: 100%;
}

/* ── Hero Logo Wrapper Floating Animation ── */
@keyframes logo-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero-logo-wrapper {
  display: inline-block;
  animation: logo-float 5s ease-in-out infinite;
}

/* ── Accessibility / Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .whatsapp-float {
    animation: none !important;
  }

  .scroll-indicator .scroll-arrow {
    animation: none !important;
  }

  .hero-leaf {
    animation: none !important;
  }

  .hero-logo-wrapper {
    animation: none !important;
  }

  .product-card,
  .philosophy-card,
  .step-card,
  .testimonial-card {
    transition: none !important;
  }

  #cursor-glow {
    display: none !important;
  }
}
