/* =========================================================
   MOBILE BOTTOM NAV VARIABLES
========================================================= */

:root {
    --mbn-primary: var(--rk-primary, #08182c);
    --mbn-secondary: var(--rk-secondary, #b78b4f);
    --mbn-accent: var(--rk-accent, #d5ae75);

    --mbn-background: #ffffff;
    --mbn-surface: #ffffff;

    --mbn-text: #6f747c;
    --mbn-text-active: #111111;

    --mbn-border: rgba(15, 24, 36, 0.1);
    --mbn-badge: #e63946;
    --mbn-white: #ffffff;

    --mbn-height: 72px;
    --mbn-radius: 22px;
    --mbn-home-size: 58px;

    --mbn-shadow:
        0 15px 45px rgba(8, 24, 44, 0.18);

    --mbn-transition: 0.25s ease;
}

/* =========================================================
   DESKTOP HIDDEN
========================================================= */

.mbn-nav {
    display: none;
}

/* =========================================================
   MOBILE NAV
========================================================= */

@media (max-width: 991px) {
    body {
        padding-bottom:
            calc(
                var(--mbn-height) +
                26px +
                env(safe-area-inset-bottom)
            ) !important;
    }

    .footer_nav {
        display: none !important;
    }

    .mbn-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 99990;

        max-width: 520px;
        height: var(--mbn-height);
        margin: 0 auto;

        display: block;

        background: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--mbn-border);
        border-radius: var(--mbn-radius);

        box-shadow: var(--mbn-shadow);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .mbn-list {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0 8px;

        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr))
            72px
            repeat(2, minmax(0, 1fr));

        align-items: center;
        list-style: none;
    }

    .mbn-item {
        min-width: 0;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .mbn-link {
        width: 100%;
        height: 100%;
        padding: 8px 3px 6px;

        border: 0;
        outline: 0;
        background: transparent;

        color: var(--mbn-text);

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;

        cursor: pointer;
        text-decoration: none;

        transition:
            color var(--mbn-transition),
            transform var(--mbn-transition);
    }

    .mbn-link:hover,
    .mbn-link:focus {
        color: var(--mbn-secondary);
    }

    .mbn-icon {
        position: relative;
        width: 30px;
        height: 28px;

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 20px;
        line-height: 1;
    }

    .mbn-label {
        max-width: 100%;

        color: inherit;
        font-size: 10px;
        font-weight: 650;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Cart count */

    .mbn-cart-count {
        position: absolute;
        top: -7px;
        right: -9px;

        min-width: 19px;
        height: 19px;
        padding: 0 5px;

        border: 2px solid var(--mbn-surface);
        border-radius: 999px;

        background: var(--mbn-badge);
        color: var(--mbn-white);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 9px;
        font-weight: 800;
        line-height: 1;
    }

    /* Center home button */

    .mbn-home-item {
        position: relative;
    }

    .mbn-home-link {
        position: relative;
        top: -19px;
        padding-top: 0;
        justify-content: flex-start;
        color: var(--mbn-text-active);
    }

    .mbn-home-icon {
        width: var(--mbn-home-size);
        height: var(--mbn-home-size);

        border: 5px solid var(--mbn-background);
        border-radius: 50%;

        background:
            linear-gradient(
                135deg,
                var(--mbn-primary),
                var(--mbn-secondary)
            );

        color: var(--mbn-white);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 21px;

        box-shadow:
            0 10px 24px rgba(8, 24, 44, 0.28);

        transition:
            transform var(--mbn-transition),
            box-shadow var(--mbn-transition);
    }

    .mbn-home-link:hover .mbn-home-icon {
        transform: translateY(-2px);
        box-shadow:
            0 14px 29px rgba(8, 24, 44, 0.32);
    }

    .mbn-home-link .mbn-label {
        margin-top: 5px;
    }

    /* Active page support */

    .mbn-link.active {
        color: var(--mbn-secondary);
    }

    .mbn-link.active .mbn-icon::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -7px;

        width: 5px;
        height: 5px;

        border-radius: 50%;
        background: var(--mbn-secondary);

        transform: translateX(-50%);
    }

    /* Category button reset */

    .mbn-category-toggle {
        appearance: none;
        -webkit-appearance: none;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
    :root {
        --mbn-height: 68px;
        --mbn-home-size: 54px;
    }

    .mbn-nav {
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        border-radius: 19px;
    }

    .mbn-list {
        padding: 0 4px;
        grid-template-columns:
            repeat(2, minmax(0, 1fr))
            65px
            repeat(2, minmax(0, 1fr));
    }

    .mbn-icon {
        font-size: 18px;
    }

    .mbn-label {
        font-size: 9px;
    }
}

/* =========================================================
   DESKTOP SAFETY
========================================================= */

@media (min-width: 992px) {
    .mbn-nav {
        display: none !important;
    }
}