/* =================================================================
   MENÚ HORIZONTAL & NAVEGACIÓN - Libremente
   CON LOGO SUPERPUESTO HACIA ABAJO
   ================================================================= */

/* =================================================================
   BASE DEL NAVBAR
   ================================================================= */
.navbar-horizontal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    height: 80px;
    border-bottom: 1px solid rgba(107, 76, 127, 0.1);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

/* =================================================================
   LOGO CONTAINER - DISEÑO PREMIUM E INSTITUCIONAL
   ================================================================= */
.navbar-brand { 
    display: flex; 
    align-items: flex-start;
    flex-shrink: 0;
    position: relative;
    z-index: 1060;
    margin-top: 3px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(12px) saturate(180%);
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.80);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(248, 249, 250, 0.2) 100%
    );
    pointer-events: none;
    z-index: -1;
}

.navbar-brand::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: -1;
}

.navbar-brand:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    background: rgba(255, 255, 255, 0.9);
}

.brand-link { 
    display: block;
    position: relative;
    z-index: 1;
}

.navbar-logo { 
    height: 150px; 
    width: auto; 
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1060;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.navbar-logo:hover { 
    transform: scale(1.05);
}

.navbar-main { 
    display: flex; 
    align-items: center; 
    flex: 1; 
    margin: 0;
    min-width: 0;
    height: 80px;
}

/* =================================================================
   MENÚ PRINCIPAL
   ================================================================= */
.navbar-menu { 
    display: flex; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    gap: 8px; 
    align-items: center;
    flex-wrap: nowrap;
}
.menu-item { position: relative; }

.menu-link {
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 12px 16px;
    color: #4a4a4a; 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 500;
    border-radius: 8px; 
    transition: all 0.3s ease; 
    white-space: nowrap;
    position: relative;
}
.menu-link:hover { 
    color: #6b4c7f; 
    background: rgba(107, 76, 127, 0.05); 
}
.menu-link.active { 
    color: #6b4c7f; 
    background: transparent;
    font-weight: 600;
}

.menu-link .arrow { 
    font-size: 0.7rem; 
    margin-left: 4px; 
    transition: transform 0.3s ease; 
    flex-shrink: 0; 
}
.menu-link:hover .arrow { opacity: 1; }
.has-dropdown:hover .menu-link .arrow { transform: rotate(180deg); }

/* Indicador de página activa */
.menu-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(135deg, #6b4c7f 0%, #5a9e7f 100%);
    border-radius: 3px 3px 0 0;
}

/* Dropdown */
.has-dropdown { position: relative; }

.dropdown {
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: #ffffff; 
    min-width: 280px;
    list-style: none; 
    margin: 0; 
    padding: 12px 0; 
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); 
    opacity: 0; 
    visibility: hidden;
    transform: translateY(-10px); 
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s; 
    z-index: 1000;
    border: 1px solid rgba(107, 76, 127, 0.1);
}
.has-dropdown:hover .dropdown { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}

.dropdown li a { 
    display: flex; 
    align-items: center; 
    padding: 12px 24px; 
    color: #4a4a4a; 
    text-decoration: none; 
    transition: all 0.2s ease; 
    gap: 10px;
    font-size: 0.95rem;
}
.dropdown li a:hover { 
    background: linear-gradient(135deg, #6b4c7f 0%, #5a3f6f 100%); 
    color: #ffffff; 
    padding-left: 28px; 
}
.dropdown li a i { 
    width: 20px; 
    text-align: center; 
    flex-shrink: 0; 
}

/* =================================================================
   MENÚ DE USUARIO
   ================================================================= */
.navbar-user { 
    display: flex; 
    align-items: center;
    flex-shrink: 0;
    height: 80px;
}
.user-menu-wrapper { position: relative; }

.user-toggle {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 8px 16px;
    background: rgba(107, 76, 127, 0.08); 
    border-radius: 30px; 
    text-decoration: none;
    color: #333; 
    transition: all 0.3s; 
    cursor: pointer;
    border: 1px solid rgba(107, 76, 127, 0.15);
}
.user-toggle:hover { 
    background: rgba(107, 76, 127, 0.15); 
    border-color: rgba(107, 76, 127, 0.3);
}

.user-avatar { 
    width: 38px; 
    height: 38px; 
    background: linear-gradient(135deg, #5a9e7f 0%, #4a8b6f 100%); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #ffffff; 
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(90, 158, 127, 0.3);
}
.user-info { 
    display: flex; 
    flex-direction: column; 
    line-height: 1.2; 
}
.user-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.user-role { font-size: 0.75rem; color: #666; }

.user-dropdown-menu { 
    min-width: 220px; 
    border-radius: 12px; 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); 
    padding: 10px 0; 
    margin-top: 10px; 
    border: 1px solid rgba(107, 76, 127, 0.1); 
}
.user-dropdown-menu .dropdown-item { 
    padding: 12px 20px; 
    transition: all 0.2s ease; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    font-size: 0.95rem;
}
.user-dropdown-menu .dropdown-item:hover { 
    background: rgba(107, 76, 127, 0.1); 
}

/* =================================================================
   LÍNEA DE AYUDA - SOLO DESKTOP - NUEVO DISEÑO PROFESIONAL
   ================================================================= */
.navbar-help-line {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0 0 10px 30px;
    height: 80px;
}

.help-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.help-link:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #6b4c7f;
    color: #6b4c7f;
}

.help-icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #5a9e7f 0%, #4a8b6f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(90, 158, 127, 0.3);
}

.help-icon {
    font-size: 1.1rem;
    color: #ffffff;
}

.help-content {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.help-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.help-number {
    font-size: 1.05rem;
    font-weight: 700;
    color: #495057;
    letter-spacing: 0.5px;
}

.help-link:hover .help-label {
    color: #6b4c7f;
}

.help-link:hover .help-number {
    color: #6b4c7f;
}

/* =================================================================
   REDES SOCIALES
   ================================================================= */
.navbar-social { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex-shrink: 0;
    height: 80px;
}
.navbar-social .social-icon { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: rgba(107, 76, 127, 0.08); 
    color: #6b4c7f; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    transition: all 0.3s; 
    border: 2px solid transparent; 
    font-size: 1rem;
    flex-shrink: 0;
}
.navbar-social .social-icon:hover, 
.navbar-social .social-icon:focus { 
    background: #6b4c7f; 
    color: #ffffff; 
    transform: translateY(-3px); 
    border-color: #5a9e7f;
    box-shadow: 0 4px 12px rgba(107, 76, 127, 0.3);
    outline: none; 
}

/* =================================================================
   BOTÓN HAMBURGUESA MÓVIL
   ================================================================= */
.navbar-mobile-toggle {
    display: none; 
    align-items: center; 
    justify-content: center;
    background: linear-gradient(135deg, #6b4c7f 0%, #5a3f6f 100%); 
    color: #ffffff; 
    border: none; 
    border-radius: 10px;
    cursor: pointer; 
    padding: 0;
    width: 48px; 
    height: 48px;
    z-index: 1060; 
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(107, 76, 127, 0.3);
}
.navbar-mobile-toggle:hover { 
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(107, 76, 127, 0.4);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
}

.hamburger-icon span:nth-child(1) {
    top: 0;
}

.hamburger-icon span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-icon span:nth-child(3) {
    bottom: 0;
}

/* Icono X cuando está activo */
.navbar-mobile-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
    margin-top: -1.5px;
}

.navbar-mobile-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.navbar-mobile-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
    margin-bottom: -1.5px;
}

/* =================================================================
   RESPONSIVE - TABLET
   ================================================================= */
@media (max-width: 1200px) { 
    .navbar-social { display: none; }
    .navbar-help-line .help-label { display: none; }
    .navbar-help-line .help-link {
        padding: 10px 16px;
    }
    .navbar-container {
        padding: 0 30px;
    }
    .navbar-main {
        margin-left: 25px;
    }
}

/* =================================================================
   RESPONSIVE MENÚ (MÓVIL)
   ================================================================= */
@media (max-width: 992px) {
    .navbar-container {
        padding: 0 25px;
    }
    
    .navbar-logo {
        height: 110px;
    }
    
    .navbar-brand {
        margin-top: 2px;
        padding: 6px 16px;
    }
    
    .user-info { display: none; }
    .user-toggle { padding: 8px; }
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    .navbar-user { 
        margin-left: auto; 
        margin-right: 10px;
        flex-shrink: 0;
    }
    .navbar-mobile-toggle { display: flex; }
    
    /* OCULTAR línea de ayuda en móvil */
    .navbar-help-line {
        display: none !important;
    }
    
    /* Menú móvil con fondo suave */
    .navbar-main {
        position: fixed; 
        top: 80px; 
        left: -100%; 
        width: 100%; 
        max-width: 100%;
        height: calc(100vh - 80px);
        background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
        margin: 0; 
        padding: 30px 25px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        overflow-y: hidden;
        overflow-x: hidden;
        z-index: 1040;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    }
    .navbar-main.mobile-active { left: 0; }
    
    .navbar-menu { 
        flex-direction: column; 
        width: 100%; 
        gap: 0;
        box-sizing: border-box;
        flex: 1;
        overflow-y: auto;
    }
    
    .menu-item { 
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(107, 76, 127, 0.1);
    }
    
    .menu-link { 
        padding: 18px 24px; 
        width: 100%; 
        justify-content: space-between;
        box-sizing: border-box;
        font-size: 1.05rem;
    }
    
    .menu-link .arrow { 
        margin-left: 0; 
        margin-right: 4px; 
    }
    
    /* Dropdowns en móvil */
    .dropdown {
        position: static; 
        opacity: 1; 
        visibility: visible; 
        transform: none; 
        box-shadow: none;
        background: rgba(107, 76, 127, 0.05); 
        margin: 0 0 10px 25px;
        display: none; 
        border-radius: 10px; 
        border-left: 4px solid #6b4c7f;
        width: calc(100% - 25px);
        box-sizing: border-box;
    }
    
    .has-dropdown[aria-expanded="true"] .dropdown {
        display: block;
        animation: slideDownMobile 0.3s ease;
    }
    
    @keyframes slideDownMobile {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .dropdown li a { 
        padding: 14px 24px;
        box-sizing: border-box;
        font-size: 0.95rem;
    }
    
    .navbar-user { 
        margin-top: auto;
        padding-top: 20px;
        border-top: 2px solid rgba(107, 76, 127, 0.2);
    }
    
    .user-dropdown-menu { 
        position: static; 
        box-shadow: none; 
        margin-top: 10px; 
        background: rgba(107, 76, 127, 0.08); 
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 576px) {
    .navbar-container { 
        padding: 0 18px;
        gap: 10px;
    }
    .navbar-logo { 
        height: 95px; 
    }
    .navbar-brand {
        margin-top: 1px;
        padding: 5px 14px;
    }
    .navbar-main {
        padding: 25px 20px;
        top: 80px;
        height: calc(100vh - 80px);
    }
    
    .menu-link {
        padding: 16px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-container { 
        padding: 0 15px;
    }
    .navbar-logo { 
        height: 85px; 
    }
    .navbar-brand {
        margin-top: 0;
        padding: 4px 12px;
    }
    .navbar-main {
        padding: 20px 18px;
        top: 80px;
        height: calc(100vh - 80px);
    }
    
    .menu-link {
        padding: 15px 18px;
        font-size: 0.98rem;
    }
}

/* =================================================================
   ACCESIBILIDAD
   ================================================================= */
.menu-link:focus-visible, 
.user-toggle:focus-visible, 
.dropdown-item:focus-visible, 
.navbar-mobile-toggle:focus-visible,
.help-link:focus-visible { 
    outline: 2px solid #6b4c7f; 
    outline-offset: 2px; 
}

@media (max-width: 992px) {
    .menu-link, 
    .dropdown li a, 
    .user-toggle,
    .help-link { 
        min-height: 48px; 
        display: flex; 
        align-items: center; 
    }
    
    .menu-link.active::after { 
        bottom: 0; 
        left: 0; 
        transform: none; 
        width: 5px; 
        height: 100%; 
        border-radius: 0 2px 2px 0; 
    }
}

/* =================================================================
   PREVENIR SCROLL HORIZONTAL - GLOBAL
   ================================================================= */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}