/*
 * ss-bottom-nav — Fixed mobile app-style bottom navigation (v2 redesign).
 *
 * 5 tabs: Home / Search / Cart / Account / Menu.
 * Shown on mobile only (≤1023px). Desktop keeps existing header + MegaMenu.
 * iOS safe-area bottom padding baked in.
 */

.ss-bottom-nav {
    display: none;
}

@media (max-width: 1023px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .ss-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #1a2543;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 9998;
    }

    .ss-bottom-nav__tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: transparent;
        border: 0;
        padding: 8px 4px;
        color: rgba(255, 255, 255, 0.65);
        text-decoration: none;
        font-family: inherit;
        cursor: pointer;
        min-height: 44px;
        transition: color .15s ease;
        position: relative;
    }
    .ss-bottom-nav__tab:hover,
    .ss-bottom-nav__tab.is-active {
        color: #ffffff;
    }
    .ss-bottom-nav__tab.is-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: #1abc9c;
        border-radius: 0 0 2px 2px;
    }
    .ss-bottom-nav__icon { display: block; }
    .ss-bottom-nav__label {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1;
    }

    .ss-bottom-nav__cart-wrap {
        position: relative;
        display: inline-flex;
    }
    .ss-bottom-nav__badge {
        position: absolute;
        top: -6px;
        right: -8px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        background: #1abc9c;
        color: #ffffff;
        font-size: 10px;
        font-weight: 800;
        line-height: 18px;
        text-align: center;
        border-radius: 999px;
        border: 2px solid #1a2543;
        box-sizing: content-box;
        font-family: 'JetBrains Mono', 'Menlo', monospace;
    }
    .ss-bottom-nav__badge[hidden] { display: none; }

    /* Hide MegaMenu only when it lives in the page header area (desktop bar).
       When it lives INSIDE .nav-sections (Luma mobile drawer), let it render —
       that's the actual menu content the user sees when they tap the Menu tab. */
    .page-header .rwc-mm-hamburger,
    .page-header > .rwc-mm-bar,
    .page-header > .rwc-megamenu,
    .rwc-mm-overlay {
        display: none !important;
    }

    /* Hide top-header duplicates (hamburger + cart) — bottom nav handles them.
       body prefix bumps specificity above parent theme's styles-l rule
       (.header.content .minicart-wrapper{display:flex !important} which
       otherwise wins by source-order-later. */
    body .page-header .nav-toggle,
    body .page-header .minicart-wrapper,
    body .page-header .action.showcart,
    body .header.content .minicart-wrapper,
    body .header.content .action.showcart,
    body .header.content .action.nav-toggle {
        display: none !important;
    }

    /* Mobile header layout: parent theme uses flex/grid inside .header.content
       which treats .logo as a slot. Force block layout so .logo can own its
       own row and center itself. */
    body .header.content {
        display: block !important;
    }

    /* Mobile logo: hide the "S" mark, show the wordmark as a bold uppercase
       letter-spaced text, centered in the header. */
    body .header.content .logo {
        display: block !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 12px 0 !important;
        text-align: center !important;
        position: static !important;
    }
    body .header.content .logo .ss-logo__mark {
        display: none !important;
    }
    body .header.content .logo .ss-logo__text {
        display: inline-block !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif !important;
        font-size: 20px !important;
        font-weight: 800 !important;
        letter-spacing: 0.14em !important;
        text-transform: uppercase !important;
        color: #0f172a !important;
        line-height: 1 !important;
    }
    body .header.content .logo .ss-logo__text strong {
        font-weight: 800 !important;
        color: #0f172a !important;
    }

    /* MegaMenu drawer opens directly (skips Luma's intermediate drawer). */
}
