﻿/* ============================================================
   NAVBAR.CSS  –  TiendaOnline / Hunter Store
   Header moderno de dos filas (Todo en Azul Oscuro):
     Fila 1 (top-bar):  logo | categorías dropdown | productos | search | notif | cuenta
     Fila 2 (admin-bar): solo visible para Administrador — links del panel
   ============================================================ */

/* ── Reset básico del header ── */
#mainHeader {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   TOP BAR  (fila 1) - DISEÑO AZUL OSCURO PREMIUM
   ============================================================ */
.top-bar {
    background: #0b1120;
    border-bottom: none;
    padding: 0.2rem 0; /* 🔧 Corregido: sin el signo de menos */
}

    .top-bar .container-fluid {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0 1.5rem;
        max-width: 1400px;
        margin: 0 auto;
    }

/* ── Logo ── */
.brand-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    text-decoration: none;
    flex-shrink: 0;
}

    .brand-block img {
        height: 125px;
        width: auto;
        max-height: none;
        /* 👇 Truco para que no estire el header 👇 */
        margin-top: -30px;
        margin-bottom: -30px;
        position: relative;
        z-index: 1001; /* Asegura que el logo no se esconda detrás de otras cosas */
    }

.brand-icon-wrap {
    width: 40px;
    height: 40px;
    background: #2563eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

.brand-name {
    font-size: 1.8rem; /* 🔧 Lo subimos de 1.15 a 1.8. Si lo quieres más bestia, ponle 2.0rem */
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin: 0;
    margin-left: -21px; /* 🔧 Truquito ninja: mueve el texto un chin a la izquierda por si la imagen tiene un borde invisible */
    margin-top: -2px; 
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.brand-block:hover .brand-name {
    color: #3b82f6;
}

/* ── Logo Imagen ── */
.store-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

/* ── Divisor vertical ── */
.bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ── Categorías dropdown ── */
.cats-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    font-size: 0.875rem;
    font-weight: 600;
    color: #60a5fa;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s;
}

    .cats-btn:hover {
        background: rgba(37, 99, 235, 0.25);
        color: #93c5fd;
        border-color: #3b82f6;
    }

    .cats-btn svg, .cats-btn .cats-chevron, .cats-btn i {
        font-size: 0.85rem;
        color: #60a5fa;
    }

/* ── Productos link ── */
.products-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

    .products-link:hover {
        background: rgba(37, 99, 235, 0.15);
        color: #93c5fd;
        text-decoration: none;
    }

/* ── Buscador Tipo Píldora ── */
#mainHeader .search-wrap {
    flex: 1;
    max-width: 450px;
    position: relative;
    margin: 0 1rem;
}

#mainHeader .search-input {
    width: 100%;
    padding: 0.45rem 1rem 0.45rem 2.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

    #mainHeader .search-input::placeholder {
        color: #94a3b8 !important;
    }

    #mainHeader .search-input:focus {
        border-color: #3b82f6 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
    }

#mainHeader .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10;
}

/* ── Iconos derecha (lupa móvil + notificaciones + wishlist + carrito) ── */
.icon-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #f8fafc;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

    .icon-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #3b82f6;
        text-decoration: none;
    }

.icon-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* ── Bloque cuenta (derecha) ── */
.account-block {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s;
}

    .account-block:hover {
        background: rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }

.account-avatar {
    width: 32px;
    height: 32px;
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    color: #93c5fd;
}

.account-label {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.account-greeting {
    font-size: 0.7rem;
    color: #94a3b8;
}

.account-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: #ffffff;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chevron {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ============================================================
   MENÚS DESPLEGABLES (Categorías y Cuenta) - DARK PREMIUM
   ============================================================ */
.account-dropdown {
    background-color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    padding: 8px !important;
    min-width: 220px;
    margin-top: 8px !important;
}

    .account-dropdown .dropdown-item {
        color: #cbd5e1 !important;
        border-radius: 8px;
        font-size: 0.875rem;
        padding: 0.5rem 0.85rem;
        transition: all 0.2s ease;
    }

        .account-dropdown .dropdown-item:hover,
        .account-dropdown .dropdown-item:focus {
            background-color: rgba(59, 130, 246, 0.15) !important;
            color: #60a5fa !important;
            transform: translateX(4px);
        }

    .account-dropdown .dropdown-divider {
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin: 0.5rem 0;
    }

    .account-dropdown .text-primary {
        color: #60a5fa !important;
    }

    .account-dropdown .drop-icon {
        font-size: 1.05rem;
        transition: all 0.2s ease;
    }

    /* Colores premium para cada opción */
    .account-dropdown .c-pass {
        color: #a855f7;
    }
    /* Morado moderno */
    .account-dropdown .c-account {
        color: #3b82f6;
    }
    /* Azul clásico */
    .account-dropdown .c-fav {
        color: #f43f5e;
    }
    /* Rosa/Rojo vibrante */
    .account-dropdown .c-orders {
        color: #10b981;
    }
    /* Verde esmeralda */
    .account-dropdown .c-addr {
        color: #f97316;
    }
    /* Naranja cálido */

    .account-dropdown .dropdown-item:hover .drop-icon {
        filter: brightness(1.3);
        transform: scale(1.1);
    }

/* ── BOTÓN DE CERRAR SESIÓN ── */
.btn-logout {
    padding: 0.5rem 0.85rem;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    background: transparent;
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .btn-logout:hover {
        background-color: rgba(239, 68, 68, 0.1) !important;
        color: #f87171 !important;
        text-decoration: none !important;
        transform: translateX(4px);
    }

/* ── Botones login/register cuando no está autenticado ── */
.auth-btn-login {
    font-size: 0.825rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #ffffff;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

    .auth-btn-login:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: #ffffff;
        color: #ffffff;
        text-decoration: none;
    }

.auth-btn-register {
    font-size: 0.825rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    background: #2563eb;
    color: white;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

    .auth-btn-register:hover {
        background: #1d4ed8;
        color: white;
        text-decoration: none;
    }

/* ── Auth-block: contenedor de botones login/register ──
   🔑 Esta clase existe para aplicar order:2 en móvil igual que .account-block ── */
.auth-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================================
   ADMIN BAR  (fila 2)
   ============================================================ */
.admin-bar {
    background: #0b1120;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    padding: 0;
}

    .admin-bar .container-fluid {
        display: flex;
        align-items: stretch;
        padding: 0 1.5rem;
        max-width: 1400px;
        margin: 0 auto;
        gap: 0;
    }

/* Links del admin bar */
.admin-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.2s;
}

    .admin-link:hover {
        color: #ffffff;
        border-bottom-color: #3b82f6;
        background: rgba(255, 255, 255, 0.05);
        text-decoration: none;
    }

    .admin-link.active {
        color: #3b82f6;
        border-bottom-color: #3b82f6;
        font-weight: 600;
    }

    /* Botón destacado — Ofertas Activas */
    .admin-link.admin-link--highlight {
        margin-left: auto;
        color: #ffffff;
        background: rgba(59, 130, 246, 0.25);
        border: 1px solid rgba(59, 130, 246, 0.4);
        border-radius: 8px;
        padding: 0.4rem 1rem;
        font-weight: 600;
        align-self: center;
        border-bottom-color: rgba(59, 130, 246, 0.4) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

        .admin-link.admin-link--highlight:hover {
            background: rgba(59, 130, 246, 0.35);
            color: #ffffff;
            border-color: #3b82f6;
        }

    .admin-link .link-icon {
        font-size: 0.9rem;
        opacity: 0.9;
    }

    /* Colores de iconos del admin bar */
    .admin-link .c-purple {
        color: #a855f7;
    }
    /* Dashboard */
    .admin-link .c-pink {
        color: #f43f5e;
    }
    /* Panel Admin */
    .admin-link .c-orange {
        color: #f97316;
    }
    /* Logística */
    .admin-link .c-green {
        color: #10b981;
    }
    /* Finanzas */
    .admin-link .c-yellow {
        color: #facc15;
    }
    /* Categorías */
    .admin-link .c-cyan {
        color: #06b6d4;
    }
    /* Admin Ofertas */
    .admin-link .c-blue {
        color: #3b82f6;
    }
    /* Banners */

    .admin-link .c-lightning {
        color: #facc15;
        text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
    }

    .admin-link:hover .link-icon {
        filter: brightness(1.2);
    }

/* ============================================================
   BOTÓN LUPA MÓVIL
   🔑 Vive DENTRO de .icon-group en el HTML.
      display:none en desktop (>991px), display:flex en tablet/móvil (≤991px).
   ============================================================ */
.search-toggle-btn {
    display: none; /* Oculto por defecto en desktop */
    position: relative;
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .search-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #3b82f6;
    }

    /* Lupa activa: pintada de azul cuando el overlay está abierto */
    .search-toggle-btn.active {
        color: #3b82f6;
        background: rgba(59, 130, 246, 0.15);
    }

/* ============================================================
   BUSCADOR EXPANDIDO EN MÓVIL / TABLET
   Se activa añadiendo .search-open al #mainHeader (via JS)
   ============================================================ */
.search-overlay-mobile {
    display: none;
    width: 100%;
    padding: 0.5rem 1rem 0.6rem;
    background: #0b1120;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: slideDownSearch 0.2s ease forwards;
}

@keyframes slideDownSearch {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mainHeader.search-open .search-overlay-mobile {
    display: block;
}

.search-overlay-mobile .search-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex: none;
    position: relative;
}

.search-overlay-mobile .search-input {
    width: 100%;
    padding: 0.5rem 2.75rem 0.5rem 2.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50px !important;
    font-size: 0.875rem !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

    .search-overlay-mobile .search-input::placeholder {
        color: #94a3b8 !important;
    }

    .search-overlay-mobile .search-input:focus {
        border-color: #3b82f6 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
    }

.search-overlay-mobile .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10;
}

/* Botón X para cerrar el overlay */
.search-overlay-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

    .search-overlay-close:hover {
        color: #f87171;
    }


/* ── Cuenta siempre pegada a la derecha en desktop ── */
.account-block,
.auth-block {
    margin-left: 0;
    flex-shrink: 0;
}

/* ── Base (fuera de media queries) ── */
.account-block,
.account-wrapper,
.auth-block {
    margin-left: 0;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — COLAPSO PROGRESIVO (100% FLUIDO)

   MAPA DE BREAKPOINTS:
   > 991px  → desktop completo: barra de búsqueda visible, sin lupa
   ≤ 991px  → tablet/móvil grande: se oculta la barra, APARECE LA LUPA
                                    layout sigue en una sola fila
   ≤ 800px  → móvil: layout pasa a dos filas (Cat + Prod en fila 2)
   ≤ 576px  → móvil pequeño: logo e iconos más compactos
   ≤ 400px  → micro (Galaxy Z Fold 5): todo muy compacto
   ============================================================ */

/* ── TABLETS Y PANTALLAS MEDIANAS (hasta 991px) ─────────────
   🔑 CAMBIO CLAVE: La lupa se activa aquí, NO a 800px.
      Esto cubre iPad Air (820), Surface Pro 7 (912), Zenbook Fold (853).
   ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {

    /* Ocultar buscador desktop y subtítulo del logo */
    .top-bar .search-wrap,
    .brand-sub {
        display: none;
    }

    /* 🔍 LUPA: aparece en tablet/móvil en cuanto desaparece la barra desktop */
    .search-toggle-btn {
        display: flex;
    }

    /* Admin bar: scroll horizontal elegante */
    .admin-bar .container-fluid {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        gap: 0.2rem;
    }

        .admin-bar .container-fluid::-webkit-scrollbar {
            height: 3px;
        }

        .admin-bar .container-fluid::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
        }

    .admin-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
        flex-shrink: 0;
    }

        .admin-link.admin-link--highlight {
            margin: 0;
            padding: 0.4rem 0.7rem;
        }
}

/* ── MÓVILES (hasta 800px) ──────────────────────────────────
   Layout pasa a DOS FILAS:
   Fila 1: [Logo]  →  [icon-group + lupa]  [cuenta / auth]   ← cuenta SIEMPRE derecha
   Fila 2: [Categorías 50%]    [Productos 50%]
   ──────────────────────────────────────────────────────────── */
@media (max-width: 800px) {


    /* 👇 Ajustes del Logo y Texto en celular 👇 */
    .brand-block img {
        height: 65px !important; /* 🔧 Ajusta ESTE NÚMERO para TODOS los celulares (ej: 60px, 70px) */
        width: auto !important;
        max-height: none !important; /* Matamos cualquier restricción */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .brand-name {
        font-size: 1.5rem !important; /* 🔧 Letra FraGo para todos los celulares */
        margin-left: -5px !important;
    }

    .account-block,
    .account-wrapper {
        order: 3;
        padding: 0.3rem 0.45rem;
        gap: 0.4rem;
        flex-shrink: 0;
        margin-left: 0;
    }

    .auth-block {
        order: 3;
        gap: 0.35rem;
        flex-shrink: 0;
    }

    /* Matar la flecha automática de Bootstrap en el dropdown de cuenta */
    .account-block.dropdown-toggle::after {
        display: none !important;
    }

    .top-bar .container-fluid {
        flex-wrap: wrap;
        padding: 0.55rem 1rem;
        gap: 0.4rem;
        align-items: center;
    }

    /* Ocultar divisores verticales */
    .bar-divider {
        display: none;
    }

    /* ── FILA 1 ── */
    .brand-block {
        order: 1;
        flex: 1 1 auto; /* 🔑 ocupa el espacio disponible empujando el resto a la derecha */
    }

    /* icon-group (lupa + bell + heart + cart) — va ANTES de la cuenta */
    .icon-group {
        order: 2;
        margin-left: 0; /* 🔑 ya no empuja, el brand-block crece y hace el trabajo */
        gap: 0.2rem;
        flex-shrink: 0;
    }

    /* Cuenta — usuario logueado — SIEMPRE al extremo derecho */
    .account-block {
        order: 3; /* 🔑 order 3 = después de icon-group, pegado a la derecha */
        padding: 0.3rem 0.45rem;
        gap: 0.4rem;
        flex-shrink: 0;
        margin-left: 0;
    }

    /* Auth buttons — usuario NO logueado, misma posición que .account-block */
    .auth-block {
        order: 3; /* 🔑 mismo order que account-block */
        gap: 0.35rem;
        flex-shrink: 0;
    }

    /* ── FILA 2: Categorías y Productos al 50% ── */
    .top-bar .container-fluid > *:has(.cats-btn) {
        order: 4; /* 🔑 order 4 = segunda fila */
        width: calc(50% - 0.2rem);
        margin-top: 0.35rem;
    }

    .cats-btn {
        width: 100%;
        justify-content: center;
    }

    .products-link {
        order: 4; /* 🔑 order 4 = segunda fila */
        width: calc(50% - 0.2rem);
        margin-top: 0.35rem;
        justify-content: center;
        background: rgba(37, 99, 235, 0.15);
        border: 1px solid rgba(37, 99, 235, 0.3);
        border-radius: 8px;
        padding: 0.4rem 0.75rem;
    }

    /* Fallback nth-child para el wrapper de categorías */
    .top-bar .container-fluid > div:nth-child(3) {
        order: 4;
        width: calc(50% - 0.2rem);
        margin-top: 0.35rem;
    }

    /* Ocultar buscador desktop */
    .top-bar .search-wrap {
        display: none !important;
    }
}

/* ── MÓVILES PEQUEÑOS (hasta 576px) ── */
@media (max-width: 576px) {

    /* Solo avatar visible, ocultar nombre y flecha */
    .account-label, .account-chevron {
        display: none;
    }

    .top-bar .container-fluid {
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }


    .brand-icon-wrap {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .icon-btn,
    .search-toggle-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .account-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    /* Auth buttons compactos */
    .auth-btn-login,
    .auth-btn-register {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Fila 2 — 50% exacto */
    .top-bar .container-fluid > *:has(.cats-btn),
    .products-link,
    .top-bar .container-fluid > div:nth-child(3) {
        width: calc(50% - 0.2rem);
    }
}

/* ── PANTALLAS MUY GRANDES (1400px+) ── */
@media (min-width: 1400px) {
    .top-bar .container-fluid,
    .admin-bar .container-fluid {
        padding: 0 2rem;
    }

    #mainHeader .search-wrap {
        max-width: 550px;
    }
}

/* ── Galaxy Z Fold 5 y similares (hasta 400px) ── */
@media (max-width: 400px) {


    .account-block,
    .account-wrapper {
        order: 3 !important;
        flex-shrink: 0;
    }

    .auth-block {
        order: 3 !important;
        gap: 0.2rem;
        flex-shrink: 0;
    }

    .top-bar .container-fluid {
        padding: 0.45rem 0.6rem;
        gap: 0.2rem;
    }

    /* Fila 1 */
    .brand-block {
        order: 1 !important;
        flex: 1 1 auto !important; /* 🔑 igual que en 800px, empuja los demás a la derecha */
        gap: 0.4rem;
    }

    .icon-group {
        order: 2 !important;
        margin-left: 0 !important; /* 🔑 ya no hace falta margin-left:auto */
        gap: 0.1rem;
        flex-shrink: 0;
    }

    .account-block {
        order: 3 !important; /* 🔑 siempre después de icon-group */
        flex-shrink: 0;
    }

    .auth-block {
        order: 3 !important;
        gap: 0.2rem;
        flex-shrink: 0;
    }

    /* Tamaños compactos para 344px */
   

    .brand-icon-wrap {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        border-radius: 7px;
    }

    

    .icon-btn,
    .search-toggle-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .account-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .icon-badge {
        min-width: 15px;
        height: 15px;
        font-size: 0.55rem;
        top: -1px;
        right: -1px;
    }

    .account-block {
        padding: 0.25rem 0.3rem;
        gap: 0.3rem;
    }

    /* Auth buttons super compactos */
    .auth-btn-login,
    .auth-btn-register {
        padding: 0.28rem 0.4rem;
        font-size: 0.68rem;
    }

    /* Fila 2 */
    .top-bar .container-fluid > div:nth-child(3),
    .top-bar .container-fluid > *:has(.cats-btn) {
        order: 4 !important; /* 🔑 corregido de 3 a 4 */
        width: calc(50% - 0.1rem);
        margin-top: 0.3rem;
    }

    .products-link {
        order: 4 !important; /* 🔑 corregido de 3 a 4 */
        width: calc(50% - 0.1rem) !important;
        margin-top: 0.3rem;
        font-size: 0.8rem;
        padding: 0.38rem 0.5rem;
    }

    .cats-btn {
        font-size: 0.8rem;
        padding: 0.38rem 0.5rem;
        justify-content: center;
        width: 100%;
    }

    /* Admin bar compacto */
    .admin-link {
        font-size: 0.7rem;
        padding: 0.45rem 0.5rem;
    }
}

/* Ajustes específicos para tablets (iPad Air, Surface, etc.) */
@media (min-width: 801px) and (max-width: 1024px) {
    
    .top-bar .container-fluid {
        gap: 0.5rem !important; /* Reduce el espacio entre botones */
        padding: 0 1rem;
    }

    /* Ocultamos el "Bienvenido" para que solo quede el nombre */
    .account-greeting {
        display: none !important;
    }

    /* Acortamos el ancho máximo del nombre del usuario */
    .account-name {
        max-width: 90px !important;
        font-size: 0.75rem;
    }

    /* Reducimos un poco el padding de los botones de categoría y productos */
    .cats-btn, .products-link {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    .account-block {
        padding: 0.3rem 0.4rem;
    }
}
