/* Restyle the inner tab bar only. Its fixed position, safe-area padding,
   visibility breakpoint and existing navigation/motion logic stay intact. */
@media (max-width: 768px) {
    #bottomNav .bottom-nav-inner {
        gap: 4px;
        padding: 5px 6px;
        border: 1px solid var(--surface-glass-border, rgba(255, 255, 255, .88));
        border-radius: 26px;
        background: var(--surface-glass, rgba(255, 255, 255, .88));
        -webkit-backdrop-filter: blur(24px) saturate(160%);
        backdrop-filter: blur(24px) saturate(160%);
        box-shadow: var(--shadow-elevated, 0 8px 26px rgba(25, 39, 65, .12));
    }

    #bottomNav .bottom-nav-item {
        min-width: 0;
        border-radius: 19px;
        color: var(--text-secondary, #626970);
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(var(--brand-primary-rgb, 62, 100, 168), .16);
        user-select: none;
        -webkit-user-select: none;
        transition: background-color 220ms cubic-bezier(0.4, 0, 0.2, 1), color 220ms ease, transform 140ms ease;
    }

    /* Include the small gaps around each link in its touch target. */
    #bottomNav .bottom-nav-item::before { content: ''; position: absolute; inset: -5px -2px; }
    #bottomNav .bottom-nav-item > * { pointer-events: none; }
    #bottomNav .bottom-nav-item.is-pressed,
    #bottomNav .bottom-nav-item:active { transform: scale(.94); background: rgba(var(--brand-primary-rgb, 62, 100, 168), .18); }
    #bottomNav .bottom-nav-item[aria-busy="true"] { background: var(--brand-primary-solid, #3E64A8); color: #FFFFFF; }
    #bottomNav .bottom-nav-item.is-selecting { animation: bottom-nav-select 360ms ease-out; }

    #bottomNav .bottom-nav-item[aria-busy="true"] i { visibility: hidden; }
    #bottomNav .bottom-nav-item[aria-busy="true"]::after {
        content: '';
        display: block;
        position: absolute;
        inset: 6px auto auto 50%;
        width: 15px;
        height: 15px;
        margin-left: -7.5px;
        box-sizing: border-box;
        border: 2px solid rgba(255,255,255,.44);
        border-top-color: white;
        background: transparent;
        border-radius: 50%;
        animation: bottom-nav-loading .75s linear infinite;
        pointer-events: none;
    }
    @keyframes bottom-nav-loading { to { transform: rotate(1turn); } }
    @media (prefers-reduced-motion: reduce) {
        #bottomNav .bottom-nav-item[aria-busy="true"]::after { animation: none; }
    }

    @keyframes bottom-nav-select {
        0% { box-shadow: inset 0 0 0 2px rgba(var(--brand-primary-rgb, 62, 100, 168), .34); background: rgba(var(--brand-primary-rgb, 62, 100, 168), .24); }
        100% { box-shadow: inset 0 0 0 0 rgba(var(--brand-primary-rgb, 62, 100, 168), 0); }
    }

    #bottomNav .bottom-nav-item i {
        font-size: 20px;
        background: transparent;
        color: inherit;
        box-shadow: none;
    }

    #bottomNav .bottom-nav-item.active {
        background: var(--brand-primary-solid, #3E64A8);
        color: #FFFFFF;
        box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb, 62, 100, 168), .30);
    }

    #bottomNav .bottom-nav-item.active:not([aria-busy="true"])::after { display: none; }

    #bottomNav [data-nav="cart"]:has(.bottom-nav-cart-badge.show) {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: center;
        align-items: center;
        gap: 4px 2px;
    }
    #bottomNav [data-nav="cart"] > span:last-child {
        grid-column: 1 / -1;
    }
    #bottomNav .bottom-nav-cart-badge {
        display: none;
        align-items: center;
        justify-content: center;
        position: static;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 6px;
        background: var(--brand-primary-solid, #3e64a8);
        color: #FFFFFF;
        border: 0;
        font: 700 11px/1 var(--font-ui);
        font-variant-numeric: tabular-nums;
        box-shadow: none;
        pointer-events: none;
    }

    #bottomNav .bottom-nav-cart-badge.show {
        display: inline-flex;
    }

    #bottomNav .bottom-nav-item:is(.active, [aria-busy="true"]) .bottom-nav-cart-badge {
        background: #fff;
        color: var(--brand-primary-solid, #3e64a8);
    }

    #bottomNav .bottom-nav-notif-dot {
        display: none;
        position: absolute;
        top: 6px;
        left: calc(50% + 7px);
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: var(--brand-accent-solid, #E05A7A);
        border: 1.5px solid var(--surface-card, #FFFFFF);
        box-shadow: 0 1px 4px rgba(var(--brand-accent-rgb, 224, 90, 122), .45);
        pointer-events: none;
    }

    #bottomNav .bottom-nav-notif-dot.show {
        display: block;
    }

    #bottomNav .bottom-nav-item.active .bottom-nav-notif-dot {
        border-color: var(--brand-primary-solid, #3E64A8);
    }
}

@media (max-width: 360px) {
    #bottomNav .bottom-nav-item i { font-size: 18px; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    #bottomNav .bottom-nav-item,
    #bottomNav .bottom-nav-item i { transition: none; animation: none !important; }
}
