/**
 * Emex Cars — Hero
 * Garaje interactivo con hitboxes, texto animado e indicador de scroll
 */

/* === HERO GARAJE INTERACTIVO === */

.emex-garage-hero {
    position: relative;
    width: 100vw;
    background-color: #050505;
    overflow: hidden;
    
    /* ESCRITORIO: Altura grande para impacto visual */
    height: 85vh; 
    min-height: 500px;
    
    /* Compensación para subir la imagen por debajo del Header */
    margin-top: -80px !important; 
    
    /* Romper contenedor para ancho completo */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Capas de Imagen (Fondo y Luces) */
.emex-garage-bg, 
.emex-garage-light {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    
    background-size: cover; 
    background-position: center bottom; 
    background-repeat: no-repeat;
    
    transition: opacity 0.2s ease-in-out; /* Rápido para efecto encendido */
    pointer-events: none; /* Decorativo, no bloquea el ratón */
}

/* --- ZONAS DE INTERACCIÓN (HITBOXES) --- */
.emex-garage-hitboxes {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 25;
    /* Quitamos display: flex para evitar conflictos con absolute */
}

.emex-hitbox {
    /* CAMBIO CLAVE: Absolute para obedecer exactamente al 'left' del JS */
    position: absolute; 
    top: 0;       /* Pegado arriba */
    height: 100%; /* Altura completa */
    cursor: pointer;
}

/* --- CONTENEDOR DE TEXTO --- */
.emex-hero-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 30; /* Por encima de todo */
    pointer-events: none; /* FANTASMA: El ratón lo atraviesa para tocar los coches */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* POSICIÓN ESCRITORIO: Subido para no tapar coches */
    justify-content: flex-end; 
    margin-top: -80px; 
}

/* Título */
.emex-hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-align: center;
    margin: 0;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
    
    /* Animación de entrada */
    opacity: 0;
    animation: emexSimpleFade 1.5s ease-out forwards 0.5s;
}

/* Subtítulo */
.emex-hero-subtitle {
    color: var(--emex-punch-red);
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 15px;
    text-align: center;
    
    /* Animación de entrada */
    opacity: 0;
    animation: emexSimpleFade 1.5s ease-out forwards 1s;
}

/* Animación de aparición suave */
@keyframes emexSimpleFade {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- INDICADOR DE SCROLL (FLECHA) --- */
.emex-scroll-indicator {
    position: absolute;
    bottom: 30px; 
    left: 0; 
    width: 100%;
    
    display: flex; 
    flex-direction: column; 
    align-items: center;
    
    color: rgba(255,255,255,0.7);
    z-index: 30;
    pointer-events: none;
    
    animation: emexBounce 2s infinite;
}

.emex-scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.emex-arrow-down {
    width: 20px; 
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
}

/* Animación de rebote */
@keyframes emexBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- MEDIA QUERY: MÓVIL (AJUSTES CRÍTICOS) --- */
@media (max-width: 768px) {
    .emex-garage-hero {
        /* SOLUCIÓN FRANJAS NEGRAS: Altura proporcional al ancho (60vw es aprox 16:9 + margen) */
        height: 60vw; 
        min-height: auto; 
        
        margin-top: -80px !important; /* Ajuste específico para header móvil */
    }

    .emex-garage-bg, 
    .emex-garage-light {
        /* En móvil forzamos cover sobre la caja proporcional */
        background-size: cover; 
        background-position: center center;
    }

    .emex-hero-content {
        /* POSICIÓN MÓVIL: Texto bajado debajo del header */
        justify-content: flex-start;
        padding-bottom: 0;
        padding-top: 225px; 
    }

    .emex-hero-title { 
        font-size: 1.5rem; 
        letter-spacing: 1px; 
        line-height: 1.1;
    }
    
    .emex-hero-subtitle { 
        font-size: 0.75rem; 
        margin-top: 5px; 
    }
    
    /* Ocultamos la flecha en móvil para limpiar la vista */
    .emex-scroll-indicator { 
        display: none; 
    }
}
