/* === Menú de navegación unificado MasVendido === */
.mv-topbar {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    position: sticky;
    top: 0;
    z-index: 50;
}
.mv-topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    position: relative;
    flex-wrap: wrap;
}
.mv-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
    line-height: 1.1;
    flex: 1 1 auto;
    min-width: 0;
}
.mv-brand small {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}
.mv-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.mv-nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 9px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.mv-nav-link[hidden] { display: none !important; }
.mv-nav-link:hover { background: rgba(255,255,255,0.14); }
.mv-nav-link.active {
    background: rgba(255,255,255,0.20);
    border-color: rgba(255,255,255,0.38);
}
.mv-nav-link:focus-visible,
.mv-user-btn:focus-visible,
.mv-menu-item:focus-visible,
.mv-nav-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.mv-user { position: relative; flex-shrink: 0; }
.mv-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.30);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    cursor: pointer;
    max-width: 100%;
}
.mv-user-btn:hover { background: rgba(255,255,255,0.22); }
.mv-user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #fff;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
    text-transform: uppercase;
    flex-shrink: 0;
}
.mv-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 9rem;
}
.mv-caret { font-size: 0.7rem; opacity: 0.9; }
.mv-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: #fff;
    color: #0f172a;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15,23,42,0.22);
    border: 1px solid #e2e8f0;
    padding: 6px;
    display: none;
    z-index: 80;
}
.mv-user-menu.open { display: block; }
.mv-user-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 6px;
}
.mv-user-head strong { display: block; font-size: 0.95rem; }
.mv-user-empresa {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e40af;
    margin-top: 2px;
}
.mv-user-empresa[hidden] { display: none !important; }
.mv-user-rol { font-size: 0.75rem; color: #64748b; }
.mv-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.9rem;
    color: #0f172a;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}
.mv-menu-item:hover { background: #f1f5f9; }
.mv-menu-danger { color: #b91c1c; }
.mv-menu-danger:hover { background: #fee2e2; }
.mv-nav-toggle-label {
    display: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}
.mv-nav-toggle {
    display: none;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    width: 46px; height: 42px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mv-nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* Tablet / móvil: menú desplegable (hamburguesa) */
@media (max-width: 1024px) {
    .mv-nav-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
        flex-direction: column;
        width: auto;
        min-width: 46px;
        padding: 6px 10px;
        height: auto;
    }
    .mv-nav-toggle-label {
        display: block;
        margin-top: 2px;
    }
    .mv-user {
        order: 3;
    }
    .mv-nav {
        display: none !important;
        order: 10;
        flex: 1 1 100%;
        width: 100%;
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 0 4px;
        background: transparent;
        box-shadow: none;
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mv-topbar.nav-open .mv-nav {
        display: flex !important;
    }
    .mv-nav-link {
        padding: 14px 16px;
        white-space: normal;
        font-size: 1rem;
    }
    .mv-nav .mv-user { display: none !important; }
    .mv-topbar-inner > .mv-user {
        width: auto;
        order: 3;
        margin-left: 0;
    }
    .mv-topbar-inner > .mv-user .mv-user-btn {
        border-radius: 999px;
        padding: 6px 10px 6px 6px;
    }
    .mv-topbar-inner > .mv-user .mv-user-name {
        max-width: 5.5rem;
    }
    .mv-topbar-inner > .mv-user .mv-user-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        background: #fff;
        color: #0f172a;
        border: 1px solid #e2e8f0;
        box-shadow: 0 12px 32px rgba(15,23,42,0.22);
    }
    .mv-topbar-inner > .mv-user .mv-menu-item { color: #0f172a; }
    .mv-topbar-inner > .mv-user .mv-user-head strong { color: #0f172a; }
    .mv-topbar-inner > .mv-user .mv-user-rol { color: #64748b; }
    .mv-topbar-inner > .mv-user .mv-menu-danger { color: #b91c1c; }
}
