/**
 * Hero Section - Slideshow & CTAs
 * 
 * Slideshow CSS-only crossfade con Progressive Enhancement.
 * Sin librerías externas. Funciona sin JS (primera imagen visible).
 *
 * @version 1.0.0
 */

/* ============= HERO CONTAINER ============= */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Fallback si no carga slideshow */
    background: linear-gradient(135deg, #003366 0%, #004d99 100%);
    color: white;
    text-align: center;
    padding: 0;
}

/* ============= SLIDESHOW ============= */
.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    animation: heroFade 18s infinite;
    /* will-change para rendimiento GPU */
    will-change: opacity;
}

/* 3 slides, 18s total: 6s por slide (4s visible + 2s transition) */
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }

@keyframes heroFade {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    33%  { opacity: 1; }
    38%  { opacity: 0; }
    100% { opacity: 0; }
}

/* Primera imagen visible por defecto (Progressive Enhancement) */
.hero-slide:first-child {
    opacity: 1;
}

/* Si hay animaciones, primera imagen entra en el ciclo */
@media (prefers-reduced-motion: no-preference) {
    .hero-slide:first-child {
        opacity: 0;
        animation: heroFade 18s infinite;
        animation-delay: 0s;
    }
}

/* Respetar preferencia reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        animation: none !important;
    }
    .hero-slide:first-child {
        opacity: 1;
    }
}

/* ============= OVERLAY ============= */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(0, 51, 102, 0.75) 0%,
        rgba(0, 51, 102, 0.60) 50%,
        rgba(0, 51, 102, 0.80) 100%
    );
}

/* ============= HERO CONTENT ============= */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem 1.5rem;
}

.hero-content h2 {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.92;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ============= HERO CTAs ============= */
.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #ff6b35;
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.btn-hero-primary:hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(255, 107, 53, 0.5);
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: transparent;
    color: white;
    border: 2.5px solid rgba(255, 255, 255, 0.85);
}

.btn-hero-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: translateY(-2px);
}

.btn-hero-icon {
    font-size: 1.2em;
}

/* ============= TRUST BADGES ============= */
.hero-trust {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 120px;
}

.hero-trust-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #ff6b35;
}

.hero-trust-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .hero {
        min-height: 75vh;
    }

    .hero-content {
        padding: 1.5rem 1rem;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .hero-trust {
        gap: 1rem;
    }

    .hero-trust-item {
        min-width: 90px;
        padding: 0.6rem 0.8rem;
    }

    .hero-trust-number {
        font-size: 1.5rem;
    }

    .hero-trust-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 70vh;
    }

    .hero-trust {
        gap: 0.5rem;
    }

    .hero-trust-item {
        min-width: 80px;
        padding: 0.5rem;
    }
}
