/* ─── STICKY FILTER BAR ─────────────────────────────────────────── */
.fsearch-bar {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 13px;
    color: #334155;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: relative;
    z-index: 100;
}

/* ─── TOP ROW: PILL BUTTONS ─────────────────────────────────────── */
.fsearch-toprow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    flex-wrap: wrap;
}

.fsearch-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
    position: relative;
    font-family: inherit;
}

.fsearch-pill:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

.fsearch-pill.is-open {
    border-color: #1e293b;
    background: #f1f5f9;
    color: #1e293b;
}

.fsearch-pill.is-active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

.fsearch-pill.is-active:hover {
    background: #0f172a;
}

.fsearch-pill-arrow {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transition: transform .2s;
}

.fsearch-pill.is-open .fsearch-pill-arrow {
    transform: rotate(180deg);
}

.fsearch-pill-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    font-size: 10px;
    line-height: 1;
    margin-left: 2px;
    transition: background .12s;
}

.fsearch-pill.is-active .fsearch-pill-clear:hover {
    background: rgba(255,255,255,.4);
}

.fsearch-toprow-spacer { flex: 1; }

.fsearch-reset-all {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    white-space: nowrap;
    transition: color .12s;
}

.fsearch-reset-all:hover { color: #b91c1c; }
.fsearch-reset-all.visible { display: inline-flex; }

/* ─── DROPDOWN PANEL ────────────────────────────────────────────── */
.fsearch-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 20px;
    min-width: 260px;
    max-width: 400px;
    z-index: 200;
}

.fsearch-dropdown.is-open { display: block; }

/* slider inside dropdown */
.fsearch-drop-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    margin-bottom: 14px;
}

.fsearch-dual-range { display: flex; flex-direction: column; }

.fsearch-dual-track {
    position: relative;
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 10px 0 0;
}

.fsearch-dual-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: #1e293b;
    border-radius: 4px;
    pointer-events: none;
}

.fsearch-thumb {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0; left: 0;
    background: transparent;
    outline: none;
    pointer-events: none;
    margin: 0;
}

.fsearch-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #1e293b;
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 2;
    margin-top: -7px;
    transition: transform .12s, box-shadow .12s;
}

.fsearch-thumb::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #1e293b;
    cursor: pointer;
    pointer-events: all;
}

.fsearch-thumb:hover::-webkit-slider-thumb,
.fsearch-thumb:focus::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(30,41,59,.12);
}

.fsearch-dual-vals {
    position: relative;
    height: 18px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.fsearch-val-lo { position: absolute; left: 0; }
.fsearch-val-hi { position: absolute; right: 0; }
.fsearch-val-sep { display: none; }

/* buttons inside dropdown */
.fsearch-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fsearch-tag-btn {
    padding: 6px 13px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.fsearch-tag-btn:hover { border-color: #94a3b8; color: #1e293b; }

.fsearch-tag-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

/* ─── STATUS BAR ────────────────────────────────────────────────── */
.fsearch-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #64748b;
}

.fsearch-status.visible { display: flex; }

.fsearch-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.fsearch-status-dot.loading { background: #f59e0b; animation: fsearch-pulse .8s ease-in-out infinite; }
.fsearch-status-dot.done    { background: #22c55e; }
.fsearch-status-dot.empty   { background: #ef4444; }

@keyframes fsearch-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.4; transform:scale(.7); }
}

/* ─── HIDDEN PRODUCTS ───────────────────────────────────────────── */
.fsearch-hidden { display: none !important; }

/* When filtering: force top-left alignment for flex AND grid containers */
.fsearch-filtered {
    justify-content: flex-start !important;
    justify-items: start !important;
    align-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
}


/* ─── INACTIVE FILTER ───────────────────────────────────────────── */
.fsearch-inactive { opacity: .4; pointer-events: none; }

/* ─── MOBILE ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .fsearch-dropdown {
        position: fixed;
        left: 12px; right: 12px;
        top: auto;
        max-width: none;
        width: auto;
    }

    .fsearch-toprow { gap: 5px; }
    .fsearch-pill { font-size: 11px; padding: 6px 10px; }
}