/* شريط التنقل السفلي — هواتف فقط + صفحات ما بعد تسجيل الدخول */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        --mbn-brand: #850606;
        --mbn-brand-glow: rgba(133, 6, 6, 0.55);
        --mbn-glass: rgba(255, 255, 255, 0.72);
        --mbn-glass-edge: rgba(255, 255, 255, 0.55);
        --mbn-divider: rgba(133, 6, 6, 0.14);
        --mbn-label: #4a4a4a;
        --mbn-label-active: #1a1a1a;
        --mbn-active-glow: rgba(133, 6, 6, 0.18);

        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px));
        pointer-events: none;
        direction: ltr;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    /* إخفاء الشريط عند فتح القائمة الجانبية */
    body.sidebar-open .mobile-bottom-nav {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mbn-shell {
        pointer-events: auto;
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        gap: 0;
        height: 55px;
        margin-top: 12px;
        padding: 0 4px 7px;
        border-radius: 26px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 45%),
            var(--mbn-glass);
        backdrop-filter: blur(20px) saturate(1.4);
        -webkit-backdrop-filter: blur(20px) saturate(1.4);
        border: 1.5px solid var(--mbn-glass-edge);
        box-shadow:
            0 0 0 1px rgba(133, 6, 6, 0.14),
            0 -2px 12px var(--mbn-brand-glow),
            0 2px 8px rgba(133, 6, 6, 0.14),
            0 8px 22px rgba(133, 6, 6, 0.14),
            0 3px 10px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.85),
            inset 0 -1px 0 rgba(133, 6, 6, 0.1);
        transition:
            background 0.35s ease,
            border-color 0.35s ease,
            box-shadow 0.35s ease;
    }

    .mbn-shell::before {
        content: "";
        position: absolute;
        top: -14px;
        left: 50%;
        width: 62px;
        height: 32px;
        transform: translateX(-50%);
        border-radius: 31px 31px 0 0;
        background: var(--mbn-glass);
        backdrop-filter: blur(20px) saturate(1.4);
        -webkit-backdrop-filter: blur(20px) saturate(1.4);
        border: 1.5px solid var(--mbn-glass-edge);
        border-bottom: none;
        box-shadow:
            0 -3px 12px var(--mbn-brand-glow),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        z-index: 0;
        pointer-events: none;
        transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    }

    .mbn-shell::after {
        content: "";
        position: absolute;
        left: 12%;
        right: 12%;
        top: -2px;
        bottom: -2px;
        border-radius: inherit;
        pointer-events: none;
        z-index: 0;
        background:
            radial-gradient(ellipse 55% 70% at 50% -5%, rgba(133, 6, 6, 0.7) 0%, transparent 68%),
            radial-gradient(ellipse 50% 60% at 50% 105%, rgba(133, 6, 6, 0.5) 0%, transparent 70%);
        opacity: 0.9;
        animation: mbn-edge-pulse 3.2s ease-in-out infinite;
    }

    @keyframes mbn-edge-pulse {
        0%, 100% { opacity: 0.65; }
        50% { opacity: 1; }
    }

    .mbn-item {
        position: relative;
        z-index: 1;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        min-width: 0;
        height: 100%;
        padding: 2px 2px 0;
        text-decoration: none;
        color: var(--mbn-label);
        font-size: 9px;
        font-weight: 700;
        font-family: 'Tajawal', sans-serif;
        border-radius: 12px;
        transition:
            color 0.25s ease,
            transform 0.25s cubic-bezier(0.34, 1.45, 0.64, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .mbn-item + .mbn-item::before {
        content: "";
        position: absolute;
        left: 0;
        top: 18%;
        bottom: 22%;
        width: 1px;
        background: linear-gradient(
            180deg,
            transparent 0%,
            var(--mbn-divider) 20%,
            var(--mbn-divider) 80%,
            transparent 100%
        );
        pointer-events: none;
    }

    .mbn-item--center + .mbn-item::before,
    .mbn-item--center::before {
        opacity: 0;
    }

    .mbn-ico {
        display: grid;
        place-items: center;
        width: 35px;
        height: 35px;
        border-radius: 8px;
        transition:
            background 0.25s ease,
            box-shadow 0.25s ease,
            transform 0.25s cubic-bezier(0.34, 1.45, 0.64, 1);
    }

    .mbn-ico svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
        display: block;
    }

    .mbn-item > span:not(.mbn-ico) {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
        color: var(--mbn-label);
        transition: color 0.25s ease;
    }

    .mbn-item.is-active > span:not(.mbn-ico) {
        color: var(--mbn-label-active);
    }

    .mbn-item.is-active .mbn-ico {
        background: var(--mbn-active-glow);
        box-shadow:
            0 0 12px var(--mbn-brand-glow),
            inset 0 0 0 1px rgba(133, 6, 6, 0.12);
    }

    .mbn-item.is-active > span:not(.mbn-ico)::after {
        content: "";
        display: block;
        width: 14px;
        height: 2.5px;
        margin: 2px auto 0;
        border-radius: 99px;
        background: var(--mbn-brand);
        box-shadow: 0 0 8px var(--mbn-brand-glow);
        animation: mbn-underline-in 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
    }

    @keyframes mbn-underline-in {
        from { transform: scaleX(0); opacity: 0; }
        to { transform: scaleX(1); opacity: 1; }
    }

    .mbn-item:active {
        transform: scale(0.94);
    }


    .mbn-item--wallet .mbn-ico { color: var(--c-add, #ffc107); }
    .mbn-item--deposit .mbn-ico { color: var(--c-blas, rgb(12 107 249)); }
    .mbn-item--home .mbn-ico { color: var(--c-success, rgb(24 135 83)); }
    .mbn-item--orders .mbn-ico { color: var(--c-warning, #dc3545); }
    .mbn-item--security .mbn-ico { color: rgb(24 135 83); }


    .mbn-item--center {
        z-index: 2;
        justify-content: flex-start;
        padding-top: 0;
        margin-top: -16px;
    }

    .mbn-item--center .mbn-ico {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background:
            linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.75) 100%);
        box-shadow:
            0 0 0 2.5px rgba(133, 6, 6, 0.2),
            0 0 14px var(--mbn-brand-glow),
            0 5px 12px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 1);
        animation: mbn-center-breathe 2.8s ease-in-out infinite;
    }

    .mbn-item--center .mbn-ico svg {
        width: 20px;
        height: 20px;
    }

    .mbn-item--center.is-active .mbn-ico {
        background:
            linear-gradient(160deg, #fff 0%, rgba(255, 245, 245, 0.95) 100%);
        box-shadow:
            0 0 0 2.5px rgba(133, 6, 6, 0.35),
            0 0 18px var(--mbn-brand-glow),
            0 6px 14px rgba(133, 6, 6, 0.22),
            inset 0 1px 0 #fff;
    }

    .mbn-item--center > span:not(.mbn-ico) {
        margin-top: 1px;
        font-size: 9px;
    }

    @keyframes mbn-center-breathe {
        0%, 100% {
            transform: translateY(0);
            box-shadow:
                0 0 0 2.5px rgba(133, 6, 6, 0.2),
                0 0 12px var(--mbn-brand-glow),
                0 5px 12px rgba(0, 0, 0, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 1);
        }
        50% {
            transform: translateY(-2px);
            box-shadow:
                0 0 0 2.5px rgba(133, 6, 6, 0.32),
                0 0 18px var(--mbn-brand-glow),
                0 6px 14px rgba(133, 6, 6, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 1);
        }
    }


    body.theme-dark .mobile-bottom-nav {
        --mbn-glass: rgba(0, 0, 0, 0.62);
        --mbn-glass-edge: rgba(133, 6, 6, 0.45);
        --mbn-divider: rgba(255, 255, 255, 0.1);
        --mbn-label: rgba(255, 255, 255, 0.72);
        --mbn-label-active: #fff;
        --mbn-active-glow: rgba(133, 6, 6, 0.35);
        --mbn-brand-glow: rgba(133, 6, 6, 0.7);
    }

    body.theme-dark .mbn-shell {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
            var(--mbn-glass);
        box-shadow:
            0 0 0 1px rgba(133, 6, 6, 0.35),
            0 -1px 0 rgba(133, 6, 6, 0.55),
            0 1px 0 rgba(133, 6, 6, 0.35),
            0 10px 28px rgba(0, 0, 0, 0.45),
            0 0 20px rgba(133, 6, 6, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            inset 0 -1px 0 rgba(133, 6, 6, 0.15);
    }

    body.theme-dark .mbn-shell::before {
        background: var(--mbn-glass);
        box-shadow:
            0 -3px 14px var(--mbn-brand-glow),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    body.theme-dark .mbn-item--center .mbn-ico {
        background: linear-gradient(160deg, rgba(40, 40, 40, 0.95) 0%, rgba(18, 18, 18, 0.9) 100%);
        box-shadow:
            0 0 0 2.5px rgba(133, 6, 6, 0.45),
            0 0 18px var(--mbn-brand-glow),
            0 5px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    body.theme-dark .mbn-item--center.is-active .mbn-ico {
        background: linear-gradient(160deg, rgba(55, 20, 20, 0.98) 0%, rgba(20, 8, 8, 0.95) 100%);
    }
}
