.ks-product-filter-widget {
    margin-bottom: 30px;
}

.ks-product-filter-form {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.ks-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1f1a17;
}

.ks-filter-heading-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.ks-filter-clear {
    border: 0;
    background: transparent;
    color: #8a6b4f;
    font-size: 13px;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.ks-filter-close {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #1f1a17;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ks-filter-status {
    min-height: 18px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #7b756f;
}

.ks-filter-group {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0;
    padding: 16px 0 4px;
}

.ks-filter-group legend {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2d2722;
}

.ks-filter-option {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.35;
    color: #332b25;
    cursor: pointer;
}

.ks-filter-option input {
    margin: 0;
    accent-color: #8a6b4f;
}

.ks-product-filter-form.is-loading,
ul.products.ks-products-loading {
    opacity: 0.55;
    pointer-events: none;
}

.ks-no-products {
    list-style: none;
    width: 100% !important;
    padding: 22px !important;
    background: #fff;
    border-radius: 10px;
    text-align: center;
}

.ks-filter-mobile-toggle,
.ks-filter-backdrop {
    display: none;
}

@media (max-width: 991px) {
    body.ks-filter-modal-open {
        overflow: hidden;
    }

    .ks-filter-mobile-toggle {
        display: inline-flex;
        position: fixed;
        left: 16px;
        bottom: max(18px, env(safe-area-inset-bottom));
        z-index: 9999;
        width: auto;
        min-width: 132px;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border: 0;
        border-radius: 999px;
        background: #8a6b4f;
        color: #fff;
        padding: 14px 20px;
        margin: 0;
        font-weight: 800;
        text-align: center;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
    }

    .ks-filter-mobile-toggle::before {
        content: '☰';
        font-size: 16px;
        line-height: 1;
    }

    .ks-filter-mobile-toggle[aria-expanded="true"] {
        background: #1f1a17;
    }

    .ks-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 9997;
        border: 0;
        background: rgba(0, 0, 0, 0.44);
        padding: 0;
        cursor: default;
    }

    .ks-product-filter-form {
        display: block;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 9998;
        max-height: min(74vh, 620px);
        overflow-y: auto;
        margin: 0;
        padding: 18px;
        border-radius: 18px;
        transform: translateY(18px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
        box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
    }

    .ks-product-filter-form.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .ks-product-filter-form.is-open + .ks-filter-backdrop,
    .ks-product-filter-widget:has(.ks-product-filter-form.is-open) .ks-filter-backdrop {
        display: block;
    }

    .ks-filter-heading {
        position: sticky;
        top: -18px;
        z-index: 1;
        background: #fff;
        padding: 2px 0 12px;
    }

    .ks-filter-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
