/* Animaciones globales — Compu Express */

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes heroGlow {
    0%, 100% {
        opacity: 0.4;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.65;
        transform: translate(2%, -2%) scale(1.05);
    }
}

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

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

/* Carga inicial */
.animate-in {
    opacity: 0;
    animation: fadeInUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-in-delay-1 { animation-delay: 0.08s; }
.animate-in-delay-2 { animation-delay: 0.16s; }
.animate-in-delay-3 { animation-delay: 0.24s; }
.animate-in-delay-4 { animation-delay: 0.32s; }
.animate-in-delay-5 { animation-delay: 0.4s; }
.animate-in-delay-6 { animation-delay: 0.48s; }

.animate-scale {
    opacity: 0;
    animation: scaleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.94);
    transition:
        opacity 0.55s ease,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Hero animado */
.hero-home {
    position: relative;
    overflow: hidden;
}

.hero-home::before {
    content: '';
    position: absolute;
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    top: -20%;
    right: -10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-home::after {
    content: '';
    position: absolute;
    width: min(400px, 60vw);
    height: min(400px, 60vw);
    bottom: -15%;
    left: -8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 114, 184, 0.25) 0%, transparent 70%);
    animation: heroGlow 10s ease-in-out infinite reverse;
    pointer-events: none;
}

.hero-home > * {
    position: relative;
    z-index: 1;
}

/* Tarjetas interactivas */
.features-row--home .uiverse-card,
.catalog-page .product-card,
.services-grid .uiverse-card,
.services-grid--pro .service-card-pro,
.process-step {
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease,
        border-color 0.3s ease;
}

.features-row--home .uiverse-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 28px 60px rgba(15, 114, 184, 0.22);
}

.catalog-page .product-grid > li {
    animation: fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.catalog-page .product-grid > li:nth-child(1) { animation-delay: 0.04s; }
.catalog-page .product-grid > li:nth-child(2) { animation-delay: 0.08s; }
.catalog-page .product-grid > li:nth-child(3) { animation-delay: 0.12s; }
.catalog-page .product-grid > li:nth-child(4) { animation-delay: 0.16s; }
.catalog-page .product-grid > li:nth-child(5) { animation-delay: 0.2s; }
.catalog-page .product-grid > li:nth-child(6) { animation-delay: 0.24s; }
.catalog-page .product-grid > li:nth-child(n+7) { animation-delay: 0.28s; }

/* Header al hacer scroll (complementa modern.css) */
body.modern-ui > header.header-scrolled {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Botones con pulso sutil al hover */
.btn,
.card-btn,
.auth-submit {
    position: relative;
    overflow: hidden;
}

.btn::before,
.card-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before,
.card-btn:hover:not(:disabled)::before {
    opacity: 1;
    animation: shimmerLine 0.8s ease;
}

/* Auth entrance */
.auth-light-card.animate-auth {
    animation: authFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

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

    .reveal,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }

    .animate-in {
        opacity: 1;
        animation: none;
    }
}
