/* ====================================
   NUEVO HEADER Y NAVEGACIÓN PRINCIPAL
   Mobile-First Responsive Design
   ==================================== */

/* ===== CSS VARIABLES ===== */
:root {
    --header-bg-color: #1e3a8a; /* Azul principal del header */
    --header-text-color: #ffffff;
    --nav-bg-color: #ffffff;
    --nav-text-color: #333333;
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
    --hamburger-size: 24px;
}

/* ===== BASE STYLES - MOBILE FIRST ===== */

/* Container principal */
.principal-web-container {
    width: 100%;
    height: auto; /* Cambiar de min-height: 100vh a height: auto */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: 0;
    /* Eliminar cualquier altura mínima que cause espacio extra */
    min-height: 0;
}

/* Top header (barra superior con contacto) */
.top-header {
    background: var(--header-bg-color);
    color: var(--header-text-color);
    padding: 8px 15px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 996;
}

.top-header .contact-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-header .header-buttons .intranet-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--header-text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

.top-header .header-buttons .intranet-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

/* Header principal */
.principal-web-header {
    background: rgba(27, 78, 140, 0.39);
    backdrop-filter: blur(20px);
    color: var(--header-text-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 997;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sección del logo */
.principal-web-logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.principal-web-logo-mdm {
    height: 200px;
    margin: -30px -10px -35px -45px;
    width: auto;
    object-fit: contain;
}

.principal-web-logo-texto {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.principal-web-logo-texto-line1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.principal-web-logo-texto-line2 {
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: 2px;
    margin-left: 37px;
}

.principal-web-linea {
    color: #fdfdfd;
    margin-right: 5px;
}

/* Botón de menú hamburguesa */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: var(--hamburger-size);
    height: var(--hamburger-size);
    padding: 0;
    z-index: 1001;
    transition: transform var(--transition-speed) ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--header-text-color);
    margin: 2px 0;
    transition: all var(--transition-speed) ease;
    transform-origin: center;
}

/* Animación del botón hamburguesa cuando está activo */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navegación principal (menú desplegable) */
.principal-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 400px;
    height: 100vh;
    background: var(--nav-bg-color);
    box-shadow: var(--nav-shadow);
    transition: right var(--transition-speed) ease;
    z-index: 999;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header del menú con botón de cerrar */
.nav-header {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.nav-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 2px;
    border-radius: 20px;
    transition: all var(--transition-speed) ease;
    width: 10%;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-close:hover {
    background: #e9ecef;
    color: #333;
}

/* Hacer el scroll transparente */
.principal-sidebar::-webkit-scrollbar {
    width: 8px;
}

.principal-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.principal-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.principal-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Para Firefox */
.principal-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.principal-sidebar.active {
    right: 0;
}

/* Overlay para cerrar el menú */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Botones de navegación */
.principal-sidebar button {
    background: none;
    border: none;
    padding: 15px 25px;
    text-align: left;
    color: var(--nav-text-color);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-bottom: 1px solid #f0f0f0;
}

.principal-sidebar button:hover,
.principal-sidebar button.active {
    background: var(--header-bg-color);
    color: var(--header-text-color);
    transform: translateX(5px);
}

/* Enlaces de navegación */
.principal-sidebar .sidebar-link {
    display: block;
    padding: 15px 25px;
    color: var(--nav-text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: all var(--transition-speed) ease;
    border-bottom: 1px solid #f0f0f0;
}

.principal-sidebar .sidebar-link:hover {
    background: #f8f9fa;
    color: var(--header-bg-color);
    transform: translateX(5px);
}

/* ===== MOBILE STYLES (max-width: 767px) ===== */
@media (max-width: 767px) {
    .top-header {
        padding: 8px 15px;
        font-size: 0.85rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 15px;
        align-items: center;
        flex-direction: column;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
    }
}

/* ===== SMALL MOBILE STYLES (max-width: 480px) ===== */
@media (max-width: 480px) {
    .top-header {
        padding: 6px 10px;
        font-size: 0.8rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 8px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .principal-web-logo-mdm {
    height: 75px;
    margin: -30px -10px -35px -30px;
    width: auto;
    object-fit: contain;
    }
    .principal-web-logo-texto-line1 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    }
    .principal-web-logo-texto-line2 {
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 2px;
    margin-left: 40px;
    }
    .principal-web-linea {
    color: #fdfdfd;
    margin-right: 5px;
    }
}
@media (max-width: 390px) {
    .top-header {
        padding: 4px 8px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 6px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .contact-info span {
        font-size: 0.7rem;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .top-header .header-buttons .intranet-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .principal-web-header {
        padding: 10px 15px;
    }
    
    .principal-web-logo-mdm {
        height: 60px;
        margin: -20px -5px -25px -20px;
        width: auto;
        object-fit: contain;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 2px;
        margin-left: 30px;
    }
    
    .principal-web-linea {
        color: #fdfdfd;
        margin-right: 3px;
    }
}

@media (max-width: 600px) {
    .top-header {
        padding: 4px 8px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 6px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .contact-info span {
        font-size: 0.7rem;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .top-header .header-buttons .intranet-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .principal-web-header {
        padding: 10px 15px;
    }
    
    .principal-web-logo-mdm {
        height: 60px;
        margin: -20px -5px -25px -20px;
        width: auto;
        object-fit: contain;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 2px;
        margin-left: 30px;
    }
    
    .principal-web-linea {
        color: #fdfdfd;
        margin-right: 3px;
    }
}

@media (min-width: 716px) and (max-width: 767px) {
    .top-header {
        padding: 4px 8px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 6px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .contact-info span {
        font-size: 0.7rem;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .top-header .header-buttons .intranet-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .principal-web-header {
        padding: 10px 15px;
    }
    
    .principal-web-logo-mdm {
        height: 60px;
        margin: -20px -5px -25px -20px;
        width: auto;
        object-fit: contain;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 2px;
        margin-left: 30px;
    }
    
    .principal-web-linea {
        color: #fdfdfd;
        margin-right: 3px;
    }
}

@media (max-width: 715px) {
    .top-header {
        padding: 4px 8px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 6px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .contact-info span {
        font-size: 0.7rem;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .top-header .header-buttons .intranet-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .principal-web-header {
        padding: 10px 15px;
    }
    
    .principal-web-logo-mdm {
        height: 60px;
        margin: -20px -5px -25px -20px;
        width: auto;
        object-fit: contain;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 2px;
        margin-left: 30px;
    }
    
    .principal-web-linea {
        color: #fdfdfd;
        margin-right: 3px;
    }
}

/* ===== EXTRA SMALL MOBILE STYLES (max-width: 375px) ===== */
@media (max-width: 375px) {
    .top-header {
        padding: 4px 8px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 6px;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    
    .top-header .contact-info span {
        font-size: 0.7rem;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .top-header .header-buttons .intranet-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .principal-web-header {
        padding: 10px 15px;
    }
    
    .principal-web-logo-mdm {
        height: 57px;
        margin: -20px -5px -25px -20px;
        width: auto;
        object-fit: contain;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 2px;
        margin-left: 30px;
    }
    
    .principal-web-linea {
        color: #fdfdfd;
        margin-right: 3px;
    }
}

/* ===== TABLET STYLES (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .top-header {
        padding: 8px 20px;
        font-size: 0.87rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-header .contact-info {
        gap: 15px;
        display: flex;
        align-items: center;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
    }
    
    .principal-web-header {
        padding: 20px 30px;
    }
    
    .principal-web-logo-mdm {
        height: 100px;
        margin: -30px -5px -35px -35px;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 1.2rem;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 1rem;
    }
    
    .principal-sidebar {
        width: 80%;
        max-width: 350px;
    }
}

/* ===== DESKTOP STYLES (1024px+) ===== */
@media (min-width: 1024px) {
    .top-header {
        padding: 10px 40px;
        font-size: 0.9rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-header .contact-info {
        display: flex;
        gap: 20px;
        align-items: center;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
    }
    
    .principal-web-header {
        padding: 25px 40px;
    }
    
    .principal-web-logo-section {
        gap: 20px;
    }
    
    .principal-web-logo-mdm {
        height: 120px;
        margin-left: -50px;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 1.4rem;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 1.1rem;
    }
    
    .menu-toggle {
        width: 28px;
        height: 28px;
    }
    
    .hamburger-line {
        height: 3px;
        margin: 3px 0;
    }
    
    .principal-sidebar {
        width: 70%;
        max-width: 450px;
        padding: 30px 0 30px 0;
    }
    
    .principal-sidebar button {
        padding: 18px 30px;
        font-size: 1.2rem;
    }
    
    .principal-sidebar .sidebar-link {
        padding: 18px 30px;
        font-size: 1.1rem;
    }
}

/* ===== LARGE DESKTOP (1440px+) ===== */
@media (min-width: 1440px) {
    .top-header {
        padding: 12px 60px;
        font-size: 0.95rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-header .contact-info {
        gap: 30px;
        display: flex;
        align-items: center;
    }
    
    .top-header .header-buttons {
        display: flex;
        align-items: center;
    }
    
    .principal-web-header {
        padding: 30px 60px;
    }
    
    .principal-web-logo-mdm {
        height: 130px;
        margin: -40px -10px -40px -60px;
    }
    
    .principal-web-logo-texto-line1 {
        font-size: 1.6rem;
    }
    
    .principal-web-logo-texto-line2 {
        font-size: 1.2rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .menu-toggle,
    .principal-sidebar,
    .nav-overlay,
    .principal-sidebar button,
    .principal-sidebar .sidebar-link {
        transition: none;
    }
}

/* ===== FOCUS STYLES ===== */
.menu-toggle:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.principal-sidebar button:focus,
.principal-sidebar .sidebar-link:focus {
    outline: 2px solid var(--header-bg-color);
    outline-offset: -2px;
}

/* ===== INTEGRATION WITH MAIN CONTENT ===== */
.main-content {
    margin: 0;
    padding: 0;
    width: 100%;
    flex: 1;
}

/* Ajustar el container para que no interfiera con el header */
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Evitar conflictos con estilos existentes */
.principal-web-container .main-content {
    display: block;
    margin: 0;
    padding: 0;
    flex: 1; /* SOLUCIÓN FINAL: Expandir para ocupar todo el espacio disponible */
}

.principal-web-container .container {
    display: flex;
    margin: 0;
    padding: 0;
}

/* Asegurar que no hay espacios entre header y contenido */
.principal-web-container {
    width: 100%;
    height: auto; /* CORREGIDO: Eliminar min-height: 100vh que causa espacio extra */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: 0;
}

/* CORRECCIÓN CRÍTICA: Eliminar altura forzada del contenedor */
body .principal-web-container {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

/* ===== SOLUCIÓN LIMPIA PARA ELIMINAR ESPACIO VERTICAL ===== */

/* Resetear completamente todos los márgenes y paddings problemáticos */
.principal-web-container {
    margin: 0;
    padding: 0;
    position: relative;
}

/* Eliminar cualquier espacio entre header y main-content */
.principal-web-header + .main-content,
.principal-web-header + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Asegurar que main-content no tenga espacios internos innecesarios */
.principal-web-container .main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative;
    z-index: 1;
}

/* Eliminar espacios en containers y content internos */
.principal-web-container .main-content .container,
.principal-web-container .main-content .content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ===== REGLA FINAL DE MÁXIMA PRIORIDAD ===== */
/* Esta regla sobrescribe cualquier estilo de otros archivos CSS */
body .principal-web-container .main-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    transform: none !important;
    top: auto !important;
    position: static !important;
    flex: 1 !important; /* SOLUCIÓN FINAL: Forzar expansión para ocupar todo el espacio disponible */
}

/* Eliminar cualquier pseudo-elemento que pueda estar agregando espacio */
.principal-web-header::after,
.principal-web-header + *::before,
.main-content::before {
    content: none !important;
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


