/* nav.css - VERSIÓN CORREGIDA (USANDO BOOTSTRAP) */

/* ===============================
   NAVBAR PRINCIPAL
   =============================== */

.navbar {
    padding: 0.5rem 1rem;
    font-size: 16px;
    position: relative;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.navbar-logo {
    height: 36px;
    width: auto;
}

.navbar-name {
    height: 20px;
    width: auto;
}

.navbar-collapse {
    display: flex !important;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

.navbar-section-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 40px;
}

.navbar-section-center {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    min-width: 0;
    margin-left: -30px;
}

.navbar-section-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* ===============================
   DISPONIBLE 
   =============================== */

.disponible-item {
    margin-right: 15px;
}

.disponible-link {
    color: #2c527c !important;
    font-weight: 600;
    padding: 8px 12px !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: transparent !important;
}

.disponible-link:hover {
    background-color: #2c527c !important;
    color: white !important;
}

.disponible-text {
    white-space: nowrap;
    font-size: 0.9rem;
}

#montoDisponible {
    font-weight: 700;
}

/* ===============================
   BUSCADOR
   =============================== */

.navbar-search {
    width: 100%;
    max-width: 350px;
    display: flex;
}

.navbar-search .form-control {
    width: 75%;
    min-width: 200px;
    border-radius: 20px 0 0 20px;
    height: 36px;
    border: 1px solid #ddd;
    border-right: none;
    padding: 0 15px;
    font-size: 14px;
}

.navbar-search .btn-search {
    width: 25%;
    min-width: 45px;
    border-radius: 0 20px 20px 0;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2c527c;
    color: white;
    border: 1px solid #2c527c;
}

.navbar-search .btn-search:hover {
    background-color: #1e3a5f;
}

/* ===============================
   LINKS GENERALES
   =============================== */

.nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 8px 15px !important;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link:focus {
    background-color: #2c527c !important;
    color: white !important;
}

.cart-icon {
    position: relative;
    margin-left: 10px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -0px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
}

/* ===============================
   DROPDOWNS (ELIMINAR HOVER - USAR BOOTSTRAP)
   =============================== */

/* SOLO estilos visuales, NO comportamiento */
.nav-item.dropdown .dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 8px 0;
    margin-top: 5px;
    border-radius: 8px;
}

.navbar-secondary-item .dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 250px;
    padding: 10px 0;
    margin-top: 8px;
    border-radius: 8px;
}

/* Items de dropdown */
.dropdown-item {
    padding: 8px 20px;
    color: #333 !important;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #2c527c !important;
}

/* ===============================
   SUBMENÚS ANIDADOS (CORREGIDO)
   =============================== */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: -10px;
    margin-left: -1px;
    background-color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1001;
    min-width: 200px;
    padding: 8px 0;
    border-radius: 8px;
    display: none; /* Bootstrap lo mostrará */
}

/* Flecha indicadora */
.dropdown-submenu > .dropdown-item::after {
    content: "▸";
    float: right;
    margin-left: 10px;
    border: none;
}

/* MOSTRAR submenús al hacer hover - ESTO SÍ lo necesitamos */
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* ===============================
   SEGUNDA LÍNEA
   =============================== */

.navbar-divider {
    height: 3px;
    background: linear-gradient(90deg, #2c527c, #3a6ea5);
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
}

.navbar-secondary {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 10px 0;
}

.navbar-secondary-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar-secondary-item {
    margin: 0;
}

.navbar-secondary-link {
    color: #2c527c !important;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.navbar-secondary-link:hover {
    background-color: #2c527c;
    color: white !important;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 992px) {
    .navbar-collapse {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navbar-section-left,
    .navbar-section-center,
    .navbar-section-right {
        width: 100%;
        max-width: 100%;
        padding: 10px 0;
        justify-content: center;
        margin-left: 0;
    }
    
    .navbar-search {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .navbar-section-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 1px solid #eee;
        margin-top: 5px;
    }
    
    .dropdown-submenu > .dropdown-menu {
        position: static;
        margin: 5px 0 5px 15px;
        box-shadow: none;
        border: 1px solid #eee;
    }
    
    .navbar-secondary-menu {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem;
    }
    
    .navbar-search {
        max-width: 100%;
    }
    
    .navbar-secondary-menu {
        gap: 15px;
        flex-direction: column;
    }
}

/* ===============================
   FIX ESPECÍFICO SOLO PARA MENÚ DE USUARIO
   =============================== */

/* Aplicar hover manual SOLO al menú de usuario */
.navbar-section-right .nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Asegurar z-index alto SOLO para el menú de usuario */
.navbar-section-right .dropdown-menu {
    z-index: 9999 !important;
}

/* Fix específico para el dropdown de perfil */
#profileDropdown {
    cursor: pointer;
}

/* NO aplicar estos estilos a otros dropdowns - solo al de usuario */
.navbar-section-right .nav-item.dropdown .dropdown-menu {
    pointer-events: auto !important;
}

/* ===============================
   FIX PARA ENLACES NO CLICKEABLES EN SEGUNDA LÍNEA
   =============================== */

.navbar-secondary {
    position: relative;
    z-index: 1; /* Asegura que esté por encima del contenido pero debajo de los dropdowns */
}

.navbar-secondary-menu {
    position: relative;
    z-index: 1;
}

.navbar-secondary-link {
    position: relative;
    z-index: 2; /* Los enlaces deben tener z-index más alto */
    pointer-events: auto !important; /* Fuerza que sean clickeables */
}

/* Asegurar que los dropdowns no interfieran con la segunda línea */
.navbar-section-right .dropdown-menu {
    z-index: 9999 !important;
    /* Limitar la superposición solo al área necesaria */
    overflow: visible;
}

/* Fix específico para cuando los dropdowns están abiertos */
.navbar-section-right .nav-item.dropdown.show .dropdown-menu {
    z-index: 10000;
}

/* Garantizar que los enlaces de la segunda línea sean siempre clickeables */
.navbar-secondary-item .navbar-secondary-link {
    pointer-events: all !important;
    cursor: pointer !important;
}