.mobile-tabbar,
.mm-root { display: none; }

@media (max-width: 991.98px) {
    :root { --mt-h: 60px; }

    body:has(.mobile-tabbar) .micro-bar,
    body:has(.mobile-tabbar) .sub-nav-deck,
    body:has(.mobile-tabbar) .heavy-header .action-group { display: none !important; }

    body:has(.mobile-tabbar) .heavy-header { padding: 10px 0; box-shadow: 0 1px 0 var(--b2c-line, #e6e8ec); }
    body:has(.mobile-tabbar) .heavy-header .container { flex-wrap: nowrap !important; gap: 12px; padding-left: 14px; padding-right: 14px; }
    body:has(.mobile-tabbar) .heavy-header .main-brand { flex-shrink: 0; }
    body:has(.mobile-tabbar) .heavy-header .main-brand img { height: 30px; max-width: 108px; object-fit: contain; }
    body:has(.mobile-tabbar) .heavy-header .search-engine { order: 0; flex: 1 1 auto; min-width: 0; width: auto; max-width: none; margin: 0 !important; }
    body:has(.mobile-tabbar) .heavy-header .search-group {
        display: flex;
        align-items: center;
        height: 40px;
        overflow: hidden;
        border: 1px solid transparent;
        border-radius: 10px;
        background: var(--b2c-surface-muted, #f3f4f6);
        box-shadow: none;
        transition: border-color .15s ease, background-color .15s ease;
    }
    body:has(.mobile-tabbar) .heavy-header .search-group:focus-within { border-color: var(--b2c-primary, #1d4ed8); background: var(--b2c-surface, #fff); }
    body:has(.mobile-tabbar) .heavy-header .search-group input {
        flex: 1 1 auto;
        min-width: 0;
        height: 100%;
        padding: 0 4px 0 0;
        border: 0;
        background: transparent;
        color: var(--b2c-ink, #171a1f);
        font-size: 16px;
        outline: none;
        box-shadow: none;
    }
    body:has(.mobile-tabbar) .heavy-header .search-group input::placeholder { color: var(--b2c-steel, #6b7280); }
    body:has(.mobile-tabbar) .heavy-header .search-group button[type="submit"] {
        order: -1;
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px;
        height: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent !important;
        color: var(--b2c-steel, #6b7280) !important;
        font-size: .92rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    body:has(.mobile-tabbar) .heavy-header .search-group .search-filter-btn {
        flex: 0 0 40px;
        width: 40px;
        min-width: 40px;
        height: 26px;
        margin-right: 2px;
        padding: 0;
        border: 0;
        border-left: 1px solid var(--b2c-line, #e6e8ec);
        border-radius: 0;
        background: transparent !important;
        color: var(--b2c-ink, #171a1f) !important;
        font-size: .9rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1066;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--mt-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid var(--b2c-line, #e6e8ec);
        background: var(--b2c-surface, #fff);
        box-shadow: 0 -4px 16px rgba(23, 26, 31, .06);
    }
    .mt-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        border: 0;
        background: none;
        color: var(--b2c-steel, #6b7280);
        font-size: .66rem;
        font-weight: 600;
        line-height: 1.1;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .mt-item:hover { color: var(--b2c-ink, #171a1f); text-decoration: none; }
    .mt-item.is-active { color: var(--b2c-primary, #1d4ed8); }
    .mt-item.is-active::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; border-radius: 0 0 2px 2px; background: var(--b2c-primary, #1d4ed8); }
    .mobile-tabbar:has([data-mm-toggle].is-active) .mt-item.is-active:not([data-mm-toggle]) { color: var(--b2c-steel, #6b7280); }
    .mobile-tabbar:has([data-mm-toggle].is-active) .mt-item.is-active:not([data-mm-toggle])::before { display: none; }
    .mt-icon { position: relative; font-size: 1.2rem; line-height: 1; }
    .mt-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mt-badge {
        position: absolute;
        top: -7px;
        right: -12px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border: 2px solid var(--b2c-surface, #fff);
        border-radius: 9px;
        background: var(--b2c-accent, #e31e24);
        color: #fff;
        font-size: .6rem;
        font-weight: 700;
        line-height: 13px;
        text-align: center;
    }
    .mt-badge[hidden] { display: none; }
    .mt-dot { position: absolute; top: -3px; right: -6px; width: 9px; height: 9px; border: 2px solid var(--b2c-surface, #fff); border-radius: 50%; background: var(--b2c-accent, #e31e24); }

    body:has(.mobile-tabbar) { padding-bottom: calc(var(--mt-h) + env(safe-area-inset-bottom)); }
    body.has-pd-buy-bar:has(.mobile-tabbar) { padding-bottom: calc(84px + var(--mt-h) + env(safe-area-inset-bottom)); }
    body:has(.mobile-tabbar) .pd-buy-bar,
    body:has(.mobile-tabbar) .checkout-mobile-bar { bottom: calc(var(--mt-h) + env(safe-area-inset-bottom)); padding-bottom: .6rem; box-shadow: 0 -6px 20px rgba(15, 23, 42, .08); }
    body:has(.mobile-tabbar) .pd-buy-bar,
    body:has(.mobile-tabbar) .checkout-mobile-bar { z-index: 1064; }
    body:has(.mobile-tabbar) .pd-buy-backdrop,
    body:has(.mobile-tabbar) .checkout-mobile-backdrop { z-index: 1063; }
    body:has(.mobile-tabbar) #toastContainer { bottom: calc(var(--mt-h) + env(safe-area-inset-bottom)) !important; }
    body:has(.mobile-tabbar).has-pd-buy-bar #toastContainer,
    body:has(.mobile-tabbar):has(.checkout-mobile-bar) #toastContainer { bottom: calc(var(--mt-h) + 90px + env(safe-area-inset-bottom)) !important; }

    .mm-root {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: calc(var(--mt-h) + env(safe-area-inset-bottom));
        z-index: 1065;
        display: block;
        overflow: hidden;
        background: var(--b2c-surface, #fff);
        visibility: hidden;
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .2s ease, transform .25s ease, visibility .25s;
    }
    .mm-root.is-open { visibility: visible; opacity: 1; transform: none; }
    .mm-root:not(.is-open) { pointer-events: none; }
    .mm-root:not(.is-open) .mm-panel { visibility: hidden !important; }
    .mm-stack { position: absolute; inset: 0; }

    .mm-panel {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        background: var(--b2c-surface, #fff);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s;
    }
    .mm-panel.is-active { transform: none; visibility: visible; z-index: 2; }
    .mm-panel.is-behind { transform: translateX(-28%); visibility: visible; z-index: 1; }

    .mm-head {
        display: flex;
        align-items: center;
        gap: 6px;
        min-height: 56px;
        padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px;
        border-bottom: 1px solid var(--b2c-line, #e6e8ec);
    }
    .mm-head:has(.mm-icon-btn:first-child) { padding-left: 6px; }
    .mm-head strong { flex: 1; min-width: 0; font-size: 1.05rem; font-weight: 700; color: var(--b2c-ink, #171a1f); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-icon-btn { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--b2c-ink, #171a1f); font-size: 1rem; }
    .mm-icon-btn:active { background: var(--b2c-surface-muted, #f6f7f9); }

    .mm-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }

    .mm-user { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 8px solid var(--b2c-surface-muted, #f6f7f9); background: none; color: var(--b2c-ink, #171a1f); text-align: left; }
    .mm-avatar { width: 42px; height: 42px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--b2c-primary-soft, #e8eefd); color: var(--b2c-primary, #1d4ed8); font-weight: 700; }
    .mm-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .mm-user-text strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-user-text span { color: var(--b2c-steel, #6b7280); font-size: .8rem; }
    .mm-user > .fa-chevron-right { color: var(--b2c-steel, #6b7280); font-size: .8rem; }

    .mm-guest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; border-bottom: 8px solid var(--b2c-surface-muted, #f6f7f9); }
    .mm-btn { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--b2c-line, #e6e8ec); border-radius: 8px; color: var(--b2c-ink, #171a1f); font-weight: 600; font-size: .9rem; text-decoration: none; }
    .mm-btn.is-primary { border-color: var(--b2c-primary, #1d4ed8); background: var(--b2c-primary, #1d4ed8); color: #fff; }
    .mm-btn:hover { text-decoration: none; }

    .mm-list { list-style: none; margin: 0; padding: 0; }
    .mm-list li + li .mm-link { border-top: 1px solid var(--b2c-line-soft, #eef0f3); }
    .mm-link {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 52px;
        padding: 0 16px;
        border: 0;
        background: none;
        color: var(--b2c-ink, #171a1f);
        font-size: .95rem;
        font-weight: 500;
        text-align: left;
        text-decoration: none;
    }
    .mm-link:active { background: var(--b2c-surface-muted, #f6f7f9); }
    .mm-link:hover { color: var(--b2c-ink, #171a1f); text-decoration: none; }
    .mm-link > span:first-child { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-link > .fa-chevron-right { color: var(--b2c-steel, #6b7280); font-size: .78rem; }
    .mm-link.is-all { color: var(--b2c-primary, #1d4ed8); font-weight: 600; }
    .mm-link.is-current { font-weight: 700; }
    .mm-link.is-current > .fa-check { color: var(--b2c-primary, #1d4ed8); }
    .mm-link.is-danger { color: var(--b2c-danger, #c0272d); }
    .mm-link.is-danger .mm-lead { color: inherit; }
    .mm-lead { width: 22px; margin-right: 10px; text-align: center; color: var(--b2c-steel, #6b7280); font-size: .95rem; }
    .mm-value { color: var(--b2c-steel, #6b7280); font-size: .85rem; font-weight: 600; }
    .mm-count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--b2c-accent, #e31e24); color: #fff; font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center; }

    .mm-garage { margin: 12px 16px 0; border: 1px solid var(--b2c-line, #e6e8ec); border-radius: 10px; overflow: hidden; }
    .mm-garage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--b2c-surface-muted, #f6f7f9); font-weight: 700; font-size: .88rem; }
    .mm-garage-head i { margin-right: 6px; color: var(--b2c-primary, #1d4ed8); }
    .mm-garage-clear { color: var(--b2c-danger, #c0272d); font-size: .76rem; font-weight: 600; text-decoration: none; }
    .mm-garage-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--b2c-line-soft, #eef0f3); color: var(--b2c-ink, #171a1f); font-size: .86rem; text-decoration: none; }
    .mm-garage-item i { color: var(--b2c-steel, #6b7280); }
    .mm-garage-item.is-active { font-weight: 700; }
    .mm-garage-item.is-active i { color: var(--b2c-success, #15803d); }
    .mm-garage-add { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--b2c-line-soft, #eef0f3); color: var(--b2c-primary, #1d4ed8); font-size: .86rem; font-weight: 600; text-decoration: none; }
    .mm-garage-head + .mm-garage-add { border-top: 0; }

    .mm-currency { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--b2c-line-soft, #eef0f3); }
    .mm-currency-label { display: flex; align-items: center; gap: 10px; color: var(--b2c-ink, #171a1f); font-size: .9rem; font-weight: 500; }
    .mm-currency-label i { width: 22px; text-align: center; color: var(--b2c-steel, #6b7280); }
    .mm-currency-options { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--b2c-surface-muted, #f6f7f9); }
    .mm-currency-options a { min-width: 46px; padding: 6px 10px; border-radius: 6px; color: var(--b2c-ink-soft, #4b5160); font-size: .8rem; font-weight: 700; text-align: center; text-decoration: none; }
    .mm-currency-options a.is-current { background: var(--b2c-surface, #fff); color: var(--b2c-primary, #1d4ed8); box-shadow: 0 1px 3px rgba(23, 26, 31, .12); }

    .mm-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; border-bottom: 8px solid var(--b2c-surface-muted, #f6f7f9); }
    .mm-quick-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 8px 4px; border: 1px solid var(--b2c-line, #e6e8ec); border-radius: 10px; color: var(--b2c-ink, #171a1f); font-size: .74rem; font-weight: 600; text-align: center; text-decoration: none; }
    .mm-quick-item i { color: var(--b2c-primary, #1d4ed8); font-size: 1.15rem; }
    .mm-quick-item:hover { color: var(--b2c-ink, #171a1f); text-decoration: none; }
    .mm-quick-item .mm-count { position: absolute; top: 6px; right: 6px; }

    .mm-value-long { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .mm-contact { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 16px 0; color: var(--b2c-steel, #6b7280); font-size: .85rem; font-weight: 600; text-decoration: none; }

    html.mm-scroll-lock, html.mm-scroll-lock body { overflow: hidden !important; }
    body:has(.mobile-tabbar) .cookie-consent-banner { bottom: calc(var(--mt-h) + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .mm-root, .mm-panel { transition: none; }
}
