/**
 * Vertex Bazaar — fixed bottom tab bar (mobile only), FREEFIREBD-style
 */
/* Keep below header drawer (.ps-drawer 10000) and site popups; lift widgets via mobile-fixed-nudge.js */
.vb-mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--vb-bg-nav);
    border-top: 1px solid var(--vb-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.vb-mobile-bottom-nav__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 2px;
    max-width: 520px;
    margin: 0 auto;
}

.vb-mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 4px 2px;
    text-decoration: none;
    color: var(--vb-text-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

button.vb-mobile-bottom-nav__item {
    appearance: none;
    border: none;
    margin: 0;
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: auto;
    box-sizing: border-box;
}

.vb-mobile-bottom-nav__item:hover {
    color: var(--vb-text);
    background: var(--vb-border-subtle);
}

.vb-mobile-bottom-nav__item--active {
    color: var(--vb-accent-orange);
}

.vb-mobile-bottom-nav__item--active .vb-mobile-bottom-nav__icon {
    stroke: var(--vb-accent-orange);
}

.vb-mobile-bottom-nav__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .vb-mobile-bottom-nav {
        display: block;
    }

    body.has-vb-mobile-nav {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    /*
     * Default chat widgets use z-index ~2e9 and paint over the tab bar.
     * Clamp known roots below .vb-mobile-bottom-nav (9990) so tabs stay tappable.
     * (If your widget uses a different root, add it or lower z-index in the widget’s own settings.)
     */
    body.has-vb-mobile-nav #tawkchat-container,
    body.has-vb-mobile-nav #tawkchat-min-container,
    body.has-vb-mobile-nav .tawk-min-container,
    body.has-vb-mobile-nav #tidio-chat-code,
    body.has-vb-mobile-nav #tidio-chat,
    body.has-vb-mobile-nav .crisp-client,
    body.has-vb-mobile-nav #fb-root .fb_dialog,
    body.has-vb-mobile-nav .intercom-lightweight-app {
        z-index: 9988 !important;
    }
}

:root[data-theme="light"] .vb-mobile-bottom-nav {
    background: #ffffff;
    border-top-color: var(--vb-border);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .vb-mobile-bottom-nav {
        background: #ffffff;
        border-top-color: var(--vb-border);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    }
}
