/* ==========================================================================
   Woo Search Filters - design layer

   Every value comes from a --wd-* variable. The defaults below are the
   "Amber" preset; the Design tab overrides them (inline <style> printed by
   WSF\Design) so nothing here needs editing to restyle the filters.
   ========================================================================== */

.wsf-design,
.wsf-selected-filter,
.wsf-sorting-bar {
    --wd-accent: #f59e0b;
    --wd-accent-text: #ffffff;
    --wd-text: #1f2937;
    --wd-heading: #111827;
    --wd-muted: #9ca3af;
    --wd-bg: #ffffff;
    --wd-border: #e5e7eb;

    --wd-font: inherit;
    --wd-heading-size: 16px;
    --wd-heading-weight: 700;
    --wd-heading-transform: none;
    --wd-text-size: 14px;
    --wd-text-weight: 400;
    --wd-count-size: 12px;

    --wd-radius: 12px;
    --wd-control-radius: 4px;
    --wd-button-radius: 8px;
    --wd-check-size: 18px;
    --wd-gap: 8px;
    --wd-padding: 20px;
    --wd-block-gap: 20px;

    --wd-box-border: 1px solid var(--wd-border);
    --wd-box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    --wd-divider: 1px solid var(--wd-border);
}

/* ---------- the filter box ---------- */
.wsf-design {
    box-sizing: border-box;
    font-family: var(--wd-font);
    font-size: var(--wd-text-size);
    font-weight: var(--wd-text-weight);
    color: var(--wd-text);
    line-height: 1.45;
    background: var(--wd-bg);
    padding: var(--wd-padding);
    border-radius: var(--wd-radius);
    border: var(--wd-box-border);
    box-shadow: var(--wd-box-shadow);
}

.wsf-design *,
.wsf-design *::before,
.wsf-design *::after {
    box-sizing: border-box;
}

/* blocks (one per filter) */
.wsf-design > .wsf-filter-wrap,
.wsf-design > .wsf-replace-count {
    margin: 0 0 var(--wd-block-gap);
    padding: 0 0 var(--wd-block-gap);
    border-bottom: var(--wd-divider);
}

.wsf-design > .wsf-filter-wrap:last-of-type,
.wsf-design > .wsf-replace-count:last-of-type {
    margin-bottom: 0;
}

.wsf-design h5 {
    margin: 0 0 12px;
    padding: 0;
    font-family: inherit;
    font-size: var(--wd-heading-size);
    font-weight: var(--wd-heading-weight);
    text-transform: var(--wd-heading-transform);
    color: var(--wd-heading);
    line-height: 1.3;
}

.wsf-design ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wsf-design li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ---------- options ---------- */
.wsf-design li label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 var(--wd-gap);
    font-size: var(--wd-text-size);
    font-weight: var(--wd-text-weight);
    color: var(--wd-text);
    cursor: pointer;
    transition: color .15s;
}

.wsf-design li label:hover {
    color: var(--wd-accent);
}

.wsf-design li label:has(input:checked) {
    font-weight: 600;
    color: var(--wd-heading);
}

.wsf-design .wsf-count {
    color: var(--wd-muted);
    font-size: var(--wd-count-size);
    font-weight: 400;
}

.wsf-design li:has(input:disabled) label {
    color: var(--wd-muted);
    cursor: not-allowed;
}

/* custom checkbox / radio */
.wsf-design input.wsf-filter-checkbox,
.wsf-design input.wsf-filter-radio {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    position: relative;
    width: var(--wd-check-size);
    height: var(--wd-check-size);
    margin: 0;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--wd-text) 28%, var(--wd-bg));
    border-radius: var(--wd-control-radius);
    background: var(--wd-bg);
    cursor: pointer;
    box-shadow: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.wsf-design input.wsf-filter-radio {
    border-radius: 50%;
}

/* some themes / WP admin draw their own tick: we draw ours */
.wsf-design input.wsf-filter-checkbox::before,
.wsf-design input.wsf-filter-radio::before {
    content: none !important;
}

.wsf-design li label:hover input.wsf-filter-checkbox:not(:disabled),
.wsf-design li label:hover input.wsf-filter-radio:not(:disabled) {
    border-color: var(--wd-accent);
}

.wsf-design input.wsf-filter-checkbox:checked,
.wsf-design input.wsf-filter-radio:checked {
    background: var(--wd-accent);
    border-color: var(--wd-accent);
}

.wsf-design input.wsf-filter-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 46%;
    width: 30%;
    height: 55%;
    border: solid var(--wd-accent-text);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.wsf-design input.wsf-filter-radio:checked::after {
    content: "";
    position: absolute;
    inset: 25%;
    border-radius: 50%;
    background: var(--wd-accent-text);
}

.wsf-design input.wsf-filter-checkbox:focus-visible,
.wsf-design input.wsf-filter-radio:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wd-accent) 28%, transparent);
}

.wsf-design input.wsf-filter-checkbox:disabled,
.wsf-design input.wsf-filter-radio:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------- select ---------- */
.wsf-design select,
.wsf-sorting-bar select {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    font: inherit;
    font-size: var(--wd-text-size);
    color: var(--wd-text);
    background-color: var(--wd-bg);
    border: 1.5px solid var(--wd-border);
    border-radius: var(--wd-control-radius);
    box-shadow: none;
    outline: 0;
}

.wsf-sorting-bar select {
    width: auto;
}

.wsf-design select:focus,
.wsf-sorting-bar select:focus {
    border-color: var(--wd-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wd-accent) 22%, transparent);
}

/* ---------- show more / less ---------- */
.wsf-design .wsf-show-more-btn,
.wsf-design .wsf-show-less-btn {
    display: inline-block;
    margin-top: 2px;
    font-size: calc(var(--wd-text-size) - 1px);
    font-weight: 600;
    color: var(--wd-accent);
    text-decoration: none;
    cursor: pointer;
}

.wsf-design .wsf-show-more-btn:hover,
.wsf-design .wsf-show-less-btn:hover {
    filter: brightness(.85);
}

.wsf-design .wsf-show-less-btn.wsf-show-more {
    display: none;
}

.wsf-design .wsf-show-all .wsf-show-less-btn.wsf-show-more {
    display: inline-block;
}

/* ---------- reset button ---------- */
.wsf-design .wsf-reset-container {
    margin: var(--wd-block-gap) 0 0;
}

.wsf-design .wsf-reset-filters,
.wsf-design .wsf-reset-filters.button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    font-family: inherit;
    font-size: var(--wd-text-size);
    font-weight: 600;
    line-height: 1.2;
    color: var(--wd-accent-text);
    background: var(--wd-accent);
    border: 0;
    border-radius: var(--wd-button-radius);
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s;
}

.wsf-design .wsf-reset-filters:hover {
    filter: brightness(.92);
    color: var(--wd-accent-text);
}

/* ---------- price range slider ---------- */
.wsf-design .tl-slider-container {
    position: relative;
    display: block;
    width: 100%;
}

.wsf-design .tl-input-fields {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    background: none;
}

.wsf-design .tl-input-fields > div {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.wsf-design .tl-input-fields label {
    min-width: 0;
    margin: 0 6px 0 0;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--wd-muted);
}

.wsf-design .tl-input-fields input[type="number"] {
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 6px 10px;
    font: inherit;
    font-size: var(--wd-text-size);
    color: var(--wd-text);
    background: var(--wd-bg);
    border: 1.5px solid var(--wd-border);
    border-radius: var(--wd-control-radius);
    box-shadow: none;
    outline: 0;
}

.wsf-design .tl-input-fields input[type="number"]:focus {
    border-color: var(--wd-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wd-accent) 22%, transparent);
}

.wsf-design .tl-slider {
    position: relative;
    height: 4px;
    margin: 25px 8px 15px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--wd-text) 14%, var(--wd-bg));
}

.wsf-design .tl-track {
    position: absolute;
    height: 100%;
    border-radius: 99px;
    background: var(--wd-accent);
}

.wsf-design .tl-thumb {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 18px;
    height: 18px;
    border: 3px solid var(--wd-accent);
    border-radius: 50%;
    background: var(--wd-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    transform: translate(-50%, -50%);
    cursor: grab;
}

.wsf-design .tl-thumb:active {
    cursor: grabbing;
}

.wsf-design .tl-tooltip {
    background: var(--wd-heading);
    color: var(--wd-bg);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* ---------- selected filters (chips) ---------- */
.wsf-selected-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-family: var(--wd-font);
}

.wsf-selected-filter li {
    margin: 0;
    list-style: none;
}

.wsf-selected-filter .close-wrap {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 4px 6px 4px 12px;
    gap: 8px;
    font-size: var(--wd-text-size);
    font-weight: 600;
    color: var(--wd-accent-text);
    background: var(--wd-accent);
    border: 0;
    border-radius: 999px;
}

.wsf-selected-filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: inherit;
    cursor: pointer;
}

.wsf-selected-filter input {
    display: none;
}

.wsf-selected-filter i.fa,
.wsf-selected-filter i.fa-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-style: normal;
    border-radius: 50%;
    color: inherit;
    background: color-mix(in srgb, var(--wd-accent-text) 22%, transparent);
    font-size: 14px;
    line-height: 1;
}

.wsf-selected-filter i.fa::before,
.wsf-selected-filter i.fa-close::before {
    content: "\00d7" !important;
    font-family: inherit !important;
}

/* ---------- sorting bar (sits on the page, not in the box) ---------- */
.wsf-sorting-bar {
    font-family: var(--wd-font);
    font-size: var(--wd-text-size);
}

.wsf-sorting-bar select {
    background-color: transparent;
    color: inherit;
    border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent);
}
