/* ==========================================================================
   EVO TRADE DIRECT — Shop Filters (desktop styling)
   Loaded only where the filters render (see inc/shop-filters.php).

   Scope: every selector starts from an .evo-shop-* component class. Product
   cards, Add to Cart, the wishlist button, the header, navigation, homepage
   and footer are never targeted. The theme's product-grid columns and
   breakpoints (4 / 3 at 1100px / 2 at 820px) are not changed.

   Contents
   1. Tokens and page layout
   2. Toolbar (price, availability, deals)
   3. Sidebar and collapsible groups
   4. Active filter chips (markup arrives with the chips/URL-state task)
   5. Results header, grid spacing and pagination
   6. Loading, empty and error states
   7. Responsive behaviour
   8. Reduced motion
   ========================================================================== */


/* 1. TOKENS AND PAGE LAYOUT
   ========================================================================== */

.evo-shop-layout {
    --evo-f-green: var(--brand-green, #176B45);
    --evo-f-green-dark: var(--brand-green-dark, #0F2A1C);
    --evo-f-tint: #EDF5F0;
    --evo-f-tint-line: #D3E6DA;
    --evo-f-surface: var(--white, #FFFFFF);
    --evo-f-ink: var(--ink, #1A1A1A);
    --evo-f-body: var(--body-text, #4A4A4A);
    --evo-f-muted: var(--muted-text, #767676);
    --evo-f-line: var(--border, #E6E4DD);
    --evo-f-line-strong: #D5DCD7;
    --evo-f-gold: var(--star-gold, #F5A623);
    --evo-f-shadow: 0 1px 2px rgba(15, 42, 28, 0.04), 0 8px 24px rgba(15, 42, 28, 0.05);
    --evo-f-sidebar: 260px;

    display: grid;
    grid-template-columns: var(--evo-f-sidebar) minmax(0, 1fr);
    grid-template-areas:
        "toolbar toolbar"
        "chips   chips"
        "sidebar results";
    column-gap: 32px;
    align-items: start;
    margin: 0 0 24px;
}

.evo-shop-layout--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "toolbar"
        "chips"
        "results";
}

.evo-shop-layout .evo-shop-toolbar { grid-area: toolbar; }
.evo-shop-layout > .evo-shop-chips   { grid-area: chips; }
.evo-shop-layout .evo-shop-sidebar { grid-area: sidebar; }
.evo-shop-layout > .evo-shop-results { grid-area: results; }

/* Shared keyboard focus ring (WCAG 2.1 AA). */
.evo-shop-toolbar a:focus-visible,
.evo-shop-toolbar button:focus-visible,
.evo-shop-toolbar input:focus-visible,
.evo-shop-sidebar input:focus-visible,
.evo-shop-filters__summary:focus-visible,
.evo-shop-chips a:focus-visible,
.evo-shop-chips button:focus-visible,
.evo-shop-results .woocommerce-ordering select:focus-visible,
.evo-shop-results .woocommerce-pagination a:focus-visible,
.evo-shop-results__error a:focus-visible,
.evo-shop-results__retry:focus-visible,
.evo-shop-results__empty-actions a:focus-visible {
    outline: 2px solid var(--evo-f-green);
    outline-offset: 2px;
}


/* 2. TOOLBAR — compact horizontal bar
   ========================================================================== */

.evo-shop-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin: 0 0 20px;
    padding: 12px 18px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line);
    border-radius: 12px;
    box-shadow: var(--evo-f-shadow);
}

.evo-shop-filters__fields {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    min-width: 0;
}

.evo-shop-filters__field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.evo-shop-filters__label {
    color: var(--evo-f-ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* Number inputs: toolbar price fields and sidebar dimension fields. */
.evo-shop-filters__field input[type="number"],
.evo-shop-filters__range input[type="number"] {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line-strong);
    border-radius: 8px;
    color: var(--evo-f-ink);
    font: inherit;
    font-size: 14px;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border-color 0.15s ease;
}

.evo-shop-filters__field input[type="number"]::-webkit-inner-spin-button,
.evo-shop-filters__field input[type="number"]::-webkit-outer-spin-button,
.evo-shop-filters__range input[type="number"]::-webkit-inner-spin-button,
.evo-shop-filters__range input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.evo-shop-filters__field input[type="number"]:hover,
.evo-shop-filters__range input[type="number"]:hover,
.evo-shop-filters__field input[type="number"]:focus,
.evo-shop-filters__range input[type="number"]:focus {
    border-color: var(--evo-f-green);
}

.evo-shop-filters__field input[type="number"] {
    width: 96px;
}

/* Availability and deals: pill toggles. */
.evo-shop-filters__field--toggle {
    flex: 0 0 auto;
}

.evo-shop-filters__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px 0 12px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line-strong);
    border-radius: 999px;
    color: var(--evo-f-ink);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.evo-shop-filters__check:hover {
    border-color: var(--evo-f-green);
}

.evo-shop-filters__check:has(input:checked) {
    background: var(--evo-f-tint);
    border-color: var(--evo-f-green);
    color: var(--evo-f-green-dark);
}

/* Custom checkbox / radio (toolbar toggles and sidebar option lists). */
.evo-shop-filters__check input,
.evo-shop-filters__options:not(.evo-shop-filters__options--buttons) .evo-shop-filters__option input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    background: var(--evo-f-surface);
    border: 1.5px solid #B9C5BD;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.evo-shop-filters__check input[type="checkbox"],
.evo-shop-filters__option input[type="checkbox"] {
    border-radius: 5px;
}

.evo-shop-filters__option input[type="radio"] {
    border-radius: 50%;
}

.evo-shop-filters__check input:hover,
.evo-shop-filters__option input:hover {
    border-color: var(--evo-f-green);
}

.evo-shop-filters__check input[type="checkbox"]:checked,
.evo-shop-filters__option input[type="checkbox"]:checked {
    background: var(--evo-f-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat;
    border-color: var(--evo-f-green);
}

.evo-shop-filters__option input[type="radio"]:checked {
    background: radial-gradient(circle, var(--evo-f-green) 0 4px, var(--evo-f-surface) 5px);
    border-color: var(--evo-f-green);
}

/* Actions: Apply stays for no-JS use and the Enter key; Reset is a text link. */
.evo-shop-filters__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.evo-shop-filters__submit {
    min-height: 40px;
    padding: 0 20px;
    background: var(--evo-f-green);
    border: 1px solid var(--evo-f-green);
    border-radius: 8px;
    color: #FFFFFF;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.evo-shop-filters__submit:hover {
    background: var(--evo-f-green-dark);
    border-color: var(--evo-f-green-dark);
}

.evo-shop-toolbar.is-loading .evo-shop-filters__submit {
    opacity: 0.7;
    cursor: progress;
}

.evo-shop-filters__reset {
    color: var(--evo-f-green);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.evo-shop-filters__reset:hover {
    color: var(--evo-f-green-dark);
}

.evo-shop-filters__reset[hidden] {
    display: none;
}


/* 3. SIDEBAR AND COLLAPSIBLE GROUPS
   ========================================================================== */

.evo-shop-sidebar {
    position: sticky;
    top: 96px; /* Clears the sticky site header. */
    max-height: calc(100vh - 120px);
    padding: 0 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line);
    border-radius: 12px;
    box-shadow: var(--evo-f-shadow);
}

.evo-shop-filters__group {
    border-bottom: 1px solid var(--evo-f-line);
}

.evo-shop-filters__group:last-child {
    border-bottom: 0;
}

/* Title + selection badge + chevron on one grid row. */
.evo-shop-filters__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 14px;
    align-items: center;
    column-gap: 8px;
    padding: 15px 0;
    color: var(--evo-f-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.evo-shop-filters__summary::-webkit-details-marker {
    display: none;
}

.evo-shop-filters__summary:hover {
    color: var(--evo-f-green);
}

.evo-shop-filters__summary::after {
    content: "";
    grid-column: 3;
    justify-self: center;
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 1.75px solid currentColor;
    border-bottom: 1.75px solid currentColor;
    color: var(--evo-f-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin-top 0.2s ease;
}

.evo-shop-filters__group[open] > .evo-shop-filters__summary::after {
    margin-top: 3px;
    transform: rotate(225deg);
}

.evo-shop-filters__badge {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--evo-f-green);
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

/* Option lists. Side padding leaves room for the focus ring inside the scroll box. */
.evo-shop-filters__options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 264px;
    margin: 0 -4px;
    padding: 4px 4px 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    list-style: none;
}

.evo-shop-filters__option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    color: var(--evo-f-ink);
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    transition: color 0.15s ease;
}

.evo-shop-filters__option:hover {
    color: var(--evo-f-green);
}

.evo-shop-filters__option:has(input:checked) {
    color: var(--evo-f-green-dark);
    font-weight: 600;
}

/* Subcategory indent. */
.evo-shop-filters__option--depth-1 { padding-left: 14px; }
.evo-shop-filters__option--depth-2 { padding-left: 28px; }
.evo-shop-filters__option--depth-3 { padding-left: 42px; }

/* Customer rating: stars come from CSS, so the markup stays plain text. */
.evo-shop-filters__option[for^="evo-filter-rating-"] span::before {
    margin-right: 6px;
    color: var(--evo-f-gold);
    letter-spacing: 1px;
}

.evo-shop-filters__option[for="evo-filter-rating-4"] span::before { content: "\2605\2605\2605\2605\2606"; }
.evo-shop-filters__option[for="evo-filter-rating-3"] span::before { content: "\2605\2605\2605\2606\2606"; }
.evo-shop-filters__option[for="evo-filter-rating-2"] span::before { content: "\2605\2605\2606\2606\2606"; }
.evo-shop-filters__option[for="evo-filter-rating-1"] span::before { content: "\2605\2606\2606\2606\2606"; }

/* Size and Pack Size: compact button grid. */
.evo-shop-filters__options--buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    max-height: none;
}

.evo-shop-filters__options--buttons .evo-shop-filters__option {
    position: relative;
    min-height: 0;
}

.evo-shop-filters__options--buttons .evo-shop-filters__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.evo-shop-filters__options--buttons .evo-shop-filters__option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding: 0 12px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line-strong);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.evo-shop-filters__options--buttons .evo-shop-filters__option:hover span {
    border-color: var(--evo-f-green);
}

.evo-shop-filters__options--buttons .evo-shop-filters__option input:checked + span {
    background: var(--evo-f-green);
    border-color: var(--evo-f-green);
    color: #FFFFFF;
}

.evo-shop-filters__options--buttons .evo-shop-filters__option input:focus-visible + span {
    outline: 2px solid var(--evo-f-green);
    outline-offset: 2px;
}

/* Dimensions: min / max per row. */
.evo-shop-filters__ranges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 16px;
}

.evo-shop-filters__range {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.evo-shop-filters__range-label {
    color: var(--evo-f-body);
    font-size: 13px;
}


/* 4. ACTIVE FILTER CHIPS
   Expected markup (added by the chips/URL-state task):
   <div class="evo-shop-chips" aria-label="Active filters">
     <span class="evo-shop-chip">Brand: Acme
       <button type="button" class="evo-shop-chip__remove" aria-label="Remove Brand: Acme">×</button>
     </span>
     <a class="evo-shop-chips__clear" href="…">Clear All</a>
   </div>
   ========================================================================== */

.evo-shop-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 20px;
}

.evo-shop-chips[hidden] {
    display: none;
}

.evo-shop-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 6px 0 12px;
    background: var(--evo-f-tint);
    border: 1px solid var(--evo-f-tint-line);
    border-radius: 999px;
    color: var(--evo-f-green-dark);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}

.evo-shop-chip__remove {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--evo-f-green);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.evo-shop-chip__remove:hover {
    background: var(--evo-f-green);
    color: #FFFFFF;
}

.evo-shop-chips__clear {
    padding: 0 4px;
    color: var(--evo-f-green);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.evo-shop-chips__clear:hover {
    color: var(--evo-f-green-dark);
}


/* 5. RESULTS HEADER, GRID SPACING AND PAGINATION
   The count and sort form are WooCommerce output with no theme styling, so
   they are laid out here, inside the results wrapper only.
   ========================================================================== */

.evo-shop-results {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
    min-height: 80px;
    scroll-margin-top: 96px;
}

.evo-shop-results > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.evo-shop-results > .woocommerce-result-count {
    grid-column: 1;
    margin: 0;
    color: var(--evo-f-body);
    font-size: 14px;
}

.evo-shop-results > .woocommerce-ordering {
    grid-column: 2;
    margin: 0;
}

.evo-shop-results .woocommerce-ordering select.orderby {
    min-width: 210px;
    height: 40px;
    padding: 0 38px 0 14px;
    background: var(--evo-f-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%230F2A1C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E") right 14px center / 12px no-repeat;
    border: 1px solid var(--evo-f-line-strong);
    border-radius: 8px;
    color: var(--evo-f-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease;
}

.evo-shop-results .woocommerce-ordering select.orderby:hover {
    border-color: var(--evo-f-green);
}

/* The theme gives ul.products margin: 24px 0 !important. Only the spacing is
   tuned here (columns are untouched) so the grid sits level with the sidebar. */
.evo-shop-layout .evo-shop-results ul.products {
    margin: 20px 0 28px !important;
}

.evo-shop-results .woocommerce-pagination {
    margin: 4px 0 0;
}

.evo-shop-results .woocommerce-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.evo-shop-results .woocommerce-pagination li > .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line-strong);
    border-radius: 8px;
    color: var(--evo-f-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.evo-shop-results .woocommerce-pagination a.page-numbers:hover {
    border-color: var(--evo-f-green);
    color: var(--evo-f-green);
}

.evo-shop-results .woocommerce-pagination li > .page-numbers.current {
    background: var(--evo-f-green);
    border-color: var(--evo-f-green);
    color: #FFFFFF;
}

.evo-shop-results .woocommerce-pagination li > .page-numbers.dots {
    background: transparent;
    border-color: transparent;
}


/* 6. LOADING, EMPTY AND ERROR STATES
   ========================================================================== */

.evo-shop-results.is-loading {
    pointer-events: none;
}

.evo-shop-results.is-loading > * {
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.evo-shop-results.is-loading::after {
    content: "";
    position: absolute;
    top: 72px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid var(--evo-f-line);
    border-top-color: var(--evo-f-green);
    border-radius: 50%;
    animation: evo-shop-spin 0.7s linear infinite;
}

@keyframes evo-shop-spin {
    to { transform: rotate(360deg); }
}

/* "No products found" message from WooCommerce. */
.evo-shop-results .woocommerce-info {
    margin: 8px 0 0;
    padding: 18px 20px;
    background: var(--evo-f-tint);
    border: 1px solid var(--evo-f-tint-line);
    border-left: 4px solid var(--evo-f-green);
    border-radius: 10px;
    color: var(--evo-f-green-dark);
    font-size: 15px;
    list-style: none;
}

/* "No exact matches — Clear filters" prompt. */
.evo-shop-results__empty-actions {
    margin: 16px 0 0;
}

.evo-shop-results__empty-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 20px;
    background: var(--evo-f-green);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.evo-shop-results__empty-actions a:hover {
    background: var(--evo-f-green-dark);
    color: #FFFFFF;
}

/* AJAX error box (inserted by shop-filters.js above the previous results). */
.evo-shop-results__error {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: var(--evo-f-surface);
    border: 1px solid var(--evo-f-line);
    border-left: 4px solid var(--evo-f-green);
    border-radius: 8px;
    color: var(--evo-f-ink);
    font-size: 14px;
}

.evo-shop-results__error p {
    margin: 0 0 8px;
}

.evo-shop-results__error p:last-child {
    margin: 0;
}

.evo-shop-results__error a {
    color: var(--evo-f-green);
    text-decoration: underline;
}

.evo-shop-results__retry {
    padding: 8px 16px;
    background: var(--evo-f-green);
    border: 1px solid var(--evo-f-green);
    border-radius: 8px;
    color: #FFFFFF;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.evo-shop-results__retry:hover {
    background: var(--evo-f-green-dark);
    border-color: var(--evo-f-green-dark);
}

.evo-shop-results[tabindex="-1"]:focus { outline: none; }




.evo-shop-filters__option--disabled {
    opacity: 0.45;
    pointer-events: none;
}

.evo-shop-filters__option-count {
    display: inline-block;
    margin-left: 0.4em;
    font-size: 0.85em;
    color: #666;
}


/* 7. RESPONSIVE BEHAVIOUR
   ========================================================================== */

/* Small desktops: slimmer sidebar; the theme switches the grid to 3 columns here. */
@media (max-width: 1100px) {
    .evo-shop-layout {
        --evo-f-sidebar: 232px;
        column-gap: 28px;
    }
}

/* Tablet: the sidebar would squeeze the grid, so it stacks above the results
   as a two-column set of group tiles. (The mobile drawer replaces this later.) */
@media (max-width: 1000px) {
    .evo-shop-layout,
    .evo-shop-layout--no-sidebar {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "toolbar"
            "chips"
            "sidebar"
            "results";
    }

    .evo-shop-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
        align-items: start;
        max-height: none;
        margin: 0 0 24px;
        padding: 0;
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .evo-shop-filters__group,
    .evo-shop-filters__group:last-child {
        padding: 0 14px;
        background: var(--evo-f-surface);
        border: 1px solid var(--evo-f-line);
        border-radius: 10px;
    }
}

@media (max-width: 820px) {
    .evo-shop-filters__actions {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .evo-shop-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .evo-shop-results > .woocommerce-ordering select.orderby,
    .evo-shop-results .woocommerce-ordering select.orderby {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .evo-shop-toolbar {
        padding: 14px;
    }

    .evo-shop-filters__fields {
        flex-direction: column;
        align-items: stretch;
        flex-basis: 100%;
    }

    .evo-shop-filters__field {
        width: 100%;
    }

    .evo-shop-filters__field input[type="number"] {
        flex: 1;
        width: auto;
    }

    .evo-shop-filters__actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .evo-shop-filters__submit {
        width: 100%;
    }

    .evo-shop-results {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 10px;
    }

    .evo-shop-results > .woocommerce-ordering {
        grid-column: 1;
    }
}


/* 8. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .evo-shop-layout *,
    .evo-shop-layout *::before,
    .evo-shop-layout *::after {
        transition-duration: 0.01ms !important;
    }

    .evo-shop-results.is-loading::after {
        animation-duration: 1.8s;
    }
}

/* 9. MOBILE FILTER DRAWER (Task 7)
   ========================================================================== */
.evo-shop-mobile-trigger,
.evo-shop-mobile-backdrop,
.evo-shop-mobile-drawer__header,
.evo-shop-mobile-drawer__footer {
    display: none;
}

@media (min-width: 768px) {
    .evo-shop-mobile-drawer,
    .evo-shop-mobile-drawer__body {
        display: contents;
    }
}

@media (max-width: 767px) {
    .evo-shop-layout,
    .evo-shop-layout--no-sidebar {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "mobile-trigger" "chips" "results";
        row-gap: 12px;
    }

    .evo-shop-layout > .evo-shop-mobile-trigger { grid-area: mobile-trigger; }
    .evo-shop-layout > .evo-shop-chips { grid-area: chips; }
    .evo-shop-layout > .evo-shop-results { grid-area: results; }

    .evo-shop-mobile-trigger {
        display: none;
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 52px;
        padding: 12px 16px;
        border: 1px solid var(--evo-f-line);
        border-radius: 10px;
        background: var(--evo-f-surface);
        color: var(--evo-f-ink);
        box-shadow: var(--evo-f-shadow);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

    .evo-shop-mobile-trigger:focus-visible,
    .evo-shop-mobile-drawer button:focus-visible {
        outline: 2px solid var(--evo-f-green);
        outline-offset: 3px;
    }

    .evo-shop-mobile-trigger__count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 28px;
        min-height: 28px;
        padding: 0 8px;
        border-radius: 999px;
        background: var(--evo-f-tint);
        color: var(--evo-f-green-dark);
        font-size: 13px;
        font-variant-numeric: tabular-nums;
    }

    .evo-shop-mobile-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 998;
        display: block;
        background: rgba(10, 20, 14, 0.48);
    }

    /* No-JS fallback: keep the original filters visible and submit-able. */
    .evo-shop-mobile-drawer {
        position: static;
        display: block;
        width: auto;
        height: auto;
        max-height: none;
        transform: none;
        visibility: visible;
        box-shadow: none;
        background: transparent;
    }

    .evo-shop-mobile-drawer__header,
    .evo-shop-mobile-drawer__footer { display: none; }

    .evo-shop-mobile-drawer .evo-shop-filters__actions { display: flex; }

    .evo-shop-filters-enhanced .evo-shop-mobile-trigger { display: flex; }

    .evo-shop-filters-enhanced .evo-shop-mobile-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 999;
        display: flex;
        flex-direction: column;
        width: min(520px, 100vw);
        height: 100dvh;
        max-height: 100dvh;
        background: var(--evo-f-surface);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 0.24s ease, visibility 0.24s ease;
    }

    .evo-shop-filters-enhanced .evo-shop-mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .evo-shop-filters-enhanced .evo-shop-mobile-drawer__header,
    .evo-shop-filters-enhanced .evo-shop-mobile-drawer__footer { display: flex; }

    .evo-shop-filters-enhanced .evo-shop-mobile-drawer .evo-shop-filters__actions { display: none; }

    .evo-shop-mobile-drawer__header {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: max(16px, env(safe-area-inset-top)) 20px 16px;
        border-bottom: 1px solid var(--evo-f-line);
    }

    .evo-shop-mobile-drawer__header h2 {
        margin: 0;
        color: var(--evo-f-ink);
        font: inherit;
        font-size: 19px;
        font-weight: 600;
    }

    .evo-shop-mobile-drawer__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--evo-f-line);
        border-radius: 8px;
        background: transparent;
        color: var(--evo-f-ink);
        font-size: 27px;
        line-height: 1;
        cursor: pointer;
    }

    .evo-shop-mobile-drawer__body {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px 16px 24px;
        -webkit-overflow-scrolling: touch;
    }

    .evo-shop-mobile-drawer .evo-shop-toolbar {
        display: block;
        margin: 0 0 16px;
        padding: 14px;
        box-shadow: none;
    }

    .evo-shop-mobile-drawer .evo-shop-filters__fields {
        flex-direction: column;
        align-items: stretch;
    }

    .evo-shop-mobile-drawer .evo-shop-filters__field {
        width: 100%;
        flex-wrap: wrap;
    }

    .evo-shop-mobile-drawer .evo-shop-filters__actions {
        display: none;
    }

    .evo-shop-mobile-drawer .evo-shop-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
        position: static;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .evo-shop-mobile-drawer .evo-shop-filters__group,
    .evo-shop-mobile-drawer .evo-shop-filters__group:last-child {
        padding: 0 14px;
        background: var(--evo-f-surface);
        border: 1px solid var(--evo-f-line);
        border-radius: 10px;
    }

    .evo-shop-mobile-drawer__footer {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--evo-f-surface);
        border-top: 1px solid var(--evo-f-line);
        box-shadow: 0 -8px 24px rgba(15, 42, 28, 0.06);
    }

    .evo-shop-mobile-drawer__estimate {
        margin: 0;
        color: var(--evo-f-muted);
        text-align: center;
        font-size: 13px;
        line-height: 1.4;
    }

    .evo-shop-mobile-drawer__apply {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 50px;
        padding: 12px 18px;
        border: 1px solid #176B45;
        border-radius: 9px;
        background: #176B45;
        color: #fff;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

    .evo-shop-mobile-drawer__apply:hover { background: #125638; }

    .evo-shop-mobile-drawer__cancel {
        min-height: 40px;
        padding: 8px 12px;
        border: 0;
        background: transparent;
        color: var(--evo-f-muted);
        font: inherit;
        font-size: 14px;
        cursor: pointer;
    }

    .evo-shop-layout .evo-shop-results {
        min-width: 0;
    }

    html.evo-shop-drawer-open,
    body.evo-shop-drawer-open {
        overflow: hidden;
    }
}
/* ==========================================================================
   COLLECTION PAGES (Best Sellers / New Arrivals / Special Deals)
   ========================================================================== */
.evo-collection__header {
    margin-bottom: 20px;
}

.evo-collection__empty {
    padding: 48px 20px;
    text-align: center;
    background: var(--white, #FFFFFF);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.evo-collection__empty p {
    margin: 0 0 16px;
    color: var(--body-text);
    font-size: 15px;
}

.evo-collection__empty-link {
    display: inline-block;
    padding: 11px 22px;
    color: #FFFFFF;
    background: var(--brand-green);
    border-radius: 8px;
    font-weight: 600;
}

.evo-collection__empty-link:hover {
    color: #FFFFFF;
    background: var(--brand-green-deep);
}

@media (max-width: 640px) {
    .evo-collection__header .page-title {
        font-size: 28px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .evo-shop-mobile-drawer { transition: none; }
}
