/* ===================================
   ANIMATIONS.CSS - Sistema de Animaciones Base
   Mejoras Visuales Distrimayor
   =================================== */

/* ===================================
   KEYFRAMES BÁSICOS
   =================================== */

/* Animaciones de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInDown {
    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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animaciones de hero section */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de gradiente dinámico */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animación flotante */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Animación de pulso suave */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Efecto shimmer */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(200%) rotate(45deg);
    }
}

/* Animación de rotación suave */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animación de bounce suave */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   CLASES DE ANIMACIÓN UTILITARIAS
   =================================== */

/* Animaciones de entrada básicas */
.animate-fade-in {
    animation: fadeIn 0.8s var(--transition-normal) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s var(--transition-normal) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s var(--transition-normal) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s var(--transition-normal) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s var(--transition-normal) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s var(--transition-normal) forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s var(--transition-normal) forwards;
}

/* Animaciones continuas */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===================================
   ANIMACIONES ESCALONADAS
   =================================== */

/* Para elementos que aparecen en secuencia */
.stagger-animation {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--transition-normal) forwards;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   TRANSICIONES MEJORADAS
   =================================== */

/* Transiciones base para elementos interactivos */
.smooth-transition {
    transition: all var(--transition-normal);
}

.smooth-transition-fast {
    transition: all var(--transition-fast);
}

.smooth-transition-slow {
    transition: all var(--transition-slow);
}

/* Transiciones específicas para hover */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ===================================
   OPTIMIZACIONES GPU
   =================================== */

/* Clase base para elementos animados - optimización GPU */
.gpu-optimized {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Para elementos que se animan frecuentemente */
.gpu-transform {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.gpu-opacity {
    will-change: opacity;
}

.gpu-filter {
    will-change: filter;
}

/* ===================================
   ESTADOS DE CARGA Y LAZY LOADING
   =================================== */

/* Estado inicial para elementos con lazy loading */
.lazy-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.lazy-animate.loaded {
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    opacity: 1;
    transform: translateY(0);
}

/* Indicador de carga */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===================================
   ACCESIBILIDAD - RESPETO POR PREFERENCIAS
   =================================== */

/* Respeto por usuarios que prefieren movimiento reducido */
@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;
    }
    
    .animate-float,
    .animate-pulse,
    .animate-spin,
    .hero-gradient-animate,
    .hero-particle {
        animation: none !important;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none !important;
    }
    
    .hero-title,
    .hero-subtitle,
    .hero-cta {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===================================
   FALLBACKS PARA COMPATIBILIDAD
   =================================== */

/* Fallback para navegadores sin soporte de backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .navbar-transparent-enhanced {
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .custom-navbar.transparent-nav {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* Fallback para navegadores sin soporte de clip-path */
@supports not (clip-path: ellipse(70% 100% at 50% 0%)) {
    .hero-video-container {
        clip-path: none;
        border-radius: 0 0 50px 50px;
    }
}

/* Fallback para dispositivos de baja potencia */
@media (max-width: 768px) {
    .hero-particles {
        display: none;
    }
    
    .video-overlay {
        animation: none;
        background: linear-gradient(
            135deg, 
            rgba(21, 101, 192, 0.8) 0%, 
            rgba(46, 125, 50, 0.7) 50%, 
            rgba(245, 124, 0, 0.8) 100%
        );
    }
    
    .hero-title,
    .hero-subtitle,
    .hero-cta {
        animation-duration: 0.5s;
    }
}

/* ===================================
   ANIMACIONES ESPECÍFICAS DEL HERO
   =================================== */

/* Animaciones para el hero section */
.hero-title-animate {
    opacity: 0;
    animation: slideInFromTop 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.hero-subtitle-animate {
    opacity: 0;
    animation: slideInFromBottom 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

.hero-cta-animate {
    opacity: 0;
    animation: scaleIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

/* Gradiente dinámico mejorado para overlay del hero */
.hero-gradient-animate {
    background: linear-gradient(
        135deg, 
        rgba(21, 101, 192, 0.7) 0%, 
        rgba(46, 125, 50, 0.5) 30%,
        rgba(245, 124, 0, 0.6) 70%,
        rgba(21, 101, 192, 0.8) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
}

/* Animación de partículas flotantes para el hero */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.7;
    }
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
}

.hero-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.hero-particle:nth-child(2) { left: 20%; top: 80%; animation-delay: 1s; }
.hero-particle:nth-child(3) { left: 60%; top: 40%; animation-delay: 2s; }
.hero-particle:nth-child(4) { left: 80%; top: 70%; animation-delay: 3s; }
.hero-particle:nth-child(5) { left: 40%; top: 10%; animation-delay: 4s; }
.hero-particle:nth-child(6) { left: 90%; top: 30%; animation-delay: 5s; }

/* ===================================
   ANIMACIONES DE NAVEGACIÓN MEJORADAS
   =================================== */

/* Transición mejorada del navbar */
.navbar-enhanced-transition {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Estado transparente mejorado */
.navbar-transparent-enhanced {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Indicador de sección activa */
.nav-link-enhanced {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-enhanced::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 3px;
    background: var(--accent-orange);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-enhanced.active::after,
.nav-link-enhanced:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Animación del menú móvil */
@keyframes mobileMenuSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-animate {
    animation: mobileMenuSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efecto ripple para navegación */
.nav-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: navRipple 0.6s linear;
    pointer-events: none;
}

@keyframes navRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mejoras para dispositivos touch */
.touch-active {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

/* Efecto hover mejorado para enlaces de navegación */
.nav-link-hover-effect {
    position: relative;
    overflow: hidden;
}

.nav-link-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-hover-effect:hover::before {
    left: 100%;
}

/* ===================================
   EFECTOS HOVER AVANZADOS
   =================================== */

/* Efecto ripple para botones */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ripple-effect:hover::after {
    width: 300px;
    height: 300px;
}

/* Efecto shimmer para tarjetas */
.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.shimmer-effect:hover::after {
    animation: shimmer 0.6s ease-in-out;
    opacity: 1;
}

/* ===================================
   ANIMACIONES DE SCROLL
   =================================== */

/* Clases para elementos que se animan al hacer scroll */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s var(--transition-normal), 
                transform 0.8s var(--transition-normal);
}

.scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Variaciones de animaciones de scroll */
.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s var(--transition-normal), 
                transform 0.8s var(--transition-normal);
}

.scroll-animate-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s var(--transition-normal), 
                transform 0.8s var(--transition-normal);
}

.scroll-animate-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s var(--transition-normal), 
                transform 0.8s var(--transition-normal);
}

.scroll-animate-scale.in-view {
    opacity: 1;
    transform: scale(1);
}
/* =====
==============================
   ANIMACIONES ESPECÍFICAS PARA TASK 3
   =================================== */

/* Animaciones mejoradas para tarjetas */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.glass-card-lg.animate-in {
    animation: cardSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animaciones para botones CTA con efectos 3D */
@keyframes button3DHover {
    0% {
        transform: translateY(0) scale(1) rotateX(0deg);
    }
    50% {
        transform: translateY(-3px) scale(1.01) rotateX(2deg);
    }
    100% {
        transform: translateY(-6px) scale(1.02) rotateX(5deg);
    }
}

.btn-cta:hover,
.btn-pse-seccion:hover {
    animation: button3DHover 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animación de ripple mejorada */
@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: rippleExpand 0.6s linear;
    pointer-events: none;
}

/* Animaciones para botones flotantes */
@keyframes floatingButtonEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    60% {
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-btn.animate-in {
    animation: floatingButtonEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animación de pulso para elementos importantes */
@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-soft);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-medium);
    }
}

.btn-pse-seccion {
    animation: gentlePulse 4s ease-in-out infinite;
}

/* Animaciones para el modal de WhatsApp */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whatsapp-modal-position .modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animación de escritura para textarea */
@keyframes textareaGrow {
    from {
        height: auto;
    }
    to {
        height: var(--target-height);
    }
}

.whatsapp-modal-position textarea.growing {
    animation: textareaGrow 0.2s ease-out;
}

/* Efectos de hover mejorados para iconos */
.icon-box {
    position: relative;
    overflow: hidden;
}

.icon-box::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.glass-card-lg:hover .icon-box::after {
    width: 120%;
    height: 120%;
}

/* Animaciones de entrada para proveedores */
@keyframes providerCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateY(15deg);
    }
    60% {
        transform: translateY(-5px) rotateY(-5deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateY(0deg);
    }
}

.proveedor-card.animate-in {
    animation: providerCardEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efectos de carga shimmer */
@keyframes shimmerLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200px 100%;
    animation: shimmerLoading 1.5s infinite;
}

/* Animaciones de scroll mejoradas */
@keyframes scrollReveal {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.scroll-animate-enhanced {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    filter: blur(5px);
    transition: none;
}

.scroll-animate-enhanced.in-view {
    animation: scrollReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efectos de hover para controles de carousel */
@keyframes carouselControlHover {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1.05);
    }
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    animation: carouselControlHover 0.3s ease-out;
}

/* Animación de indicadores de carousel */
@keyframes indicatorActive {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1.2);
    }
}

.carousel-indicators button.active {
    animation: indicatorActive 0.3s ease-out;
}

/* Efectos de focus mejorados */
.btn-cta:focus-visible,
.btn-pse-seccion:focus-visible,
.floating-btn:focus-visible {
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 var(--accent-orange);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 124, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 124, 0, 0);
    }
}

/* Animaciones para dispositivos de alta performance */
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
    .glass-card-lg:hover {
        animation: cardHoverEnhanced 0.3s ease-out;
    }
    
    @keyframes cardHoverEnhanced {
        0% {
            transform: translateY(0) scale(1);
        }
        50% {
            transform: translateY(-8px) scale(1.01);
        }
        100% {
            transform: translateY(-12px) scale(1.02);
        }
    }
}
/* ===
================================
   ANIMACIONES AVANZADAS - TASK 5
   Sistema de JavaScript para animaciones avanzadas
   =================================== */

/* Animación de ripple avanzada */
@keyframes rippleAnimation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Estados de lazy loading para animaciones pesadas */
.lazy-animation-pending {
    opacity: 0.3;
    filter: blur(1px);
    transition: all 0.3s ease;
}

.lazy-animation-loading {
    opacity: 0.6;
    filter: blur(0.5px);
    transition: all 0.3s ease;
}

.lazy-animation-loaded {
    opacity: 1;
    filter: blur(0);
    transition: all 0.5s ease;
}

/* Sistema de partículas mejorado */
.hero-particle.particle-active {
    animation: particleFloat var(--duration, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate3d(var(--x-offset, 20px), var(--y-offset, -30px), 0) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate3d(calc(var(--x-offset, 20px) * -0.5), calc(var(--y-offset, -30px) * 1.5), 0) scale(0.9);
        opacity: 0.8;
    }
    75% {
        transform: translate3d(calc(var(--x-offset, 20px) * 0.8), calc(var(--y-offset, -30px) * 0.3), 0) scale(1.05);
        opacity: 0.4;
    }
}

/* Micro-animaciones para elementos interactivos */
.advanced-ripple {
    position: absolute !important;
    pointer-events: none !important;
    border-radius: 50% !important;
    z-index: 1000 !important;
}

/* Efectos de parallax suave */
.parallax-smooth {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Optimizaciones GPU para animaciones avanzadas */
.gpu-optimized {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Animaciones de micro-interacciones */
.micro-bounce {
    animation: microBounce 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes microBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.micro-pulse {
    animation: microPulse 0.6s ease-in-out;
}

@keyframes microPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Efectos de parallax sutiles */
.subtle-parallax {
    transition: transform 0.1s ease-out;
}

/* Animaciones de entrada escalonadas mejoradas */
.stagger-enhanced {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-enhanced.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Soporte para prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-particle.particle-active,
    .advanced-ripple,
    .parallax-smooth,
    .micro-bounce,
    .micro-pulse,
    .subtle-parallax {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
    
    .lazy-animation-pending,
    .lazy-animation-loading,
    .lazy-animation-loaded {
        opacity: 1 !important;
        filter: none !important;
        transition: none !important;
    }
    
    .stagger-enhanced {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Fallbacks para navegadores sin soporte */
@supports not (backdrop-filter: blur(10px)) {
    .lazy-animation-pending,
    .lazy-animation-loading {
        filter: none;
    }
}

/* Optimizaciones para dispositivos de baja potencia */
@media (max-width: 768px) and (max-resolution: 150dpi) {
    .hero-particle.particle-active {
        animation-duration: 6s;
    }
    
    .parallax-smooth {
        will-change: auto;
    }
    
    .gpu-optimized {
        will-change: auto;
    }
}

/* ===================================
   MICRO-ANIMACIONES ADICIONALES - TASK 5
   =================================== */

/* Estados de micro-interacciones */
.micro-hover {
    transform: translateY(-2px) scale(1.02);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.micro-focus {
    transform: scale(1.03);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efectos específicos para diferentes tipos de elementos */
.btn.micro-hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.glass-card.micro-hover,
.glass-card-lg.micro-hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-strong);
}

.proveedor-card.micro-hover {
    transform: translateY(-3px) scale(1.05);
}

.nav-link.micro-hover {
    transform: translateY(-1px);
    color: var(--accent-orange);
}

.floating-btn.micro-hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Animaciones de carga progresiva */
.progressive-load {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progressive-load.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Efectos de parallax mejorados */
.parallax-enhanced {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Animaciones de entrada con delay personalizable */
.animate-in-delayed {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.animate-in-delayed.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Estados de carga para elementos pesados */
.heavy-animation-loading {
    position: relative;
}

.heavy-animation-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-blue);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Optimizaciones específicas para dispositivos móviles */
@media (max-width: 768px) {
    .micro-hover,
    .micro-focus {
        transform: none;
        transition: none;
    }
    
    .parallax-enhanced {
        will-change: auto;
        transform: none !important;
    }
    
    .heavy-animation-loading::after {
        display: none;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .micro-hover,
    .micro-focus,
    .progressive-load,
    .animate-in-delayed,
    .parallax-enhanced {
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    
    .heavy-animation-loading::after {
        display: none;
    }
}

/* Estados de error y fallback */
.animation-error {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Indicadores de performance */
.performance-optimized {
    will-change: transform, opacity;
    contain: layout style paint;
}

.performance-optimized.animating {
    will-change: transform, opacity;
}

.performance-optimized:not(.animating) {
    will-change: auto;
}