.category-listing--filtered {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.product-filter-panel {
    border: 1px solid var(--line, #dfe5e1);
    border-radius: 10px;
    background: #fff;
    padding: 16px;
}

.product-filter-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line, #dfe5e1);
}

.product-filter-heading > div {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
}

.product-filter-heading strong { font-size: 17px; }
.product-filter-heading span { color: var(--muted, #68746d); font-size: 13px; }

.product-filter-clear {
    color: #ef4444;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}

.product-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 12px;
}

.product-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-height: 27px;
    border: 1px solid #cfd2ff;
    border-radius: 999px;
    background: #f0f0ff;
    padding: 3px 9px;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.product-filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-filter-chip:hover { border-color: #8b8ff8; background: #e8e8ff; }

.product-filter-chip:focus-visible,
.product-filter-clear:focus-visible {
    outline: 3px solid rgba(88, 101, 242, .25);
    outline-offset: 2px;
}

.product-filter-section {
    margin: 0;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid #edf0ee;
}

.product-filter-section legend {
    float: left;
    display: block;
    width: 100%;
    margin: 0 0 7px;
    color: #435047;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.product-filter-section legend + * { clear: both; }

.product-filter-section select,
.product-filter-price-fields input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cfd7d2;
    border-radius: 7px;
    background: #fff;
    padding: 0 11px;
    color: var(--ink, #17211b);
}

.product-filter-price-fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}

.product-filter-option {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 7px;
    color: #34413a;
    font-size: 13px;
}

.product-filter-section legend + .product-filter-option { margin-top: 0; }
.product-filter-option input { width: 16px; height: 16px; margin: 0; accent-color: #5865f2; }
.product-filter-option small { color: #89938d; }

.product-filter-range {
    position: relative;
    height: 20px;
    margin: 10px 4px 0;
    cursor: ew-resize;
    touch-action: none;
}

.product-filter-range-track,
.product-filter-range-selection {
    position: absolute;
    top: 8px;
    height: 4px;
    border-radius: 99px;
}

.product-filter-range-track { inset-inline: 0; background: #dfe4f0; }
.product-filter-range-selection { left: var(--price-start); right: calc(100% - var(--price-end)); background: #6569f5; }

.product-filter-range input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    appearance: none;
    pointer-events: none;
}

.product-filter-range input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.product-filter-range input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border: 0;
    border-radius: 50%;
    background: #6569f5;
    appearance: none;
    pointer-events: auto;
    cursor: grab;
}

.product-filter-range input[type="range"]::-moz-range-track { height: 4px; background: transparent; }
.product-filter-range input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #6569f5;
    pointer-events: auto;
    cursor: grab;
}

.product-filter-range input[type="range"]:focus-visible::-webkit-slider-thumb,
.product-filter-range input[type="range"]:focus-visible::-moz-range-thumb {
    outline: 3px solid rgba(88, 101, 242, .28);
    outline-offset: 2px;
}

.product-filter-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    color: #89938d;
    font-size: 11px;
}

.product-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 16px; }

.product-filter-actions button,
.product-filter-mobile-toggle {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--ink, #17211b);
    padding: 0 16px;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
}

.product-filter-updating { margin: 12px 0 0; color: #68746d; font-size: 12px; }
.product-filter-form[aria-busy="true"] { opacity: .68; pointer-events: none; }
.product-filter-mobile-toggle,
.product-filter-close,
.product-filter-backdrop { display: none; }

.product-filter-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.product-filter-active-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    background: #fff;
    color: #17211b;
    font-size: 11px;
}

.category-listing__results { min-width: 0; }

@media (max-width: 820px) {
    .category-listing--filtered { display: block; }
    .product-filter-mobile-toggle { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; }
    .product-filter-panel {
        position: fixed;
        z-index: 120;
        inset: 0 0 0 auto;
        width: min(90vw, 360px);
        height: 100dvh;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        box-shadow: -18px 0 50px rgba(15, 23, 42, .18);
        transform: translateX(105%);
        transition: transform .26s cubic-bezier(.22, 1, .36, 1);
        will-change: transform;
    }
    .product-filter-shell.is-open .product-filter-panel,
    .product-filter-panel:target { transform: translateX(0); }
    .product-filter-backdrop { display: block; position: fixed; z-index: 119; inset: 0; background: rgba(15, 23, 42, .48); opacity: 0; pointer-events: none; transition: opacity .24s ease-out; }
    .product-filter-shell.is-open .product-filter-backdrop,
    .product-filter-shell:has(.product-filter-panel:target) .product-filter-backdrop { opacity: 1; pointer-events: auto; }
    .product-filter-close {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        margin-left: auto;
        align-items: center;
        justify-content: center;
        border: 1px solid transparent;
        border-radius: 12px;
        background: transparent;
        color: inherit;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .product-filter-close:hover {
        border-color: var(--line, #dfe5e1);
        background: var(--surface, #f4f6f3);
    }
    .product-filter-close:focus {
        outline: none;
    }
    .product-filter-close:focus-visible {
        outline: 3px solid rgba(23, 33, 27, .18);
        outline-offset: 2px;
    }
    .product-filter-close svg {
        width: 22px;
        height: 22px;
        display: block;
    }
    .product-filter-shell.is-open .product-filter-close,
    .product-filter-panel:target .product-filter-close { display: inline-flex; }
    body.product-filter-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .product-filter-panel,.product-filter-backdrop { transition: none; }
}
