/**
 * ============================================================================
 * ARCHIVO: assets/css/common.css
 * PROYECTO: AXV.es - Núcleo Digital
 * DESCRIPCIÓN: Estilos globales unificados. Controla la base, la cabecera,
 * el pie de página corporativo y la adaptación móvil.
 * ============================================================================
 * * 🛠️ MANUAL DE SOLUCIÓN DE PROBLEMAS (TROUBLESHOOTING):
 * ----------------------------------------------------------------------------
 * Síntoma: En las subcarpetas la web se ve blanca, sin estilos y el menú no abre.
 * Causa: Error 404 de ruta. El archivo PHP no está enviando bien la ruta base.
 * Solución: Revisa que la variable $ruta_base esté declarada como '../' antes
 * de incluir el archivo header.php.
 * ============================================================================
 */

/* ============================================================================
   1. VARIABLES Y BASES GENERALES (Estilo AXV)
   ============================================================================ */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    --accent-color: #000000;
    --font-main: "Inter", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Fuerza al footer a irse abajo si hay poco contenido */
    line-height: 1.6;
}

/* ============================================================================
   2. CABECERA Y NAVEGACIÓN (Diseño de Escritorio)
   ============================================================================ */
.axv-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-section {
    flex: 1; /* Reparte el espacio en tres bloques exactos (33.3% cada uno) */
    display: flex;
    align-items: center;
}
.nav-left {
    justify-content: flex-start;
    gap: 2rem;
}
.nav-center {
    justify-content: center;
}
.nav-right {
    justify-content: flex-end;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.5;
}

.nav-link.active {
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
}

/* Botón de Acceso Privado */
.btn-portal {
    border: 1px solid var(--text-color);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    background-color: transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-portal:hover {
    background-color: var(--accent-color);
    color: #ffffff !important;
}

/* Visibilidad de elementos del botón (En PC el texto se ve y el icono se oculta) */
.btn-texto {
    display: block;
}
.avatar-movil {
    display: none;
}

.axv-logo {
    height: 38px;
    display: block;
}

/* ============================================================================
   3. PIE DE PÁGINA / FOOTER (Diseño General)
   ============================================================================ */
.axv-footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 5%;
    background-color: #ffffff;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-philosophy p {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}
.footer-legal a:hover {
    color: var(--accent-color);
}
.footer-legal .separator {
    margin: 0 0.8rem;
    color: var(--border-color);
}
.footer-attribution p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-attribution a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

/* ============================================================================
   4. TEMA OSCURO (Estilos para Header y Footer Negros)
   ============================================================================ */
.dark-theme {
    background-color: #000000 !important; /* El !important asegura el bloque negro */
    color: #ffffff;
}
.dark-theme.axv-header {
    border-bottom: 1px solid #222222;
}
.dark-theme.axv-footer {
    border-top: 1px solid #222222;
}
.dark-theme .nav-link {
    color: #ffffff;
}
.dark-theme .nav-link:hover {
    opacity: 0.7;
}
.dark-theme .btn-portal {
    border-color: #ffffff;
    color: #ffffff;
}
.dark-theme .btn-portal:hover {
    background-color: #ffffff;
    color: #000000 !important;
}
.dark-theme .footer-philosophy p,
.dark-theme .footer-attribution p {
    color: #cccccc;
}
.dark-theme .footer-legal a {
    color: #999999;
}
.dark-theme .footer-legal a:hover {
    color: #ffffff;
}
.dark-theme .separator {
    color: #333333;
}
.dark-theme .footer-attribution a {
    color: #ffffff;
}
/* ============================================================================
Fuentes/Letras
   ============================================================================ */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/inter-regular.woff2") format("woff2");
    font-display: swap; /* Importante para el rendimiento */
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    src: url("../fonts/inter-semibold.woff2") format("woff2");
    font-display: swap;
}

body {
    font-family: "Inter", sans-serif;
    /* ... resto de tu configuración */
}

/* ============================================================================
   5. SECCIONES ESPECIALES (Estilos de la Página Próximamente)
   ============================================================================ */
.axv-section-maintenance {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 0;
    background-color: #ffffff;
}

.maintenance-box {
    max-width: 600px;
    margin: 0 auto;
}

.maintenance-box h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    letter-spacing: -0.02em;
}

.maintenance-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* ============================================================================
   6. MENÚ HAMBURGUESA Y ADAPTABILIDAD MÓVIL (MÁXIMO 768PX)
   Rediseño de fila única: Hamburguesa (Izda) - Logo (Centro) - Icono (Dcha)
   ============================================================================ */
.mobile-menu-toggle {
    display: none; /* Oculto en ordenadores */
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 200;
}

.mobile-menu-toggle .bar {
    height: 2px;
    width: 100%;
    background-color: #ffffff; /* Blanco para contrastar con el fondo negro */
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    /* Transformamos el menú superior en una rejilla rígida de 3 columnas */
    .navbar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        width: 100%;
        padding: 0;
    }

    /* Posicionamiento milimétrico en sus respectivas celdas */
    .mobile-menu-toggle {
        display: flex;
        grid-column: 1;
        justify-self: start;
    }

    .nav-center {
        grid-column: 2;
        justify-self: center;
        margin: 0;
    }

    .nav-right {
        grid-column: 3;
        justify-self: end;
    }

    /* EL DESPLEGABLE: Se convierte en una persiana absoluta que flota arriba */
    .nav-left {
        display: none; /* Controlado mediante el archivo main.js */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Se abre justo abajo del header */
        left: 0;
        width: 100%;
        background-color: #000000;
        padding: 2rem 5%;
        border-bottom: 1px solid #222222;
        z-index: 9999 !important; /* Pasa por encima de cualquier caja o slider */
        gap: 1.5rem;
    }

    /* Clase activa que inyecta JavaScript al pulsar la hamburguesa */
    .nav-left.is-active {
        display: flex;
    }

    /* INTERCAMBIO VISUAL DEL ÁREA DE CLIENTE (Oculta texto, muestra "cabecita") */
    .btn-texto {
        display: none !important;
    }

    .avatar-movil {
        display: block !important;
        color: #ffffff;
    }

    .btn-portal {
        border: none;
        padding: 0;
        background: transparent;
    }
}
