/* =========================================
   1. VARIABLES & CONFIGURACIÓN (Design Tokens)
   ========================================= */
:root {
    /* Paleta Oficial Ejército del Aire y del Espacio */
    --ea-blue: #183860;       /* Pantone 2955 - Principal */
    --ea-red: #AD2E1C;        /* Rojo Bandera - Acentos */
    --ea-yellow: #FABD00;     /* Amarillo Bandera - Hover y Llamadas a la acción */
    --ea-sky: #6CB4EE;        /* Azul Cielo - Decorativo */
    
    /* Neutros */
    --text-dark: #1A1A1A;     /* Negro casi puro para texto */
    --text-light: #F5F5F5;    /* Blanco roto para fondos oscuros */
    --bg-light: #FFFFFF;
    --bg-gray: #F4F6F8;       /* Gris muy suave para secciones alternas */
    
    /* Tipografía Corporativa */
    --font-primary: 'Archivo', Arial, sans-serif;
    
    /* Espaciado y Layout */
    --container-width: 1200px;
    --spacing-unit: 1rem;
    --border-radius: 4px;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
}

/* =========================================
   2. RESET & BASICS
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden; 
    width: 100%;
}

img { max-width: 100%; height: auto; display: block; }

/* Enlaces Generales */
a {
    color: var(--ea-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--ea-red); text-decoration: underline; }

/* FOCO VISIBLE (Accesibilidad) */
:focus-visible {
    outline: 3px solid var(--ea-yellow);
    outline-offset: 2px;
}

/* =========================================
   3. COMPONENTES DE UI
   ========================================= */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--ea-yellow);
    color: var(--ea-blue);
    border: 2px solid var(--ea-yellow);
}

.btn-primary:hover {
    background-color: #e0a800;
    border-color: #e0a800;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--ea-blue);
}

/* =========================================
   4. HEADER & NAVEGACIÓN
   ========================================= */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 90px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.logo-area a {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
}

.logo-ea, .logo-aspa, .logo-minisdef {
    height: 50px;
    width: auto;
    transition: height 0.3s ease;
}

/* Menú de Navegación Desktop */
.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-weight: 700;
    color: var(--ea-blue);
    text-transform: uppercase;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    text-decoration: none;
}

/* Subrayado Amarillo en Desktop */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--ea-yellow);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Botón Hamburguesa */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

/* =========================================
   5. SECCIÓN HERO
   ========================================= */
.hero-section {
    position: relative;
    height: 80vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}

.hero-media img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.6);
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    max-width: 800px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    font-weight: 400;
    max-width: 600px;
}

.hero-actions { display: flex; gap: 1rem; }

/* =========================================
   6. CONTENIDO PRINCIPAL & GRID
   ========================================= */
.intro-section { padding: 4rem 1rem; text-align: center; max-width: 800px; margin: 0 auto; }
.intro-section h2 { color: var(--ea-blue); font-size: 2.5rem; margin-bottom: 1.5rem; }

.quick-access { padding-bottom: 4rem; }
.card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem;
}
.card {
    background: white; border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); overflow: hidden;
    border: 1px solid #eee; transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-content h3 { color: var(--ea-blue); margin-bottom: 0.5rem; font-size: 1.5rem; }
.card-content p { margin-bottom: 1.5rem; color: #555; flex-grow: 1; }

/* =========================================
   7. SECCIÓN FAQ
   ========================================= */
.faq-section {
    background-color: var(--bg-gray); padding: 4rem 1rem;
    border-radius: var(--border-radius); margin-bottom: 4rem;
}
.faq-section h2 { color: var(--ea-blue); text-align: center; margin-bottom: 2rem; }
details { background: white; margin-bottom: 1rem; border-radius: var(--border-radius); border: 1px solid #ddd; overflow: hidden; }
summary { padding: 1rem 1.5rem; cursor: pointer; font-weight: 700; color: var(--ea-blue); position: relative; list-style: none; }
summary::after { content: '+'; position: absolute; right: 1.5rem; font-size: 1.5rem; font-weight: 400; }
details[open] summary::after { content: '-'; }
details p { padding: 1rem 1.5rem; border-top: 1px solid #eee; margin: 0; }

/* =========================================
   8. FOOTER (MEJORADO)
   ========================================= */
.site-footer { background-color: var(--ea-blue); color: white; padding-top: 3rem; }

.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 3rem; 
    padding-bottom: 3rem; 
}

/* Ajuste de columnas para que estén centradas */
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el contenido horizontalmente (logo, textos) */
    text-align: center;  /* Centra el texto */
}

.footer-col h4 { 
    color: var(--ea-yellow); 
    margin-bottom: 1.2rem; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    letter-spacing: 1px; 
}

/* LOGO EA DEL FOOTER: MÁS GRANDE */
.footer-logo { 
    height: 150px;  
    margin-bottom: 1.5rem;
    display: block; 
}

.site-footer a { color: #ddd; }
.site-footer a:hover { color: var(--ea-yellow); text-decoration: none; }

.social-links { list-style: none; display: flex; gap: 1rem; }

.footer-legal { background-color: #0f243e; padding: 1.5rem 0; font-size: 0.85rem; text-align: center; }
.footer-legal ul { list-style: none; display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }


/* =========================================
   9. RESPONSIVE Y MENÚ MÓVIL (Breakpoint 1024px)
   ========================================= */
@media (max-width: 1024px) {
    .logo-area a { gap: 0.5rem; }
    /* Nota: Se mantiene visible el logo del Ministerio */

    .mobile-menu-toggle { display: block; }

    /* Icono Hamburguesa */
    .hamburger-icon {
        display: block; width: 30px; height: 3px; background: var(--ea-blue); position: relative; transition: all 0.3s ease;
    }
    .hamburger-icon::before, .hamburger-icon::after {
        content: ''; position: absolute; width: 100%; height: 3px; background: var(--ea-blue); left: 0; transition: all 0.3s ease;
    }
    .hamburger-icon::before { top: -8px; }
    .hamburger-icon::after { top: 8px; }

    /* Hover amarillo en icono hamburguesa */
    .mobile-menu-toggle:hover .hamburger-icon,
    .mobile-menu-toggle:hover .hamburger-icon::before,
    .mobile-menu-toggle:hover .hamburger-icon::after {
        background-color: var(--ea-yellow);
    }

    .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon { background: transparent; }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::before { transform: rotate(45deg); top: 0; }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::after { transform: rotate(-45deg); top: 0; }

    /* Menú Desplegable Flotante */
/* Dentro del @media (max-width: 1024px) */

.nav-list {
    position: fixed; /* Cambiamos absolute por fixed para que baje con el scroll si quieres, o absolute si no */
    top: 90px; /* ALTURA EXACTA DEL HEADER (Antes era 100%) */
    left: 0; 
    width: 100%;
    background-color: var(--ea-blue);
    height: calc(100vh - 90px); /* Que ocupe el resto de la pantalla */
    overflow-y: auto; /* Si el menú es muy largo, permite scroll dentro */
    
    /* El resto igual... */
    flex-direction: column; 
    align-items: center; 
    padding: 2rem 0; /* Un poco más de aire arriba */
    gap: 0;
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); 
    z-index: 998;
}

    .nav-list.open { opacity: 1; visibility: visible; transform: translateY(0); }

    .nav-list li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .nav-link { display: block; padding: 1.2rem; color: white; text-align: center; font-size: 1.1rem; }
    
    /* Hover amarillo en las OPCIONES del menú móvil */
    .nav-link:hover { 
        background-color: rgba(255,255,255,0.05); 
        color: var(--ea-yellow);
        text-decoration: none; 
    }
    
    .nav-link::after { display: none; } 
    
    .hero-content h1 { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}

/* 10. AJUSTE EXTRA PARA MÓVILES PEQUEÑOS (Breakpoint 480px) */
@media (max-width: 480px) {
    .logo-ea, .logo-aspa, .logo-minisdef {
        height: 35px;
    }
    .logo-area a { gap: 0.3rem; }
}

/* =========================================
   CORRECCIONES DE PRODUCCIÓN (Helicópteros y Layout)
   ========================================= */

/* Forzar que los bloques de contenido (imagen + texto) se apilen en móvil */
@media (max-width: 768px) {

    .container[style*="display: flex"], 
    .container[style*="display:flex"],
    .bloque-helicoptero, /* Añade esta clase a tus filas en el HTML de helicóptero si no la tienen */
    article[style*="display: flex"] { 
        flex-direction: column !important;
        height: auto !important;
    }

    /* Asegurar que las imágenes y textos ocupen el 100% */
    .bloque-helicoptero img, 
    .bloque-helicoptero div {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin-bottom: 1rem;
    }
}
