/**
 * ESTILOS DEL MENÚ MÓVIL
 * Agregar estos estilos a tu archivo estilos.css existente
 * O incluir este archivo en tus páginas
 */

/* =====================================================
   MENÚ MÓVIL - ESTILOS RESPONSIVOS
   ===================================================== */

/* Botón de menú hamburguesa */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #1e3a5f;
    padding: 0.5rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    color: #2563eb;
}

/* =====================================================
   RESPONSIVE - TABLET Y MÓVIL
   ===================================================== */
@media (max-width: 768px) {
    
    /* Mostrar botón hamburguesa */
    .menu-toggle {
        display: block;
    }
    
    /* Header ajustes */
    .header-content {
        position: relative;
    }
    
    /* Navegación móvil */
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        display: none;
        border-top: 3px solid #2563eb;
    }
    
    /* Menú principal */
    #nav-menu {
        display: none;
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Mostrar menú cuando está activo */
    #nav-menu.active {
        display: flex !important;
    }
    
    /* Mostrar navegación cuando el menú está activo */
    nav:has(#nav-menu.active) {
        display: block;
    }
    
    /* Fallback para navegadores sin :has() */
    #nav-menu.active {
        display: flex !important;
    }
    
    /* Items del menú */
    #nav-menu > li {
        border-bottom: 1px solid #e5e7eb;
        margin: 0;
    }
    
    #nav-menu > li:last-child {
        border-bottom: none;
    }
    
    #nav-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        color: #1e3a5f;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9375rem;
        transition: all 0.3s ease;
    }
    
    #nav-menu > li > a:hover,
    #nav-menu > li > a.active {
        background: #f0f7ff;
        color: #2563eb;
    }
    
    /* =====================================================
       DROPDOWN / SUBMENÚ MÓVIL
       ===================================================== */
    
    /* Contenedor dropdown */
    .dropdown {
        position: relative;
    }
    
    /* Link principal del dropdown */
    .dropdown-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    /* Icono de flecha */
    .dropdown-icon {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    /* Rotar flecha cuando está activo */
    .dropdown.active .dropdown-icon {
        transform: rotate(180deg);
    }
    
    /* Submenú oculto por defecto */
    .dropdown-menu {
        display: none;
        position: static !important;
        background: #f8fafc;
        box-shadow: none;
        padding: 0;
        margin: 0;
        list-style: none;
        border-top: 1px solid #e5e7eb;
        animation: slideDown 0.3s ease;
    }
    
    /* Mostrar submenú cuando dropdown está activo */
    .dropdown.active .dropdown-menu {
        display: block !important;
    }
    
    /* Items del submenú */
    .dropdown-menu li {
        margin: 0;
    }
    
    .dropdown-menu a {
        display: block;
        padding: 0.875rem 1.5rem 0.875rem 2.5rem;
        color: #475569;
        text-decoration: none;
        font-size: 0.875rem;
        border-bottom: 1px solid #e5e7eb;
        transition: all 0.3s ease;
    }
    
    .dropdown-menu a:hover,
    .dropdown-menu a.active {
        background: #e0f2fe;
        color: #2563eb;
    }
    
    .dropdown-menu li:last-child a {
        border-bottom: none;
    }
    
    /* Animación del submenú */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* =====================================================
   RESPONSIVE - MÓVIL PEQUEÑO
   ===================================================== */
@media (max-width: 480px) {
    #nav-menu > li > a {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .dropdown-menu a {
        padding: 0.75rem 1rem 0.75rem 2rem;
        font-size: 0.8125rem;
    }
}

/* =====================================================
   DESKTOP - RESTAURAR COMPORTAMIENTO NORMAL
   ===================================================== */
@media (min-width: 769px) {
    nav {
        display: block !important;
        position: static;
        background: none;
        box-shadow: none;
        border: none;
    }
    
    #nav-menu {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        box-shadow: none;
    }
    
    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        padding: 0.5rem 0;
        z-index: 1000;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding: 0.75rem 1.25rem;
        border-bottom: none;
    }
}
