/* =========================================================
   BISSKET FRESH PREMIUM MOBILE SIDEBAR
   Independent component — no old header dependency
========================================================= */

:root {
    --bms-orange: #f37021;
    --bms-orange-dark: #d95612;
    --bms-orange-light: #ff9b55;
    --bms-orange-soft: #fff3e9;

    --bms-charcoal: #181818;
    --bms-text: #292929;
    --bms-muted: #777777;

    --bms-white: #ffffff;
    --bms-surface: #f6f6f7;
    --bms-border: rgba(24, 24, 24, 0.09);

    --bms-panel-width: 390px;

    --bms-shadow: 24px 0 65px rgba(12, 12, 12, 0.24);

    --bms-card-shadow: 0 10px 26px rgba(24, 24, 24, 0.07);

    --bms-transition: 0.28s cubic-bezier(0.22, 0.8, 0.25, 1);
}

/* Body scroll lock */

body.bms-body-locked {
    overflow: hidden !important;
}

/* Desktop hidden */

.bms-root {
    display: none;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 991px) {
    .bms-root,
    .bms-root * {
        box-sizing: border-box;
    }

    .bms-root {
        position: fixed;

        inset: 0;

        z-index: 100500;

        display: block;

        visibility: hidden;
        pointer-events: none;
    }

    .bms-root.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    /* Overlay */

    .bms-overlay {
        position: absolute;

        inset: 0;

        width: 100%;
        height: 100%;

        margin: 0;
        padding: 0;

        border: 0;

        background: rgba(10, 10, 10, 0.58);

        opacity: 0;

        cursor: pointer;

        -webkit-backdrop-filter: blur(4px);

        backdrop-filter: blur(4px);

        transition: opacity var(--bms-transition);
    }

    .bms-root.is-open .bms-overlay {
        opacity: 1;
    }

    /* Main panel */

    .bms-panel {
        position: absolute;

        top: 0;
        left: 0;
        bottom: 0;

        width: min(90vw, var(--bms-panel-width));

        max-width: var(--bms-panel-width);

        padding: 0;

        background: var(--bms-white);

        display: grid;

        grid-template-rows:
            auto
            auto
            minmax(0, 1fr)
            auto;

        overflow: hidden;

        box-shadow: var(--bms-shadow);

        transform: translateX(-104%);

        transition: transform var(--bms-transition);
    }

    .bms-root.is-open .bms-panel {
        transform: translateX(0);
    }

    /* =====================================================
       BRAND HEADER
    ===================================================== */

    .bms-header {
        position: relative;

        min-height: 100px;

        padding: 18px 68px 16px 20px;

        border-bottom: 1px solid var(--bms-border);

        background: linear-gradient(135deg, #ffffff 0%, #fff8f2 100%);

        display: flex;
        align-items: center;
    }

    .bms-brand {
        min-width: 0;

        color: var(--bms-charcoal);

        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;

        gap: 6px;

        text-decoration: none;
    }

    .bms-brand:hover {
        color: var(--bms-charcoal);
        text-decoration: none;
    }

    .bms-brand img {
        display: block;

        width: auto;
        max-width: 155px;
        max-height: 51px;

        object-fit: contain;
    }

    .bms-brand > strong {
        color: var(--bms-charcoal);

        font-size: 24px;
        font-weight: 900;
    }

    .bms-brand > span {
        color: var(--bms-muted);

        font-size: 9px;
        font-weight: 700;
        line-height: 1.3;

        letter-spacing: 0.025em;
    }

    .bms-close {
        position: absolute;

        top: 20px;
        right: 18px;

        width: 40px;
        height: 40px;

        padding: 0;

        border: 1px solid var(--bms-border);

        border-radius: 50%;

        background: var(--bms-white);
        color: var(--bms-charcoal);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 17px;

        cursor: pointer;

        box-shadow: 0 6px 18px rgba(24, 24, 24, 0.08);

        transition:
            color 0.2s ease,
            border-color 0.2s ease,
            transform 0.2s ease;
    }

    .bms-close:hover {
        color: var(--bms-orange);

        border-color: rgba(243, 112, 33, 0.35);

        transform: rotate(8deg);
    }

    /* =====================================================
       INTRO CARD
    ===================================================== */

    .bms-intro {
        min-height: 76px;

        margin: 14px 18px 8px;
        padding: 13px;

        border-radius: 17px;

        background: linear-gradient(135deg, var(--bms-charcoal), #303030);

        color: var(--bms-white);

        display: grid;

        grid-template-columns:
            42px
            minmax(0, 1fr)
            38px;

        align-items: center;

        gap: 11px;

        box-shadow: 0 14px 30px rgba(24, 24, 24, 0.16);
    }

    .bms-intro-icon {
        width: 42px;
        height: 42px;

        border-radius: 13px;

        background: rgba(255, 255, 255, 0.1);

        color: var(--bms-orange);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 17px;
    }

    .bms-intro span,
    .bms-intro strong {
        display: block;
    }

    .bms-intro div:nth-child(2) > span {
        margin-bottom: 3px;

        color: rgba(255, 255, 255, 0.62);

        font-size: 9px;
    }

    .bms-intro div:nth-child(2) > strong {
        font-size: 12px;
        font-weight: 800;
    }

    .bms-intro > button {
        width: 38px;
        height: 38px;

        padding: 0;

        border: 0;
        border-radius: 12px;

        background: var(--bms-orange);
        color: var(--bms-white);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 12px;

        cursor: pointer;

        transition:
            background 0.2s ease,
            transform 0.2s ease;
    }

    .bms-intro > button:hover {
        background: var(--bms-orange-dark);

        transform: translateX(2px);
    }

    /* =====================================================
       TABS
    ===================================================== */

    .bms-tabs {
        margin: 6px 18px 7px;
        padding: 4px;

        border-radius: 14px;

        background: #f1f1f2;

        display: grid;

        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 4px;
    }

    .bms-tab {
        min-height: 43px;

        padding: 0 12px;

        border: 0;
        border-radius: 11px;

        background: transparent;
        color: var(--bms-muted);

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 8px;

        font-family: inherit;
        font-size: 11px;
        font-weight: 800;

        cursor: pointer;

        transition:
            color 0.2s ease,
            background 0.2s ease,
            box-shadow 0.2s ease;
    }

    .bms-tab.is-active {
        background: var(--bms-white);
        color: var(--bms-orange);

        box-shadow: 0 5px 16px rgba(24, 24, 24, 0.08);
    }

    /* =====================================================
       SCROLLABLE BODY
    ===================================================== */

    .bms-body {
        min-height: 0;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;

        scrollbar-width: thin;

        scrollbar-color: rgba(243, 112, 33, 0.4) transparent;
    }

    .bms-tab-content {
        display: none;

        padding: 12px 18px 22px;
    }

    .bms-tab-content.is-active {
        display: block;

        animation: bmsContentEnter 0.22s ease;
    }

    .bms-section-title {
        margin: 3px 2px 10px;

        color: var(--bms-muted);

        font-size: 9px;
        font-weight: 850;

        letter-spacing: 0.11em;

        text-transform: uppercase;
    }

    /* =====================================================
       QUICK ACCESS
    ===================================================== */

    .bms-quick-grid {
        margin-bottom: 22px;

        display: grid;

        grid-template-columns: repeat(4, minmax(0, 1fr));

        gap: 7px;
    }

    .bms-quick-grid > a,
    .bms-quick-grid > button {
        min-width: 0;
        min-height: 76px;

        padding: 9px 3px 8px;

        border: 1px solid var(--bms-border);

        border-radius: 14px;

        background: var(--bms-white);
        color: var(--bms-text);

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 7px;

        font-family: inherit;

        text-decoration: none;

        cursor: pointer;

        transition:
            color 0.2s ease,
            border-color 0.2s ease,
            background 0.2s ease,
            transform 0.2s ease;
    }

    .bms-quick-grid > a:hover,
    .bms-quick-grid > button:hover,
    .bms-quick-grid > .is-active {
        color: var(--bms-orange);

        border-color: rgba(243, 112, 33, 0.25);

        background: var(--bms-orange-soft);

        text-decoration: none;

        transform: translateY(-2px);
    }

    .bms-quick-icon {
        width: 34px;
        height: 34px;

        border-radius: 11px;

        background: var(--bms-surface);

        color: currentColor;

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 15px;
    }

    .bms-quick-grid strong {
        max-width: 100%;

        overflow: hidden;

        font-size: 9px;
        font-weight: 800;

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* =====================================================
       POPULAR CATEGORIES
    ===================================================== */

    .bms-popular-list {
        margin-bottom: 20px;

        display: grid;

        gap: 7px;
    }

    .bms-popular-item {
        min-height: 61px;

        padding: 7px 11px 7px 7px;

        border: 1px solid var(--bms-border);

        border-radius: 15px;

        color: var(--bms-text);

        display: grid;

        grid-template-columns:
            46px
            minmax(0, 1fr)
            16px;

        align-items: center;

        gap: 11px;

        text-decoration: none;

        transition:
            color 0.2s ease,
            border-color 0.2s ease,
            background 0.2s ease,
            transform 0.2s ease;
    }

    .bms-popular-item:hover {
        color: var(--bms-orange);

        border-color: rgba(243, 112, 33, 0.25);

        background: var(--bms-orange-soft);

        text-decoration: none;

        transform: translateX(2px);
    }

    .bms-popular-image {
        width: 46px;
        height: 46px;

        overflow: hidden;

        border-radius: 12px;

        background: var(--bms-orange-soft);
        color: var(--bms-orange);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 16px;
    }

    .bms-popular-image img {
        width: 100%;
        height: 100%;

        display: block;

        object-fit: cover;
    }

    .bms-popular-content {
        min-width: 0;
    }

    .bms-popular-content strong,
    .bms-popular-content small {
        display: block;
    }

    .bms-popular-content strong {
        overflow: hidden;

        font-size: 11px;
        font-weight: 800;

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bms-popular-content small {
        margin-top: 4px;

        color: var(--bms-muted);

        font-size: 8px;
        line-height: 1.2;
    }

    .bms-popular-item > i {
        color: #aaaaaa;

        font-size: 9px;
    }

    /* =====================================================
       ACCOUNT CARD
    ===================================================== */

    .bms-account-card {
        min-height: 75px;

        padding: 12px;

        border-radius: 17px;

        background: linear-gradient(135deg, var(--bms-charcoal), #303030);

        color: var(--bms-white);

        display: grid;

        grid-template-columns:
            42px
            minmax(0, 1fr)
            38px;

        align-items: center;

        gap: 11px;

        box-shadow: var(--bms-card-shadow);
    }

    .bms-account-icon {
        width: 42px;
        height: 42px;

        border-radius: 13px;

        background: rgba(255, 255, 255, 0.1);

        color: var(--bms-orange);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 17px;
    }

    .bms-account-content {
        min-width: 0;
    }

    .bms-account-content small,
    .bms-account-content strong {
        display: block;
    }

    .bms-account-content small {
        margin-bottom: 4px;

        color: rgba(255, 255, 255, 0.62);

        font-size: 9px;
    }

    .bms-account-content strong {
        font-size: 11px;
        font-weight: 800;
    }

    .bms-account-card > a {
        width: 38px;
        height: 38px;

        border-radius: 12px;

        background: var(--bms-orange);
        color: var(--bms-white);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 11px;

        text-decoration: none;
    }

    /* =====================================================
       CATEGORY ACCORDION
    ===================================================== */

    .bms-category-list {
        display: grid;

        gap: 8px;
    }

    .bms-category-card {
        overflow: hidden;

        border: 1px solid var(--bms-border);

        border-radius: 16px;

        background: var(--bms-white);

        transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease;
    }

    .bms-category-card.is-open {
        border-color: rgba(243, 112, 33, 0.3);

        box-shadow: var(--bms-card-shadow);
    }

    .bms-category-row {
        min-height: 66px;

        padding: 7px;

        display: grid;

        grid-template-columns:
            minmax(0, 1fr)
            auto;

        align-items: center;
    }

    .bms-category-main {
        min-width: 0;

        color: var(--bms-text);

        display: grid;

        grid-template-columns:
            49px
            minmax(0, 1fr);

        align-items: center;

        gap: 11px;

        text-decoration: none;
    }

    .bms-category-main:hover {
        color: var(--bms-orange);
        text-decoration: none;
    }

    .bms-category-image {
        width: 49px;
        height: 49px;

        overflow: hidden;

        border-radius: 12px;

        background: var(--bms-orange-soft);
        color: var(--bms-orange);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 17px;
    }

    .bms-category-image img {
        width: 100%;
        height: 100%;

        display: block;

        object-fit: cover;
    }

    .bms-category-info {
        min-width: 0;
    }

    .bms-category-info strong,
    .bms-category-info small {
        display: block;
    }

    .bms-category-info strong {
        overflow: hidden;

        font-size: 11px;
        font-weight: 800;

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bms-category-info small {
        margin-top: 4px;

        color: var(--bms-muted);

        font-size: 8px;
    }

    .bms-category-toggle {
        width: 38px;
        height: 38px;

        padding: 0;

        border: 0;
        border-radius: 12px;

        background: var(--bms-surface);
        color: var(--bms-charcoal);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 10px;

        cursor: pointer;

        transition:
            color 0.2s ease,
            background 0.2s ease,
            transform 0.25s ease;
    }

    .bms-category-card.is-open .bms-category-toggle {
        background: var(--bms-orange-soft);
        color: var(--bms-orange);

        transform: rotate(180deg);
    }

    .bms-submenu {
        max-height: 0;

        padding: 0 12px;

        overflow: hidden;

        border-top: 1px solid transparent;

        background: #fcfcfc;

        transition:
            max-height 0.35s ease,
            padding 0.3s ease,
            border-color 0.3s ease;
    }

    .bms-category-card.is-open .bms-submenu {
        max-height: 700px;

        padding-top: 7px;
        padding-bottom: 10px;

        border-top-color: var(--bms-border);
    }

    .bms-subcategory {
        border-radius: 11px;
    }

    .bms-subcategory-link {
        min-height: 39px;

        padding: 7px 8px;

        border-radius: 10px;

        color: #555555;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;

        font-size: 10px;
        font-weight: 700;

        text-decoration: none;
    }

    .bms-subcategory-link:hover {
        color: var(--bms-orange);

        background: var(--bms-orange-soft);

        text-decoration: none;
    }

    .bms-subcategory-link i {
        font-size: 8px;
    }

    .bms-child-list {
        margin: 0 8px 7px;

        padding: 3px 0 3px 12px;

        border-left: 2px solid rgba(243, 112, 33, 0.22);

        display: grid;

        gap: 2px;
    }

    .bms-child-list a {
        min-height: 29px;

        padding: 6px 8px;

        border-radius: 8px;

        color: var(--bms-muted);

        display: flex;
        align-items: center;

        font-size: 9px;
        font-weight: 600;

        text-decoration: none;
    }

    .bms-child-list a:hover {
        color: var(--bms-orange);

        background: var(--bms-orange-soft);
    }

    .bms-empty {
        padding: 26px 16px;

        border: 1px dashed var(--bms-border);

        border-radius: 15px;

        color: var(--bms-muted);

        text-align: center;

        font-size: 11px;
    }

    /* =====================================================
       SUPPORT FOOTER
    ===================================================== */

    .bms-footer {
        min-height: 76px;

        padding: 11px 18px calc(11px + env(safe-area-inset-bottom));

        border-top: 1px solid var(--bms-border);

        background: var(--bms-white);

        display: grid;

        grid-template-columns:
            40px
            minmax(0, 1fr)
            38px;

        align-items: center;

        gap: 10px;

        box-shadow: 0 -8px 24px rgba(24, 24, 24, 0.05);
    }

    .bms-support-icon {
        width: 40px;
        height: 40px;

        border-radius: 13px;

        background: var(--bms-orange-soft);
        color: var(--bms-orange);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 16px;
    }

    .bms-support-content {
        min-width: 0;
    }

    .bms-support-content small,
    .bms-support-content strong {
        display: block;
    }

    .bms-support-content small {
        margin-bottom: 3px;

        color: var(--bms-muted);

        font-size: 8px;
    }

    .bms-support-content strong {
        overflow: hidden;

        color: var(--bms-charcoal);

        font-size: 10px;
        font-weight: 800;

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bms-call-button {
        width: 38px;
        height: 38px;

        border-radius: 12px;

        background: var(--bms-orange);
        color: var(--bms-white);

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 12px;

        text-decoration: none;

        box-shadow: 0 7px 17px rgba(243, 112, 33, 0.25);
    }

    .bms-call-button:hover {
        background: var(--bms-orange-dark);
        color: var(--bms-white);

        text-decoration: none;
    }

    /* Animation */

    @keyframes bmsContentEnter {
        from {
            opacity: 0;

            transform: translateY(5px);
        }

        to {
            opacity: 1;

            transform: translateY(0);
        }
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
    :root {
        --bms-panel-width: 355px;
    }

    .bms-panel {
        width: 92vw;
    }

    .bms-header {
        min-height: 92px;

        padding-left: 16px;
    }

    .bms-brand img {
        max-width: 135px;
        max-height: 46px;
    }

    .bms-brand > span {
        font-size: 8px;
    }

    .bms-intro,
    .bms-tabs {
        margin-left: 14px;
        margin-right: 14px;
    }

    .bms-tab-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bms-quick-grid {
        gap: 5px;
    }

    .bms-quick-grid > a,
    .bms-quick-grid > button {
        min-height: 71px;
    }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    .bms-overlay,
    .bms-panel,
    .bms-close,
    .bms-tab,
    .bms-category-toggle,
    .bms-submenu {
        transition: none !important;
    }

    .bms-tab-content.is-active {
        animation: none !important;
    }
}
