/**
 * Blade Boss Navigation v2 — "Best Nav Bar on the Planet"
 * 
 * DNA from Sticky_Nav_Bar v8.1:
 *   ✓ Floating centered pill (desktop)
 *   ✓ Glassmorphic backdrop blur + saturate
 *   ✓ Multi-layer premium shadows
 *   ✓ Gradient underline (green → orange) on hover
 *   ✓ Shimmer sweep on CTA button
 *   ✓ floatDown entrance animation
 *   ✓ Avatar pill + dropdown (logged-in)
 *   ✓ iOS bottom tab bar (mobile)
 *   ✓ Right-side slide-out menu (mobile)
 *   ✓ Hamburger → X morphing animation
 *   ✓ Hide on scroll down, reveal on scroll up
 *
 * Upgrades:
 *   + Design tokens integration
 *   + View Transition names (nav persists across page transitions)
 *   + Proper responsive cascade (mobile-first → 768 → 1024 → 1200)
 *   + Magnetic hover micro-interactions
 *   + Smoother mobile scroll lock (no iOS jump)
 *   + 48px touch targets everywhere
 *   + SVG icons instead of emoji (tab bar)
 *   + Proper ARIA focus styles
 */


/* ═══════════════════════════════════════
   SHARED / ALL BREAKPOINTS
   ═══════════════════════════════════════ */

/* View Transition: nav persists across page navigations */
.bb-desktop-nav,
.bb-mobile-header,
.bb-mobile-tabbar {
    view-transition-name: bb-nav;
}

/* Reset within nav scope */
.bb-nav *,
.bb-nav *::before,
.bb-nav *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Shared font stack */
.bb-nav,
.bb-nav a,
.bb-nav button,
.bb-nav span,
.bb-slide-menu,
.bb-slide-menu a,
.bb-slide-menu button {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animation keyframes */
@keyframes floatDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.96);
    }
    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(4px) scale(1.005);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes dropdownReveal {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 120, 66, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245, 120, 66, 0); }
}


/* ═══════════════════════════════════════
   DESKTOP FLOATING PILL
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
    .bb-desktop-nav {
        position: fixed;
        top: 24px;
        left: 50%;
        transform: translateX(-50%);
        z-index: var(--z-nav, 1000);

        /* Glassmorphic */
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.6);

        /* Floating pill */
        border-radius: 60px;
        padding: 10px 24px 10px 28px;
        min-height: 60px;
        max-width: calc(100vw - 40px);

        /* Premium multi-layer shadows */
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.03),
            0 4px 12px rgba(0, 0, 0, 0.05),
            0 12px 40px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.7);

        /* Layout */
        display: flex;
        align-items: center;
        gap: 36px;

        /* Entrance */
        animation: floatDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);

        /* Transitions */
        transition:
            top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            background 0.4s ease,
            box-shadow 0.4s ease,
            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease;
    }

    /* Subtle glow ring on hover */
    .bb-desktop-nav::after {
        content: '';
        position: absolute;
        inset: -2px;
        background: linear-gradient(
            135deg,
            transparent 20%,
            rgba(30, 94, 52, 0.08) 50%,
            transparent 80%
        );
        border-radius: 60px;
        opacity: 0;
        z-index: -1;
        transition: opacity 0.4s ease;
        pointer-events: none;
    }

    .bb-desktop-nav:hover::after {
        opacity: 1;
    }

    /* ── Scrolled state ── */
    .bb-desktop-nav.scrolled {
        top: 12px;
        padding: 8px 20px 8px 24px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow:
            0 2px 4px rgba(0, 0, 0, 0.04),
            0 8px 24px rgba(0, 0, 0, 0.08),
            0 16px 56px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    /* ── Hidden state (scroll down) ── */
    .bb-desktop-nav.nav-hidden {
        transform: translateX(-50%) translateY(-120px);
        opacity: 0;
        pointer-events: none;
    }

    /* ── Logo ── */
    .bb-logo-link {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        margin-right: 8px;
        transition: transform 0.3s var(--ease-out, ease);
    }

    .bb-logo {
        height: 36px;
        width: auto;
        max-width: 150px;
        object-fit: contain;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.08));
        transition: all 0.35s var(--ease-out, ease);
    }

    .bb-desktop-nav.scrolled .bb-logo {
        height: 30px;
        max-width: 130px;
    }

    .bb-logo-link:hover .bb-logo {
        transform: scale(1.06) rotate(-1.5deg);
        filter: drop-shadow(0 3px 8px rgba(30, 94, 52, 0.18));
    }

    /* ── Nav links ── */
    .bb-nav-menu {
        display: flex;
        align-items: center;
        gap: 28px;
        list-style: none;
        margin: 0 auto 0 0;
    }

    .bb-nav-link {
        color: var(--bb-charcoal, #2A2A2A);
        text-decoration: none;
        font-size: 14.5px;
        font-weight: 550;
        letter-spacing: 0.01em;
        position: relative;
        padding: 8px 2px;
        white-space: nowrap;
        transition: color 0.3s ease, opacity 0.3s ease;
        opacity: 0.75;
    }

    .bb-nav-link:hover {
        opacity: 1;
        color: var(--bb-green, #1E5E34);
    }

    /* The gradient underline — green → orange */
    .bb-nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2.5px;
        background: linear-gradient(90deg, var(--bb-green, #1E5E34), var(--bb-orange, #F57842));
        border-radius: 2px;
        transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .bb-nav-link:hover::after,
    .bb-nav-link.active::after {
        width: 100%;
        left: 0;
    }

    .bb-nav-link.active {
        color: var(--bb-green, #1E5E34);
        font-weight: 650;
        opacity: 1;
    }

    /* Focus visible */
    .bb-nav-link:focus-visible {
        outline: 2px solid var(--bb-orange, #F57842);
        outline-offset: 4px;
        border-radius: 4px;
    }

    /* ── CTA area ── */
    .bb-nav-cta {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }

    /* Login pill button */
    .bb-nav-login-link {
        color: var(--bb-green, #1E5E34);
        background: rgba(30, 94, 52, 0.07);
        border: 1px solid rgba(30, 94, 52, 0.18);
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        padding: 9px 20px;
        border-radius: 30px;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .bb-nav-login-link:hover {
        background: rgba(30, 94, 52, 0.12);
        border-color: rgba(30, 94, 52, 0.3);
        transform: translateY(-1px);
    }

    .bb-nav-login-link:focus-visible {
        outline: 2px solid var(--bb-green, #1E5E34);
        outline-offset: 2px;
    }

    /* Join Now — premium CTA with shimmer */
    .bb-nav-join {
        display: inline-flex;
        align-items: center;
        padding: 10px 26px;
        background: linear-gradient(135deg, var(--bb-orange, #F57842) 0%, #E86A2E 100%);
        color: #fff;
        border: none;
        border-radius: 30px;
        font-size: 14.5px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-decoration: none;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
        cursor: pointer;
        box-shadow:
            0 2px 8px rgba(245, 120, 66, 0.25),
            0 4px 16px rgba(245, 120, 66, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transition: all 0.35s var(--ease-out, ease);
    }

    /* Shimmer sweep */
    .bb-nav-join::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.25),
            transparent
        );
        transition: none;
    }

    .bb-nav-join:hover::before {
        animation: shimmer 0.6s ease forwards;
    }

    .bb-nav-join:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow:
            0 4px 12px rgba(245, 120, 66, 0.35),
            0 8px 28px rgba(245, 120, 66, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        color: #fff;
    }

    .bb-nav-join:active {
        transform: translateY(0) scale(0.98);
        transition-duration: 0.1s;
    }

    .bb-nav-join:focus-visible {
        outline: 2px solid var(--bb-orange, #F57842);
        outline-offset: 3px;
    }


    /* ═══ LOGGED-IN: USER DROPDOWN ═══ */

    .bb-user-dropdown {
        position: relative;
    }

    .bb-user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 5px 14px 5px 5px;
        background: rgba(30, 94, 52, 0.05);
        border: 1px solid rgba(30, 94, 52, 0.12);
        border-radius: 30px;
        cursor: pointer;
        height: 42px;
        transition: all 0.3s ease;
        font-size: 0; /* collapse whitespace */
        white-space: nowrap;
        -webkit-user-select: none;
        user-select: none;
    }

    .bb-user-info:hover {
        background: rgba(30, 94, 52, 0.1);
        border-color: rgba(30, 94, 52, 0.22);
    }

    .bb-user-info:focus-visible {
        outline: 2px solid var(--bb-green, #1E5E34);
        outline-offset: 2px;
    }

    .bb-user-avatar {
        width: 30px;
        height: 30px;
        background: linear-gradient(135deg, var(--bb-green, #1E5E34) 0%, #2A7A48 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(30, 94, 52, 0.2);
    }

    .bb-avatar-initial {
        color: #fff;
        font-weight: 700;
        font-size: 14px;
        text-transform: uppercase;
        line-height: 1;
    }

    .bb-username {
        font-size: 13px;
        font-weight: 600;
        color: var(--bb-charcoal, #2A2A2A);
        letter-spacing: 0.01em;
    }

    .bb-chevron {
        margin-left: 2px;
        transition: transform 0.3s var(--ease-out, ease);
        color: var(--bb-charcoal, #2A2A2A);
        opacity: 0.5;
    }

    .bb-user-dropdown.open .bb-chevron {
        transform: rotate(180deg);
    }

    /* Dropdown menu */
    .bb-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 14px;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.06),
            0 12px 40px rgba(0, 0, 0, 0.12);
        min-width: 220px;
        padding: 6px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(0.96);
        transform-origin: top right;
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
        z-index: 1001;
    }

    .bb-dropdown-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        animation: dropdownReveal 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .bb-dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        color: var(--bb-charcoal, #2A2A2A);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-radius: 10px;
        transition: all 0.15s ease;
        cursor: pointer;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
    }

    .bb-dropdown-item svg {
        opacity: 0.5;
        flex-shrink: 0;
        transition: opacity 0.15s ease;
    }

    .bb-dropdown-item:hover {
        background: rgba(30, 94, 52, 0.06);
        color: var(--bb-green, #1E5E34);
    }

    .bb-dropdown-item:hover svg {
        opacity: 0.8;
    }

    .bb-dropdown-divider {
        height: 1px;
        background: rgba(0, 0, 0, 0.06);
        margin: 4px 8px;
    }

    .bb-dropdown-logout {
        color: #dc2626;
    }

    .bb-dropdown-logout:hover {
        background: rgba(239, 68, 68, 0.06);
        color: #dc2626;
    }

    .bb-dropdown-logout svg {
        stroke: #dc2626;
    }


    /* ── Hide mobile elements ── */
    .bb-mobile-header,
    .bb-mobile-tabbar,
    .bb-slide-menu,
    .bb-menu-overlay {
        display: none !important;
    }
}


/* ═══════════════════════════════════════
   TABLET REFINEMENTS (768–1024)
   ═══════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
    .bb-desktop-nav {
        padding: 8px 16px 8px 22px;
        gap: 20px;
    }

    .bb-nav-menu {
        gap: 16px;
    }

    .bb-nav-link {
        font-size: 13.5px;
        padding: 6px 1px;
    }

    .bb-logo {
        height: 30px;
    }

    .bb-nav-login-link {
        padding: 8px 14px;
        font-size: 13px;
    }

    .bb-nav-join {
        padding: 9px 18px;
        font-size: 13.5px;
    }
}

/* ═══════════════════════════════════════
   LARGE TABLET / SMALL LAPTOP (1025–1200)
   ═══════════════════════════════════════ */
@media (min-width: 1025px) and (max-width: 1200px) {
    .bb-desktop-nav {
        gap: 28px;
    }

    .bb-nav-menu {
        gap: 22px;
    }

    .bb-nav-link {
        font-size: 14px;
    }
}


/* ═══════════════════════════════════════
   MOBILE (< 768px)
   ═══════════════════════════════════════ */
@media (max-width: 767px) {

    /* ── Hide desktop ── */
    .bb-desktop-nav {
        display: none !important;
    }

    /* ━━━ MOBILE HEADER ━━━ */
    .bb-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding-top: env(safe-area-inset-top, 0px);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 9999;
        display: flex;
        align-items: center;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    }

    .bb-mobile-header.nav-hidden {
        transform: translateY(calc(-100% - env(safe-area-inset-top, 0px)));
    }

    .bb-mobile-header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 16px;
    }

    .bb-mobile-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* Mobile JOIN header button */
    .bb-mobile-join-header {
        display: inline-flex;
        align-items: center;
        background: linear-gradient(135deg, var(--bb-orange, #F57842), #E86A2E);
        color: #fff;
        border: none;
        border-radius: 20px;
        padding: 7px 16px;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        text-decoration: none;
        box-shadow: 0 2px 8px rgba(245, 120, 66, 0.3);
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s ease;
    }

    .bb-mobile-join-header:active {
        transform: scale(0.94);
    }

    .bb-mobile-logo {
        height: 30px;
        width: auto;
        display: block;
    }

    /* ━━━ HAMBURGER ━━━ */
    .bb-hamburger {
        width: 44px;
        height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        background: none;
        border: none;
        border-radius: 12px;
        transition: background 0.2s ease;
        z-index: 10001;
    }

    .bb-hamburger:active {
        background: rgba(0, 0, 0, 0.04);
    }

    .bb-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--bb-charcoal, #2A2A2A);
        margin: 3px 0;
        border-radius: 2px;
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }

    .bb-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .bb-hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .bb-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }


    /* ━━━ SLIDE-OUT MENU ━━━ */
    .bb-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 9998;
        -webkit-tap-highlight-color: transparent;
    }

    .bb-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .bb-slide-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
        z-index: 10000;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-top: calc(70px + env(safe-area-inset-top, 0px));
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .bb-slide-menu::-webkit-scrollbar {
        display: none;
    }

    .bb-slide-menu.active {
        transform: translateX(0);
    }

    .bb-slide-menu-content {
        padding: 8px 20px 120px;
    }

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .bb-slide-menu-content {
            padding-bottom: calc(100px + env(safe-area-inset-bottom));
        }
    }

    /* User section in slide menu */
    .bb-mobile-user-section {
        padding: 16px 0 20px;
        margin-bottom: 8px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .bb-mobile-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .bb-user-avatar-lg {
        width: 40px;
        height: 40px;
    }

    .bb-user-avatar-lg .bb-avatar-initial {
        font-size: 17px;
    }

    .bb-mobile-username {
        font-size: 16px;
        font-weight: 700;
        color: var(--bb-charcoal, #2A2A2A);
        line-height: 1.3;
    }

    .bb-mobile-tier {
        font-size: 13px;
        font-weight: 500;
        color: var(--bb-green, #1E5E34);
        opacity: 0.8;
    }

    /* Menu links */
    .bb-slide-menu-links {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .bb-slide-menu-links li {
        margin-bottom: 2px;
    }

    .bb-slide-menu-links a {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        color: var(--bb-charcoal, #2A2A2A);
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        border-radius: 12px;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        min-height: 48px;
    }

    .bb-slide-menu-links a:hover,
    .bb-slide-menu-links a.active {
        background: rgba(30, 94, 52, 0.06);
        color: var(--bb-green, #1E5E34);
        font-weight: 600;
    }

    .bb-slide-menu-links a.active {
        background: rgba(30, 94, 52, 0.08);
    }

    /* Menu footer (auth buttons) */
    .bb-slide-menu-footer {
        padding-top: 20px;
        margin-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .bb-slide-login {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px;
        background: rgba(30, 94, 52, 0.06);
        border: 1px solid rgba(30, 94, 52, 0.15);
        border-radius: 12px;
        color: var(--bb-green, #1E5E34);
        text-decoration: none;
        font-size: 15px;
        font-weight: 600;
        min-height: 48px;
        transition: all 0.2s ease;
    }

    .bb-slide-login:active {
        transform: scale(0.97);
    }

    .bb-slide-join {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px;
        background: linear-gradient(135deg, var(--bb-orange, #F57842), #E86A2E);
        border-radius: 12px;
        color: #fff;
        text-decoration: none;
        font-size: 15px;
        font-weight: 700;
        min-height: 48px;
        box-shadow: 0 4px 15px rgba(245, 120, 66, 0.3);
        transition: all 0.2s ease;
    }

    .bb-slide-join:active {
        transform: scale(0.97);
    }

    .bb-mobile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        background: rgba(239, 68, 68, 0.06);
        border: 1px solid rgba(239, 68, 68, 0.15);
        border-radius: 12px;
        color: #dc2626;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        min-height: 48px;
        transition: all 0.2s ease;
    }

    .bb-mobile-logout-btn:active {
        transform: scale(0.97);
    }


    /* ━━━ iOS BOTTOM TAB BAR ━━━ */
    .bb-mobile-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 9997;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.04);
    }

    .bb-tabs {
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 56px;
        padding: 0 8px;
    }

    .bb-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: var(--bb-charcoal, #2A2A2A);
        opacity: 0.5;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        padding: 6px 4px;
        border-radius: 10px;
        min-height: 48px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font-body);
    }

    .bb-tab:active {
        transform: scale(0.92);
        opacity: 0.7;
    }

    .bb-tab.active {
        color: var(--bb-green, #1E5E34);
        opacity: 1;
    }

    .bb-tab.active .bb-tab-icon {
        transform: scale(1.1);
    }

    .bb-tab.active .bb-tab-icon svg {
        stroke-width: 2.5;
    }

    .bb-tab-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s var(--ease-out, ease);
        line-height: 1;
    }

    .bb-tab-icon svg {
        stroke: currentColor;
    }

    .bb-tab-label {
        font-size: 10px;
        font-weight: 550;
        letter-spacing: 0.01em;
        line-height: 1;
    }

    .bb-tab-more {
        color: var(--bb-orange, #F57842);
        opacity: 0.7;
    }

    .bb-tab-more.active {
        color: var(--bb-orange, #F57842);
        opacity: 1;
    }


    /* ── Body spacing ── */
    body {
        padding-top: calc(60px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Mobile scroll lock ── */
    body.bb-menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        /* --scroll-y set by JS to prevent iOS jump */
        top: calc(-1 * var(--scroll-y, 0px));
    }
}


/* ═══════════════════════════════════════
   DESKTOP BODY SPACING
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
    body {
        padding-top: 100px;
    }
}


/* ═══════════════════════════════════════
   ACCESSIBILITY & MOTION
   ═══════════════════════════════════════ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bb-desktop-nav,
    .bb-nav-link::after,
    .bb-nav-join,
    .bb-slide-menu,
    .bb-dropdown-menu,
    .bb-hamburger span,
    .bb-mobile-header,
    .bb-tab,
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .bb-desktop-nav {
        animation: none;
    }
}

/* Skip link — visible on focus only */
.bb-skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bb-green, #1E5E34);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 99999;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: top 0.2s ease;
}

.bb-skip-link:focus {
    top: 0;
}


/* ═══════════════════════════════════════
   PRINT
   ═══════════════════════════════════════ */
@media print {
    .bb-desktop-nav,
    .bb-mobile-header,
    .bb-mobile-tabbar,
    .bb-slide-menu,
    .bb-menu-overlay {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}