/* --- ESTILOS GENERALES --- */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    /* Añade padding-top igual (o mayor) a la altura del menú para evitar solapamiento inicial */
    /* La altura exacta dependerá del padding, tamaño fuente, y altura del logo */
    padding-top: 55px; /* AJUSTA ESTE VALOR SEGÚN LA ALTURA REAL DE TU MENÚ */
}

/* --- ESTILOS DEL MENÚ DE NAVEGACIÓN --- */
#main-navbar {
    background-color: #2c3e50; /* Color azul oscuro/gris */
    color: #ecf0f1; /* Texto claro */
    padding: 0 1em;
    position: fixed;   /* Cambiado a fixed para asegurar que SIEMPRE esté visible */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100; /* Alto z-index */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    box-sizing: border-box;
    min-height: 55px; /* Altura mínima - AJUSTA ESTO CON EL PADDING-TOP del body */
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo a la izq, menú/toggle a la der */
    max-width: 1300px; /* Ancho máximo del contenido del menú */
    margin: 0 auto; /* Centrar el contenido */
    height: 100%; /* Asegurar que ocupe la altura de la barra */
    min-height: inherit; /* Heredar altura mínima */
}

.navbar-logo {
    height: 40px; /* Altura del logo */
    width: auto;
    display: block;
    margin-right: 25px;
    flex-shrink: 0;
}

.navbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* Centrado: flex-grow permite que ocupe espacio, justify lo centra */
    justify-content: center;
    flex-grow: 1;
    height: 100%; /* Para alinear items verticalmente si es necesario */
}

.menu-item {
    position: relative;
    display: flex; /* Para centrar verticalmente el enlace */
    align-items: center; /* Centra verticalmente el enlace */
}

.menu-item > a {
    display: block;
    padding: 0 18px; /* Padding horizontal */
    line-height: 55px; /* Centrado vertical igual a la altura de la barra */
    color: #ecf0f1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.menu-item:hover > a,
.menu-item > a:focus {
    background-color: #34495e; /* Color más oscuro al pasar el ratón */
    color: #fff;
    outline: none;
}

/* Estilos Submenús */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff; /* Fondo blanco */
    min-width: 230px;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1110; /* Encima de la barra principal */
    border: 1px solid #bdc3c7; /* Borde sutil */
    border-radius: 0 0 4px 4px;
}

.submenu .submenu { /* Sub-submenús */
    top: -1px;
    left: 100%;
    border-radius: 0 4px 4px 4px;
}

/* Mostrar submenú en HOVER */
.menu-item.has-submenu:hover > .submenu {
    display: block;
}

.submenu li {
    position: relative;
}

.submenu a {
    display: block;
    padding: 9px 18px; /* Padding enlaces de submenú */
    color: #2c3e50; /* Texto oscuro */
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9em;
    line-height: 1.5; /* Resetear line-height */
}

.submenu a:hover,
.submenu a:focus {
    background-color: #ecf0f1; /* Fondo gris claro */
    color: #2c3e50;
    outline: none;
}

.submenu .has-submenu > a::after {
    content: '\25B6'; /* Triángulo/flecha derecha */
    font-size: 0.8em;
    display: inline-block;
    margin-left: 8px;
    float: right; /* Poner flecha a la derecha */
    line-height: inherit; /* Mantener alineación */
}

.submenu hr {
    border: 0;
    border-top: 1px solid #ecf0f1;
    margin: 6px 0;
}

/* --- RESPONSIVIDAD DEL MENÚ --- */
.menu-toggle-button {
    display: none; /* Oculto en escritorio */
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 26px;
    cursor: pointer;
    padding: 10px;
    margin-left: auto; /* Empuja a la derecha */
}

@media (max-width: 992px) { /* Ajusta este breakpoint */
    .menu-toggle-button {
        display: block;
    }
    .navbar-menu {
        display: none; /* Ocultar por defecto */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #2c3e50;
        padding: 0;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        max-height: calc(100vh - 55px); /* Ajusta 55px a la altura de tu barra */
        overflow-y: auto;
        border-top: 1px solid #34495e;
        justify-content: flex-start; /* Alinear al inicio */
    }
    .navbar-menu.active { /* Mostrar cuando JS añade la clase */
        display: flex;
    }
    .menu-item {
        display: block;
        width: 100%;
        border-bottom: 1px solid #34495e;
        align-items: stretch; /* Ocupar altura completa */
    }
     .menu-item > a {
         line-height: normal; /* Resetear line-height */
         padding: 12px 18px;
     }
     .menu-item:last-child { border-bottom: none; }

    /* Submenús en móvil */
    .submenu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #34495e;
        border-radius: 0;
        min-width: 100%;
        background-color: rgba(0,0,0,0.15);
        padding-left: 20px;
    }
    .submenu .submenu { padding-left: 35px; background-color: rgba(0,0,0,0.25); }
    .submenu a { color: #ecf0f1; }
     .submenu a:hover, .submenu a:focus { background-color: #34495e; color: #fff; }
     .submenu .has-submenu > a::after { float: none; /* Quitar float en móvil */ }
}

/* --- CLASES INDICADORAS VISUALES (MENÚ COLUMNAS) --- */
.columna-visible-en-menu::before,
.columna-oculta-en-menu::before {
    content: "";
    display: inline-block;
    width: 1.3em; /* Espacio para el icono */
    text-align: center;
    margin-left: -1.3em; /* Compensar espacio */
    font-weight: bold;
}
.columna-visible-en-menu::before {
     content: "\2713"; /* Checkmark */
     color: #27ae60; /* Verde */
}
.columna-oculta-en-menu::before {
    content: "\00A0"; /* Espacio (o "\2717" para una X) */
    color: #c0392b; /* Rojo si usas X */
}

/* --- AJUSTE CONTENIDO PRINCIPAL --- */
/* El padding-top en el body ya debería manejar esto */
/* .main-content-area { padding-top: 55px; } /* Si no usas padding en body */


