/*
 * Binoise navigation system
 * Desktop menu + mega menu + mobile header/drawer.
 * Loaded after main.css so it can safely normalize the old menu utilities.
 */

:root {
    --bnoise-nav-accent: #fe5e22;
    --bnoise-nav-accent-2: #fa7921;
    --bnoise-nav-accent-soft: #fff4ef;
    --bnoise-nav-text: #30343b;
    --bnoise-nav-muted: #8a9099;
    --bnoise-nav-line: #eceef2;
    --bnoise-nav-surface: #ffffff;
    --bnoise-nav-soft: #f7f8fa;
}

body.bnoise-mobile-menu-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Mobile header + drawer
   -------------------------------------------------------------------------- */
@media (max-width: 63.999rem) {
    .bnoise-mobile-header {
        position: relative;
        z-index: 90;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        min-height: 66px;
        padding: 8px 9px;
        margin-top: 6px;
        border: 1px solid #edf0f3;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 8px 26px rgba(28, 34, 46, 0.06);
        transition: box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease !important;
    }

    .bnoise-mobile-header.mobile-header-scroll {
        position: fixed !important;
        top: 8px !important;
        right: 14px !important;
        left: 14px !important;
        width: auto !important;
        min-height: 58px;
        padding: 6px 8px !important;
        margin: 0 !important;
        border: 1px solid rgba(229, 232, 237, 0.96);
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 12px 34px rgba(28, 34, 46, 0.12) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 990 !important;
    }

    .bnoise-mobile-menu-toggle,
    .bnoise-mobile-action-btn,
    .bnoise-mobile-drawer-close {
        appearance: none;
        border: 0;
        outline: 0;
        cursor: pointer;
    }

    .bnoise-mobile-menu-toggle {
        position: relative;
        flex: 0 0 42px;
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        border: 1px solid #eceef2 !important;
        border-radius: 13px !important;
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(30, 34, 43, 0.04);
        transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
    }

    .bnoise-mobile-menu-toggle:hover,
    .bnoise-mobile-menu-toggle[aria-expanded="true"] {
        border-color: rgba(254, 94, 34, 0.24) !important;
        background: var(--bnoise-nav-accent-soft) !important;
    }

    .bnoise-mobile-menu-toggle span {
        position: absolute;
        right: 50%;
        width: 17px;
        height: 1.8px;
        border-radius: 999px;
        background: #4b5057;
        transform: translateX(50%);
        transition: transform 180ms ease, width 180ms ease, background-color 180ms ease;
    }

    .bnoise-mobile-menu-toggle span:nth-child(1) { top: 13px; }
    .bnoise-mobile-menu-toggle span:nth-child(2) { top: 19px; width: 13px; }
    .bnoise-mobile-menu-toggle span:nth-child(3) { top: 25px; }

    .bnoise-mobile-menu-toggle[aria-expanded="true"] span {
        background: var(--bnoise-nav-accent);
    }

    .bnoise-mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
        top: 20px;
        transform: translateX(50%) rotate(45deg);
    }

    .bnoise-mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
        width: 0;
        opacity: 0;
    }

    .bnoise-mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
        top: 20px;
        transform: translateX(50%) rotate(-45deg);
    }

    .bnoise-mobile-logo {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 76px;
        transform: translate(-50%, -50%);
    }

    .bnoise-mobile-logo a {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bnoise-mobile-logo img {
        display: block;
        width: auto;
        max-width: 74px;
        max-height: 50px;
        padding: 0 !important;
        object-fit: contain;
    }

    .bnoise-mobile-header.mobile-header-scroll .bnoise-mobile-logo img {
        max-height: 44px;
    }

    .bnoise-mobile-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-right: auto;
    }

    .bnoise-mobile-action-btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid #eceef2;
        border-radius: 13px;
        background: #fff;
        color: #565c65;
        box-shadow: 0 4px 12px rgba(30, 34, 43, 0.04);
        transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
    }

    .bnoise-mobile-action-btn:hover {
        color: var(--bnoise-nav-accent);
        border-color: rgba(254, 94, 34, 0.22);
        background: var(--bnoise-nav-accent-soft);
        transform: translateY(-1px);
    }

    .bnoise-mobile-action-btn svg {
        width: 20px;
        height: 20px;
        color: currentColor !important;
    }

    .bnoise-mobile-cart-count {
        position: absolute;
        top: -4px;
        right: -4px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: var(--bnoise-nav-accent);
        color: #fff;
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
    }

    .bnoise-mobile-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 66px;
        height: 42px;
        padding: 0 10px;
        border: 1px solid rgba(254, 94, 34, 0.22);
        border-radius: 13px;
        background: var(--bnoise-nav-accent-soft);
        color: var(--bnoise-nav-accent);
        font-size: 11px;
        font-weight: 800;
        transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
    }

    .bnoise-mobile-login:hover {
        background: var(--bnoise-nav-accent);
        color: #fff;
        transform: translateY(-1px);
    }

    .bnoise-mobile-login svg {
        width: 17px;
        height: 17px;
        color: currentColor !important;
    }

    .bnoise-mobile-search-row {
        margin-top: 8px;
    }

    .bnoise-mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 1199;
        background: rgba(20, 24, 31, 0.42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .bnoise-mobile-menu-overlay.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .bnoise-mobile-drawer {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        z-index: 1200 !important;
        display: flex !important;
        flex-direction: column;
        width: min(88vw, 370px) !important;
        height: 100dvh !important;
        padding: 14px 14px 12px !important;
        overflow: hidden !important;
        border: 0;
        border-left: 1px solid #e8ebef;
        border-radius: 20px 0 0 20px;
        background: #fff;
        box-shadow: -22px 0 60px rgba(20, 24, 31, 0.18) !important;
        transform: translate3d(100%, 0, 0) !important;
        transition: transform 260ms cubic-bezier(.22,.72,.28,1) !important;
    }

    .bnoise-mobile-drawer.is-open,
    .bnoise-mobile-drawer:not(.translate-x-full) {
        transform: translate3d(0, 0, 0) !important;
    }

    .bnoise-mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        padding: 0 2px 10px;
        border-bottom: 1px solid #f0f1f3;
    }

    .bnoise-mobile-drawer-logo img {
        display: block;
        width: auto;
        max-width: 76px;
        max-height: 48px;
        object-fit: contain;
    }

    .bnoise-mobile-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid #eceef2 !important;
        border-radius: 12px !important;
        background: #fff !important;
        color: #5e646c;
        transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
    }

    .bnoise-mobile-drawer-close:hover {
        border-color: rgba(254, 94, 34, 0.22) !important;
        background: var(--bnoise-nav-accent-soft) !important;
        color: var(--bnoise-nav-accent);
    }

    .bnoise-mobile-drawer-account {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        margin: 12px 0;
        padding: 11px;
        border: 1px solid #f0e7e2;
        border-radius: 16px;
        background: linear-gradient(135deg, #fff9f6 0%, #fff 72%);
    }

    .bnoise-mobile-user-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 13px;
        background: #fff0e9;
        color: var(--bnoise-nav-accent);
    }

    .bnoise-mobile-user-icon svg {
        width: 20px;
        height: 20px;
        color: currentColor !important;
    }

    .bnoise-mobile-user-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .bnoise-mobile-user-copy span {
        color: #999da5;
        font-size: 10px;
        font-weight: 500;
    }

    .bnoise-mobile-user-copy strong {
        overflow: hidden;
        color: #3d4249;
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .bnoise-mobile-account-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 10px;
        border: 1px solid rgba(254, 94, 34, 0.18);
        border-radius: 10px;
        background: #fff;
        color: var(--bnoise-nav-accent);
        font-size: 10px;
        font-weight: 800;
        white-space: nowrap;
        transition: background-color 160ms ease, color 160ms ease;
    }

    .bnoise-mobile-account-link:hover {
        background: var(--bnoise-nav-accent);
        color: #fff;
    }

    .bnoise-mobile-drawer-search {
        margin-bottom: 12px;
    }

    .bnoise-mobile-drawer .binoise-ajax-search {
        width: 100%;
    }

    .bnoise-mobile-tabs {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .bnoise-mobile-tab-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
        border: 1px solid #eceef2;
        border-radius: 14px;
        background: #f6f7f9 !important;
    }

    .bnoise-mobile-tab-buttons .menu-tab-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 7px 8px !important;
        border: 0 !important;
        border-radius: 10px;
        color: #737982;
        background: transparent;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
    }

    .bnoise-mobile-tab-buttons .menu-tab-btn::before {
        display: none !important;
    }

    .bnoise-mobile-tab-buttons .menu-tab-btn.menu-tab-active {
        color: var(--bnoise-nav-accent) !important;
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(30, 34, 43, 0.06);
    }

    .bnoise-mobile-menu-tab {
        min-height: 0;
        padding: 10px 2px 8px !important;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #d8dbe0 transparent;
    }

    .bnoise-mobile-menu-list,
    .bnoise-side-submenu-list,
    .bnoise-side-submenu-nested,
    .bnoise-mobile-magazine-list ul {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .bnoise-mobile-menu-list .bnoise-side-item {
        width: 100%;
        padding: 0 !important;
        border: 0;
        color: #454a51;
    }

    .bnoise-mobile-drawer .bnoise-side-link {
        position: relative;
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        gap: 9px;
        min-width: 0;
        min-height: 46px;
        padding: 6px 8px !important;
        border: 0 !important;
        border-radius: 12px;
        color: #444a51;
        font-size: 12px;
        font-weight: 650;
        line-height: 1.7;
        transition: color 160ms ease, background-color 160ms ease;
    }

    .bnoise-mobile-drawer .bnoise-side-link::before {
        display: none !important;
    }

    .bnoise-mobile-drawer .bnoise-side-link:hover,
    .bnoise-mobile-drawer .current-menu-item > .bnoise-side-link,
    .bnoise-mobile-drawer .current-menu-ancestor > .bnoise-side-parent .bnoise-side-link {
        color: var(--bnoise-nav-accent);
        background: var(--bnoise-nav-accent-soft);
    }

    .bnoise-side-item-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        border: 1px solid #edf0f3;
        border-radius: 10px;
        background: #fafbfc;
        color: #737982;
    }

    .bnoise-side-item-icon svg {
        width: 17px;
        height: 17px;
        color: currentColor !important;
    }

    .bnoise-side-parent {
        display: flex;
        align-items: center;
        gap: 4px;
        width: 100%;
        border-bottom: 1px solid #f2f3f5;
        border-radius: 12px;
        transition: background-color 160ms ease;
    }

    .bnoise-side-parent.is-open {
        background: #fffaf7;
    }

    .bnoise-mobile-submenu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        margin-left: 5px;
        border: 0;
        border-radius: 10px;
        background: #f7f8fa;
        color: #8e949c;
        cursor: pointer;
        transition: color 160ms ease, background-color 160ms ease;
    }

    .bnoise-mobile-submenu-toggle:hover,
    .bnoise-mobile-submenu-toggle[aria-expanded="true"] {
        background: #fff0e9;
        color: var(--bnoise-nav-accent);
    }

    .bnoise-mobile-submenu-toggle .arr-icon {
        width: 16px;
        height: 16px;
        transition: transform 200ms ease;
    }

    .bnoise-mobile-submenu-toggle[aria-expanded="true"] .arr-icon {
        transform: rotate(180deg);
    }

    .bnoise-side-submenu {
        overflow: hidden;
        transition: max-height 230ms ease;
    }

    .bnoise-side-submenu-list {
        gap: 2px;
        margin: 4px 0 7px;
        padding: 6px 10px 6px 4px;
        border-right: 2px solid #ffe0d1;
        border-radius: 0 10px 10px 0;
        background: #fafbfc;
    }

    .bnoise-side-submenu-list > li,
    .bnoise-side-submenu-nested > li {
        width: 100%;
    }

    .bnoise-side-submenu-list .bnoise-side-link,
    .bnoise-side-submenu-nested .bnoise-side-link {
        min-height: 38px;
        padding: 5px 9px !important;
        color: #686e77;
        font-size: 11px;
        font-weight: 600;
    }

    .bnoise-side-submenu-list .bnoise-side-item-icon {
        display: none;
    }

    .bnoise-side-submenu-nested {
        margin: 0 14px 4px 0;
        padding-right: 8px;
        border-right: 1px dashed #e3e5e9;
    }

    .bnoise-mobile-magazine-list li {
        border-bottom: 1px solid #f0f1f3;
    }

    .bnoise-mobile-magazine-list li:last-child {
        border-bottom: 0;
    }

    .bnoise-mobile-magazine-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 48px;
        padding: 7px 9px;
        border-radius: 11px;
        color: #555b63;
        font-size: 11px;
        font-weight: 650;
        line-height: 1.8;
        transition: color 160ms ease, background-color 160ms ease;
    }

    .bnoise-mobile-magazine-list a:hover {
        color: var(--bnoise-nav-accent);
        background: var(--bnoise-nav-accent-soft);
    }

    .bnoise-mobile-magazine-list svg {
        flex: 0 0 auto;
        color: #a2a7ae;
    }

    .bnoise-mobile-empty {
        padding: 20px 8px;
        color: #999da5;
        font-size: 11px;
        text-align: center;
    }

    .bnoise-mobile-drawer-footer {
        flex: 0 0 auto;
        padding-top: 10px;
        border-top: 1px solid #f0f1f3;
    }

    .bnoise-mobile-drawer-footer a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 40px;
        border: 1px solid #f0d4c5;
        border-radius: 12px;
        background: #fff9f6;
        color: #e75d23;
        font-size: 11px;
        font-weight: 750;
    }

    .bnoise-mobile-drawer-footer svg {
        width: 17px;
        height: 17px;
        color: currentColor !important;
    }
}

@media (max-width: 24rem) {
    .bnoise-mobile-header {
        min-height: 62px;
        padding-inline: 7px;
    }

    .bnoise-mobile-logo {
        width: 66px;
    }

    .bnoise-mobile-logo img {
        max-width: 64px;
        max-height: 44px;
    }

    .bnoise-mobile-menu-toggle,
    .bnoise-mobile-action-btn {
        flex-basis: 39px;
        width: 39px !important;
        height: 39px !important;
    }

    .bnoise-mobile-actions {
        gap: 4px;
    }

    .bnoise-mobile-login {
        min-width: 58px;
        height: 39px;
        padding-inline: 8px;
    }

    .bnoise-mobile-drawer {
        width: min(92vw, 350px) !important;
    }
}

/* --------------------------------------------------------------------------
   Desktop navigation + mega menu
   -------------------------------------------------------------------------- */
@media (min-width: 64rem) {
    .header-container {
        isolation: isolate;
    }

    .header-container .bnoise-desktop-header {
        min-height: 76px;
        padding: 10px 22px;
        overflow: visible;
        border: 1px solid #eceef2;
        border-radius: 22px !important;
        background: rgba(255, 255, 255, 0.97) !important;
        box-shadow: 0 12px 35px rgba(35, 42, 58, 0.06), 0 2px 8px rgba(35, 42, 58, 0.04);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .bnoise-desktop-brand {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        min-width: 74px;
        padding: 2px 8px;
        border-radius: 14px;
        transition: transform 180ms ease, background-color 180ms ease;
    }

    .bnoise-desktop-brand:hover {
        background: #fff7f2;
        transform: translateY(-1px);
    }

    .bnoise-desktop-brand img {
        display: block;
        width: auto;
        max-width: 78px;
        height: 54px;
        object-fit: contain;
    }

    .bnoise-desktop-nav {
        min-width: 0;
        align-items: stretch;
        margin-inline: 20px;
    }

    .bnoise-desktop-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px !important;
        width: 100%;
    }

    .bnoise-desktop-menu > .menu-item.menu-item-depth-0 {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px !important;
        min-height: 48px;
        padding: 4px 7px !important;
        border: 1px solid transparent;
        border-radius: 14px;
        color: var(--bnoise-nav-text);
        transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    }

    .bnoise-desktop-menu > .menu-item.menu-item-depth-0:hover,
    .bnoise-desktop-menu > .menu-item.menu-item-depth-0.menu-open,
    .bnoise-desktop-menu > .menu-item.menu-item-depth-0.current-menu-item,
    .bnoise-desktop-menu > .menu-item.menu-item-depth-0.current-menu-ancestor,
    .bnoise-desktop-menu > .menu-item.menu-item-depth-0.current-menu-parent {
        border-color: rgba(250, 121, 33, 0.11);
        background: #fff7f2;
        color: var(--bnoise-nav-accent);
        box-shadow: 0 4px 12px rgba(243, 111, 38, 0.04);
    }

    .bnoise-desktop-menu .menu-link-depth-0 {
        position: relative;
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 8px 5px !important;
        color: inherit;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.7;
        white-space: nowrap;
        transition: color 180ms ease;
    }

    .bnoise-desktop-menu .menu-item > a::before {
        display: none !important;
        width: 0 !important;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > svg {
        flex: 0 0 auto;
        width: 8px;
        height: 14px;
        color: #9298a1;
        transition: color 180ms ease, transform 180ms ease;
    }

    .bnoise-desktop-menu > .menu-item-depth-0:hover > svg,
    .bnoise-desktop-menu > .menu-item-depth-0.menu-open > svg,
    .bnoise-desktop-menu > .menu-item-depth-0.current-menu-ancestor > svg {
        color: var(--bnoise-nav-accent);
    }

    .bnoise-desktop-menu > .menu-item-has-children.menu-open > svg,
    .bnoise-desktop-menu > .menu-item-has-children:hover > svg {
        transform: rotate(-90deg) translateX(-1px);
    }

    /* Dropdown base */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1 {
        position: absolute;
        top: 100% !important;
        right: 0;
        left: auto;
        z-index: 120;
        width: 360px;
        min-width: 360px;
        height: auto !important;
        min-height: 0;
        gap: 3px !important;
        padding: 0 12px !important;
        overflow: hidden;
        border: 1px solid #e8ebef;
        border-radius: 20px !important;
        background: #fff;
        box-shadow: 0 28px 70px rgba(28, 34, 46, 0.13), 0 6px 18px rgba(28, 34, 46, 0.05);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px) scale(0.985);
        transform-origin: top right;
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, padding 180ms ease;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1::after {
        content: "";
        position: absolute;
        top: -12px;
        right: 0;
        left: 0;
        height: 12px;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1.open {
        max-height: min(72vh, 660px);
        padding: 12px !important;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    /* True two-column mega mode only when a second level actually exists. */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) {
        width: 690px;
        min-width: 690px;
        min-height: 330px;
        padding-left: 378px !important;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children)::before {
        content: "";
        position: absolute;
        top: 12px;
        bottom: 12px;
        left: 12px;
        width: 344px;
        border: 1px solid #f0f1f3;
        border-radius: 16px;
        background: linear-gradient(145deg, #fafbfc 0%, #fff 100%);
    }

    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1 {
        position: relative;
        display: flex;
        align-items: center;
        gap: 9px !important;
        width: 100%;
        min-height: 46px;
        padding: 4px 6px !important;
        border: 0;
        border-radius: 12px;
        color: #4a5058;
        transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1.menu-item-has-children {
        position: static;
    }

    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1:hover,
    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1.mega-active,
    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1.current-menu-item,
    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1.current-menu-ancestor {
        background: #fff4ef;
        color: var(--bnoise-nav-accent);
    }

    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1.mega-active {
        transform: translateX(-2px);
    }

    .bnoise-desktop-menu .sub-menu-level-1 .menu-link-depth-1 {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        min-height: 36px;
        padding: 5px 3px !important;
        color: inherit;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.8;
    }

    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1 > svg {
        flex: 0 0 auto;
        width: 6px;
        height: 12px;
        color: #a6abb3;
        transition: color 160ms ease, transform 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1:hover > svg,
    .bnoise-desktop-menu .sub-menu-level-1 > .menu-item-depth-1.mega-active > svg {
        color: var(--bnoise-nav-accent);
        transform: translateX(-2px);
    }

    .bnoise-desktop-menu .sub-menu-level-1 > li > div:first-child {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 0 1px rgba(250, 121, 33, 0.06);
    }

    /* Inner mega panel */
    .bnoise-desktop-menu .sub-menu-level-2 {
        position: absolute !important;
        top: 18px !important;
        right: auto !important;
        bottom: 18px !important;
        left: 18px !important;
        z-index: 130;
        width: 332px !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 42px 12px 12px !important;
        overflow-y: auto;
        border: 0 !important;
        border-radius: 14px;
        background: transparent;
        box-shadow: none !important;
        align-content: start;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 7px !important;
        scrollbar-width: thin;
        scrollbar-color: #d9dce1 transparent;
    }

    .bnoise-desktop-menu .sub-menu-level-2.hidden {
        display: none !important;
    }

    .bnoise-desktop-menu .sub-menu-level-2:not(.hidden) {
        display: grid !important;
    }

    .bnoise-desktop-menu .sub-menu-level-2::before {
        content: "دسته‌بندی‌ها";
        position: absolute;
        top: 10px;
        right: 12px;
        left: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eceef2;
        color: #363b42;
        font-size: 12px;
        font-weight: 800;
    }

    .bnoise-desktop-menu .sub-menu-level-2 .menu-item {
        width: 100%;
        min-height: 39px;
        padding: 0 !important;
        border-radius: 10px;
        color: #626872;
        transition: color 160ms ease, background-color 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-2 .menu-item:hover,
    .bnoise-desktop-menu .sub-menu-level-2 .current-menu-item {
        background: #fff4ef;
        color: var(--bnoise-nav-accent);
    }

    .bnoise-desktop-menu .sub-menu-level-2 a {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 39px;
        padding: 7px 8px !important;
        color: inherit;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.7;
    }

    /* Account actions */
    .bnoise-desktop-actions {
        flex: 0 0 auto;
        padding-right: 14px;
        margin-right: 2px;
        border-right: 1px solid #eef0f3;
    }

    .bnoise-login-btn,
    .bnoise-account-btn {
        min-height: 44px;
        border-radius: 12px !important;
        font-weight: 700;
        text-decoration: none;
        transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease !important;
    }

    .bnoise-login-btn {
        gap: 7px !important;
        padding: 9px 15px !important;
        border: 1px solid var(--bnoise-nav-accent) !important;
        background: linear-gradient(135deg, #ff8442 0%, #f36f26 100%) !important;
        color: #fff !important;
        box-shadow: 0 8px 18px rgba(243, 111, 38, 0.18);
    }

    .bnoise-login-btn:hover {
        background: linear-gradient(135deg, #f97835 0%, #e96018 100%) !important;
        box-shadow: 0 11px 24px rgba(243, 111, 38, 0.24);
        transform: translateY(-1px);
    }

    .bnoise-login-btn span,
    .bnoise-login-btn svg {
        color: #fff !important;
    }

    .bnoise-account-profile {
        width: 44px;
        min-width: 44px;
        padding: 9px !important;
        border: 1px solid #f1b28e;
        background: #fff7f2 !important;
        color: #f36f26;
    }

    .bnoise-account-profile:hover {
        border-color: #f36f26;
        background: #f36f26 !important;
        box-shadow: 0 8px 18px rgba(243, 111, 38, 0.16) !important;
        transform: translateY(-1px);
    }

    .bnoise-account-profile svg {
        width: 20px;
        height: 20px;
        color: #f36f26 !important;
    }

    .bnoise-account-profile:hover svg {
        color: #fff !important;
    }

    .bnoise-logout-btn {
        padding: 8px 13px !important;
        border: 1px solid #f36f26;
        background: #fff !important;
        color: #f36f26 !important;
        box-shadow: none !important;
    }

    .bnoise-logout-btn:hover {
        background: #fff7f2 !important;
        box-shadow: 0 8px 18px rgba(243, 111, 38, 0.10) !important;
        transform: translateY(-1px);
    }

    .bnoise-logout-btn #logout-button {
        display: flex;
        align-items: center;
        gap: 7px;
        color: inherit;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }

    .bnoise-logout-btn #logout-button svg {
        width: 18px;
        height: 18px;
        color: #f36f26 !important;
    }

    /* Sticky desktop state: no gray/blur backdrop behind the card. */
    .header-container.scroll {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 999;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 10px 0;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .header-container.scroll .bnoise-desktop-header {
        min-height: 68px;
        width: min(calc(100% - var(--bnoise-layout-inline-space)), var(--bnoise-layout-max));
        max-width: none;
        margin-inline: auto !important;
        flex: 0 0 auto;
        border-color: #e7eaf0;
        border-radius: 18px !important;
        background: #fff !important;
        box-shadow: 0 12px 34px rgba(35, 42, 58, 0.10) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-container.scroll .bnoise-desktop-brand img {
        height: 48px;
    }
}

@media (min-width: 90rem) {
    .header-container .bnoise-desktop-header {
        min-height: 80px;
        padding-inline: 28px;
    }

    .bnoise-desktop-nav {
        margin-inline: 28px;
    }

    .bnoise-desktop-menu {
        gap: 8px !important;
    }

    .bnoise-desktop-menu .menu-link-depth-0 {
        padding-inline: 8px !important;
        font-size: 15px;
    }

    .bnoise-login-btn {
        padding-inline: 18px !important;
    }
}

/* --------------------------------------------------------------------------
   Mega menu visual polish v3
   Desktop only. Pure CSS layer on top of the navigation system above.
   -------------------------------------------------------------------------- */
@media (min-width: 64rem) {
    /* Shared panel refinement */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1 {
        border-color: #e9ebef;
        background: #fff;
        box-shadow:
                0 30px 80px rgba(28, 34, 46, 0.14),
                0 8px 24px rgba(28, 34, 46, 0.06),
                inset 0 3px 0 rgba(254, 94, 34, 0.88);
    }

    /* ----------------------------------------------------------------------
       One-level dropdown: turn the plain vertical list into a store panel.
       ---------------------------------------------------------------------- */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) {
        width: 560px;
        min-width: 560px;
        min-height: 0;
        padding: 0 !important;
        overflow: hidden;
        border-radius: 22px !important;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)).open {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: 8px !important;
        max-height: min(74vh, 620px);
        padding: 82px 14px 14px !important;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #d9dce1 transparent;
    }

    /* Header band inside the simple dropdown */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children))::before {
        content: "دسته‌بندی محصولات";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        height: 68px;
        padding: 0 58px 0 18px;
        border-bottom: 1px solid #f0f1f3;
        background:
                radial-gradient(circle at calc(100% - 29px) 50%, #fe5e22 0 4px, #fff0e8 4.5px 15px, transparent 15.5px),
                linear-gradient(135deg, #fffaf7 0%, #ffffff 64%);
        color: #30343b;
        font-size: 13px;
        font-weight: 850;
        line-height: 1.5;
        letter-spacing: -0.15px;
        pointer-events: none;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) > .menu-item-depth-1 {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 58px;
        padding: 5px 8px !important;
        overflow: hidden;
        border: 1px solid #eef0f3;
        border-radius: 15px;
        background: #fafbfc;
        color: #4b5159;
        box-shadow: 0 1px 0 rgba(31, 36, 44, 0.01);
        transition:
                color 170ms ease,
                background-color 170ms ease,
                border-color 170ms ease,
                box-shadow 170ms ease,
                transform 170ms ease;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) > .menu-item-depth-1:hover,
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) > .menu-item-depth-1.current-menu-item {
        border-color: #ffd7c5;
        background: #fff8f4;
        color: var(--bnoise-nav-accent);
        box-shadow: 0 8px 20px rgba(243, 111, 38, 0.08);
        transform: translateX(-2px);
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) .menu-link-depth-1 {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 46px;
        padding: 7px 43px 7px 8px !important;
        color: inherit;
        font-size: 12.5px;
        font-weight: 750;
        line-height: 1.8;
    }

    /* Soft category marker */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) .menu-link-depth-1::before {
        content: "" !important;
        position: absolute;
        top: 50%;
        right: 4px;
        display: block !important;
        width: 30px !important;
        height: 30px;
        border: 1px solid #ffe2d4;
        border-radius: 10px;
        background: radial-gradient(circle at center, #fe5e22 0 3px, #fff1e9 3.5px 100%);
        transform: translateY(-50%);
        transition: transform 170ms ease, border-color 170ms ease, background-color 170ms ease;
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:not(:has(> .menu-item-depth-1.menu-item-has-children)) > .menu-item-depth-1:hover .menu-link-depth-1::before {
        border-color: #ffc8ad;
        transform: translateY(-50%) scale(1.06);
    }

    /* ----------------------------------------------------------------------
       True mega menu: richer master/detail panel for nested categories.
       ---------------------------------------------------------------------- */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) {
        width: 760px;
        min-width: 760px;
        min-height: 390px;
        padding: 18px 402px 18px 16px !important;
        border-radius: 24px !important;
        background: linear-gradient(135deg, #ffffff 0%, #fdfdfd 100%);
    }

    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children)::before {
        top: 16px;
        bottom: 16px;
        left: 16px;
        width: 368px;
        border: 1px solid #eceef2;
        border-radius: 18px;
        background:
                linear-gradient(180deg, rgba(255, 248, 244, 0.65) 0%, rgba(250, 251, 252, 0.96) 28%, #fafbfc 100%);
        box-shadow: inset 0 1px 0 #fff;
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1 {
        min-height: 52px;
        margin-bottom: 5px;
        padding: 4px 8px !important;
        border: 1px solid transparent;
        border-radius: 14px;
        background: transparent;
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1:hover,
    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1.mega-active,
    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1.current-menu-item,
    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1.current-menu-ancestor {
        border-color: #ffd8c7;
        background: linear-gradient(135deg, #fff4ef 0%, #fff9f6 100%);
        box-shadow: 0 7px 18px rgba(243, 111, 38, 0.07);
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) .menu-link-depth-1 {
        position: relative;
        min-height: 40px;
        padding-right: 35px !important;
        font-size: 12.5px;
        font-weight: 780;
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) .menu-link-depth-1::before {
        content: "" !important;
        position: absolute;
        top: 50%;
        right: 4px;
        display: block !important;
        width: 24px !important;
        height: 24px;
        border: 1px solid #eeeef1;
        border-radius: 8px;
        background: radial-gradient(circle at center, #a9afb7 0 2.5px, #f7f8fa 3px 100%);
        transform: translateY(-50%);
        transition: border-color 160ms ease, background 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1:hover .menu-link-depth-1::before,
    .bnoise-desktop-menu .sub-menu-level-1:has(> .menu-item-depth-1.menu-item-has-children) > .menu-item-depth-1.mega-active .menu-link-depth-1::before {
        border-color: #ffd2bd;
        background: radial-gradient(circle at center, #fe5e22 0 2.5px, #fff0e8 3px 100%);
    }

    /* Detail panel */
    .bnoise-desktop-menu .sub-menu-level-2 {
        top: 28px !important;
        bottom: 28px !important;
        left: 28px !important;
        width: 344px !important;
        padding: 50px 12px 12px !important;
        border-radius: 16px;
        background: transparent;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px !important;
    }

    .bnoise-desktop-menu .sub-menu-level-2::before {
        content: "انتخاب سریع";
        top: 9px;
        right: 12px;
        left: 12px;
        padding: 0 0 10px;
        border-bottom: 1px solid #e8eaee;
        color: #363b42;
        font-size: 12px;
        font-weight: 850;
    }

    .bnoise-desktop-menu .sub-menu-level-2 .menu-item {
        min-height: 42px;
        overflow: hidden;
        border: 1px solid #eceef2;
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.86);
        color: #626872;
        transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-2 .menu-item:hover,
    .bnoise-desktop-menu .sub-menu-level-2 .current-menu-item {
        border-color: #ffd5c2;
        background: #fff7f2;
        color: var(--bnoise-nav-accent);
        box-shadow: 0 5px 14px rgba(243, 111, 38, 0.07);
        transform: translateY(-1px);
    }

    .bnoise-desktop-menu .sub-menu-level-2 a {
        position: relative;
        min-height: 42px;
        padding: 8px 22px 8px 8px !important;
        font-size: 11.5px;
        font-weight: 680;
    }

    .bnoise-desktop-menu .sub-menu-level-2 a::before {
        content: "" !important;
        position: absolute;
        top: 50%;
        right: 8px;
        display: block !important;
        width: 6px !important;
        height: 6px;
        border-radius: 999px;
        background: #c2c6cc;
        transform: translateY(-50%);
        transition: background-color 160ms ease, box-shadow 160ms ease;
    }

    .bnoise-desktop-menu .sub-menu-level-2 .menu-item:hover > a::before,
    .bnoise-desktop-menu .sub-menu-level-2 .current-menu-item > a::before {
        background: var(--bnoise-nav-accent);
        box-shadow: 0 0 0 3px #ffe9de;
    }

    /* Keep the invisible hover bridge functional above both panel types. */
    .bnoise-desktop-menu > .menu-item-depth-0 > .sub-menu-level-1::after {
        top: -14px;
        height: 14px;
    }
}

/* =========================================================
   Binoise - Desktop top utility actions (cart + phone)
   ========================================================= */
@media (min-width: 1024px) {
    /* Desktop utility group in the upper header row. */
    .bnoise-desktop-utilities {
        display: flex !important;
        align-items: center;
        gap: 8px !important;
        padding: 4px;
        border: 1px solid #f0f1f3;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 6px 22px rgba(35, 37, 78, 0.045);
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility {
        position: relative;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px !important;
        min-height: 42px;
        padding: 6px 11px !important;
        border: 1px solid transparent;
        border-radius: 12px;
        background: transparent;
        color: #4e5260;
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        transition:
                background-color 180ms ease,
                border-color 180ms ease,
                color 180ms ease,
                transform 180ms ease,
                box-shadow 180ms ease;
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility:hover {
        border-color: #ffd9c4;
        background: #fff7f2;
        color: #f36f26;
        box-shadow: 0 6px 16px rgba(243, 111, 38, 0.08);
        transform: translateY(-1px);
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility > .icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        border-radius: 10px;
        background: #f7f8fa;
        transition: background-color 180ms ease, transform 180ms ease;
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility > .icon svg {
        width: 19px !important;
        height: 19px !important;
        color: #666b74 !important;
        transition: color 180ms ease;
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility:hover > .icon {
        background: #fa7921;
        transform: scale(1.03);
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility:hover > .icon svg {
        color: #fff !important;
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility > span:not([class*="absolute"]) {
        color: #4d515b !important;
        font-size: 13px !important;
        font-weight: 700;
        line-height: 1;
        transition: color 180ms ease;
    }

    .bnoise-desktop-utilities > .bnoise-desktop-utility:hover > span:not([class*="absolute"]) {
        color: #f36f26 !important;
    }

    /* Cart count badge. */
    .bnoise-desktop-cart > span[class*="absolute"] {
        top: -3px !important;
        right: -3px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px !important;
        border: 2px solid #fff;
        border-radius: 999px !important;
        background: #fa7921 !important;
        color: #fff !important;
        font-size: 10px !important;
        font-weight: 800;
        line-height: 1;
        box-shadow: 0 3px 8px rgba(250, 121, 33, 0.24);
        z-index: 2;
    }

    /* Phone number stays visually stable in RTL layouts. */
    .bnoise-desktop-phone > span {
        direction: ltr;
        unicode-bidi: embed;
        letter-spacing: 0.15px;
        font-variant-numeric: tabular-nums;
    }
}
