/**
 * TRANSPORT MD3 LLC — ANIMACIONES MODERNAS 2026
 * Scroll-driven animations nativas (CSS View Timeline) con fallback progresivo
 */

/* ==========================================================================
   1. KEYFRAMES NATIVOS
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(28, 154, 139, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(28, 154, 139, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ==========================================================================
   2. SCROLL-DRIVEN ANIMATIONS 2026 (NATIVAS)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    /* Animación al entrar elementos al viewport */
    .scroll-reveal {
      animation: fadeInUp linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }

    .scroll-reveal-scale {
      animation: fadeInScale linear backwards;
      animation-timeline: view();
      animation-range: entry 15% cover 35%;
    }

    .bento-card {
      animation: fadeInUp linear backwards;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }

    .stat-item {
      animation: fadeInScale linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* ==========================================================================
   3. FALLBACK PROGRESIVO PARA NAVEGADORES SIN VIEW-TIMELINE
   ========================================================================== */
.reveal-fallback {
  opacity: 0;
  transform: translateY(28px);
  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-fallback.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Retardos escalonados para listas o grids */
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }

/* ==========================================================================
   4. MICRO-INTERACCIONES Y DETALLES LUXURY
   ========================================================================== */
.pulse-badge {
  animation: pulseGlow 2.8s infinite ease-in-out;
}

/* Efecto brillo sutil en botones principales al interactuar */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.btn-primary:hover::after {
  left: 200%;
}

/* Indicador de pulsación verde del widget de WhatsApp */
.wa-badge-online {
  animation: pulseGlow 2.2s infinite ease-in-out;
}

/* ==========================================================================
   5. ACCESIBILIDAD (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;
  }
}
