.mfp-wrap.off-canvas:has(#main-menu > .sg-menu-head) {
    --sg-menu-width: min(370px, calc(100vw - 20px));
    --sg-menu-paper: #faf5ef;
    --sg-menu-ink: #2d211d;
    --sg-menu-muted: #62534b;
    --sg-menu-line: #eaded5;
    --sg-menu-red: #a4292b;
    --sg-menu-red-dark: #842022;
}

.mfp-wrap.off-canvas .mfp-content:has(#main-menu > .sg-menu-head) {
    --drawer-width: var(--sg-menu-width);
    width: var(--sg-menu-width);
    background: var(--sg-menu-paper);
}

.mfp-wrap.off-canvas:has(#main-menu > .sg-menu-head) > .mfp-close {
    top: 14px;
    right: auto;
    left: calc(var(--sg-menu-width) - 61px);
    width: 44px;
    height: 44px;
    border: 1px solid var(--sg-menu-line);
    border-radius: 8px;
    background: #fff;
    color: var(--sg-menu-ink);
    opacity: 1;
    mix-blend-mode: normal;
}

body:has(.mfp-wrap.mfp-ready #main-menu > .sg-menu-head) > .wpwidget,
body:has(.mfp-wrap.mfp-ready #shop-sidebar) > .wpwidget {
    display: none !important;
}

#main-menu:has(> .sg-menu-head) {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    background: var(--sg-menu-paper);
    color: var(--sg-menu-ink);
}

#main-menu.mfp-hide:has(> .sg-menu-head) {
    display: none;
}

.sg-menu-head {
    display: flex;
    min-height: 72px;
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) 17px 10px;
    border-bottom: 1px solid var(--sg-menu-line);
    background: #fff;
}

.sg-menu-brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding-right: 56px;
    color: var(--sg-menu-red-dark);
    font-weight: 700;
}

.sg-menu-brand img {
    display: block;
    width: 158px;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
}

.sg-menu-start {
    padding: 14px 16px 12px;
}

.sg-menu-search {
    display: flex;
    min-height: 44px;
    margin: 0;
    border: 1px solid var(--sg-menu-line);
    border-radius: 8px;
    background: #fff;
}

.sg-menu-search:focus-within {
    border-color: var(--sg-menu-red);
}

.sg-menu-search input[type='search'] {
    min-width: 0;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding-left: 11px;
    border: 0;
    border-radius: 8px 0 0 8px;
    box-shadow: none;
    font-size: 16px;
}

.sg-menu-search input::placeholder {
    color: var(--sg-menu-muted);
    font-size: 14px;
}

.sg-menu-search button {
    width: 46px;
    min-height: 44px;
    flex: 0 0 46px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 7px 7px 0;
    background: var(--sg-menu-red);
    color: #fff;
    font-size: 19px;
    line-height: 1;
}

.sg-menu-shortcuts {
    margin-top: 10px;
}

.sg-menu-shortcut-heading {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.sg-menu-shortcut-heading > a {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    color: var(--sg-menu-red-dark);
    font-size: 13px;
}

.sg-menu-shortcuts ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sg-menu-shortcuts li {
    margin: 0;
}

.sg-menu-shortcuts li a {
    display: flex;
    min-height: 44px;
    height: 100%;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid var(--sg-menu-line);
    border-radius: 7px;
    background: #fff;
    color: var(--sg-menu-ink);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.sg-menu-shortcuts li a[aria-current='page'] {
    border-color: var(--sg-menu-red);
    background: #fff0ec;
    color: var(--sg-menu-red-dark);
    font-weight: 700;
}

#main-menu:has(> .sg-menu-head) > .sidebar-menu {
    min-height: auto;
    padding: 0 16px 12px;
}

#main-menu:has(> .sg-menu-head) .nav-sidebar {
    border-top: 1px solid var(--sg-menu-line);
}

#main-menu:has(> .sg-menu-head) .nav-sidebar li {
    border-color: var(--sg-menu-line);
}

#main-menu:has(> .sg-menu-head) .nav-sidebar a {
    min-height: 44px;
    padding-block: 10px;
    padding-left: 5px;
    color: var(--sg-menu-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}

#main-menu:has(> .sg-menu-head) .nav-sidebar .toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    color: var(--sg-menu-red-dark);
    opacity: 1;
}

#main-menu:has(> .sg-menu-head) .nav-sidebar .sub-menu {
    padding: 0 0 5px 10px;
}

#main-menu:has(> .sg-menu-head) .nav-sidebar .sub-menu a {
    color: var(--sg-menu-muted);
    font-size: 13px;
}

#main-menu:has(> .sg-menu-head) .nav-sidebar a[aria-current='page'],
#main-menu:has(> .sg-menu-head) .nav-sidebar .current-menu-ancestor > a {
    color: var(--sg-menu-red-dark);
    font-weight: 700;
}

.sg-menu-contact {
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-top: auto;
    padding: 9px 13px max(9px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--sg-menu-line);
    background: #fff;
}

.sg-menu-contact a {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 6px;
    border: 1px solid var(--sg-menu-line);
    border-radius: 7px;
    background: var(--sg-menu-paper);
    color: var(--sg-menu-ink);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.sg-menu-contact a[href*='zalo.me']:not(.saigongift-quote-button) {
    border-color: #dceaff;
    background: #eef5ff;
    color: #13569e;
}

.sg-menu-contact a.saigongift-quote-button {
    flex: 1.45;
    border-color: var(--sg-menu-red);
    background: var(--sg-menu-red);
    color: #fff;
}

#main-menu:has(> .sg-menu-head) :is(a, button, input):focus-visible,
#shop-sidebar .widget_product_categories :is(a, input):focus-visible {
    outline: 2px solid #a4292b;
    outline-offset: -2px;
}

#shop-sidebar .widget_product_categories {
    padding: 14px;
    border: 1px solid #eaded5;
    border-radius: 10px;
    background: #fff;
}

#shop-sidebar .widget_product_categories .widget-title {
    color: #2d211d;
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.sg-sidebar-category-search input {
    min-height: 44px;
    margin: 7px 0 4px;
    border-color: #eaded5;
    border-radius: 7px;
    box-shadow: none;
    font-size: 16px;
}

.sg-sidebar-category-search input::placeholder {
    color: #62534b;
    font-size: 13px;
}

.sg-sidebar-category-empty {
    margin: 9px 0 4px;
    color: #62534b;
    font-size: 13px;
}

#shop-sidebar .widget_product_categories > .product-categories {
    max-height: min(52vh, 525px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d5beb4 transparent;
}

#shop-sidebar .product-categories li {
    padding-inline: 7px;
}

#shop-sidebar .product-categories li[hidden] {
    display: none !important;
}

#shop-sidebar .product-categories li > a {
    min-height: 44px;
    color: #342824;
    font-size: 14px;
    line-height: 1.35;
}

#shop-sidebar .product-categories li.current-cat {
    background: #faeee9;
}

#shop-sidebar .product-categories li.current-cat > a {
    color: #842022;
    font-weight: 700;
}

@media (max-width: 849px) {
    .mfp-wrap.off-canvas #shop-sidebar .widget_product_categories {
        border: 0;
        border-radius: 0;
    }
}
