/* sari3 — searchable select + price volume */
.ss-wrap,
.ss-mount {
    position: relative;
    width: 100%;
    display: block;
}

.ss {
    position: relative;
    width: 100%;
}

.ss-trigger {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: start;
    cursor: pointer;
    min-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ss-trigger:hover {
    border-color: #d4d4d4;
    background: #fcfcfc;
}

.ss.is-open .ss-trigger {
    border-color: var(--primary, #E31E24);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.12);
}

.ss.is-disabled .ss-trigger,
.ss-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    background: #f3f3f3;
    color: #888;
    box-shadow: none;
}

.ss.is-disabled .ss-trigger:hover,
.ss-trigger:disabled:hover {
    border-color: #e6e6e6;
    background: #f3f3f3;
}

.ss-trigger.is-empty .ss-placeholder {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #757575;
    font-weight: 600;
}

.ss-trigger .ss-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #1a1a1a;
}

.ss-caret {
    margin-inline-start: auto;
    width: 0.55rem;
    height: 0.55rem;
    flex-shrink: 0;
    border-inline-end: 2px solid #9a9a9a;
    border-bottom: 2px solid #9a9a9a;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
    font-size: 0;
    color: transparent;
    line-height: 0;
}

.ss.is-open .ss-caret {
    transform: rotate(225deg) translateY(-1px);
}

.ss-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background: #f7f7f7;
    border: 1px solid #eee;
    padding: 2px;
    box-sizing: border-box;
}

.ss-logo-spacer {
    width: 26px;
    flex-shrink: 0;
    display: inline-block;
}

/* CRITICAL: author display:flex must not override [hidden] */
.ss-panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 220;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 20, 30, 0.16);
    overflow: hidden;
    max-height: min(520px, 70vh);
    flex-direction: column;
}

.ss-panel[hidden] {
    display: none !important;
}

.ss-panel:not([hidden]) {
    display: flex;
}

.ss-search {
    width: 100%;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.8rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: #fafafa;
    outline: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ss-search:focus {
    background: #fff;
}

.ss-list {
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* Search sidebar — open list almost to the bottom of the viewport */
.search-sidebar .ss-panel,
.filter-modal-body .ss-panel {
    max-height: min(640px, calc(100vh - var(--header-h, 70px) - 120px));
}

.ss-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.58rem 0.7rem;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    transition: background 0.12s ease, color 0.12s ease;
}

.ss-option:hover {
    background: #f7f7f7;
}

.ss-option.is-active {
    background: #fff5f5;
    color: var(--primary, #E31E24);
}

.ss-option .ss-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-empty {
    padding: 0.85rem;
    text-align: center;
    color: #8a8a8a;
    font-size: 0.82rem;
    list-style: none;
}

.filter-brands-grid:empty {
    display: none;
}

/* Sidebar field labels must stay visible */
.search-sidebar .field-label,
.search-filter-free .field-label,
.filter-modal-body .field-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.72rem;
    font-weight: 700;
    color: #8a8a8a;
    margin-bottom: 0.3rem;
}

.search-sidebar .field-group {
    margin-bottom: 0.15rem;
}

/* ── Dual price volume slider ── */
.field-price-volume {
    grid-column: 1 / -1;
}

.price-volume-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.price-volume-head .field-label {
    margin-bottom: 0 !important;
}

.price-volume-values {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.price-volume-sep {
    color: #b0b0b0;
    font-weight: 500;
}

.price-volume {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
    touch-action: none;
    user-select: none;
}

.price-volume-track {
    position: absolute;
    inset-inline: 0;
    height: 6px;
    border-radius: 999px;
    background: #ececec;
    pointer-events: none;
}

.price-volume-range {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--primary, #E31E24);
    pointer-events: none;
}

.price-volume-thumb {
    position: absolute;
    inset-inline: 0;
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
    outline: none;
}

.price-volume-thumb::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border: none;
}

.price-volume-thumb::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

.price-volume-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -7px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #E31E24);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    pointer-events: auto;
    cursor: grab;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.price-volume-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary, #E31E24);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    pointer-events: auto;
    cursor: grab;
}

.price-volume-thumb:active::-webkit-slider-thumb,
.price-volume-thumb:focus-visible::-webkit-slider-thumb {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.16), 0 2px 8px rgba(0, 0, 0, 0.16);
    cursor: grabbing;
}

.price-volume-thumb:active::-moz-range-thumb,
.price-volume-thumb:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.16), 0 2px 8px rgba(0, 0, 0, 0.16);
    cursor: grabbing;
}

.price-volume-thumb.is-min {
    z-index: 2;
}

.price-volume-thumb.is-max {
    z-index: 3;
}

.price-volume-thumb.is-on-top {
    z-index: 4;
}

/* Condition chips (new / used) */
.filter-condition-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.filter-chip {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #DADADA;
    background: #f7f7f7;
    color: #333;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    padding: 0.62rem 0.9rem;
    border-radius: 15px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.filter-chip:hover {
    border-color: #cfcfcf;
    background: #f2f2f2;
}

.filter-chip.is-active {
    border-color: var(--primary, #E31E24);
    background: var(--primary, #E31E24);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.28);
}

#filterApplyBtn.is-counting {
    opacity: 0.75;
}
