/* Only the existing header menu and a validated product-archive sidebar. */
.emsa-category-menu.emsa-panel-ready[open] { z-index: 99990; }
.emsa-category-menu.emsa-panel-ready[open] > .emsa-category-backdrop { position: fixed; inset: 0; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: rgb(22 35 28 / 45%); cursor: default; }
.emsa-category-menu.emsa-panel-ready[open] > .emsa-category-dialog { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; box-sizing: border-box; width: min(271px, calc(100vw - 24px)); height: 100vh; height: 100dvh; background: #fff; color: #333; border-right: 1px solid #ececec; box-shadow: 10px 0 40px #26372e22; overflow: hidden; font: 14px/1.4 Arial, Helvetica,sans-serif; }
/* Keep the logged-in menu controls below the WordPress admin toolbar. */
body.admin-bar .emsa-category-menu.emsa-panel-ready[open] > .emsa-category-dialog {
    top: 32px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}
@media screen and (max-width: 782px) {
    body.admin-bar .emsa-category-menu.emsa-panel-ready[open] > .emsa-category-dialog {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}
.emsa-category-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: env(safe-area-inset-top) 8px 0 20px; }
.emsa-category-heading strong { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.emsa-category-heading strong::before { content: ''; width: 16px; height: 12px; box-sizing: border-box; border-block: 1.5px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat; }
.emsa-panel-close { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; font-size: 23px; line-height: 1; color: #333; background: transparent; }
.emsa-category-menu.emsa-panel-ready .emsa-category-dialog > nav { position: static; inset: auto; flex: 1; width: auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; padding: 0 0 max(16px, env(safe-area-inset-bottom)); border: 0; box-shadow: none; }
.emsa-category-dialog nav > ul > li { margin: 0; padding: 0; border: 0; }
.emsa-category-row { position: relative; display: flex; align-items: stretch; box-sizing: border-box; min-height: 44.5px; color: #333; }
.emsa-category-row::before { content: ''; position: absolute; inset: 1px 7px; border-radius: 6px; pointer-events: none; }
.emsa-category-menu .emsa-category-row > a { position: relative; z-index: 1; display: flex; flex: 1; align-items: center; box-sizing: border-box; min-width: 0; min-height: 44.5px; padding: 10px 20px; color: inherit; background: transparent; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.emsa-category-menu .emsa-category-row:has(> .emsa-category-toggle) > a { padding-right: 0; }
.emsa-category-menu .emsa-category-dialog .sub-menu { margin: 0; padding-left: 12px; border: 0; }
.emsa-category-menu .emsa-category-dialog .sub-menu[hidden] { display: none !important; }
.emsa-category-menu .sub-menu .emsa-category-row > a { font-weight: 400; }
.emsa-category-menu .emsa-category-toggle { position: relative; z-index: 1; flex: 0 0 44px; display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #a3aaa1; box-shadow: none; cursor: pointer; }
.emsa-category-toggle::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.emsa-category-toggle[aria-expanded='true']::after { transform: rotate(45deg); }
.emsa-category-row:hover, .emsa-category-row:focus-within, .current-menu-item > .emsa-category-row { color: #fff; }
.emsa-category-row:hover::before, .emsa-category-row:focus-within::before, .current-menu-item > .emsa-category-row::before { background: #465239; }
.emsa-category-menu .emsa-category-row:hover > .emsa-category-toggle, .emsa-category-menu .emsa-category-row:focus-within > .emsa-category-toggle, .emsa-category-menu .current-menu-item > .emsa-category-row > .emsa-category-toggle { color: #fff; }
.emsa-category-row > a:focus-visible, .emsa-category-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
.emsa-panel-close:focus-visible { outline: 3px solid #7d956a; outline-offset: -3px; }

/* Desktop fine-pointer branches fly right; touch/narrow layouts keep tap disclosures. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .emsa-category-menu.emsa-panel-ready.emsa-category-flyouts[open] > .emsa-category-dialog { overflow: visible; }
    .emsa-category-menu.emsa-category-flyouts .emsa-category-dialog .sub-menu {
        position: fixed;
        inset: auto;
        left: var(--emsa-flyout-left, 270px);
        top: var(--emsa-flyout-top, 8px);
        z-index: 2;
        box-sizing: border-box;
        width: 271px;
        max-width: calc(100vw - 16px);
        max-height: var(--emsa-flyout-height, calc(100vh - 16px));
        margin: 0;
        padding: 4px 0;
        overflow: auto;
        overscroll-behavior: contain;
        border: 1px solid #ececec;
        border-radius: 6px;
        background: #fff;
        color: #333;
        box-shadow: 8px 8px 24px #26372e22;
    }
    .emsa-category-flyouts .emsa-submenu-open > .emsa-category-row { color: #fff; }
    .emsa-category-flyouts .emsa-submenu-open > .emsa-category-row::before { background: #465239; }
    .emsa-category-menu.emsa-category-flyouts .emsa-submenu-open > .emsa-category-row > .emsa-category-toggle { color: #fff; }
    .emsa-category-flyouts .emsa-category-toggle[aria-expanded='true']::after { transform: rotate(-45deg); }
}

/* Shared local icons; override the old mobile rule that hides top-line nav links. */
.emsa-site-header .emsa-topline .emsa-wide { flex-wrap: wrap; gap: 4px 18px; }
.emsa-site-header .emsa-topline .emsa-header-socials { display: flex; flex: 0 0 auto; align-items: center; gap: 0; margin: 0; }
.emsa-site-header .emsa-topline .emsa-header-socials a { position: relative; display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; color: #465239; }
.emsa-header-socials a::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #f0f2ed; }
.emsa-social-icon { position: relative; display: block; flex: 0 0 18px; width: 18px; height: 18px; fill: currentColor; }
.emsa-header-socials a:hover::before { background: #e3e8dc; }
.emsa-header-socials a:focus-visible { outline: 2px solid #465239; outline-offset: -2px; border-radius: 6px; }
.emsa-footer .emsa-footer-socials > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.emsa-footer-socials .emsa-social-icon { flex-basis: 16px; width: 16px; height: 16px; }
@media (max-width: 690px) {
    .emsa-site-header .emsa-topline .emsa-wide { justify-content: center; gap: 4px 12px; padding-block: 5px; }
    .emsa-site-header .emsa-topline nav:not(.emsa-header-socials) { flex: 1 0 100%; justify-content: center; margin: 0; }
    .emsa-site-header .emsa-topline .emsa-header-socials { flex-basis: 100%; order: 3; justify-content: center; }
}

body.emsa-archive-panels #sidebar { display: block !important; min-width: 0; }
body.emsa-archive-panels #sidebar .ct-sidebar { position: static; }
.emsa-filter-disclosure { padding: 18px; background: #f7f9f4; border: 1px solid #e2e7df; border-radius: 8px; }
.emsa-filter-disclosure > summary { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; cursor: pointer; list-style: none; }
.emsa-filter-disclosure > summary::-webkit-details-marker { display: none; }
.emsa-filter-disclosure > summary::after { content: '+'; margin-left: auto; font-size: 23px; }
.emsa-filter-disclosure[open] > summary::after { content: '−'; }
.emsa-filter-count { min-width: 25px; padding: 2px 6px; border-radius: 20px; font-size: 13px; background: #e1ead8; text-align: center; }
.emsa-filter-content { padding-top: 12px; }
.emsa-filter-reset { display: block; padding: 10px 0; margin-bottom: 10px; font-size: 14px; text-decoration: underline; }
.emsa-extra-filters { margin: 0 0 24px; padding-bottom: 24px; border-bottom: 1px solid #dde5d6; }
.emsa-extra-filters fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.emsa-extra-filters legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 16px; }
.emsa-extra-filters input[type=search] { width: 100%; min-height: 44px; background: white; margin-block: 4px 10px; }
.emsa-brand-options { max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.emsa-extra-filters .emsa-brand-options > label, .emsa-availability-filters > label { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 6px 2px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.emsa-extra-filters .emsa-brand-options > label[hidden], .emsa-brand-empty[hidden] { display: none; }
.emsa-extra-filters input[type=checkbox] { flex-shrink: 0; width: 18px; height: 18px; margin: 0; }
.emsa-extra-filters button { width: 100%; min-height: 44px; }
body.emsa-archive-panels #sidebar .ct-widget { margin-bottom: 24px; }
body.emsa-archive-panels #sidebar .widget-title { font-size: 16px; }
body.emsa-archive-panels #sidebar .woocommerce-widget-layered-nav-list a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; line-height: 1.4; }
body.emsa-archive-panels #sidebar .price_slider_amount { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; text-align: left; line-height: 1.5; }
body.emsa-archive-panels #sidebar .price_slider_amount input { display: block !important; width: 100%; min-width: 0; min-height: 44px; padding-inline: 8px; background: #fff; }
body.emsa-archive-panels #sidebar .price_slider_amount > label { position: static; width: auto; height: auto; clip: auto; clip-path: none; white-space: normal; }
.emsa-price-field { min-width: 0; }
.emsa-price-field label { display: block; font-size: 12px; margin-bottom: 5px; }
body.emsa-archive-panels #sidebar .price_slider_amount > button,
body.emsa-archive-panels #sidebar .price_slider_amount > .price_label { grid-column: 1/-1; width: 100%; }
body.emsa-archive-panels #sidebar .price_slider_amount > .clear { display: none; }
body.emsa-archive-panels #sidebar :is(a,button,input,summary):focus-visible { outline: 3px solid #7d956a; outline-offset: 3px; }
@media(max-width:999.98px) {
 body.emsa-archive-panels #main > .ct-container[data-sidebar] { display: flex; flex-direction: column; gap: 20px; }
 body.emsa-archive-panels #main > .ct-container[data-sidebar] > #sidebar { order: 0; width: 100%; }
 body.emsa-archive-panels #main > .ct-container[data-sidebar] > section { order: 1; width: 100%; min-width: 0; }
 .emsa-filter-disclosure { padding: 12px 16px; }
 .emsa-filter-disclosure > summary { font-size: 17px; }
}

/* Native widgets stay in the sidebar; only the mobile presentation becomes modal. */
.emsa-filter-dialog { display: contents; }
.emsa-filter-heading, .emsa-filter-backdrop { display: none; }
@media (max-width: 999.98px) {
 body.emsa-archive-panels #sidebar .emsa-filter-disclosure.emsa-filter-ready[open] { position: relative; z-index: 99980; }
 .emsa-filter-disclosure.emsa-filter-ready[open] > .emsa-filter-backdrop { position: fixed; inset: 0; z-index: 0; display: block; box-sizing: border-box; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: rgb(22 35 28 / 45%); cursor: default; }
 .emsa-filter-disclosure.emsa-filter-ready[open] > .emsa-filter-dialog { position: fixed; inset: var(--emsa-filter-top, 0px) auto 0 0; z-index: 1; display: flex; flex-direction: column; box-sizing: border-box; width: min(380px, calc(100vw - 24px)); height: calc(100vh - var(--emsa-filter-top, 0px)); height: calc(100dvh - var(--emsa-filter-top, 0px)); overflow: hidden; background: #fff; color: #26372e; border-right: 1px solid #e2e7df; box-shadow: 10px 0 40px #26372e22; }
 .emsa-filter-dialog > .emsa-filter-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: env(safe-area-inset-top) 10px 0 18px; border-bottom: 1px solid #e2e7df; }
 .emsa-filter-heading strong { font-size: 19px; line-height: 1.4; }
 .emsa-filter-heading .emsa-filter-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #26372e; box-shadow: none; font-size: 26px; line-height: 1; cursor: pointer; }
 .emsa-filter-heading .emsa-filter-close:hover { background: #f0f4eb; }
 .emsa-filter-dialog > .emsa-filter-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); }
}

/* Compact staged filters: one scroll region, short lists and a persistent action footer. */
.emsa-compact-filters .emsa-filter-disclosure { padding: 10px 12px 0; background: #fff; }
.emsa-filter-enhanced > .emsa-filter-dialog { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
.emsa-filter-enhanced:not([open]) > .emsa-filter-dialog { display: none; }
.emsa-filter-enhanced .emsa-filter-content { flex: 1 1 auto; min-height: 0; padding: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.emsa-compact-filters [hidden] { display: none !important; }
.emsa-compact-filters .emsa-filter-reset,
.emsa-compact-filters .emsa-extra-filters > button[type='submit'],
.emsa-compact-filters .price_slider_amount > button[type='submit'] { display: none; }
.emsa-compact-filters .emsa-extra-filters { margin: 0; padding: 0; border: 0; }
body.emsa-archive-panels #sidebar.emsa-compact-filters .emsa-filter-group { margin: 0 !important; padding: 0; min-width: 0; border: 0; border-bottom: 1px solid #e7ebe3; }
.emsa-filter-group > legend,
body.emsa-archive-panels #sidebar .emsa-filter-group > .widget-title { display: block; width: 100%; margin: 0; padding: 0; line-height: 1.3; }
.emsa-compact-filters button.emsa-filter-group-toggle { display: grid; grid-template-columns: minmax(0,1fr) auto 14px; align-items: center; column-gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 10px 7px; border: 0; border-radius: 0; box-shadow: none; text-align: left; background: #fff; color: #26372e; cursor: pointer; font: 600 14px/1.4 Arial,sans-serif; }
.emsa-filter-group-toggle:hover,
.emsa-compact-filters button.emsa-filter-group-toggle[aria-expanded='true'] { background: #f5f7f1; }
.emsa-filter-group-name { grid-column: 1; grid-row: 1; min-width: 0; }
.emsa-filter-group-value { grid-column: 1; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #627251; font-size: 12px; font-weight: 400; }
.emsa-filter-group-value:empty { display: none; }
.emsa-filter-group-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 22px; padding: 2px 5px; border-radius: 20px; background: #e9eedf; text-align: center; color: #465239; font-size: 12px; }
.emsa-filter-group-arrow { grid-column: 3; grid-row: 1 / span 2; justify-self: center; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.emsa-filter-group-toggle[aria-expanded='true'] .emsa-filter-group-arrow { transform: rotate(225deg); }
.emsa-filter-group-body { padding: 6px 7px 10px; }
.emsa-compact-filters .emsa-brand-options,
.emsa-compact-filters .emsa-filter-options { max-height: none; overflow: visible; }
.emsa-compact-filters .emsa-brand-filters label[for='emsa-brand-search'] { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.emsa-compact-filters input[type='search'] { display: block; box-sizing: border-box; width: 100%; min-height: 44px; margin: 3px 0 6px; padding: 9px 10px; border: 1px solid #dce3d5; border-radius: 6px; background: #fff; font-size: 14px; }
.emsa-compact-filters .emsa-filter-option,
.emsa-compact-filters .emsa-brand-options > label,
.emsa-compact-filters .emsa-availability-filters .emsa-filter-group-body > label { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 2px; margin: 0; font-size: 14px; line-height: 1.4; cursor: pointer; }
.emsa-compact-filters .emsa-filter-option input[type='checkbox'],
.emsa-compact-filters .emsa-extra-filters input[type='checkbox'] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: #465239; }
.emsa-filter-option-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.emsa-filter-option-count { margin-left: auto; padding-left: 5px; color: #6f7968; font-size: 12px; }
.emsa-compact-filters button.emsa-filter-options-more,
.emsa-compact-filters button.emsa-filter-group-clear { width: auto; min-height: 44px; padding: 7px 2px; border: 0; border-radius: 0; background: transparent; color: #465239; font-size: 12px; font-weight: 600; text-align: left; text-decoration: underline; box-shadow: none; }
.emsa-compact-filters button.emsa-filter-group-clear { display: block; margin: 4px 0 0; color: #6d7566; font-weight: 400; }
.emsa-filter-options-empty { margin: 8px 0; font-size: 13px; color: #6d7566; }
.emsa-filter-actions { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 10px; padding: 10px 4px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid #dce3d5; background: #fff; }
.emsa-filter-status { grid-column: 1 / -1; margin: 0; color: #68735f; font: 12px/1.4 Arial,sans-serif; }
.emsa-filter-pending .emsa-filter-status { color: #465239; font-weight: 600; }
.emsa-filter-actions .emsa-filter-apply { min-height: 44px; padding: 10px 12px; border: 1px solid #465239; border-radius: 6px; background: #465239; color: #fff; font-size: 14px; font-weight: 600; box-shadow: none; }
.emsa-filter-actions .emsa-filter-clear { min-height: 44px; padding: 9px 5px; border: 0; background: transparent; color: #465239; font-size: 13px; text-decoration: underline; box-shadow: none; }
.emsa-applied-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; padding: 12px; border: 1px solid #e2e7df; border-radius: 8px; background: #f7f9f4; font-size: 13px; }
.emsa-applied-filters > strong { width: 100%; color: #34452d; }
.emsa-applied-filters .emsa-filter-chip { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 6px 10px; border: 1px solid #d4ddcb; border-radius: 20px; background: #fff; color: #35482d; text-decoration: none; overflow-wrap: anywhere; }
.emsa-applied-clear { padding: 7px 3px; color: #465239; text-decoration: underline; }
.emsa-applied-filters a:focus-visible { outline: 3px solid #7d956a; outline-offset: 3px; }
@media(max-width:999.98px) {
 .emsa-compact-filters .emsa-filter-disclosure { padding: 10px 14px; }
 .emsa-filter-enhanced > .emsa-filter-dialog { max-height: none; }
 .emsa-filter-enhanced .emsa-filter-dialog > .emsa-filter-content { padding: 0 12px; }
 .emsa-filter-enhanced .emsa-filter-actions { padding: 10px 18px max(14px,env(safe-area-inset-bottom)); }
 .emsa-compact-filters .emsa-filter-option,
 .emsa-compact-filters .emsa-brand-options > label,
 .emsa-compact-filters .emsa-availability-filters .emsa-filter-group-body > label { min-height: 44px; }
}

@media(max-width:999.98px) {
 .emsa-applied-filters { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; max-width: 100%; scrollbar-width: thin; padding: 10px 12px; }
 .emsa-applied-filters > strong { flex: 0 0 auto; width: auto; white-space: nowrap; }
 .emsa-applied-filters .emsa-filter-chip { display: inline-flex; flex: 0 0 auto; max-width: none; white-space: nowrap; overflow-wrap: normal; }
 .emsa-applied-clear { flex: 0 0 auto; white-space: nowrap; }
}
