/* ==========================================================================
   CRISTAL FIBRAS PISCINAS - ANIMATION & MOTION SYSTEM
   Impeccable Craft Floor & High Performance
   ========================================================================== */

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

/* Water Wave Gentle Flow */
@keyframes waterFlow {
  0% {
    transform: translateX(0) translateZ(0) scaleY(1);
  }
  50% {
    transform: translateX(-25%) translateZ(0) scaleY(1.08);
  }
  100% {
    transform: translateX(-50%) translateZ(0) scaleY(1);
  }
}

/* Water Ripple Pulse */
@keyframes waterRipple {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Gold Warranty Shimmer */
@keyframes goldShimmer {
  0% {
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.7));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.3));
  }
}

/* WhatsApp Pulse Attention */
@keyframes pulseWhatsApp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Subtle Floating Effect */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ==========================================================================
   MOTION CLASSES
   ========================================================================== */

/* Water Wave Layers */
.water-wave-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}

.water-wave {
  display: block;
  width: 200%;
  height: 60px;
  animation: waterFlow 18s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
}

.water-wave-layer-2 {
  opacity: 0.5;
  animation-duration: 12s;
  animation-direction: reverse;
}

/* Scroll Reveal using IntersectionObserver */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* Parallax Layer */
.parallax-layer {
  position: relative;
  will-change: transform;
}

/* Gold Shimmer on Warranty Seal */
.badge-warranty-shimmer {
  animation: goldShimmer 3s ease-in-out infinite;
}

/* WhatsApp Floating Button Pulse */
.btn-whatsapp-floating {
  animation: pulseWhatsApp 2.5s infinite;
}

/* Floating Card / Badge */
.float-subtle {
  animation: subtleFloat 4s ease-in-out infinite;
}

/* Card 3D Tilt */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 150ms ease-out;
}

.tilt-inner {
  transform: translateZ(20px);
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .water-wave {
    animation: none !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .btn-whatsapp-floating {
    animation: none !important;
  }

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

  .tilt-card {
    transform: none !important;
  }
}
