.wcaf-widget {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.wcaf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.wcaf-header:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.wcaf-body {
    padding: 12px;
}

.wcaf-top-controls {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.wcaf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wcaf-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.wcaf-select,
.wcaf-input {
    width: 100%;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: #fff;
    color: #222;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.2;
}

.wcaf-select:focus,
.wcaf-input:focus {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}

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

.wcaf-price-separator {
    color: #666;
    font-weight: 600;
}

.wcaf-price-slider {
    margin-top: 16px;
    margin-bottom: 12px;
    padding: 0 10px;
}

.wcaf-price-bounds {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: #666;
    padding: 0 10px;
}

.wcaf-price-slider.noUi-target,
.wcaf-price-slider .noUi-target {
    border: none;
    box-shadow: none;
    background: #e5e7eb;
    height: 6px;
    border-radius: 999px;
}

.wcaf-price-slider .noUi-connect {
    background: #222;
}

.wcaf-price-slider .noUi-horizontal .noUi-handle {
    width: 20px;
    height: 20px;
    right: -10px;
    top: -7px;
    border-radius: 50%;
    border: 2px solid #222;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    cursor: grab;
}

.wcaf-price-slider .noUi-handle::before,
.wcaf-price-slider .noUi-handle::after {
    display: none;
}

.wcaf-price-slider .noUi-handle:focus {
    outline: none;
}

.wcaf-checkbox-field {
    flex-direction: row;
    align-items: center;
}

.wcaf-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #222;
}

.wcaf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.wcaf-btn {
    appearance: none;
    border: 1px solid #b5b5b5;
    background: #f3f4f6;
    color: #222;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wcaf-btn:hover {
    background: #e5e7eb;
    border-color: #8f8f8f;
}

.wcaf-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.wcaf-categories-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin: 10px 0 8px;
}

.wcaf-tree,
.wcaf-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcaf-children {
    margin-left: 18px;
    padding-left: 10px;
    border-left: 1px solid #eee;
}

.wcaf-node {
    margin: 4px 0;
}

.wcaf-row {
    display: grid;
    grid-template-columns: 30px 18px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.wcaf-toggle,
.wcaf-toggle-placeholder {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wcaf-toggle {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    border-radius: 6px;
    color: #111827;
    padding: 0;
}

.wcaf-toggle:hover {
    background: var(--ast-global-color-3);
    border-color: #9ca3af;
}

.wcaf-toggle:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.wcaf-checkbox {
    margin: 0;
    width: 16px;
    height: 16px;
    justify-self: center;
}

.wcaf-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 14px;
    line-height: 1;
}

.wcaf-node.is-open > .wcaf-row .wcaf-chevron {
    transform: rotate(90deg);
}

.wcaf-label {
    display: block;
    cursor: pointer;
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
}

.wcaf-label:hover {
    background: #f8f8f8;
}

.wcaf-name {
    color: #222;
    line-height: 1.3;
}

.wcaf-node.is-selected > .wcaf-row .wcaf-label {
    background: #eef6ff;
}

.wcaf-products {
    position: relative;
    min-height: 120px;
}

.wcaf-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.wcaf-results-count {
    font-weight: 600;
    color: #222;
}

.wcaf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcaf-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
}

.wcaf-products ul.products {
    display: grid;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wcaf-products ul.products.columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wcaf-products ul.products.columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wcaf-products ul.products.columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wcaf-products ul.products.columns-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wcaf-products ul.products.columns-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.wcaf-products ul.products li.product {
    width: 100%;
    margin: 0;
}

@media (max-width: 1024px) {
    .wcaf-products ul.products.columns-4,
    .wcaf-products ul.products.columns-5,
    .wcaf-products ul.products.columns-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .wcaf-products ul.products.columns-2,
    .wcaf-products ul.products.columns-3,
    .wcaf-products ul.products.columns-4,
    .wcaf-products ul.products.columns-5,
    .wcaf-products ul.products.columns-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .wcaf-products ul.products {
        grid-template-columns: 1fr;
    }
}

.wcaf-products.is-loading::after {
    content: "Loading...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    z-index: 2;
}

.wcaf-no-results {
    padding: 20px 0;
}

.wcaf-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    justify-content: center;
    align-items: center;
}

.wcaf-page-btn {
    appearance: none;
    border: 1px solid #cfcfcf;
    background: #fff;
    color: #222;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 42px;
    font-weight: 600;
    line-height: 1.2;
}

.wcaf-page-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #a8a8a8;
}

.wcaf-page-btn.is-active {
    background: #222;
    color: #fff;
    border-color: #222;
}

.wcaf-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wcaf-page-dots {
    padding: 0 4px;
    color: #666;
}