.menu-header-logo > img,
.drawer-logo > img {
    display: none !important;
}

.menu-header-logo > img:first-of-type,
.drawer-logo > img:first-of-type {
    display: block !important;
}

.dark .menu-header-logo > img:first-of-type,
html.dark .menu-header-logo > img:first-of-type,
body.dark .menu-header-logo > img:first-of-type,
.dark .drawer-logo > img:first-of-type,
html.dark .drawer-logo > img:first-of-type,
body.dark .drawer-logo > img:first-of-type {
    display: none !important;
}

.dark .menu-header-logo > img:last-of-type,
html.dark .menu-header-logo > img:last-of-type,
body.dark .menu-header-logo > img:last-of-type,
.dark .drawer-logo > img:last-of-type,
html.dark .drawer-logo > img:last-of-type,
body.dark .drawer-logo > img:last-of-type {
    display: block !important;
}

.menu-header-logo > .menu-logo-light,
.drawer-logo > .menu-logo-light {
    display: block !important;
}

.menu-header-logo > .menu-logo-dark,
.drawer-logo > .menu-logo-dark {
    display: none !important;
}

.dark .menu-header-logo > .menu-logo-light,
html.dark .menu-header-logo > .menu-logo-light,
body.dark .menu-header-logo > .menu-logo-light,
.dark .drawer-logo > .menu-logo-light,
html.dark .drawer-logo > .menu-logo-light,
body.dark .drawer-logo > .menu-logo-light {
    display: none !important;
}

.dark .menu-header-logo > .menu-logo-dark,
html.dark .menu-header-logo > .menu-logo-dark,
body.dark .menu-header-logo > .menu-logo-dark,
.dark .drawer-logo > .menu-logo-dark,
html.dark .drawer-logo > .menu-logo-dark,
body.dark .drawer-logo > .menu-logo-dark {
    display: block !important;
}

.drawer-category-link,
.category-sidebar-link,
.category-slider .category-button,
.category-quick-chip {
    align-items: center !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
}

.drawer-category-image,
.category-sidebar-image,
.category-slider .category-button img,
.category-quick-chip img {
    display: block !important;
    flex: 0 0 auto !important;
    height: 38px !important;
    margin: 0 !important;
    object-fit: cover !important;
    order: 0 !important;
    width: 38px !important;
}

.drawer-category-name,
.category-sidebar-link span:not(.sr-only),
.category-slider .category-button span:not(.sr-only),
.category-quick-chip span:not(.sr-only) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    order: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
}

.category-mode-name .drawer-category-image,
.category-mode-name .category-sidebar-image,
.category-mode-name .category-slider .category-button img,
.category-mode-name .category-quick-chip img {
    display: none !important;
}

.category-mode-icon .drawer-category-name,
.category-mode-icon .category-sidebar-link span:not(.sr-only),
.category-mode-icon .category-slider .category-button span:not(.sr-only),
.category-mode-icon .category-quick-chip span:not(.sr-only),
.category-mode-icon .drawer-category-arrow {
    display: none !important;
}

.category-mode-icon .drawer-category-link,
.category-mode-icon .category-sidebar-link,
.category-mode-icon .category-slider .category-button,
.category-mode-icon .category-quick-chip {
    aspect-ratio: 1 / 1 !important;
    justify-content: center !important;
    min-height: 52px !important;
    min-width: 52px !important;
    padding: 8px !important;
    width: 52px !important;
}

@media (min-width: 1181px) {
    .menu-site-header .menu-toggle-button,
    .menu-site-header .search-button {
        display: none !important;
    }
}

@media (max-width: 1180px) {
    .menu-site-header .menu-toggle-button {
        display: inline-flex !important;
    }
}

/* Final responsive menu guardrails: keep logos single and category media predictable. */
.menu-header-logo,
.drawer-logo {
    isolation: isolate !important;
    overflow: hidden !important;
    position: relative !important;
}

.menu-header-logo > img,
.drawer-logo > img {
    display: block !important;
    height: auto !important;
    left: 50% !important;
    max-height: 88% !important;
    max-width: 88% !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
}

.menu-header-logo > img:not(:first-of-type),
.drawer-logo > img:not(:first-of-type) {
    display: none !important;
}

.dark .menu-header-logo > img:first-of-type,
html.dark .menu-header-logo > img:first-of-type,
body.dark .menu-header-logo > img:first-of-type,
.dark .drawer-logo > img:first-of-type,
html.dark .drawer-logo > img:first-of-type,
body.dark .drawer-logo > img:first-of-type {
    display: none !important;
}

.dark .menu-header-logo > img:last-of-type,
html.dark .menu-header-logo > img:last-of-type,
body.dark .menu-header-logo > img:last-of-type,
.dark .drawer-logo > img:last-of-type,
html.dark .drawer-logo > img:last-of-type,
body.dark .drawer-logo > img:last-of-type {
    display: block !important;
}

.menu-header-logo > .menu-logo-light,
.drawer-logo > .menu-logo-light {
    display: block !important;
}

.menu-header-logo > .menu-logo-dark,
.drawer-logo > .menu-logo-dark {
    display: none !important;
}

.dark .menu-header-logo > .menu-logo-light,
html.dark .menu-header-logo > .menu-logo-light,
body.dark .menu-header-logo > .menu-logo-light,
.dark .drawer-logo > .menu-logo-light,
html.dark .drawer-logo > .menu-logo-light,
body.dark .drawer-logo > .menu-logo-light {
    display: none !important;
}

.dark .menu-header-logo > .menu-logo-dark,
html.dark .menu-header-logo > .menu-logo-dark,
body.dark .menu-header-logo > .menu-logo-dark,
.dark .drawer-logo > .menu-logo-dark,
html.dark .drawer-logo > .menu-logo-dark,
body.dark .drawer-logo > .menu-logo-dark {
    display: block !important;
}

#sidebar[aria-hidden="true"] {
    pointer-events: none !important;
    visibility: hidden !important;
}

#sidebar.open,
#sidebar[aria-hidden="false"] {
    visibility: visible !important;
}

.drawer-category-link,
.category-sidebar-link,
.category-slider .category-button,
.category-quick-chip {
    align-items: center !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    position: relative !important;
}

[dir="rtl"] .drawer-category-link,
[dir="rtl"] .category-sidebar-link,
[dir="rtl"] .category-slider .category-button,
[dir="rtl"] .category-quick-chip {
    direction: rtl !important;
    text-align: right !important;
}

[dir="ltr"] .drawer-category-link,
[dir="ltr"] .category-sidebar-link,
[dir="ltr"] .category-slider .category-button,
[dir="ltr"] .category-quick-chip {
    direction: ltr !important;
    text-align: left !important;
}

.drawer-category-image,
.category-sidebar-image,
.category-slider .category-button img,
.category-quick-chip img {
    display: block !important;
    flex: 0 0 38px !important;
    float: none !important;
    height: 38px !important;
    inset: auto !important;
    margin: 0 !important;
    max-height: 38px !important;
    max-width: 38px !important;
    object-fit: cover !important;
    order: 0 !important;
    position: static !important;
    transform: none !important;
    width: 38px !important;
}

.drawer-category-name,
.category-sidebar-link span:not(.sr-only),
.category-slider .category-button span:not(.sr-only),
.category-quick-chip span:not(.sr-only) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    order: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
}

.drawer-category-arrow {
    flex: 0 0 auto !important;
    order: 2 !important;
}

.category-mode-icon .drawer-category-link,
.category-mode-icon .category-sidebar-link,
.category-mode-icon .category-slider .category-button,
.category-mode-icon .category-quick-chip {
    align-items: center !important;
    aspect-ratio: 1 / 1 !important;
    justify-content: center !important;
    min-height: 54px !important;
    min-width: 54px !important;
    padding: 8px !important;
    width: 54px !important;
}

.category-mode-icon .drawer-category-image,
.category-mode-icon .category-sidebar-image,
.category-mode-icon .category-slider .category-button img,
.category-mode-icon .category-quick-chip img {
    flex-basis: 34px !important;
    height: 34px !important;
    max-height: 34px !important;
    max-width: 34px !important;
    width: 34px !important;
}

@media (max-width: 1180px) {
    .category-slider .category-button,
    .category-quick-chip {
        max-width: 240px !important;
        min-height: 54px !important;
        min-width: 150px !important;
    }

    .category-mode-icon .category-slider .category-button,
    .category-mode-icon .category-quick-chip {
        max-width: 56px !important;
        min-width: 56px !important;
        width: 56px !important;
    }
}

/*
 * Thin top-of-viewport loading bar shown while AJAX category navigation
 * (theme2/foods.blade.php) is fetching new content, so switching categories still gives
 * visual feedback even though there's no full page reload. Lives in master.blade.php
 * (outside the region that gets replaced) so it survives every content swap.
 */
#ajax-nav-loading-bar {
    background: var(--menu-gold, #c89b2d);
    height: 3px;
    left: 0;
    opacity: 0;
    position: fixed;
    top: 0;
    transition: width 0.25s ease, opacity 0.2s ease;
    width: 0;
    z-index: 100000;
}

#ajax-nav-loading-bar.is-active {
    opacity: 1;
    width: 70%;
}

#ajax-nav-loading-bar.is-done {
    opacity: 0;
    width: 100%;
}
