/* ============================================================
   SudExpert · Premium Filter Design System
   Дизайн-система премиум-фильтра (Double-Bezel / Soft Structuralism)
   Префикс всех токенов: --nvx-f-
   ============================================================ */

:root,
.nvx-filter--premium {
    --nvx-f-accent: #4F46E5;
    --nvx-f-accent-strong: #4338CA;
    --nvx-f-accent-soft: rgba(79, 70, 229, 0.09);
    --nvx-f-accent-ring: rgba(79, 70, 229, 0.26);
    --nvx-f-surface: #FFFFFF;
    --nvx-f-shell: #F2F3F7;
    --nvx-f-border: rgba(15, 23, 42, 0.08);
    --nvx-f-border-strong: rgba(15, 23, 42, 0.16);
    --nvx-f-text: #0F172A;
    --nvx-f-text-2: #475569;
    --nvx-f-text-3: #94A3B8;
    --nvx-f-danger: #E11D48;
    --nvx-f-radius: 20px;
    --nvx-f-radius-sm: 12px;
    --nvx-f-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -16px rgba(15, 23, 42, 0.14);
    --nvx-f-ease: cubic-bezier(0.22, 1, 0.36, 1);

    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    color: var(--nvx-f-text);
    margin: 0 0 28px;
    box-sizing: border-box;
}

.nvx-filter--premium *,
.nvx-filter--premium *::before,
.nvx-filter--premium *::after {
    box-sizing: border-box;
}

/* ---------- Double-Bezel shell ---------- */
.nvx-filter__shell {
    background: var(--nvx-f-shell);
    border-radius: calc(var(--nvx-f-radius) + 6px);
    padding: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.nvx-filter__panel {
    position: relative;
    background: var(--nvx-f-surface);
    border-radius: var(--nvx-f-radius);
    padding: 14px 16px;
    box-shadow:
        var(--nvx-f-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---------- Header ---------- */
.nvx-filter__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--nvx-f-border);
}

.nvx-filter__title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nvx-filter__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--nvx-f-accent);
    background: var(--nvx-f-accent-soft);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.nvx-filter__title-text {
    min-width: 0;
}

.nvx-filter__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--nvx-f-text);
}

.nvx-filter__subtitle {
    margin: 1px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--nvx-f-text-3);
}

.nvx-filter__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nvx-filter__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    color: var(--nvx-f-surface);
    background: var(--nvx-f-accent);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.nvx-filter__count[hidden] { display: none; }

.nvx-filter__reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nvx-f-text-2);
    font-size: 13px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s var(--nvx-f-ease), color 0.25s var(--nvx-f-ease);
}

.nvx-filter__reset[hidden] { display: none; }

.nvx-filter__reset:hover { background: rgba(15, 23, 42, 0.05); color: var(--nvx-f-text); }
.nvx-filter__reset:active { transform: scale(0.97); }
.nvx-filter__reset:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--nvx-f-accent-ring);
}

/* ---------- Fields grid ---------- */
.nvx-filter__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 8px;
    align-items: flex-end;
}

.nvx-filter-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 140px;
    max-width: 260px;
}

.nvx-filter-field--checks { flex-basis: 200px; max-width: 340px; }
.nvx-filter-field--price { flex-basis: 180px; max-width: 280px; }
.nvx-filter-field--submit {
    flex: 0 0 auto;
    align-self: flex-end;
}

.nvx-filter-field--is-hidden { display: none !important; }

/* ---------- Labels ---------- */
.nvx-filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    color: var(--nvx-f-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nvx-filter-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.nvx-filter-slider__value {
    font-size: 12px;
    font-weight: 600;
    color: var(--nvx-f-text-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---------- Custom select ---------- */
.nvx-field--select {
    position: relative;
    display: block;
}

.nvx-field__control--select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 13px;
    border: 1px solid var(--nvx-f-border-strong);
    border-radius: var(--nvx-f-radius-sm);
    background: var(--nvx-f-surface);
    color: var(--nvx-f-text);
    font-size: 13.5px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.25s var(--nvx-f-ease), box-shadow 0.25s var(--nvx-f-ease), background 0.25s var(--nvx-f-ease);
}

.nvx-field__control--select:hover {
    border-color: rgba(15, 23, 42, 0.28);
}

.nvx-field__control--select:focus-visible {
    outline: none;
    border-color: var(--nvx-f-accent);
    box-shadow: 0 0 0 3px var(--nvx-f-accent-ring);
}

.nvx-field__arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--nvx-f-text-3);
    transition: color 0.25s var(--nvx-f-ease);
}

.nvx-field--select:hover .nvx-field__arrow { color: var(--nvx-f-text-2); }
.nvx-field--select:focus-within .nvx-field__arrow { color: var(--nvx-f-accent); }

/* disabled (каскадные поля до выбора родителя) */
.nvx-field__control--select:disabled {
    background: rgba(15, 23, 42, 0.03);
    color: var(--nvx-f-text-3);
    cursor: not-allowed;
    border-style: dashed;
    border-color: var(--nvx-f-border);
}

.nvx-field__control--select:disabled + .nvx-field__arrow { color: rgba(15, 23, 42, 0.18); }

.nvx-filter-field__hint {
    font-size: 12px;
    line-height: 1.35;
    color: var(--nvx-f-text-3);
    margin: 0;
}

/* ---------- Price slider ---------- */
.nvx-filter-slider--price {
    position: relative;
    height: 28px;
    margin-top: 4px;
}

.nvx-filter-slider__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 5px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #E4E7EC;
    overflow: hidden;
}

.nvx-filter-slider__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.55), var(--nvx-f-accent));
    border-radius: 999px;
    transition: left 0.18s var(--nvx-f-ease), width 0.18s var(--nvx-f-ease);
}

.nvx-filter-range {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    width: 100%;
    height: 28px;
    margin: 0;
    transform: translateY(-50%);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.nvx-filter-range::-webkit-slider-runnable-track {
    height: 28px;
    background: transparent;
}

.nvx-filter-range::-moz-range-track {
    height: 28px;
    background: transparent;
    border: none;
}

.nvx-filter-slider__scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 550;
    color: var(--nvx-f-text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nvx-filter-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 17px;
    height: 17px;
    margin-top: 5.5px;
    border-radius: 50%;
    background: var(--nvx-f-surface);
    border: 2.5px solid var(--nvx-f-accent);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22), 0 0 0 0 var(--nvx-f-accent-ring);
    cursor: grab;
    transition: transform 0.2s var(--nvx-f-ease), box-shadow 0.2s var(--nvx-f-ease), border-width 0.2s var(--nvx-f-ease);
}

.nvx-filter-range::-moz-range-thumb {
    pointer-events: auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--nvx-f-surface);
    border: 2.5px solid var(--nvx-f-accent);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
    cursor: grab;
    transition: transform 0.2s var(--nvx-f-ease), box-shadow 0.2s var(--nvx-f-ease);
}

.nvx-filter-range:hover::-webkit-slider-thumb,
.nvx-filter-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.28), 0 0 0 4px var(--nvx-f-accent-ring);
}

.nvx-filter-range:active::-webkit-slider-thumb {
    transform: scale(1.18);
    cursor: grabbing;
}

.nvx-filter-range:focus-visible { outline: none; }

/* ---------- Custom checkbox / radio ---------- */
.nvx-check,
.nvx-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-height: 24px;
    user-select: none;
}

.nvx-check__input,
.nvx-radio__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.nvx-check__box {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--nvx-f-border-strong);
    background: var(--nvx-f-surface);
    color: transparent;
    transition: background 0.22s var(--nvx-f-ease), border-color 0.22s var(--nvx-f-ease), box-shadow 0.22s var(--nvx-f-ease), transform 0.15s var(--nvx-f-ease);
}

.nvx-check__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--nvx-f-text);
    line-height: 1.3;
}

.nvx-check:hover .nvx-check__box { border-color: var(--nvx-f-accent); }
.nvx-check__input:focus-visible + .nvx-check__box { box-shadow: 0 0 0 3px var(--nvx-f-accent-ring); }
.nvx-check__input:checked + .nvx-check__box {
    background: var(--nvx-f-accent);
    border-color: var(--nvx-f-accent);
    color: #fff;
}
.nvx-check:active .nvx-check__box { transform: scale(0.94); }

.nvx-radio__dot {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--nvx-f-border-strong);
    background: var(--nvx-f-surface);
    position: relative;
    transition: border-color 0.22s var(--nvx-f-ease), box-shadow 0.22s var(--nvx-f-ease), transform 0.15s var(--nvx-f-ease);
}

.nvx-radio__dot::after {
    content: "";
    position: absolute;
    inset: 4.5px;
    border-radius: 50%;
    background: var(--nvx-f-accent);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s var(--nvx-f-ease), transform 0.2s var(--nvx-f-ease);
}

.nvx-radio__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--nvx-f-text);
}

.nvx-radio:hover .nvx-radio__dot { border-color: var(--nvx-f-accent); }
.nvx-radio__input:focus-visible + .nvx-radio__dot { box-shadow: 0 0 0 3px var(--nvx-f-accent-ring); }
.nvx-radio__input:checked + .nvx-radio__dot { border-color: var(--nvx-f-accent); }
.nvx-radio__input:checked + .nvx-radio__dot::after { opacity: 1; transform: scale(1); }
.nvx-radio:active .nvx-radio__dot { transform: scale(0.94); }

/* ---------- Tags (product_tag chips) ---------- */
.nvx-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 74px;
    overflow-y: auto;
    padding-right: 2px;
}

.nvx-tag {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
}

.nvx-tag__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.nvx-tag__box {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--nvx-f-border-strong);
    background: var(--nvx-f-surface);
    color: var(--nvx-f-text-2);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.2;
    transition: background 0.2s var(--nvx-f-ease), border-color 0.2s var(--nvx-f-ease), color 0.2s var(--nvx-f-ease), box-shadow 0.2s var(--nvx-f-ease);
}

.nvx-tag:hover .nvx-tag__box { border-color: var(--nvx-f-accent); color: var(--nvx-f-text); }
.nvx-tag__input:focus-visible + .nvx-tag__box { box-shadow: 0 0 0 3px var(--nvx-f-accent-ring); }
.nvx-tag__input:checked + .nvx-tag__box {
    background: var(--nvx-f-accent-soft);
    border-color: var(--nvx-f-accent);
    color: var(--nvx-f-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1);
}

/* ---------- Text field ---------- */
.nvx-field--text .nvx-field__control {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--nvx-f-border-strong);
    border-radius: var(--nvx-f-radius-sm);
    background: var(--nvx-f-surface);
    color: var(--nvx-f-text);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color 0.25s var(--nvx-f-ease), box-shadow 0.25s var(--nvx-f-ease);
}

.nvx-field--text .nvx-field__control::placeholder { color: var(--nvx-f-text-3); }
.nvx-field--text .nvx-field__control:hover { border-color: rgba(15, 23, 42, 0.28); }
.nvx-field--text .nvx-field__control:focus-visible {
    outline: none;
    border-color: var(--nvx-f-accent);
    box-shadow: 0 0 0 3px var(--nvx-f-accent-ring);
}

/* ---------- Footer / CTA ---------- */
.nvx-filter__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--nvx-f-border);
}

.nvx-btn--primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 6px 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--nvx-f-accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 18px -6px rgba(79, 70, 229, 0.5);
    transition: background 0.28s var(--nvx-f-ease), box-shadow 0.28s var(--nvx-f-ease), transform 0.15s var(--nvx-f-ease);
}

.nvx-filter-field--submit .nvx-btn--primary { width: 100%; justify-content: center; }

.nvx-btn__label { white-space: nowrap; }

.nvx-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transition: transform 0.28s var(--nvx-f-ease), background 0.28s var(--nvx-f-ease);
}

.nvx-btn--primary:hover {
    background: var(--nvx-f-accent-strong);
    box-shadow: 0 10px 24px -8px rgba(79, 70, 229, 0.6);
}
.nvx-btn--primary:hover .nvx-btn__icon { transform: translateX(2px); background: rgba(255, 255, 255, 0.26); }
.nvx-btn--primary:active { transform: scale(0.98); }
.nvx-btn--primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--nvx-f-accent-ring), 0 6px 18px -6px rgba(79, 70, 229, 0.5); }
.nvx-btn--primary:disabled { opacity: 0.65; cursor: wait; transform: none; }

.nvx-filter--premium.nvx-filter-loading .nvx-btn--primary {
    pointer-events: none;
}

.nvx-filter--premium.nvx-filter-loading .nvx-btn__label::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    vertical-align: -2px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: nvx-filter-spin 0.7s linear infinite;
}

@keyframes nvx-filter-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Прелоадер каскада (AJAX-наполнение опций) ---------- */
.nvx-field--cascade.nvx-cascade-loading .nvx-field__arrow {
    display: none;
}

.nvx-field--cascade.nvx-cascade-loading::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid var(--nvx-f-border-strong);
    border-top-color: var(--nvx-f-accent-strong);
    animation: nvx-filter-spin 0.7s linear infinite;
    pointer-events: none;
}

/* ---------- Прелоадер результатов при AJAX-подмене списка ---------- */
.nvx-results-loading {
    position: relative;
    pointer-events: none;
    min-height: 160px;
}

.nvx-results-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    border-radius: 10px;
    z-index: 8;
}

.nvx-results-loading::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 64px;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border-radius: 50%;
    border: 3px solid var(--nvx-f-border-strong);
    border-top-color: var(--nvx-f-accent-strong);
    animation: nvx-filter-spin 0.7s linear infinite;
    z-index: 9;
}

.nvx-filter__hint {
    font-size: 13px;
    color: var(--nvx-f-text-3);
    text-align: right;
}

/* ---------- Chips ---------- */
.nvx-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.nvx-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    background: var(--nvx-f-surface);
    box-shadow: inset 0 0 0 1px var(--nvx-f-accent-ring), 0 1px 3px rgba(15, 23, 42, 0.06);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    color: var(--nvx-f-text);
    animation: nvx-filter-chip-in 0.3s var(--nvx-f-ease);
    transition: box-shadow 0.2s var(--nvx-f-ease), transform 0.15s var(--nvx-f-ease);
}

.nvx-filter-chip:hover {
    box-shadow: inset 0 0 0 1px var(--nvx-f-accent), 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Подпись фильтра — вторичная, значение — контрастное (как label/value в маркетплейсах). */
.nvx-filter-chip-name {
    color: var(--nvx-f-text-3);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.nvx-filter-chip-name::after {
    content: "·";
    margin-left: 6px;
    color: var(--nvx-f-text-3);
    opacity: 0.7;
}

.nvx-filter-chip-value {
    color: var(--nvx-f-text);
    font-weight: 600;
}

.nvx-filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--nvx-f-accent-soft);
    color: var(--nvx-f-accent-strong);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s var(--nvx-f-ease), color 0.2s var(--nvx-f-ease), transform 0.15s var(--nvx-f-ease);
}

.nvx-filter-chip-remove:hover { background: rgba(225, 29, 72, 0.16); color: var(--nvx-f-danger); }
.nvx-filter-chip-remove:active { transform: scale(0.88); }
.nvx-filter-chip-remove:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--nvx-f-accent-ring); }

@keyframes nvx-filter-chip-in {
    from { opacity: 0; transform: translateY(4px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

/* ---------- Load-in ---------- */
.nvx-filter--premium {
    animation: nvx-filter-in 0.45s var(--nvx-f-ease);
}

@keyframes nvx-filter-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .nvx-filter__panel { padding: 16px 18px; }
    .nvx-filter-field { flex-basis: 140px; }
    .nvx-filter-field--checks { flex-basis: 190px; }
}

@media (max-width: 767px) {
    .nvx-filter--premium { margin-bottom: 20px; }
    .nvx-filter__panel { padding: 14px; border-radius: 16px; }
    .nvx-filter__shell { border-radius: 21px; }
    .nvx-filter__head { flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; }
    .nvx-filter-field { flex-basis: calc(50% - 5px); max-width: none; }
    .nvx-filter-field--submit { flex-basis: 100%; }
}

@media (max-width: 419px) {
    .nvx-filter-field { flex-basis: 100%; }
    .nvx-filter__title { font-size: 14px; }
    .nvx-filter__subtitle { font-size: 12px; }
}

/* ---------- Layout: sidebar (left / right) ---------- */
.nvx-filter--premium.nvx-filter--layout-left,
.nvx-filter--premium.nvx-filter--layout-right {
    margin: 0 0 0;
}

.nvx-filter--layout-left .nvx-filter__panel,
.nvx-filter--layout-right .nvx-filter__panel {
    padding: 18px 20px;
}

.nvx-filter--layout-left .nvx-filter__grid,
.nvx-filter--layout-right .nvx-filter__grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.nvx-filter--layout-left .nvx-filter-field,
.nvx-filter--layout-right .nvx-filter-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
}

.nvx-filter--layout-left .nvx-filter-field--submit,
.nvx-filter--layout-right .nvx-filter-field--submit {
    align-self: stretch;
}

.nvx-filter--layout-left .nvx-filter-field--checks,
.nvx-filter--layout-right .nvx-filter-field--checks {
    flex-basis: auto;
}

.nvx-filter--layout-left .nvx-filter-label,
.nvx-filter--layout-right .nvx-filter-label {
    white-space: normal;
    line-height: 1.4;
}

.nvx-filter--layout-left .nvx-filter__head,
.nvx-filter--layout-right .nvx-filter__head {
    align-items: flex-start;
    flex-wrap: wrap;
}

/* П.6: подзаголовок только в горизонтальном режиме (top). */
.nvx-filter--layout-left .nvx-filter__subtitle,
.nvx-filter--layout-right .nvx-filter__subtitle {
    display: none;
}

.nvx-filter--layout-left .nvx-filter-tags,
.nvx-filter--layout-right .nvx-filter-tags {
    max-height: none;
    overflow: visible;
}

/* ---------- Sidebar: сворачиваемые виджеты полей ---------- */
.nvx-filter--premium.nvx-filter--sidebar .nvx-filter__grid {
    gap: 10px;
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    gap: 0;
    padding: 4px 14px;
    background: var(--nvx-f-shell);
    border: 1px solid var(--nvx-f-border);
    border-radius: 14px;
    transition: border-color 0.25s var(--nvx-f-ease), box-shadow 0.25s var(--nvx-f-ease);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--open {
    border-color: var(--nvx-f-border-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--submit {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 11px 0;
    cursor: pointer;
    user-select: none;
}

/* Заголовок занимает всё левое пространство, бейдж и шеврон — справа. */
.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__head > .nvx-filter-label,
.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__head > .nvx-filter-label-row {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: auto;
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__head .nvx-filter-label {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
    color: var(--nvx-f-text);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__head .nvx-filter-slider__value {
    font-size: 12px;
    color: var(--nvx-f-accent-strong);
}

.nvx-filter-field__chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--nvx-f-surface);
    box-shadow: inset 0 0 0 1px var(--nvx-f-border-strong);
    position: relative;
    transition: transform 0.28s var(--nvx-f-ease), background 0.25s var(--nvx-f-ease), box-shadow 0.25s var(--nvx-f-ease);
}

/* Бейдж-счётчик заданных значений поля (Ozon-паттерн). */
.nvx-filter-field__badge {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--nvx-f-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.nvx-filter-field__badge[hidden] { display: none; }

/* Поле с заданным значением: подсветка заголовка и шеврона. */
.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--has-value > .nvx-filter-field__head .nvx-filter-label {
    color: var(--nvx-f-accent-strong);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--has-value > .nvx-filter-field__head .nvx-filter-field__chevron {
    background: var(--nvx-f-accent-soft);
    box-shadow: inset 0 0 0 1px var(--nvx-f-accent);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--has-value > .nvx-filter-field__head .nvx-filter-field__chevron::before,
.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--has-value > .nvx-filter-field__head .nvx-filter-field__chevron::after {
    background: var(--nvx-f-accent-strong);
}

.nvx-filter-field__chevron::before,
.nvx-filter-field__chevron::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 1.8px;
    border-radius: 2px;
    background: var(--nvx-f-text-2);
    transform-origin: center;
    transition: transform 0.28s var(--nvx-f-ease), background 0.25s var(--nvx-f-ease), opacity 0.25s var(--nvx-f-ease);
}

/* «+» в закрытом виде: горизонтальная + вертикальная линии. */
.nvx-filter-field__chevron::before { transform: translate(-50%, -50%) rotate(0deg); }
.nvx-filter-field__chevron::after { transform: translate(-50%, -50%) rotate(90deg); }

.nvx-filter-field__head:hover .nvx-filter-field__chevron {
    box-shadow: inset 0 0 0 1px var(--nvx-f-accent);
}

.nvx-filter-field__head:hover .nvx-filter-field__chevron::before,
.nvx-filter-field__head:hover .nvx-filter-field__chevron::after {
    background: var(--nvx-f-accent);
}

/* «−» в открытом виде: вертикальная линия скрывается. */
.nvx-filter-field--open > .nvx-filter-field__head .nvx-filter-field__chevron {
    background: var(--nvx-f-accent-soft);
    box-shadow: inset 0 0 0 1px var(--nvx-f-accent);
}

.nvx-filter-field--open > .nvx-filter-field__head .nvx-filter-field__chevron::before,
.nvx-filter-field--open > .nvx-filter-field__head .nvx-filter-field__chevron::after {
    background: var(--nvx-f-accent-strong);
}

.nvx-filter-field--open > .nvx-filter-field__head .nvx-filter-field__chevron::after {
    transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
    opacity: 0;
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field__body {
    display: none;
    padding: 12px 0 14px;
    border-top: 1px dashed var(--nvx-f-border);
}

.nvx-filter--premium.nvx-filter--sidebar .nvx-filter-field--open > .nvx-filter-field__body {
    display: block;
}

/* ---------- Гео-кнопка в панели фильтра ---------- */
.nvx-filter__actions .nvx-geo-map-trigger-wrap {
    margin-top: 0;
}

.nvx-filter__actions .nvx-geo-map-trigger {
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--nvx-f-accent-soft);
    color: var(--nvx-f-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.14);
    font-size: 12.5px;
    font-weight: 600;
}

.nvx-filter__actions .nvx-geo-map-trigger:hover {
    background: rgba(79, 70, 229, 0.16);
}

.nvx-filter__actions .nvx-geo-map-trigger .nvx-geo-map-icon {
    font-size: 13px;
}

/* В вертикальных макетах (left/right) шапка узкая (306px): счётчик, сброс и гео-кнопка
   уезжают на свою строку (actions flex:1 1 100%), а гео-кнопка занимает её всю ширину,
   иначе их max-content (399px) вылезает за сайдбар (горизонтальный оверфлоу в right). */
.nvx-filter--premium.nvx-filter--layout-left .nvx-filter__actions,
.nvx-filter--premium.nvx-filter--layout-right .nvx-filter__actions {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}

.nvx-filter--premium.nvx-filter--layout-left .nvx-filter__actions .nvx-geo-map-trigger-wrap,
.nvx-filter--premium.nvx-filter--layout-right .nvx-filter__actions .nvx-geo-map-trigger-wrap {
    flex: 1 1 100%;
    margin-top: 8px;
}

.nvx-filter--premium.nvx-filter--layout-left .nvx-filter__actions .nvx-geo-map-trigger,
.nvx-filter--premium.nvx-filter--layout-right .nvx-filter__actions .nvx-geo-map-trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    white-space: normal;
    text-align: left;
}

/* ---------- Layout: top — одна линия, равная высота ---------- */
.nvx-filter--premium.nvx-filter--layout-top .nvx-filter__grid {
    flex-wrap: nowrap;
    align-items: stretch;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field {
    flex: 1 1 0;
    max-width: none;
    min-height: 74px;
    justify-content: flex-end;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--checks {
    flex-basis: 0;
    max-width: none;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--price {
    flex-basis: 0;
    max-width: none;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-slider--price {
    height: 40px;
    margin-top: 0;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-slider__scale {
    display: none;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--submit {
    align-self: stretch;
    display: flex;
    align-items: flex-end;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--submit .nvx-btn--primary {
    width: auto;
    min-width: 148px;
    justify-content: center;
}

@media (max-width: 1199px) {
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter__grid {
        flex-wrap: wrap;
    }
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field {
        flex: 1 1 30%;
        max-width: none;
        min-height: 0;
    }
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter-slider__scale {
        display: flex;
    }
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter-slider--price {
        height: 28px;
        margin-top: 4px;
    }
}

/* ---------- Бюджет в шапке (layout=top): компактно справа от заголовка ---------- */
.nvx-filter--premium.nvx-filter--layout-top .nvx-filter__actions {
    gap: 10px;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget {
    flex: 0 0 auto;
    max-width: 320px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border: 1px solid var(--nvx-f-border);
    border-radius: 12px;
    background: var(--nvx-f-surface);
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget .nvx-filter-label-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    flex: 0 0 auto;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget .nvx-filter-label {
    font-size: 12px;
    color: var(--nvx-f-text-2);
    white-space: nowrap;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget .nvx-filter-slider__value {
    font-size: 12px;
    font-weight: 650;
    color: var(--nvx-f-text);
    white-space: nowrap;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget .nvx-filter-slider--price {
    flex: 1 1 150px;
    min-width: 130px;
    height: 18px;
    margin: 0;
}

.nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget .nvx-filter-slider__scale {
    display: none;
}

@media (max-width: 1199px) {
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter__head {
        flex-wrap: wrap;
    }
    .nvx-filter--premium.nvx-filter--layout-top .nvx-filter-field--budget {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* ---------- Сетка, построенная плагином для layout left/right ---------- */
.nvx-filter-layout-row {
    align-items: flex-start;
}

.nvx-filter-layout-row .nvx-filter-sidebar-col {
    align-self: flex-start;
    min-width: 0;
}

/* ---------- Mobile: канвас-фильтр (bottom-sheet) ---------- */
/* Кнопка-триггер (перенесённая кнопка «Расширенный поиск» темы или собственная)
   видна только на мобильных; на десктопе бар скрыт. */
.nvx-filter-mobile-bar { display: none; }

@media (max-width: 767px) {
    .nvx-filter-mobile-bar {
        display: block;
        margin: 0 0 12px;
    }

    .nvx-filter-mobile-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        position: relative;
    }

    /* Счётчик активных фильтров на кнопке канваса (Ozon-паттерн «Фильтры (N)»). */
    .nvx-filter-mobile-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 999px;
        background: var(--nvx-f-accent, #ee4710);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .nvx-filter-mobile-count[hidden] { display: none; }

    .nvx-filter-mobile-trigger .wr-icon-sliders { font-size: 16px; }

    /* Форма становится выезжающим снизу канвасом и уходит из потока
       при любом layout (top / left / right). */
    .nvx-filter--premium.nvx-filter--canvas {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10001;
        margin: 0;
        max-height: 88vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -14px 44px rgba(15, 18, 34, 0.3);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.34s var(--nvx-f-ease), visibility 0.34s;
    }

    .nvx-filter--premium.nvx-filter--canvas .nvx-filter__shell,
    .nvx-filter--premium.nvx-filter--canvas .nvx-filter__panel {
        border-radius: 18px 18px 0 0;
    }

    .nvx-filter--premium.nvx-filter--canvas .nvx-filter-field {
        flex-basis: 100%;
        max-width: none;
    }

    body.nvx-filter-canvas-open { overflow: hidden; }

    body.nvx-filter-canvas-open .nvx-filter--premium.nvx-filter--canvas {
        transform: translateY(0);
        visibility: visible;
    }

    .nvx-filter-mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(15, 18, 34, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.34s var(--nvx-f-ease), visibility 0.34s;
    }

    body.nvx-filter-canvas-open .nvx-filter-mobile-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Чипсы внутри канваса на читаемом фоне (не прозрачном). */
    .nvx-filter--premium.nvx-filter--canvas .nvx-filter-chips {
        background: var(--nvx-f-surface);
        border: 1px solid var(--nvx-f-border);
        border-radius: var(--nvx-f-radius-sm);
        padding: 10px 12px;
        margin: 12px 12px 0;
    }

    /* Кнопка закрытия канваса (в шапке формы). */
    .nvx-filter-mobile-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--nvx-f-shell);
        color: var(--nvx-f-text-2);
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        transition: background 0.2s var(--nvx-f-ease), color 0.2s var(--nvx-f-ease);
    }

    .nvx-filter-mobile-close:hover {
        background: var(--nvx-f-accent-soft);
        color: var(--nvx-f-accent-strong);
    }
}

/* ============================================================
   Workreap Skin
   Скин «Тема Workreap» — переопределяет переменные дизайн-системы
   токенами темы (--themecolor / --bodyfont, радиус 10px).
   Выбирается в настройках админки (Фильтры → Стиль оформления).
   ============================================================ */
.nvx-filter--premium.nvx-filter--skin-workreap,
.nvx-filter-chips.nvx-filter--skin-workreap {
    --nvx-f-accent: var(--themecolor, #ee4710);
    --nvx-f-accent-strong: #d83f0c;
    --nvx-f-accent-soft: rgba(238, 71, 16, 0.10);
    --nvx-f-accent-ring: rgba(238, 71, 16, 0.26);
    --nvx-f-surface: #FFFFFF;
    --nvx-f-shell: #F2F2F2;
    --nvx-f-border: rgba(10, 15, 38, 0.10);
    --nvx-f-border-strong: rgba(10, 15, 38, 0.20);
    --nvx-f-text: #0A0F26;
    --nvx-f-text-2: #353648;
    --nvx-f-text-3: #676767;
    --nvx-f-danger: #E11D48;
    --nvx-f-radius: 12px;
    --nvx-f-radius-sm: 8px;
    --nvx-f-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(10, 15, 38, 0.12);
    --nvx-f-ease: cubic-bezier(0.22, 1, 0.36, 1);

    font-family: var(--bodyfont, 'Inter', sans-serif);
}

.nvx-filter--premium.nvx-filter--skin-workreap .nvx-filter__shell {
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(10, 15, 38, 0.06);
}

.nvx-filter--premium.nvx-filter--skin-workreap .nvx-filter__panel {
    border-radius: 10px;
}

.nvx-filter--premium.nvx-filter--skin-workreap .nvx-filter__title {
    color: var(--nvx-f-text);
}

/* Кнопка «Применить» в стиле .wr-btn-solid-lg темы. */
.nvx-filter--premium.nvx-filter--skin-workreap .nvx-btn--primary {
    border-radius: 10px;
    font: 500 15px/25px 'Inter', sans-serif;
    box-shadow: none;
}

.nvx-filter--premium.nvx-filter--skin-workreap .nvx-btn--primary:hover {
    box-shadow: 0 6px 18px -8px var(--nvx-f-accent-ring);
}

.nvx-filter--premium.nvx-filter--skin-workreap .nvx-filter__actions .nvx-geo-map-trigger {
    border-radius: 10px;
}
