/**
 * Mobile Sticky Navigation Bar
 * Horizontal, swipeable nav fixed to bottom on mobile viewports
 * Only visible on screens <= 768px
 *
 * z-index: 999 — below modal overlays (1000+) but above content
 * Designed to not obscure cookie banners (typically z-index 9999+)
 */

/* ── Hide on desktop ───────────────────────────── */
.brew-mobile-sticky-nav {
    display: none;
}

@media (max-width: 768px) {
    .brew-mobile-sticky-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        padding: 0;
        /* Safe area for notched phones */
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .brew-mobile-sticky-nav__inner {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0;
        padding: 0;
    }

    .brew-mobile-sticky-nav__inner::-webkit-scrollbar {
        display: none;
    }

    .brew-mobile-sticky-nav__link {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 10px 14px;
        min-width: 72px;
        min-height: 48px;
        text-decoration: none;
        color: #6b7280;
        font-size: 10px;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        letter-spacing: 0.02em;
        white-space: nowrap;
        transition: color 0.15s, background 0.15s;
        border: none;
        background: none;
        -webkit-tap-highlight-color: transparent;
    }

    .brew-mobile-sticky-nav__link:hover,
    .brew-mobile-sticky-nav__link:focus {
        color: #7c3aed;
        background: #f5f3ff;
    }

    .brew-mobile-sticky-nav__link.is-active {
        color: #7c3aed;
    }

    .brew-mobile-sticky-nav__icon {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Add bottom padding to body to avoid nav overlap with content */
    body {
        padding-bottom: 64px !important;
    }

    /* When sticky TOC is also present, stack mobile nav above it */
    body.has-sticky-toc .brew-mobile-sticky-nav {
        bottom: 46px;
    }
    body.has-sticky-toc {
        padding-bottom: 112px !important;
    }
}
