/* Mobile sidebars — header text/icons white on green (max-width: 991.98px only) */

@media (max-width: 991.98px) {
    #navigation-mobile.panel--sidebar,
    #menu-mobile.panel--sidebar {
        width: 88% !important;
        max-width: 360px !important;
        background: #fff !important;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    }

    #navigation-mobile .panel__header,
    #menu-mobile .panel__header {
        display: grid !important;
        grid-template-columns: 44px 1fr 44px;
        align-items: center !important;
        justify-content: unset !important;
        padding: 14px 12px !important;
        min-height: 52px;
        background: #367c2b !important;
        border-bottom: none !important;
        text-align: center;
        color: #fff !important;
    }

    #navigation-mobile .panel__header .close-toggle--sidebar,
    #menu-mobile .panel__header .close-toggle--sidebar,
    #navigation-mobile .panel__header .svg-icon,
    #menu-mobile .panel__header .svg-icon {
        grid-column: 1;
        justify-self: start;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        margin: 0 !important;
        color: #fff !important;
        cursor: pointer;
    }

    #navigation-mobile .panel__header .close-toggle--sidebar svg,
    #menu-mobile .panel__header .close-toggle--sidebar svg,
    #navigation-mobile .panel__header .svg-icon svg,
    #menu-mobile .panel__header .svg-icon svg {
        width: 22px;
        height: 22px;
        display: block;
        color: #fff !important;
        fill: none !important;
        stroke: currentColor !important;
        overflow: visible !important;
    }

    #search-mobile .panel__header .close-search-panel svg,
    #search-mobile .panel__header .close-toggle--sidebar svg,
    #search-mobile .panel__header .svg-icon svg {
        width: 22px;
        height: 22px;
        color: #fff !important;
        fill: none !important;
        stroke: currentColor !important;
        overflow: visible !important;
    }

    #navigation-mobile .panel__header h3,
    #menu-mobile .panel__header h3,
    #navigation-mobile .panel__header .panel__header-title,
    #menu-mobile .panel__header .panel__header-title {
        grid-column: 2;
        margin: 0 !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.3;
        color: #fff !important;
        text-align: center;
    }

    #search-mobile .panel__header {
        background: #367c2b !important;
        color: #fff !important;
    }

    #search-mobile .panel__header .close-search-panel,
    #search-mobile .panel__header .close-toggle--sidebar,
    #search-mobile .panel__header .svg-icon {
        color: #fff !important;
    }

    #navigation-mobile .panel__content {
        padding: 0 0 80px !important;
        background: #fff;
    }

    #menu-mobile .panel__content {
        padding-top: 10px;
        padding-bottom: 80px !important;
        background: #fff;
    }

    /* Categories list */
    #navigation-mobile .vitsa-mobile-categories {
        margin: 0;
        padding: 0;
    }

    #navigation-mobile .vitsa-mobile-categories__group {
        border-bottom: 1px solid #e8e8e8;
    }

    #navigation-mobile .vitsa-mobile-categories__group:last-child {
        border-bottom: none;
    }

    #navigation-mobile .vitsa-mobile-categories__heading {
        margin: 0;
        padding: 14px 18px 8px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
    }

    #navigation-mobile .vitsa-mobile-categories__heading a {
        color: #1a1a1a;
        text-decoration: none;
    }

    #navigation-mobile .vitsa-mobile-categories__heading a:active {
        color: #367c2b;
    }

    #navigation-mobile .vitsa-mobile-categories__list {
        list-style: none;
        margin: 0;
        padding: 0 18px 12px;
    }

    #navigation-mobile .vitsa-mobile-categories__item {
        margin: 0;
        padding: 0;
        border: none !important;
    }

    #navigation-mobile .vitsa-mobile-categories__item a {
        display: block;
        padding: 9px 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.4;
        color: #333;
        text-decoration: none;
    }

    #navigation-mobile .vitsa-mobile-categories__item a:active {
        color: #367c2b;
    }

    /* Inline mobile header search — disable legacy slide panel */
    #search-mobile,
    #search-mobile.active {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .header--vitsa .vitsa-header-mobile__search input[type="search"],
    .header--vitsa .vitsa-header-mobile__search .vitsa-search-input,
    .header--vitsa .vitsa-header-mobile__search input.form-control,
    .header--vitsa .header-mobile .vitsa-header-mobile__search.form--quick-search-vitsa .vitsa-search-row input[type="search"].form-control {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }

    .header--vitsa .header-mobile .vitsa-header-mobile__search .bb-quick-search-results,
    .header--vitsa .header-mobile .vitsa-header-mobile__search .bb-quick-search-results.show {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        overscroll-behavior: contain;
    }

    .header--vitsa .header-mobile .vitsa-header-mobile__search .bb-quick-search-results:not(.show) {
        display: none !important;
    }

    .header--vitsa .header-mobile .vitsa-header-mobile__search .bb-quick-search-results .bb-quick-search-content {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        max-height: none !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .header--vitsa .header-mobile .vitsa-header-mobile__search .bb-quick-search-results .bb-quick-search-view-all {
        flex: 0 0 auto !important;
        display: block !important;
        background: #fff !important;
        border-top: 1px solid hsl(150, 12%, 90%) !important;
        padding: 0.75rem 1rem !important;
        text-align: center;
    }

    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* VITSA mobile hamburger menu — curated links, tighter spacing */
#menu-mobile .vitsa-mobile-menu {
    padding: 0.35rem 0 1rem;
}

#menu-mobile .vitsa-mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#menu-mobile .vitsa-mobile-menu__list > li > a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    color: #14201a;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    border: none;
    border-bottom: none;
}

#menu-mobile .vitsa-mobile-menu__list--compact > li > a {
    min-height: 2.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

#menu-mobile .vitsa-mobile-menu__list > li > a.is-active,
#menu-mobile .vitsa-mobile-menu__list > li > a:active {
    color: #367c2b;
}

#menu-mobile .vitsa-mobile-menu__section {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(20, 32, 26, 0.12);
}

#menu-mobile .vitsa-mobile-menu__section + .vitsa-mobile-menu__section {
    border-top: 1px solid rgba(20, 32, 26, 0.12);
}

#menu-mobile .vitsa-mobile-menu__section-title {
    margin: 0;
    padding: 0.55rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5f6f67;
}

#menu-mobile .vitsa-mobile-menu__all-categories {
    color: #367c2b !important;
    font-weight: 700 !important;
}

#menu-mobile .vitsa-mobile-menu__logout {
    color: #5f6f67 !important;
}

/* Hide leftover Farmart demo menus if any theme partial injects them */
#menu-mobile .menu--mobile {
    display: none !important;
}
