/* ========================================================== */
/* == 🎨 ESTILOS COMPLETOS PARA EL HEADER 🎨 == */
/* ========================================================== */

/* --- AJUSTE GENERAL PARA EL HEADER FIJO --- */
body {
    padding-top: 100px; /* Valor base (se ajusta en media queries) */
}

/* --- ESTILOS DEL BOTÓN DE UBICACIÓN --- */
.btn-ubicacion {
    background-color: #ffffff;
    color: #2E3A3F;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex; 
    width: auto;
}

.btn-ubicacion:hover {
    background-color: #ffffff;
    color: #2E3A3F;
}

.btn-ubicacion i {
    font-size: 1.1rem;
}

.ubicacion-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.ubicacion-text small {
    font-size: 0.65rem;
    opacity: 0.8;
}

.ubicacion-text strong {
    font-size: 0.85rem;
}

/* --- CÍRCULO DE HOVER PARA EL BOTÓN DE MENÚ --- */
#btnMenu {
    width: 40px;
    height: 40px;
    border-radius: 50%; 
    padding: 0 !important;
    
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out;
    vertical-align: middle;
}

#btnMenu:hover {
    background-color: #e9ecef; 
}

#btnMenu i {
    line-height: 1;
}

/* --- ESTILOS DEL PISO SUPERIOR DEL HEADER --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem; /* Ajustado en media query de desktop */
    margin-left: auto;
    padding-left: 0.5rem;
}

.search-icon-inside {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 2;
    pointer-events: none;
}

.flex-grow-1 form .search-input-with-icon {
    padding-left: 40px;
}

.search-input-with-icon {
    padding-left: 40px !important;
    /* Bordes redondeados medios (por defecto de .form-control) */
}

.bi-heart-fill {
    display: none !important; 
}

/* --- ESTILO DEL ÍCONO DEL CARRITO EN HEADER (CUADRADO) --- */
.header-actions a[data-bs-toggle="offcanvas"],
.header-actions a[data-bs-target="#carritoOffcanvas"] {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    border: 1.5px solid var(--color-borde-claro) !important;
    color: var(--color-texto) !important;
    transition: all 0.2s ease-in-out !important;
    text-decoration: none !important;
}

.header-actions a[data-bs-toggle="offcanvas"]:hover,
.header-actions a[data-bs-target="#carritoOffcanvas"]:hover {
    border-color: var(--color-borde) !important;
    background-color: var(--color-sutil) !important;
    color: var(--color-texto) !important;
}

.header-actions a[data-bs-toggle="offcanvas"] .fas.fa-shopping-cart {
    font-size: 1.15rem;
}

#cart-count {
    position: absolute;
    top: 5px !important;
    right: 5px !important;
    font-size: 0.65rem;
    padding: 0.2em 0.5em;
    transform: translate(50%, -50%) !important;
    border-radius: .375rem !important; 
}


/* ⭐ --- ESTILOS PARA "MI LISTA" E "IDENTIFICATE" --- ⭐ */

/* Estilos COMUNES de texto y alineación vertical */
.link-mi-lista,
.header-actions .dropdown .dropdown-toggle {
    font-weight: 400; /* Peso regular */
    color: #343a40 !important; /* Color gris oscuro */
    text-decoration: none !important;
    padding-bottom: 5px; /* Para alinear ambos verticalmente */
}

/* Estilo ÚNICO para "Mi lista" (para que funcione el subrayado) */
.link-mi-lista {
    position: relative; 
}

/* El subrayado verde para "Mi lista" */
.link-mi-lista.active-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px; 
    background-color: #28a745;
    border-radius: 2px;
}

/* 🔥 FORZAR LA FLECHA DEL DROPDOWN "IDENTIFICATE" (CHEVRON) 🔥 */
.header-actions .dropdown .dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.5em !important;
    vertical-align: 0.15em !important;
    content: "" !important;
    border: solid #6c757d !important;
    border-width: 0 2px 2px 0 !important;
    padding: 2.5px !important;
    transform: rotate(45deg) !important;
    -webkit-transform: rotate(45deg) !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 0 !important;
    height: 0 !important;
}

.header-actions .dropdown button.dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.5em !important;
    vertical-align: 0.15em !important;
    content: "" !important;
    border: solid #6c757d !important;
    border-width: 0 2px 2px 0 !important;
    padding: 2.5px !important;
    transform: rotate(45deg) !important;
    -webkit-transform: rotate(45deg) !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 0 !important;
    height: 0 !important;
}

/* Asegurar espacio para la flecha */
.header-actions .dropdown button.dropdown-toggle {
    padding-right: 0 !important;
    background: transparent !important;
    border: none !important;
}

.header-actions .dropdown button.dropdown-toggle:focus,
.header-actions .dropdown button.dropdown-toggle:active {
    box-shadow: none !important;
    outline: none !important;
}

/* ⭐ --- FIN DE ESTILOS DROPDOWN --- ⭐ */


/* ------------------------------------------------------------------ */
/* --- ESTILOS PARA LA BARRA DE CATEGORÍAS (AJUSTE DE ESPACIOS) --- */
/* ------------------------------------------------------------------ */
.header-con-categorias {
    padding-bottom: 0.75rem !important;
}

.category-navbar-interno {
    display: flex !important;
    align-items: center;
    background-color: transparent;
    border-top: none;
}

.nav-scroller {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: 50px; 
    flex-grow: 1; 
}

.nav-scroller::-webkit-scrollbar {
    display: none;
}

.category-navbar-interno .nav-link {
    color: #343a40;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.3rem 1rem;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 20px;
    flex-shrink: 0;
}

.category-navbar-interno .nav-link:hover {
    color: #0d6efd;
    background-color: #e9ecef;
}

/* ========================================================== */
/* ✅ AJUSTES RESPONSIVE (MÓVIL PRIMERO) ✅ */
/* ========================================================== */

/* --- 📱 Estilos para Móvil (Pantallas pequeñas) --- */
@media (max-width: 991.98px) {
    body {
        padding-top: 140px;
    }
    
    .navbar-brand-logo img {
        height: 28px !important;
    }
    
    .header-actions .fs-5 {
        font-size: 1.15rem !important;
    }
    
    .category-navbar-interno {
        display: block !important; 
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .mt-2.d-lg-none .search-input-with-icon {
        padding-left: 40px !important;
    }
}

/* --- 💻 Estilos para Desktop (Pantallas grandes) --- */
@media (min-width: 992px) {
    body {
        padding-top: 120px;
    }
    
    .header-actions {
        gap: 1.5rem; 
    }
    
    .category-navbar-interno {
        margin-left: 5rem; 
        margin-right: 4rem;
        padding-left: 1rem; 
    }
    
    body.admin-bar {
        padding-top: 152px;
    }
}