.wcaf-filter {
    border: 1px solid #e3e5ea;
    border-radius: 12px;
    padding: 16px 18px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
}

.wcaf-layout-vertical .wcaf-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wcaf-layout-horizontal .wcaf-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.wcaf-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
}

.wcaf-description {
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.wcaf-active-filters {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.wcaf-active-title {
    font-weight: 500;
    font-size: 13px;
    margin-right: 4px;
}

.wcaf-active-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wcaf-active-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #c7d2fe;
}

.wcaf-active-chip:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.wcaf-active-remove {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
}

.wcaf-reset-active {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
}

.wcaf-reset-active:hover {
    color: #111827;
}

.wcaf-field {
    min-width: 180px;
    flex: 1 1 50px;
}

.wcaf-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #111827;
}

.wcaf-field input[type="search"],
.wcaf-field input[type="text"],
.wcaf-field input[type="number"],
.wcaf-field select {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 7px 9px;
    font-size: 14px;
    background-color: #f9fafb;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.wcaf-field input:focus,
.wcaf-field select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
    background: #ffffff;
}

.wcaf-field-price .wcaf-price-slider {
    margin-bottom: 10px;
}

.wcaf-field-price .ui-slider {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
}

.wcaf-field-price .ui-slider-range {
    position: absolute;
    height: 100%;
    background: #4f46e5;
    border-radius: 999px;
}

.wcaf-field-price .ui-slider-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #4f46e5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.wcaf-price-inputs {
    display: flex;
    gap: 8px;
}

.wcaf-price-input {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 0;
    font-size: 13px;
}

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

.wcaf-cat-item {
    margin: 2px 0;
}

.wcaf-cat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcaf-cat-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.wcaf-cat-label input[type="radio"] {
    accent-color: #4f46e5;
    cursor: pointer;
}

.wcaf-cat-name {
    flex: 1 1 auto;
    font-size: 13px;
    text-decoration: none;
    color: #111827;
    white-space: normal;
    word-break: break-word;
}

.wcaf-cat-name:hover {
    color: #4f46e5;
}

.wcaf-cat-count {
    font-size: 12px;
    color: #6b7280;
    margin-left: 4px;
}

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

.wcaf-cat-toggle {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
    position: relative;
}

.wcaf-cat-toggle::before,
.wcaf-cat-toggle::after {
    content: "";
    position: absolute;
    background: #6b7280;
}

.wcaf-cat-toggle::before {
    width: 8px;
    height: 1.5px;
}

.wcaf-cat-toggle::after {
    width: 1.5px;
    height: 8px;
}

.wcaf-cat-item.is-open > .wcaf-cat-row .wcaf-cat-toggle::after {
    display: none;
}

.wcaf-cat-children {
    margin-left: 22px;
}

.wcaf-cat-item.is-open > .wcaf-cat-children {
    display: block;
}

.wcaf-attr-group {
    margin-bottom: 10px;
}

.wcaf-attr-header {
    margin-bottom: 4px;
}

.wcaf-attr-title {
    font-size: 13px;
    font-weight: 500;
}

.wcaf-attr-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcaf-attr-item {
    margin: 2px 0;
}

.wcaf-attr-item label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.wcaf-attr-item input[type="checkbox"] {
    accent-color: #4f46e5;
}

.wcaf-attr-hidden {
    display: none;
}

.wcaf-attr-show-more {
    margin-top: 4px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: #4f46e5;
    cursor: pointer;
    padding: 0;
}

.wcaf-attr-name {
    white-space: nowrap;
}

.wcaf-attr-count {
    font-size: 12px;
    color: #6b7280;
}

.wcaf-attr-dropdown {
    position: relative;
}

.wcaf-attr-dropdown-toggle {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 7px 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.wcaf-attr-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
    padding: 8px;
    z-index: 50;
    display: none;
}

.wcaf-attr-dropdown.is-open .wcaf-attr-dropdown-panel {
    display: block;
}

.wcaf-attr-search {
    width: 100%;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    font-size: 13px;
    margin-bottom: 6px;
}

.wcaf-attr-list-dropdown {
    max-height: 180px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcaf-attr-list-dropdown .wcaf-attr-item {
    padding: 2px 0;
}

.wcaf-attr-range-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.wcaf-attr-range-input {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 0;
    font-size: 13px;
}

.wcaf-attr-range-input input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 5px 7px;
    font-size: 13px;
}

.wcaf-attr-range-terms {
    display: none;
}

.wcaf-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.wcaf-submit {
    border: none;
    border-radius: 999px;
    padding: 7px 18px;
    background: #4f46e5;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

.wcaf-submit:hover {
    background: #4338ca;
}

.wcaf-submit:active {
    transform: translateY(1px);
}

.wcaf-reset-all {
    font-size: 13px;
    color: #6b7280;
    text-decoration: underline;
}

.wcaf-reset-all:hover {
    color: #111827;
}

.wcaf-empty {
    font-size: 13px;
    color: #9ca3af;
}

@media (max-width: 768px) {
    .wcaf-layout-horizontal .wcaf-fields {
        flex-direction: column;
    }

    .wcaf-filter {
        padding: 14px;
    }
}
