/* NAVBAR - VERSIÓN CORREGIDA Y EQUILIBRADA */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 10px 0; /* Espaciado normal */
    background-color: #ffffff !important;
    min-height: 80px; /* Altura estándar base */
    transition: min-height 0.3s ease, padding 0.3s ease;
}

/* CONTENEDOR DEL LOGO */
.navbar-brand {
    height: auto; /* Altura automática para adaptarse a la imagen */
    margin: 0;
    display: flex;
    justify-content: center; /* Centrado por defecto para móvil */
    align-items: center;
    width: 100%; /* Ocupa todo el ancho en móvil */
    padding: 0;
    position: relative;
    z-index: 1;
}

/* LOGO */
.navbar-brand img {
    height: 50px; /* Tamaño móvil */
    width: auto; 
    max-width: 200px;
    object-fit: contain; 
    transition: transform 0.3s ease;
    display: block;
}

.navbar-brand img:hover {
    transform: scale(1.02);
}

/* MENU DE NAVEGACIÓN */
.navbar-nav {
    align-items: center;
    margin-left: auto;
    gap: 5px;
}

.nav-link {
    font-weight: 500;
    margin: 0 5px;
    padding: 8px 15px !important;
    border-radius: 6px;
    transition: all 0.3s;
    color: #555 !important;
    text-decoration: none;
    font-size: 1rem;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #f8f9fa;
    color: #CC5027 !important;
}

.nav-link.active {
    background-color: #CC5027;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(204, 80, 39, 0.2);
}

.nav-link.active:hover {
    background-color: #003d63;
}

/* Botón cerrar sesión */
.btn-logout {
    background-color: #dc3545 !important;
    color: white !important;
    border: none;
    font-weight: 600;
}

.btn-logout:hover {
    background-color: #c82333 !important;
    color: white !important;
}

/* BOTÓN HAMBURGUESA */
.navbar-toggler {
    position: absolute;
    right: 15px; /* A la derecha */
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #ddd !important;
    padding: 5px !important;
    width: 40px;
    height: 40px;
    z-index: 2000;
    background-color: white;
}

/* AJUSTES RESPONSIVE (Laptop / Pantallas medianas) - NUEVO */
@media (min-width: 992px) and (max-width: 1300px) {
    .navbar-brand img {
        height: 80px; /* Reducir logo para dar espacio */
    }
    
    .navbar-brand {
        margin-right: 1rem; /* Reducir margen del logo */
    }

    .nav-link {
        padding: 8px 8px !important; /* Reducir padding horizontal */
        margin: 0 2px; /* Reducir margen entre items */
        font-size: 0.9rem; /* Ligeramente más pequeño */
    }
}

/* AJUSTES RESPONSIVE (Escritorio grande) */
@media (min-width: 1301px) {
    .navbar {
        min-height: 140px; 
        padding: 15px 0;
    }

    .navbar-brand {
        width: auto;
        justify-content: flex-start;
        position: static;
        height: auto;
        margin-right: 2rem;
    }
    
    .navbar-brand img {
        height: 110px;
        max-width: 350px; 
    }

    .navbar-toggler {
        display: none;
    }
}

/* Base para escritorio (min-width: 992px) general para estructura */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none;
    }
    
    .navbar-brand {
        width: auto;
        justify-content: flex-start;
        position: static;
        height: auto;
    }
}

/* AJUSTES RESPONSIVE (Móvil) */
@media (max-width: 991px) {
    /* Fondo blanco para el menú desplegable */
    .navbar-collapse {
        background-color: #ffffff;
        position: absolute;
        top: 100%; /* Justo debajo del navbar */
        left: 0;
        width: 100%;
        padding: 15px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        z-index: 1900; /* Debajo del toggler pero encima del contenido */
    }

    .navbar-nav {
        margin: 0;
        width: 100%;
        align-items: flex-start; /* Alinear a la izquierda en móvil */
    }

    .nav-item {
        width: 100%;
        margin-bottom: 5px;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 10px 15px !important;
    }
    
    /* Asegurar que el logo no se monte sobre el menú si colapsa extraño */
    .navbar {
        position: relative; /* Para posicionar el collapse */
    }
}

@media (max-width: 420px) {
    .navbar-brand img {
        height: 62px; /* Ajuste para pantallas muy pequeñas */
    }
}
