/* estilos.css - Arquitectura Visual AntenaDigital.es */

/* --- ARQUITECTURA FLEXBOX ESTRUCTURAL (UNIFICADA) --- */
html, body {
    height: 100% !important;
    max-width: 100%; /* Evita desbordamiento horizontal */
    margin: 0;
    padding: 0;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important; /* Corta de raíz el desplazamiento lateral fantasma */
    overflow-y: hidden !important; /* Mantiene la cabecera y footer fijos a nivel global */
    overscroll-behavior-x: none !important; /* Evita el "rebote" lateral en iOS/Android */
    touch-action: pan-y; /* Bloquea el arrastre horizontal táctil, deja solo scroll vertical */
    position: relative;
}

body {
    /* Clave: convierte a body en "containing block" de sus hijos position:fixed
       (sidebar-navigation, menu-overlay, mobile-menu-btn). Sin esto, esos elementos
       fixed no quedan recortados por el overflow:hidden de arriba y su hueco
       "aparcado" fuera de pantalla cuenta como zona scrollable del documento,
       lo cual es la causa de que aparezcan al hacer RePag/AvPag o al arrastrar. */
    transform: translateZ(0);
}

/* Contenedor elástico central entre cabecera y pie */
.contenedor-principal {
    display: flex !important; 
    flex-grow: 1 !important;
    height: 0 !important; /* Fuerza a flexbox a ceñirse al espacio real de la pantalla */
    min-height: 0 !important;
    position: relative; 
    width: 100%; 
    overflow: hidden !important; 
    background-color: #f8f9fa; /* Fondo gris claro limpio para las secciones */
}

/* Páginas tradicionales de texto (Cronologías, sobre, etc.) */
.contenedor-tradicional {
    flex-grow: 1 !important;
    width: 100%;
    height: 100% !important;
    overflow-y: auto !important; /* ¡EL SCROLL SE QUEDA AQUÍ PARA NAVEGAR EL TEXTO! */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px; 
    box-sizing: border-box;
    display: block; /* Mantiene comportamiento de bloque para respetar el centrado de Bootstrap */
}

/* Evitamos que las barras superiores e inferiores se deformen */
.navbar-horizontal, .site-footer {
    flex-shrink: 0 !important;
}

/* --- ESTILOS NAVBAR HORIZONTAL (PC) --- */
.navbar-horizontal {
    width: 100%; 
    height: 60px; 
    background-color: #1a252f; 
    color: white;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 0 20px; 
    box-sizing: border-box; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 5000; 
    position: relative;
}

.navbar-logo h1 { margin: 0; font-size: 18px; color: #3498db; display: inline-block; vertical-align: middle; }
.navbar-logo span { font-size: 11px; color: #bdc3c7; margin-left: 10px; display: inline-block; vertical-align: middle; }

.nav-links-horizontal { display: flex; list-style: none; margin: 0; padding: 0; }
.dropdown-h { position: relative; } 

.nav-item-h { color: #ecf0f1; text-decoration: none; font-size: 14px; padding: 21px 15px; display: block; cursor: pointer; }
.nav-item-h:hover { background-color: #2c3e50; color: #3498db; }

/* Submenús */
.dropdown-content-h {
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0;
    background-color: #1a252f; 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    min-width: 170px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 9999; 
}
.submenu-h { position: relative; }
.submenu-content-h {
    display: none;
    position: absolute;
    top: 0;
    left: -100%; 
    background-color: #111a22;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 160px;
    box-shadow: -4px 4px 10px rgba(0,0,0,0.4); 
    z-index: 10000;
}
.dropdown-h:hover > .dropdown-content-h { display: block; }
.submenu-h:hover > .submenu-content-h { display: block; }

.dropdown-content-h button, .dropdown-content-h a {
    color: #ecf0f1; padding: 12px 16px; text-decoration: none; display: block;
    width: 100%; text-align: left; background: none; border: none; font-size: 13px; cursor: pointer;
    box-sizing: border-box;
}
.dropdown-content-h button:hover, .dropdown-content-h a:hover { background-color: #2c3e50; color: #3498db; }
.dropdown-content-h button.activo { color: #2ecc71 !important; font-weight: bold; }
.sub-comunidad { font-weight: bold; color: #e67e22 !important; }

/* --- MENÚ LATERAL Y BOTÓN EN MÓVILES --- */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px; 
    right: 15px; 
    z-index: 6000;
    background-color: #1a252f; 
    color: white; 
    border: none;
    padding: 8px 12px; 
    border-radius: 4px; 
    font-size: 15px; 
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.menu-overlay {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 6500 !important;
}

.sidebar-navigation {
    position: fixed !important;
    right: 0;
    top: 0;
    width: 280px;
    height: 100% !important;
    background-color: #1a252f;
    z-index: 7000 !important;
    transform: translateX(100%); /* Oculto completamente a la derecha */
    transition: transform 0.3s ease-in-out, visibility 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3);
    visibility: hidden; /* El truco clave: inaccesible para teclado/foco en PC */
}
/* Cuando abres el menú en móvil mediante tu JS asignando la clase movil-abierto */
.sidebar-navigation.movil-abierto { 
    transform: translateX(0) !important; 
    visibility: visible !important;
}

.sidebar-logo { padding: 20px; background-color: #111a22; border-bottom: 1px solid #2c3e50; }
.sidebar-logo h2 { margin: 0; font-size: 16px; color: #3498db; }

.nav-links-vertical { padding: 15px 0; overflow-y: auto; flex-grow: 1; }
.nav-item-v, .dropdown-v-btn {
    display: block; width: 100%; padding: 12px 20px; color: #ecf0f1; text-decoration: none;
    font-size: 14px; text-align: left; background: none; border: none; cursor: pointer; box-sizing: border-box;
}
.nav-item-v:hover, .dropdown-v-btn:hover { background-color: #2c3e50; }
.dropdown-v-content { background-color: #111a22; padding: 10px 0; }
.sub-block { padding: 5px 0 10px 0; border-bottom: 1px solid #1a252f; }
.block-title { display: block; font-size: 11px; color: #e67e22; font-weight: bold; padding: 5px 20px; }

.sidebar-navigation .btn-red-mapa { display: block; width: 100%; background: none; border: none; color: #bdc3c7; padding: 8px 30px; font-size: 13px; text-align: left; cursor: pointer; }
.sidebar-navigation .btn-red-mapa:hover { color: white; background-color: #1a252f; }
.sidebar-navigation .btn-red-mapa.activo { color: #2ecc71; font-weight: bold; }
.menu-seccion-v { display: block; padding: 10px 20px; font-size: 14px; color: #3498db; font-weight: bold; text-transform: uppercase; }

/* --- VISOR DE MAPAS --- */
#map { 
    flex-grow: 1; 
    height: 100%; 
    width: 100%; 
    z-index: 1; 
}

/* --- PANEL LATERAL DE SERVICIOS --- */
.sidebar-servicios {
    position: absolute; top: 0; right: -400px; width: 360px; height: 100%;
    background-color: #ffffff; box-shadow: -2px 0 10px rgba(0,0,0,0.2); z-index: 1500;
    transition: right 0.3s ease; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box;
}
.sidebar-servicios.abierto { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ecf0f1; padding-bottom: 10px; margin-bottom: 15px; }
.sidebar-header h2 { margin: 0; font-size: 18px; color: #2c3e50; }
.btn-cerrar { background: none; border: none; font-size: 22px; font-weight: bold; color: #7f8c8d; cursor: pointer; }
.sidebar-contenido { overflow-y: auto; flex-grow: 1; }

.tabla-servicios { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-servicios th { background-color: #f4f6f7; text-align: left; padding: 8px; color: #34495e; }
.tabla-servicios td { padding: 8px; border-bottom: 1px solid #f2f4f4; vertical-align: middle; }
.logo-servicio { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; background-color: #f8f9fa; margin-right: 8px; }
.info-tecnica { font-size: 11px; color: #7f8c8d; }
.enlace-popup { color: #3498db; font-weight: bold; text-decoration: underline; cursor: pointer; }

/* --- PIE DE PÁGINA (40px) --- */
.site-footer {
    height: 40px; 
    width: 100%; 
    background-color: #111a22; 
    color: #bdc3c7;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 0 20px; 
    box-sizing: border-box; 
    font-size: 12px; 
    border-top: 1px solid #2c3e50; 
    z-index: 2000;
}
.footer-left a { color: #3498db; text-decoration: none; margin-left: 15px; }
.footer-left a:hover { text-decoration: underline; }
.footer-right { color: #95a5a6; }

/* --- ADAPTACIONES RESPONSIVAS MÓVILES --- */
@media (max-width: 768px) {
    .navbar-horizontal { display: none !important; }
    .mobile-menu-btn { display: block; }
    .sidebar-servicios { width: 100%; right: -100%; }
}

/* Ocultar por completo el menú de móvil en pantallas grandes de PC */
@media (min-width: 992px) {
    .sidebar-navigation, 
    .mobile-menu-btn, 
    .menu-overlay {
        display: none !important; /* Desaparece del DOM y flujo visual en ordenadores */
    }
}

.logo-link { text-decoration: none; color: inherit; display: inline-block; vertical-align: middle; }
.logo-link:hover { text-decoration: none; color: inherit; }
/* 1. Forzar la fuente en todo el menú horizontal y vertical */
.site-footer,
.footer-left,
.navbar-horizontal, 
.nav-links-horizontal a, 
.sidebar-navigation, 
.nav-links-vertical a {
    font-family: 'Roboto', sans-serif !important;
}

/* 2. Forzar la fuente en el panel lateral y la tabla de servicios de radio */
#panelLateral,
.sidebar-servicios,
.sidebar-header h2,
.tabla-servicios,
.tabla-servicios th,
.tabla-servicios td,
.info-tecnica {
    font-family: 'Roboto', sans-serif !important;
}

/* Opcional: Asegurar que los textos pequeños o secundarios no pierdan la fuente */
.tabla-servicios td span, 
.navbar-logo span {
    font-family: 'Roboto', sans-serif !important;
}