/* Estilos navbar optimizados */
:root {
    --nav-yellow: #ffee00;
    --nav-dark: #333333;
    --nav-white: #ffffff;
}

.fraga-navbar {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
}
.fraga-navbar.navbar-hidden {
    transform: translateY(-100%);
}

/* =========================================
   FILA SUPERIOR (Amarilla)
   ========================================= */
.nav-top-bar {
    background-color: var(--nav-yellow);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative; 
    z-index: 1040;
}

.nav-brand img {
    height: 50px;
    width: auto;
    display: block;
    transition: transform 0.2s;
}
.nav-brand:hover img { transform: scale(1.02); }

/* Buscador Central (Desktop) */
.nav-search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}
.nav-search-form {
    display: flex;
    background: var(--nav-white);
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid transparent; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.nav-search-input {
    flex: 1;
    border: none;
    padding: 0.6rem 1.2rem;
    outline: none;
    font-size: 0.95rem;
}
.nav-search-btn {
    background: transparent;
    border: none;
    padding: 0 1.2rem;
    color: var(--nav-dark);
    cursor: pointer;
    transition: color 0.2s;
}
.nav-search-btn:hover { color: #000; }

/* Acciones Derecha (Desktop) */
.nav-actions {
    display: flex;
    align-items: center;
}
.nav-desktop-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-action-item {
    color: var(--nav-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
    cursor: pointer;
}
.nav-action-item:hover { opacity: 0.8; color: var(--nav-dark); }
.nav-icon-lg { font-size: 1.4rem; }

.nav-cart-icon-wrapper {
    position: relative;
    display: inline-flex;
}
.nav-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #000;
    color: #fff;
    font-size: 0.7rem;
    height: 18px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
}

.nav-hamburger-toggle, 
.nav-search-mobile-toggle, 
.nav-mobile-dropdown, 
.nav-mobile-search-bar { 
    display: none; 
}

/* =========================================
   FILA INFERIOR (Blanca)
   ========================================= */
.nav-bottom-bar {
    background-color: var(--nav-white);
    border-top: 1px solid rgba(0,0,0,0.05);
    position: relative; 
    z-index: 1020;
}

.nav-bottom-container {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 0 1rem;
    height: 50px; 
}

.nav-location-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    min-width: 150px;
}

.nav-spacer-right {
    min-width: 150px;
}

.nav-desktop-menu-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    height: 100%;
}
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 1.5rem; 
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav-menu-link {
    color: #555;
    text-decoration: none;
    padding: 0 0.5rem;
    height: 50px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap; 
}
.nav-menu-link:hover, .nav-menu-link.active {
    color: #000;
    border-bottom-color: var(--nav-yellow);
    font-weight: 600; 
}

/* =========================================
   DROPDOWN USUARIO DESKTOP (Aesthetics & Animación)
   ========================================= */
.user-dropdown-menu {
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.06);
    min-width: 200px;
    margin-top: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    font-family: 'Inter', sans-serif;
    /* Animación de entrada sutil */
    animation: slideDropdownIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDropdownIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.user-dropdown-item {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
}
.user-dropdown-item:hover {
    background-color: #f8fafc;
    color: #0f172a;
}
.user-dropdown-item.logout-item {
    color: #dc2626; /* Rojo intenso */
}
.user-dropdown-item.logout-item:hover {
    background-color: #fef2f2; /* Fondo rojo ultra sutil */
    color: #b91c1c; 
}

/* =========================================
   BOTÓN CERRAR SESIÓN (Móvil Soft Red)
   ========================================= */
.btn-logout-soft {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.btn-logout-soft:hover {
    background-color: #fca5a5 !important;
    color: #7f1d1d !important;
    transform: translateY(-2px);
}
.btn-logout-soft svg {
    stroke: currentColor; 
}

/* ==========================================================
   MOBILE OVERRIDES
   ========================================================== */
@media (max-width: 991px) {
    
    .nav-top-bar { padding: 0.5rem 1rem; }
    
    .nav-hamburger-toggle { 
        display: flex;
        align-items: center;
        font-size: 1.8rem; 
        background: none;
        border: none;
        color: var(--nav-dark);
        padding: 0;
        z-index: 1050;
        width: 50px; 
    }

    .nav-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%); 
        z-index: 1040;
    }
    .nav-brand img { height: 35px; } 

    .nav-actions { 
        width: 50px; 
        justify-content: flex-end;
        z-index: 1050;
    }
    
    .nav-search-mobile-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.4rem;
        color: var(--nav-dark);
        padding: 0;
    }
    
    .nav-mobile-search-bar {
        display: block;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        padding: 0 1rem;
        background: var(--nav-yellow);
        border-top: 1px solid transparent;
        transition: all 0.3s ease;
    }
    .nav-mobile-search-bar.active {
        max-height: 70px; 
        opacity: 1;
        padding: 0.5rem 1rem;
        border-top-color: rgba(0,0,0,0.05);
    }

    .nav-bottom-container { justify-content: center; }
    .nav-location-wrapper { font-size: 0.95rem; justify-content: center; }
    
    .nav-mobile-dropdown {
        display: flex;
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        background-color: var(--nav-white);
        flex-direction: column; 
        align-items: stretch;
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        list-style: none;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.35s ease-in-out;
        z-index: 1050;
    }

    .nav-mobile-dropdown.menu-active {
        max-height: calc(100vh - 65px) !important; 
        overflow-y: auto !important; 
        /* FIX: Reducción drástica del espacio sobrante inferior */
        padding-bottom: 15px !important; 
        opacity: 1;
        border-top: 1px solid #eee;
    }

    .nav-mobile-compact-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.8rem 1rem;
        background-color: #fafafa;
    }

    .nav-compact-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #444;
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        padding: 0.5rem;
    }

    .nav-compact-link i {
        font-size: 1.2rem;
        color: var(--nav-dark);
    }

    .nav-compact-divider {
        width: 1px;
        height: 20px;
        background-color: #ccc;
        margin: 0 1rem;
    }

    .nav-compact-badge {
        background: #000;
        color: #fff;
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
        border-radius: 10px;
        font-weight: bold;
    }

    .nav-mobile-divider-bottom {
        height: 1px;
        background-color: #eee;
        margin: 0;
    }

    .mobile-link-centered {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        border-left: none !important;
        padding: 1.2rem 1.5rem;
        border-bottom: 1px solid #f3f4f6;
        color: #444;
    }

    .mobile-link-centered:hover, 
    .mobile-link-centered.active {
        background-color: #fafafa;
        color: #000;
        font-weight: bold;
    }
}