.cfv2-root {
    position: relative;
}

.cfv2-layout {
    align-items: flex-start;
}

.cfv2-sidebar-column {
    position: sticky;
    top: var(--header-height, 100px);
    z-index: 20;
}

.cfv2-sidebar-panel {
    max-height: calc(100vh - var(--header-height, 100px) - 20px);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
}

.cfv2-sidebar-header,
.cfv2-sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #edf0f3;
}

.cfv2-sidebar-header {
    font-size: 16px;
}

.cfv2-sidebar-actions {
    padding-top: 10px;
    padding-bottom: 10px;
}

.cfv2-sidebar-selected {
    font-size: 12px;
    color: #64748b;
}

.cfv2-mobile-close {
    display: none;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-filter-list {
    max-height: calc(100vh - var(--header-height, 100px) - 125px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.cfv2-group {
    border-bottom: 1px solid #edf0f3;
}

.cfv2-group-heading {
    position: relative;
    display: flex;
    align-items: center;
}

.cfv2-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 14px 42px 14px 16px;
    border: 0;
    background: #fff;
    text-align: left;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.cfv2-group-caption {
    min-width: 0;
    flex: 1 1 auto;
}

.cfv2-group-caption small {
    color: #64748b;
    font-weight: 400;
}

.cfv2-group-selected {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 8px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e8f2ff;
    color: #1677d2;
    font-size: 12px;
}

.cfv2-group-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-left: 9px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .2s ease, color .15s ease;
}

.cfv2-group--open .cfv2-group-arrow {
    transform: rotate(180deg);
}

.cfv2-group-reset {
    position: absolute;
    right: 42px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    padding: 2px 4px;
    border: 0;
    background: #fff;
    color: #dc3545;
    font-size: 11px;
    cursor: pointer;
}

.cfv2-group-body {
    display: none;
    padding: 0 16px 16px;
}

.cfv2-group--open .cfv2-group-body {
    display: block;
}

.cfv2-search-input {
    margin-bottom: 10px;
}

.cfv2-options {
    display: grid;
    grid-template-columns: repeat(var(--cfv2-columns, 1), minmax(0, 1fr));
    gap: 7px 14px;
}

.cfv2-options--scroll {
    min-height: 0;
    max-height: calc(var(--cfv2-visible-rows, 10) * 31px);
    overflow-y: auto;
    padding-right: 6px;
    align-content: start;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Длинный раскрытый список остаётся внутри собственного viewport и никогда
   не увеличивает высоту документа тысячами grid-строк. */
.cfv2-options--expanded-viewport {
    height: min(52vh, calc(var(--cfv2-visible-rows, 10) * 31px));
    max-height: min(52vh, calc(var(--cfv2-visible-rows, 10) * 31px));
    overflow-y: auto;
    contain: layout paint;
    content-visibility: auto;
}


/* ===== CFV2 v70: постоянно видимый индикатор неполного списка ===== */
.cfv2-options-host {
    position: relative;
    min-width: 0;
}

.cfv2-options-scrollport {
    min-width: 0;
}

.cfv2-options-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    margin-top: 8px;
    padding: 9px 0 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.cfv2-options-footer[hidden] {
    display: none !important;
}

.cfv2-group--has-hidden-values .cfv2-options-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96));
}

.cfv2-options-footer-summary {
    min-width: 0;
    color: #7b8ca3;
    font-size: 11px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.cfv2-options-footer .cfv2-show-more {
    flex: 0 0 auto;
    min-height: 30px;
    margin-top: 0;
    padding: 4px 0;
    font-size: 14px;
    white-space: nowrap;
}

.cfv2-options-footer .cfv2-show-more::after {
    content: '↓';
    margin-left: 5px;
    font-size: 12px;
    line-height: 1;
}

.cfv2-options-footer .cfv2-show-more[data-virtual-action="collapse"]::after {
    content: '↑';
}

.cfv2-show-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 12px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px dashed currentColor;
    background: transparent;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
}

.cfv2-show-more:hover,
.cfv2-show-more:focus-visible {
    color: #1d4ed8;
    outline: none;
}

.cfv2-show-more[hidden] {
    display: none !important;
}

.cfv2-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: start;
    gap: 7px;
    min-width: 0;
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.35;
    cursor: pointer;
}

.cfv2-option[hidden] {
    display: none !important;
}

.cfv2-option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cfv2-checkbox {
    position: relative;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background: #fff;
}

.cfv2-option-input:checked + .cfv2-checkbox {
    border-color: #2f80ed;
    background: #2f80ed;
}

.cfv2-option-input:checked + .cfv2-checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cfv2-option-input:focus-visible + .cfv2-checkbox {
    outline: 2px solid rgba(47, 128, 237, .35);
    outline-offset: 2px;
}

.cfv2-option-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cfv2-search-highlight {
    padding: 0 1px;
    border-radius: 3px;
    color: inherit;
    background: rgba(255, 211, 92, .32);
    box-shadow: inset 0 -1px 0 rgba(190, 128, 0, .16);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.cfv2-option-count {
    color: #94a3b8;
    font-size: 12px;
}

.cfv2-search-empty {
    padding: 10px 0 0;
    color: #94a3b8;
    font-size: 12px;
}

.cfv2-range {
    --cfv2-range-left: 0%;
    --cfv2-range-right: 0%;
}

.cfv2-range-numbers,
.cfv2-range-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cfv2-range-numbers label {
    flex: 1 1 0;
    min-width: 0;
    color: #64748b;
    font-size: 12px;
}

.cfv2-range-number {
    width: 100%;
    margin-top: 4px;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.cfv2-range-track {
    position: relative;
    height: 30px;
    margin: 12px 2px 4px;
}

.cfv2-range-track::before,
.cfv2-range-fill {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 14px;
    height: 4px;
    border-radius: 2px;
}

.cfv2-range-track::before {
    background: #dbe3ec;
}

.cfv2-range-fill {
    left: var(--cfv2-range-left);
    right: var(--cfv2-range-right);
    background: #2f80ed;
}

.cfv2-range-input {
    position: absolute;
    left: 0;
    top: 7px;
    width: 100%;
    height: 18px;
    margin: 0;
    pointer-events: none;
    appearance: none;
    background: transparent;
}

.cfv2-range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: #2f80ed;
    box-shadow: 0 0 0 2px #fff, 0 1px 5px rgba(15, 23, 42, .25);
    appearance: none;
    pointer-events: auto;
    cursor: grab;
}

.cfv2-range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #2f80ed;
    box-shadow: 0 0 0 2px #fff, 0 1px 5px rgba(15, 23, 42, .25);
    pointer-events: auto;
    cursor: grab;
}

.cfv2-range-labels {
    color: #64748b;
    font-size: 12px;
}

.cfv2-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
}

.cfv2-mobile-open {
    display: none;
}


.cfv2-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cfv2-global-search {
    position: relative;
    flex: 1 1 520px;
    min-width: 260px;
    max-width: 760px;
}

.cfv2-global-search-control {
    position: relative;
    display: flex;
    align-items: center;
}

.cfv2-global-search-icon {
    position: absolute;
    left: 12px;
    width: 15px;
    height: 15px;
    border: 1.7px solid #94a3b8;
    border-radius: 50%;
    pointer-events: none;
}

.cfv2-global-search-icon::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 1.7px;
    border-radius: 2px;
    background: #94a3b8;
    transform: rotate(45deg);
    transform-origin: left center;
}

.cfv2-global-search-input {
    width: 100%;
    min-height: 38px;
    padding: 8px 38px 8px 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cfv2-global-search-input::-webkit-search-cancel-button {
    display: none;
}

.cfv2-global-search-input:focus,
.cfv2-global-search--open .cfv2-global-search-input {
    border-color: #7db5ff;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, .1);
}

.cfv2-global-search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-global-search-clear:hover,
.cfv2-global-search-clear:focus-visible {
    background: #f1f5f9;
    color: #475569;
}

.cfv2-global-search-dropdown {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: min(520px, 66vh);
    overflow: auto;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
    overscroll-behavior: contain;
}

.cfv2-global-search-results {
    padding: 6px 0;
}

.cfv2-global-search-group + .cfv2-global-search-group {
    border-top: 1px solid #edf2f7;
}

.cfv2-global-search-group-title {
    padding: 8px 13px 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.cfv2-global-search-result {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 7px 13px;
    border: 0;
    background: transparent;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.cfv2-global-search-result:hover,
.cfv2-global-search-result:focus-visible {
    background: #f1f7ff;
    outline: none;
}

.cfv2-global-search-checkbox {
    position: relative;
    width: 15px;
    height: 15px;
    border: 1px solid #bfd0e4;
    border-radius: 3px;
    background: #fff;
}

.cfv2-global-search-result--selected .cfv2-global-search-checkbox {
    border-color: #2f80ed;
    background: #2f80ed;
}

.cfv2-global-search-result--selected .cfv2-global-search-checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cfv2-global-search-result-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cfv2-global-search-result-state {
    color: #94a3b8;
    font-size: 11px;
}

.cfv2-global-search-result--unavailable {
    color: #9aa7b7;
    cursor: default;
}

.cfv2-global-search-result--unavailable:hover,
.cfv2-global-search-result--unavailable:focus-visible {
    background: transparent;
}

.cfv2-global-search-summary,
.cfv2-global-search-empty {
    padding: 11px 13px;
    color: #64748b;
    font-size: 12px;
}

.cfv2-global-search-summary {
    border-top: 1px solid #edf2f7;
}

.cfv2-result-legend {
    margin-left: auto;
    color: #64748b;
    font-size: 13px;
}

.cfv2-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}

.cfv2-applied-label {
    color: #64748b;
    font-size: 13px;
}

.cfv2-chip-remove,
.cfv2-clear-link {
    border: 0;
    border-radius: 16px;
    background: #eef4fb;
    color: #334155;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.cfv2-clear-link {
    background: transparent;
    color: #dc3545;
}

.cfv2-cards-wrap {
    position: relative;
}

.cfv2-cards-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 160px;
    background: rgba(255, 255, 255, .78);
    color: #334155;
}

.cfv2-cards-overlay[hidden] {
    display: none !important;
}

.cfv2-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.cfv2-page-link,
.cfv2-page-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d8dee7;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    text-decoration: none;
}

.cfv2-page-link--active {
    border-color: #2f80ed;
    background: #2f80ed;
    color: #fff;
}

.cfv2-page-gap {
    border-color: transparent;
}

.cfv2-result-legend--bottom {
    margin: 10px 0 0;
    text-align: center;
}

.cfv2-preview {
    position: fixed;
    z-index: 1055;
    width: 190px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .2);
}

.cfv2-preview::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 34px;
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.cfv2-preview[hidden] {
    display: none !important;
}

.cfv2-preview-close {
    position: absolute;
    right: 8px;
    top: 5px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-preview-text {
    padding-right: 16px;
    color: #475569;
    font-size: 13px;
}

.cfv2-preview-count {
    display: block;
    margin: 2px 0 12px;
    color: #0f172a;
    font-size: 22px;
}

.cfv2-preview-apply {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 700;
}

.cfv2-preview--error .cfv2-preview-text {
    color: #dc3545;
}

/* v70: компактный preview встроен визуально в правую часть строки
 * глобального поиска. Он остаётся fixed-overlay и не участвует в потоке,
 * поэтому не растягивает фильтр и не сдвигает dropdown. */
@media (min-width: 992px) {
    .cfv2-global-search--with-preview .cfv2-global-search-input {
        padding-right: calc(var(--cfv2-global-preview-width, 270px) + 12px);
    }

    .cfv2-preview--global-inline {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 3px 4px 3px 9px;
        border-radius: 6px;
        box-shadow: none;
    }

    .cfv2-preview--global-inline::before,
    .cfv2-preview--global-inline .cfv2-preview-close {
        display: none;
    }

    .cfv2-preview--global-inline .cfv2-preview-text {
        min-width: 0;
        padding: 0;
        overflow: hidden;
        color: #64748b;
        font-size: 11px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cfv2-preview--global-inline .cfv2-preview-count {
        display: inline-block;
        min-width: 24px;
        margin: 0;
        font-size: 17px;
        line-height: 1;
        text-align: right;
    }

    .cfv2-preview--global-inline .cfv2-preview-apply {
        width: auto;
        min-width: 82px;
        min-height: 28px;
        padding: 4px 10px;
        border-radius: 5px;
        font-size: 12px;
        line-height: 1.1;
    }
}

.cfv2-sidebar-backdrop {
    display: none;
}

.cfv2-body-locked {
    overflow: hidden;
}

@media (max-width: 991px) {
    .cfv2-sidebar-column {
        position: static;
    }

    .cfv2-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        display: block;
        visibility: hidden;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .cfv2-sidebar-panel {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1045;
        width: min(390px, calc(100vw - 34px));
        max-height: none;
        border: 0;
        border-radius: 0;
        transform: translateX(-102%);
        transition: transform .24s ease;
    }

    .cfv2-sidebar-open .cfv2-sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .cfv2-sidebar-open .cfv2-sidebar-panel {
        transform: translateX(0);
    }

    .cfv2-mobile-close,
    .cfv2-mobile-open {
        display: inline-flex;
        align-items: center;
    }

    .cfv2-filter-list {
        max-height: calc(100vh - 116px);
        padding-bottom: 90px;
    }


    .cfv2-preview {
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: 12px;
        width: auto;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 4px 12px;
        padding: 12px 14px;
        border-radius: 12px;
    }

    .cfv2-preview::before {
        display: none;
    }

    .cfv2-preview-text {
        grid-column: 1;
        grid-row: 1;
    }

    .cfv2-preview-count {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        font-size: 18px;
    }

    .cfv2-preview-apply {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-width: 130px;
    }

    .cfv2-preview-close {
        display: none;
    }

    .cfv2-toolbar {
        flex-wrap: wrap;
    }

    .cfv2-result-legend {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 575px) {
    .cfv2-global-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .cfv2-preview {
        grid-template-columns: minmax(0, 1fr) 120px;
    }

    .cfv2-preview-apply {
        min-width: 0;
    }
}

/* --------------------------------------------------------------------------
 * Friendly UI v6: выбранные, недоступные значения и окно «Все фильтры»
 * ----------------------------------------------------------------------- */

@media (min-width: 992px) {
    .cfv2-sidebar-panel {
        max-height: none;
        overflow: visible;
    }

    .cfv2-filter-list {
        max-height: none;
        overflow: visible;
    }
}

.cfv2-sidebar-panel {
    border-color: #dfe7f1;
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(31, 54, 86, .08);
}

.cfv2-sidebar-header {
    align-items: flex-start;
    padding: 16px;
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.cfv2-sidebar-header-title {
    min-width: 0;
    flex: 1 1 auto;
}

.cfv2-sidebar-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cfv2-sidebar-header strong {
    display: block;
    color: #102a43;
    font-size: 17px;
    line-height: 1.2;
}

.cfv2-sidebar-subtitle {
    display: block;
    margin-top: 4px;
    color: #8293a8;
    font-size: 11px;
    line-height: 1.35;
}

.cfv2-sidebar-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px;
    background: #f7faff;
}

.cfv2-all-filters-open,
.cfv2-clear-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cfv2-all-filters-open {
    flex: 1 1 auto;
    border: 1px solid #cfe0f5;
    background: #fff;
    color: #1473e6;
}

.cfv2-all-filters-open:hover {
    border-color: #8ab9ef;
    background: #f2f8ff;
}

.cfv2-all-filters-badge {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: #1473e6;
    color: #fff;
    line-height: 19px;
    text-align: center;
}

.cfv2-clear-compact {
    flex: 0 0 auto;
    min-width: 82px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid transparent;
    background: #fff0f2;
    color: #d43d4f;
}

.cfv2-clear-compact:hover {
    background: #fff0f2;
}

.cfv2-filter-list {
    padding: 8px;
    background: #f7f9fc;
}

.cfv2-group {
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid #e1e8f1;
    border-radius: 9px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.cfv2-group:last-child {
    margin-bottom: 0;
}

.cfv2-group--selected {
    border-color: #b7d7ff;
    box-shadow: 0 0 0 2px rgba(20, 115, 230, .06);
}

.cfv2-group-toggle {
    min-height: 42px;
    padding: 10px 40px 10px 12px;
    color: #173a63;
    font-size: 13px;
}

.cfv2-group--selected .cfv2-group-toggle {
    color: #0969d8;
}

.cfv2-group-body {
    padding: 4px 12px 13px;
    border-top: 1px solid #edf2f7;
}

.cfv2-group-selected {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #1473e6;
    color: #fff;
    font-weight: 700;
}

.cfv2-search-input {
    margin: 8px 0 10px;
}

.cfv2-option {
    min-height: 23px;
    padding: 2px 3px;
    border-radius: 5px;
    transition: background .15s ease, opacity .15s ease;
}

.cfv2-option:hover {
    background: #f2f7fd;
}

.cfv2-option--selected {
    background: #edf6ff;
    color: #0f65bf;
    font-weight: 600;
}

.cfv2-option--disabled {
    opacity: .47;
    cursor: not-allowed;
}

.cfv2-option--disabled:hover {
    background: transparent;
}

.cfv2-option--disabled .cfv2-checkbox {
    background: #f2f4f7;
}

.cfv2-option-count {
    color: #7e9cbc;
}

.cfv2-unavailable {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed #d5deea;
}

.cfv2-unavailable[hidden] {
    display: none !important;
}

.cfv2-unavailable-title {
    margin-bottom: 7px;
    color: #95a6ba;
    font-size: 10px;
    line-height: 1.3;
}

.cfv2-options--disabled {
    max-height: 126px;
    overflow-y: auto;
    padding-right: 4px;
}

.cfv2-applied {
    padding: 2px 0 8px;
}

.cfv2-chip-remove {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #9ec8fa;
    background: #f2f8ff;
    color: #0969d8;
    font-weight: 600;
}

.cfv2-chip-remove:hover {
    border-color: #5ca0ef;
    background: #e5f2ff;
}

.cfv2-clear-link {
    border: 1px solid #ffc3ca;
    background: #fff7f8;
    color: #d6243b;
}

/* Все фильтры */
.cfv2-all-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.cfv2-all-modal[hidden] {
    display: none !important;
}

.cfv2-all-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 31, 54, .68);
    backdrop-filter: blur(2px);
}

.cfv2-all-modal-panel {
    position: absolute;
    inset: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: #f5f8fc;
    box-shadow: 0 24px 80px rgba(3, 19, 39, .34);
}

.cfv2-all-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px 16px;
    border-bottom: 1px solid #e2e9f2;
    background: #fff;
}

.cfv2-all-modal-header h2 {
    margin: 0;
    color: #0c2746;
    font-size: 22px;
    line-height: 1.2;
}

.cfv2-all-modal-header p {
    margin: 5px 0 0;
    color: #8496aa;
    font-size: 12px;
}

.cfv2-all-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f0f4f8;
    color: #71869e;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-all-modal-close:hover {
    background: #e4edf6;
    color: #274c73;
}

.cfv2-all-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px 24px;
}

.cfv2-all-modal-mount > .cfv2-filter-list {
    display: block;
    column-count: 3;
    column-gap: 14px;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
}

.cfv2-all-modal-mount .cfv2-group {
    display: inline-block;
    width: 100%;
    margin: 0 0 14px;
    break-inside: avoid;
    box-shadow: 0 3px 12px rgba(28, 58, 91, .045);
}

.cfv2-all-modal-mount .cfv2-group-body {
    display: block;
}

.cfv2-all-modal-mount .cfv2-options--scroll {
    max-height: 260px;
}

.cfv2-all-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 66px;
    padding: 11px 20px;
    border-top: 1px solid #dce5ef;
    background: #fff;
}

.cfv2-all-modal-status {
    min-width: 150px;
    margin-right: 8px;
    color: #71869e;
    font-size: 11px;
}

.cfv2-all-modal-count {
    display: block;
    color: #102a43;
    font-size: 18px;
}

.cfv2-all-modal-apply,
.cfv2-all-modal-reset {
    min-height: 38px;
    padding: 0 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cfv2-all-modal-apply {
    border: 1px solid #1473e6;
    background: #1473e6;
    color: #fff;
}

.cfv2-all-modal-apply:disabled {
    border-color: #b8c8d9;
    background: #b8c8d9;
    cursor: default;
}

.cfv2-all-modal-reset {
    border: 1px solid #ced9e5;
    background: #fff;
    color: #465f79;
}

@media (max-width: 1199px) {
    .cfv2-all-modal-mount > .cfv2-filter-list {
        column-count: 2;
    }
}

@media (max-width: 767px) {
    .cfv2-all-modal-panel {
        inset: 0;
        border-radius: 0;
    }

    .cfv2-all-modal-header {
        padding: 14px 16px;
    }

    .cfv2-all-modal-header h2 {
        font-size: 19px;
    }

    .cfv2-all-modal-body {
        padding: 10px;
    }

    .cfv2-all-modal-mount > .cfv2-filter-list {
        column-count: 1;
    }

    .cfv2-all-modal-footer {
        flex-wrap: wrap;
        justify-content: stretch;
        padding: 10px;
    }

    .cfv2-all-modal-status {
        flex: 1 1 100%;
        min-width: 0;
        margin: 0;
    }

    .cfv2-all-modal-apply,
    .cfv2-all-modal-reset {
        flex: 1 1 0;
    }

    .cfv2-filter-list {
        overflow-y: auto;
    }
}


/* ===== CFV2 v7: стабильный sticky, состояния выбора и блокировка ===== */
@media (min-width: 992px) {
    .cfv2-layout {
        align-items: stretch;
    }

    .cfv2-sidebar-column {
        position: relative !important;
        top: auto !important;
        align-self: stretch;
        z-index: 20;
    }

    .cfv2-sidebar-panel {
        position: relative;
        max-height: none;
        overflow: visible;
        transition: none !important;
        will-change: transform;
    }

    /* На desktop прокручивается страница, а не вся панель фильтра. */
    .cfv2-filter-list {
        max-height: none;
        overflow: visible;
        overscroll-behavior: auto;
        scrollbar-gutter: auto;
    }
}

.cfv2-group-selection-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 8px 0 10px;
    padding: 10px;
    border: 1px solid #cfe3fb;
    border-radius: 7px;
    background: #f4f9ff;
}

.cfv2-group-selection-summary[hidden] {
    display: none !important;
}

.cfv2-group-selection-caption {
    display: none;
}

.cfv2-group-selection-chip,
.cfv2-group-selection-more {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 16px;
    background: #e1efff;
    color: #0b65c2;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;
}

/* Черновой выбор остаётся на своём месте и выделяется мягко. */
.cfv2-option--pending {
    box-shadow: inset 3px 0 0 #89bdf3;
    background: #f1f7fe;
}


.cfv2-sidebar-panel,
.cfv2-all-modal-panel {
    position: relative;
}

.cfv2-filter-busy .cfv2-sidebar-panel,
.cfv2-filter-busy .cfv2-all-modal-panel {
    cursor: wait;
}

.cfv2-filter-busy .cfv2-sidebar-panel::after,
.cfv2-filter-busy .cfv2-all-modal-panel::after {
    content: attr(data-busy-text);
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 86px 18px 18px;
    background: rgba(255, 255, 255, .78);
    color: #173a63;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    pointer-events: auto;
    backdrop-filter: blur(1px);
}

.cfv2-filter-busy .cfv2-sidebar-panel::before,
.cfv2-filter-busy .cfv2-all-modal-panel::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 49px;
    z-index: 501;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    border: 3px solid #cfe2f7;
    border-top-color: #1473e6;
    border-radius: 50%;
    animation: cfv2-filter-spin .7s linear infinite;
    pointer-events: none;
}

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

@media (max-width: 991px) {
    .cfv2-filter-busy .cfv2-sidebar-panel::after,
    .cfv2-filter-busy .cfv2-all-modal-panel::after {
        padding-top: 90px;
    }
}


/* ===== CFV2 v9: направленное прилипание без scroll-transform ===== */
@media (min-width: 992px) {
    .cfv2-layout {
        align-items: stretch;
    }

    .cfv2-sidebar-column {
        position: relative !important;
        top: auto !important;
        align-self: stretch;
        min-height: 1px;
        overflow: visible;
    }

    .cfv2-sidebar-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-height: none;
        overflow: visible;
        transform: none !important;
        transition: none !important;
        will-change: auto;
        overflow-anchor: none;
    }

    .cfv2-filter-list {
        max-height: none;
        overflow: visible;
        overscroll-behavior: auto;
        scrollbar-gutter: auto;
    }
}

.cfv2-root,
.cfv2-sidebar-column,
.cfv2-sidebar-panel,
.cfv2-filter-list,
.cfv2-group,
.cfv2-options {
    overflow-anchor: none;
}

/* Count-запрос не блокирует и не затемняет фильтр. Полная загрузка блокирует
   элементы через inert, но без тяжёлого blur/полупрозрачного слоя. */
.cfv2-filter-busy .cfv2-sidebar-panel::before,
.cfv2-filter-busy .cfv2-sidebar-panel::after,
.cfv2-filter-busy .cfv2-all-modal-panel::before,
.cfv2-filter-busy .cfv2-all-modal-panel::after {
    display: none !important;
    content: none !important;
}

.cfv2-filter-busy .cfv2-sidebar-panel,
.cfv2-filter-busy .cfv2-all-modal-panel {
    opacity: 1;
    filter: none;
    backdrop-filter: none;
    cursor: wait;
}

/* Чекбокс при черновом выборе остаётся на месте без дополнительной перестройки. */
.cfv2-option,
.cfv2-option--pending {
    transition: none !important;
}

.cfv2-option--pending {
    box-shadow: none !important;
    background: transparent !important;
}

/* Числа имеют стабильную ширину, поэтому обновление count не двигает подписи. */
.cfv2-option-count {
    min-width: 3.5ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Недоступные значения остаются в исходной позиции. */
.cfv2-option--disabled {
    opacity: .48;
    background: transparent;
}

/* Внутригрупповые чипы показывают только уже применённые значения. */
button.cfv2-group-selection-chip {
    gap: 5px;
    border: 1px solid #b9d8fb;
    background: #e7f2ff;
    color: #075cad;
    cursor: pointer;
    font: inherit;
}

button.cfv2-group-selection-chip:hover,
button.cfv2-group-selection-chip:focus-visible {
    border-color: #1473e6;
    background: #dcebff;
    outline: none;
}

.cfv2-group-selection-chip-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1473e6;
    color: #fff;
    font-size: 12px;
    line-height: 1;
}


/* CFV2 v9: недоступные варианты видимы на прежних местах. */
.cfv2-unavailable:not([hidden]) {
    display: block;
    margin-top: 8px;
    padding-top: 7px;
}

.cfv2-unavailable .cfv2-options--disabled[hidden] {
    display: none !important;
}

.cfv2-unavailable-title {
    margin-bottom: 0;
    font-size: 11px;
}

.cfv2-option--disabled {
    display: grid;
    opacity: .48;
}


/* CFV2 v9: нормальный размер применённых чипов без служебных подписей. */
.cfv2-applied .cfv2-chip-remove {
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 17px;
    font-size: 13px;
    line-height: 1.25;
}


/* CFV2 v18: недоступные значения отдельным блоком, как в эталонном интерфейсе. */
.cfv2-unavailable {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d5deea;
}

.cfv2-unavailable-title {
    margin: 0 0 7px;
    color: #95a6ba;
    font-size: 11px;
    line-height: 1.3;
}

.cfv2-options--disabled {
    display: grid;
    max-height: 126px;
    overflow-y: auto;
    padding-right: 4px;
}

.cfv2-options--disabled[hidden],
.cfv2-unavailable[hidden] {
    display: none !important;
}

.cfv2-options--disabled .cfv2-option {
    opacity: .45;
    cursor: not-allowed;
}

.cfv2-options--disabled .cfv2-option:hover {
    background: transparent;
}

.cfv2-options--disabled .cfv2-checkbox {
    background: #f2f4f7;
}

/* v23: preview использует бинарную доступность, динамические количества не считаются. */
.cfv2-option-count {
    display: none !important;
}

.cfv2-preview-count:empty,
.cfv2-all-modal-count:empty {
    display: none;
}


/* ===== CFV2 v24: точный preview-count и восстановленная область sticky ===== */
@media (min-width: 992px) {
    .cfv2-sidebar-column {
        position: relative !important;
        top: auto !important;
        align-self: stretch;
        overflow: visible;
    }

    .cfv2-sidebar-panel {
        max-height: none;
        overflow: visible;
    }
}

.cfv2-preview-count,
.cfv2-all-modal-count {
    font-variant-numeric: tabular-nums;
}


/* ===== CFV2 v41: стабильная геометрия виртуальных групп =====
   Длинная группа получает единый внутренний viewport. При пересчёте фасетов
   доступные и недоступные значения меняются внутри него, не изменяя высоту
   карточки фильтра и не сдвигая соседние группы. */
@media (min-width: 992px) {
    .cfv2-group--stable-viewport .cfv2-options-host {
        display: flex;
        flex-direction: column;
        height: min(56vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
        min-height: min(56vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
        max-height: min(56vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
        overflow: hidden;
        contain: layout paint;
        overflow-anchor: none;
    }

    .cfv2-group--stable-viewport .cfv2-options-scrollport {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding-right: 4px;
        overscroll-behavior: contain;
        overflow-anchor: none;
        scrollbar-gutter: stable;
    }

    .cfv2-group--stable-viewport .cfv2-options-footer {
        flex: 0 0 auto;
        margin-top: auto;
    }

    .cfv2-group--stable-viewport .cfv2-options--available,
    .cfv2-group--stable-viewport .cfv2-options--disabled,
    .cfv2-group--stable-viewport .cfv2-options--scroll,
    .cfv2-group--stable-viewport .cfv2-options--expanded-viewport {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0;
        contain: none;
        content-visibility: visible;
    }

    .cfv2-all-modal-mount .cfv2-group--stable-viewport .cfv2-options-host {
        height: min(42vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
        min-height: min(42vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
        max-height: min(42vh, calc(var(--cfv2-stable-rows, 10) * 31px + 62px));
    }
}


/* ===== CFV2 v70: защита геометрии при фасетной перерисовке ===== */
.cfv2-group--stable-viewport .cfv2-options-host,
.cfv2-group--stable-viewport .cfv2-options-scrollport,
.cfv2-group--stable-viewport .cfv2-options-footer {
    box-sizing: border-box;
}

.cfv2-group--stable-viewport .cfv2-options-scrollport:empty {
    min-height: 1px;
}


/* ===== CFV2 v70: доступные и недоступные значения управляются отдельно ===== */
.cfv2-unavailable {
    margin-top: 9px;
    padding-top: 0;
    border-top: 1px dashed #d5deea;
}

.cfv2-unavailable-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #8ea0b6;
    font: inherit;
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.cfv2-unavailable-toggle:hover,
.cfv2-unavailable-toggle:focus-visible {
    color: #64748b;
    outline: none;
}

.cfv2-unavailable-toggle-text {
    min-width: 0;
}

.cfv2-unavailable-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease, color .15s ease;
}

.cfv2-unavailable-toggle[aria-expanded="true"] .cfv2-unavailable-toggle-icon {
    transform: rotate(180deg);
}

.cfv2-group--unavailable-expanded .cfv2-options--disabled {
    margin-top: 2px;
}

.cfv2-options-footer--complete .cfv2-options-footer-summary {
    color: #6f8198;
}


@media (max-width: 991px) {
    .cfv2-global-search {
        width: 100%;
    }

    .cfv2-global-search-dropdown {
        max-height: min(460px, 62vh);
    }
}


/* ===== CFV2 v70: понятный следующий шаг после выбора в глобальном поиске ===== */
.cfv2-preview-summary {
    min-width: 0;
}

.cfv2-preview-mainline {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.cfv2-preview-hint {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
}

.cfv2-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfv2-preview-reset {
    border: 0;
    background: transparent;
    color: #dc3545;
    padding: 5px 2px;
    font-size: 12px;
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-color: rgba(220, 53, 69, .35);
    text-underline-offset: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.cfv2-preview-reset:hover,
.cfv2-preview-reset:focus-visible {
    color: #b42332;
    text-decoration-color: currentColor;
    outline: none;
}

.cfv2-preview-reset[hidden] {
    display: none !important;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-actions {
    margin-top: 12px;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-apply {
    flex: 1 1 auto;
}

@media (min-width: 992px) {
    .cfv2-preview--global-inline {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 36px;
        padding: 4px 5px 4px 10px;
    }

    .cfv2-preview--global-inline .cfv2-preview-mainline {
        gap: 5px;
        line-height: 1.1;
    }

    .cfv2-preview--global-inline .cfv2-preview-text {
        flex: 0 1 auto;
        font-size: 11px;
    }

    .cfv2-preview--global-inline .cfv2-preview-count {
        flex: 0 0 auto;
        min-width: 20px;
        font-size: 17px;
    }

    .cfv2-preview--global-inline .cfv2-preview-hint {
        max-width: 220px;
        margin-top: 2px;
        overflow: hidden;
        font-size: 10px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cfv2-preview--global-inline .cfv2-preview-actions {
        gap: 7px;
    }

    .cfv2-preview--global-inline .cfv2-preview-reset {
        padding: 4px 0;
        font-size: 11px;
    }

    .cfv2-preview--global-inline .cfv2-preview-apply {
        min-width: 94px;
        max-width: 128px;
        padding-inline: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 991px) {
    .cfv2-preview-actions {
        justify-content: space-between;
    }
}

/* v70 corrections for the new preview structure. */
.cfv2-preview-mainline .cfv2-preview-text {
    padding-right: 0;
}

.cfv2-preview-mainline .cfv2-preview-count {
    display: inline-block;
    margin: 0;
}

.cfv2-preview-actions .cfv2-preview-apply {
    width: auto;
}


/* ===== CFV2 v70: multi-select combobox with fixed draft header ===== */
.cfv2-global-search-dropdown:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cfv2-global-search-draft {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-bottom: 1px solid #e5edf5;
    background: #f8fbff;
}

.cfv2-global-search-draft[hidden] {
    display: none !important;
}

.cfv2-global-search-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    max-height: 66px;
    overflow: auto;
    scrollbar-width: thin;
}

.cfv2-global-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: min(100%, 270px);
    min-height: 28px;
    padding: 4px 8px 4px 10px;
    border: 1px solid #bcd7ff;
    border-radius: 999px;
    background: #eaf4ff;
    color: #0b63ce;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.cfv2-global-search-chip:hover,
.cfv2-global-search-chip:focus-visible {
    border-color: #78adf5;
    background: #dceeff;
    outline: none;
}

.cfv2-global-search-chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfv2-global-search-chip-close {
    flex: 0 0 auto;
    color: #397fcf;
    font-size: 16px;
    line-height: 1;
}

.cfv2-global-search-chip-more,
.cfv2-global-search-chips-empty {
    color: #64748b;
    font-size: 12px;
}

.cfv2-global-search-chip-more {
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf2f7;
    white-space: nowrap;
}

.cfv2-global-search-draft-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
}

.cfv2-global-search-draft-status,
.cfv2-global-search-draft-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfv2-global-search-draft-status {
    min-width: 0;
    color: #52647a;
    font-size: 12px;
    white-space: nowrap;
}

.cfv2-global-search-draft-status strong {
    color: #0f172a;
    font-size: 14px;
}

.cfv2-global-search-cancel,
.cfv2-global-search-apply {
    min-height: 32px;
    padding: 6px 13px;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cfv2-global-search-cancel {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
}

.cfv2-global-search-cancel:hover,
.cfv2-global-search-cancel:focus-visible {
    border-color: #94a3b8;
    background: #f8fafc;
    outline: none;
}

.cfv2-global-search-apply {
    border: 1px solid #e92f45;
    background: #e92f45;
    color: #fff;
}

.cfv2-global-search-apply:hover,
.cfv2-global-search-apply:focus-visible {
    border-color: #cf1f35;
    background: #cf1f35;
    outline: none;
}

.cfv2-global-search-apply:disabled {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #8795a8;
    cursor: default;
}

.cfv2-global-search-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.cfv2-global-search-results:empty {
    padding: 0;
}

@media (min-width: 992px) {
    .cfv2-global-search--with-preview .cfv2-global-search-input {
        padding-right: 38px;
    }
}

@media (max-width: 640px) {
    .cfv2-global-search-draft-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .cfv2-global-search-draft-actions {
        justify-content: flex-end;
    }

    .cfv2-global-search-draft-status {
        justify-content: space-between;
    }

    .cfv2-global-search-draft-separator {
        display: none;
    }
}

/* ===== CFV2 v70: dropdown не участвует в layout, когда закрыт ===== */
.cfv2-global-search-dropdown[hidden] {
    display: none !important;
}


/* ===== CFV2 v81: popup результата рядом со всей панелью фильтра ===== */
.cfv2-preview:not(.cfv2-preview--global-inline) {
    width: 220px;
    max-width: min(220px, calc(100vw - 24px));
    padding: 12px;
    border-radius: 12px;
}


.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-mainline {
    align-items: baseline;
    gap: 6px;
    padding-right: 12px;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-text {
    font-size: 12px;
    white-space: nowrap;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-count {
    font-size: 20px;
    line-height: 1;
}

.cfv2-preview-selected {
    margin-top: 9px;
    padding-top: 8px;
    max-height: 116px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid #edf2f7;
    color: #475569;
    font-size: 13px;
    line-height: 1.3;
}

.cfv2-preview-selected[hidden] {
    display: none !important;
}

.cfv2-preview-selected-row + .cfv2-preview-selected-row {
    margin-top: 5px;
}

.cfv2-preview-selected-caption {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.cfv2-preview-selected-values {
    display: block;
    margin-top: 1px;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-weight: 600;
}

.cfv2-preview--global-inline .cfv2-preview-selected {
    display: none !important;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-hint,
.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-reset {
    display: none !important;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-actions {
    margin-top: 9px;
}

.cfv2-preview:not(.cfv2-preview--global-inline) .cfv2-preview-apply {
    width: 100%;
    min-height: 36px;
    border-radius: 8px;
    font-size: 13px;
}


/* ===== CFV2 v70: обучающая подсказка пустого глобального поиска ===== */
.cfv2-global-search-guide {
    position: relative;
    padding: 16px 44px 16px 16px;
    color: #475569;
}

.cfv2-global-search-guide-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-global-search-guide-close:hover,
.cfv2-global-search-guide-close:focus-visible {
    background: #f1f5f9;
    color: #475569;
    outline: none;
}

.cfv2-global-search-guide-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.cfv2-global-search-guide-text {
    max-width: 620px;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.cfv2-global-search-guide-subtitle {
    margin-top: 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.cfv2-global-search-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.cfv2-global-search-example {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid #dbe7f3;
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.cfv2-global-search-example:hover,
.cfv2-global-search-example:focus-visible {
    border-color: #9bc6fb;
    background: #eef6ff;
    outline: none;
}

.cfv2-global-search-example-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.cfv2-global-search-example-value {
    min-width: 0;
    overflow: hidden;
    color: #0b63ce;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfv2-global-search-example-field {
    min-width: 0;
    overflow: hidden;
    color: #7b8ba1;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfv2-global-search-example-arrow {
    color: #8ba2bd;
    font-size: 16px;
}

.cfv2-global-search-guide-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
    color: #8492a6;
    font-size: 11px;
}

@media (max-width: 640px) {
    .cfv2-global-search-examples {
        grid-template-columns: 1fr;
    }
}

/* ===== CFV2 v70: мобильная панель левого фильтра ===== */
.cfv2-mobile-footer {
    display: none;
}

@media (max-width: 991px) {
    .cfv2-sidebar-column {
        position: static !important;
        z-index: auto;
    }

    .cfv2-sidebar-backdrop {
        z-index: 2147483000;
        background: rgba(15, 23, 42, .56);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .cfv2-sidebar-panel {
        left: 0;
        top: 0;
        bottom: auto;
        z-index: 2147483001;
        display: flex;
        width: min(430px, 100vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        flex-direction: column;
        overflow: hidden;
        border: 0;
        border-radius: 0 16px 16px 0;
        background: #f7f9fc;
        box-shadow: 18px 0 48px rgba(15, 23, 42, .2);
        transform: translate3d(-102%, 0, 0);
        transition: transform .24s ease;
        will-change: transform;
    }

    .cfv2-sidebar-open .cfv2-sidebar-panel {
        transform: translate3d(0, 0, 0);
    }

    .cfv2-sidebar-header {
        position: relative;
        z-index: 3;
        flex: 0 0 auto;
        align-items: center;
        min-height: 64px;
        padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px;
        border-bottom: 1px solid #dfe7f1;
        background: #fff;
        box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
    }

    .cfv2-sidebar-header strong {
        font-size: 17px;
    }

    .cfv2-sidebar-subtitle {
        margin-top: 2px;
        font-size: 11px;
    }

    .cfv2-mobile-close {
        display: inline-flex;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid #dce5ef;
        border-radius: 12px;
        background: #f7f9fc;
        color: #52657c;
        font-size: 28px;
        line-height: 1;
        touch-action: manipulation;
    }

    .cfv2-mobile-close:active {
        background: #edf3f9;
        transform: scale(.97);
    }

    .cfv2-sidebar-header-actions {
        gap: 6px;
    }

    .cfv2-clear-compact {
        min-width: 72px;
        min-height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }

    .cfv2-filter-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 10px 10px 18px;
        background: #f7f9fc;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: auto;
    }

    .cfv2-group {
        margin-bottom: 9px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(31, 54, 86, .04);
    }

    .cfv2-group-toggle {
        min-height: 52px;
        padding: 12px 46px 12px 14px;
        font-size: 14px;
        line-height: 1.25;
        touch-action: manipulation;
    }

    .cfv2-group-reset {
        right: 46px;
        min-width: 36px;
        min-height: 32px;
        padding: 5px 6px;
        border-radius: 7px;
        font-size: 11px;
        touch-action: manipulation;
    }

    .cfv2-group-body {
        padding: 4px 12px 14px;
    }

    .cfv2-options {
        gap: 2px;
    }

    .cfv2-options--scroll,
    .cfv2-options--expanded-viewport {
        height: auto;
        max-height: min(48dvh, 440px);
        padding-right: 2px;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .cfv2-option {
        min-height: 44px;
        grid-template-columns: 24px minmax(0, 1fr) auto;
        align-items: center;
        gap: 9px;
        padding: 9px 5px;
        border-radius: 8px;
        font-size: 14px;
        line-height: 1.3;
        touch-action: manipulation;
    }

    .cfv2-checkbox {
        width: 20px;
        height: 20px;
        margin-top: 0;
        border-radius: 5px;
    }

    .cfv2-option-input:checked + .cfv2-checkbox::after {
        left: 6px;
        top: 2px;
        width: 6px;
        height: 11px;
    }

    .cfv2-option-count {
        font-size: 12px;
    }

    .cfv2-options-footer {
        min-height: 48px;
        margin-top: 6px;
        padding-top: 8px;
    }

    .cfv2-options-footer .cfv2-show-more {
        min-height: 40px;
        padding: 8px 2px;
        touch-action: manipulation;
    }

    .cfv2-unavailable-toggle {
        min-height: 40px;
        touch-action: manipulation;
    }

    .cfv2-mobile-footer {
        position: relative;
        z-index: 4;
        display: block;
        flex: 0 0 auto;
        padding: 10px 12px max(10px, env(safe-area-inset-bottom));
        border-top: 1px solid #dbe5ef;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .09);
    }

    .cfv2-mobile-footer-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 22px;
        margin-bottom: 8px;
        color: #64748b;
        font-size: 12px;
        line-height: 1.25;
        font-variant-numeric: tabular-nums;
    }

    .cfv2-mobile-footer-status strong {
        color: #173a63;
        font-size: 14px;
    }

    .cfv2-mobile-footer-actions {
        display: grid;
        grid-template-columns: minmax(92px, .72fr) minmax(150px, 1.28fr);
        gap: 8px;
    }

    .cfv2-mobile-reset,
    .cfv2-mobile-apply {
        min-width: 0;
        min-height: 48px;
        padding: 9px 12px;
        border-radius: 11px;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        touch-action: manipulation;
    }

    .cfv2-mobile-reset {
        border: 1px solid #d6e0eb;
        background: #fff;
        color: #52657c;
    }

    .cfv2-mobile-apply {
        border: 1px solid #eb2e47;
        background: #eb2e47;
        color: #fff;
        box-shadow: 0 5px 14px rgba(235, 46, 71, .22);
    }

    .cfv2-mobile-reset:active,
    .cfv2-mobile-apply:active {
        transform: translateY(1px);
    }

    .cfv2-mobile-reset:disabled,
    .cfv2-mobile-apply:disabled {
        border-color: #dfe5ec;
        background: #eef2f6;
        color: #9aa8b7;
        box-shadow: none;
        cursor: default;
    }

    .cfv2-mobile-footer--loading .cfv2-mobile-found-count {
        color: #1473e6;
    }

    .cfv2-mobile-footer--error .cfv2-mobile-found-count {
        color: #d6243b;
    }

    /* Мобильный footer заменяет плавающее окно результата слева. */
    .cfv2-preview:not(.cfv2-preview--global-inline) {
        display: none !important;
    }

    .cfv2-toolbar {
        display: flex;
        gap: 8px;
        padding: 8px;
    }

    .cfv2-mobile-open {
        order: 1;
        display: inline-flex;
        min-width: 104px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 8px 13px;
        border: 1px solid #bfd7f2;
        border-radius: 10px;
        background: #f3f8fe;
        color: #1268c4;
        font-size: 14px;
        font-weight: 700;
        touch-action: manipulation;
    }

    .cfv2-mobile-open::before {
        content: '☰';
        font-size: 15px;
        line-height: 1;
    }

    .cfv2-mobile-open .badge {
        display: inline-flex;
        min-width: 20px;
        height: 20px;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border-radius: 10px;
        line-height: 20px;
    }

    .cfv2-result-legend {
        order: 1;
        width: auto;
        flex: 1 1 auto;
        align-self: center;
        margin-left: 0;
        text-align: right;
    }

    .cfv2-global-search {
        order: 2;
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 575px) {
    .cfv2-sidebar-panel {
        width: 100vw;
        border-radius: 0;
    }

    .cfv2-toolbar {
        margin-right: -2px;
        margin-left: -2px;
    }

    .cfv2-result-legend {
        font-size: 11px;
    }

    .cfv2-mobile-footer-actions {
        grid-template-columns: minmax(88px, .68fr) minmax(0, 1.32fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cfv2-sidebar-panel,
    .cfv2-sidebar-backdrop {
        transition: none !important;
    }
}

/* ===== CFV2 v70: mobile drawer geometry and stacked-layout fix ===== */
@media (max-width: 991px) {
    /* The desktop sticky script can leave an inline min-height after the
       viewport is switched to mobile. The empty Bootstrap column must never
       reserve vertical space before the cards. */
    .cfv2-sidebar-column {
        position: static !important;
        z-index: auto !important;
        width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        flex: 0 0 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cfv2-results-column {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        flex: 0 0 100% !important;
    }

    .cfv2-sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 2147483000 !important;
        background: rgba(15, 23, 42, .42);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    /* Force viewport geometry over stale inline styles produced by desktop
       sticky mode. This is a side drawer, not a centered/full-screen modal. */
    .cfv2-sidebar-panel {
        position: fixed !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: min(360px, calc(100vw - 44px)) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        box-sizing: border-box;
        border: 0;
        border-radius: 0 14px 14px 0;
        transform: translate3d(-105%, 0, 0) !important;
        box-shadow: 16px 0 36px rgba(15, 23, 42, .22);
    }

    .cfv2-sidebar-open .cfv2-sidebar-panel {
        transform: translate3d(0, 0, 0) !important;
    }

    .cfv2-toolbar {
        margin-top: 0;
    }
}

@media (max-width: 420px) {
    .cfv2-sidebar-panel {
        width: calc(100vw - 38px) !important;
    }
}


/* ===== CFV2 v70: one-scroll mobile filter =====
   На мобильном прокручивается только .cfv2-filter-list. Внутренние списки
   значений растут порциями и не создают вложенные scroll-контейнеры. */
@media (max-width: 991px) {
    .cfv2-filter-list {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-x: none;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        scrollbar-gutter: auto;
    }

    .cfv2-group-body,
    .cfv2-options-host,
    .cfv2-options-scrollport,
    .cfv2-options,
    .cfv2-options--scroll,
    .cfv2-options--expanded-viewport,
    .cfv2-options--disabled {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
        scrollbar-gutter: auto !important;
        contain: none !important;
        content-visibility: visible !important;
    }

    .cfv2-options--scroll,
    .cfv2-options--expanded-viewport,
    .cfv2-options--disabled {
        padding-right: 0;
    }

    .cfv2-group--stable-viewport .cfv2-options-host,
    .cfv2-group--stable-viewport .cfv2-options-scrollport {
        display: block;
        flex: none;
    }

    .cfv2-options-footer {
        position: relative;
        margin-top: 10px;
    }
}


/* ===== CFV2 v70: full-screen mobile drawer, sticky group heading and state restore ===== */
@media (max-width: 991px) {
    .cfv2-sidebar-panel {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100svh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: translate3d(-102%, 0, 0) !important;
    }

    .cfv2-sidebar-open .cfv2-sidebar-panel {
        transform: translate3d(0, 0, 0) !important;
    }

    .cfv2-filter-list {
        padding-right: 10px;
        padding-left: 10px;
        scroll-padding-top: 0;
    }

    .cfv2-group {
        overflow: visible !important;
    }

    .cfv2-group-heading {
        position: sticky;
        top: 0;
        z-index: 8;
        border-radius: 12px;
        background: #fff;
    }

    .cfv2-group--open .cfv2-group-heading {
        border-radius: 12px 12px 0 0;
        box-shadow: 0 1px 0 #dfe7f1, 0 5px 12px rgba(15, 23, 42, .07);
    }

    .cfv2-group:not(.cfv2-group--open) .cfv2-group-heading {
        box-shadow: none;
    }

    .cfv2-mobile-footer {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* ===== CFV2 v70: мобильная фасетная доступность как на десктопе ===== */
@media (max-width: 991px) {
    /* Сначала идут доступные значения, затем отдельный пояснённый блок.
       Оба блока находятся внутри единственного scroll-контейнера панели. */
    .cfv2-unavailable {
        display: block;
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px dashed #cfd9e6;
    }

    .cfv2-unavailable[hidden],
    .cfv2-options--disabled[hidden] {
        display: none !important;
    }

    .cfv2-unavailable-toggle {
        min-height: 40px;
        padding: 8px 2px;
        color: #73859b;
        font-size: 12px;
        font-weight: 600;
    }

    .cfv2-options--disabled {
        display: grid;
        margin-top: 2px;
        padding-right: 0;
    }

    .cfv2-options--disabled .cfv2-option {
        display: grid;
        opacity: .48;
        color: #8a98aa;
        background: #f4f6f9;
        cursor: not-allowed;
    }

    .cfv2-options--disabled .cfv2-option:hover {
        background: #f4f6f9;
    }

    .cfv2-options--disabled .cfv2-checkbox {
        border-color: #cfd8e3;
        background: #eef2f6;
    }

    .cfv2-options--disabled .cfv2-option-title {
        text-decoration: line-through;
        text-decoration-thickness: 1px;
        text-decoration-color: #b5c0cd;
    }

    /* Пока открытая группа получает свежую availability, нельзя выбрать
       значение из устаревшего состояния. */
    .cfv2-group--facet-loading .cfv2-group-body::before {
        content: 'Проверяем доступность…';
        display: block;
        margin: 8px 0 4px;
        color: #64748b;
        font-size: 12px;
        line-height: 1.3;
    }

    .cfv2-group--facet-loading .cfv2-options-host,
    .cfv2-group--facet-loading .cfv2-search-input,
    .cfv2-group--facet-loading .cfv2-options-footer {
        opacity: .45;
        pointer-events: none;
    }
}

/* ===== CFV2 v70: продолжение доступных значений до блока недоступных ===== */
.cfv2-options-footer--mobile {
    display: none;
}

@media (max-width: 991px) {
    .cfv2-options-footer--desktop {
        display: none !important;
    }

    .cfv2-options-footer--mobile:not([hidden]) {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        margin: 10px 0 4px;
        padding: 10px 0 4px;
    }

    .cfv2-options-footer--mobile .cfv2-options-footer-summary {
        font-size: 12px;
        line-height: 1.35;
    }

    .cfv2-options-footer--mobile .cfv2-show-more {
        width: 100%;
        min-height: 42px;
        padding: 9px 12px;
        border: 1px solid #bfd4ef;
        border-radius: 10px;
        background: #f3f8ff;
        color: #1769c2;
        font-weight: 700;
        text-decoration: none;
    }

    .cfv2-options-footer--mobile .cfv2-show-more::after {
        margin-left: 7px;
    }
}


/* ===== CFV2 v70: порционная загрузка недоступных значений ===== */
.cfv2-unavailable-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    margin: 8px 0 2px;
    padding: 8px 12px;
    border: 1px solid #d7e0ea;
    border-radius: 9px;
    background: #f8fafc;
    color: #526579;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cfv2-unavailable-more:hover,
.cfv2-unavailable-more:focus-visible {
    border-color: #aebdcd;
    background: #eef3f8;
    color: #31465b;
}

.cfv2-unavailable-more[hidden] {
    display: none !important;
}

@media (max-width: 991px) {
    .cfv2-unavailable-more {
        min-height: 42px;
        margin-top: 10px;
    }
}


/* ===== CFV2 v70: только focus-артефакты Bootstrap + Font Awesome 5 ===== */
.cfv2-root .cfv2-group-arrow,
.cfv2-root .cfv2-unavailable-toggle-icon {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    speak: none;
}

/* Сохраняем Bootstrap-классы и их обычное оформление.
   Убираем только чёрные/синие рамки, которые появляются при focus/active. */
.cfv2-root .cfv2-group-toggle:focus,
.cfv2-root .cfv2-group-toggle:focus-visible,
.cfv2-root .cfv2-unavailable-toggle:focus,
.cfv2-root .cfv2-unavailable-toggle:focus-visible,
.cfv2-root .cfv2-mobile-close:focus,
.cfv2-root .cfv2-mobile-close:focus-visible,
.cfv2-root .cfv2-mobile-open:focus,
.cfv2-root .cfv2-mobile-open:focus-visible,
.cfv2-root .cfv2-preview-apply:focus,
.cfv2-root .cfv2-preview-apply:focus-visible,
.cfv2-root .cfv2-preview-reset:focus,
.cfv2-root .cfv2-preview-reset:focus-visible,
.cfv2-root .cfv2-mobile-reset:focus,
.cfv2-root .cfv2-mobile-reset:focus-visible,
.cfv2-root .cfv2-mobile-apply:focus,
.cfv2-root .cfv2-mobile-apply:focus-visible,
.cfv2-root .cfv2-show-more:focus,
.cfv2-root .cfv2-show-more:focus-visible,
.cfv2-root .cfv2-unavailable-more:focus,
.cfv2-root .cfv2-unavailable-more:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

.cfv2-root .cfv2-search-input:focus,
.cfv2-root .cfv2-search-input:focus-visible {
    outline: 0 !important;
    border-color: #ced4da !important;
    box-shadow: none !important;
}

.cfv2-root button::-moz-focus-inner {
    border: 0;
}

@media (max-width: 991px) {
    .cfv2-root button,
    .cfv2-root input,
    .cfv2-root select,
    .cfv2-root textarea {
        -webkit-tap-highlight-color: transparent;
    }
}


/* ===== CFV2 v70: единая разметка и оформление полей =====
 * Desktop и mobile используют один и тот же input из PHP:
 * form-control form-control-sm cfv2-search-input.
 * В media query меняется только геометрия drawer и списков; оформление input
 * отдельно для мобильного режима не переопределяется. */

/* ===== CFV2 v71: единое оформление локального и глобального поиска ===== */
.cfv2-root .cfv2-search-input,
.cfv2-root .cfv2-global-search-input {
    height: calc(1.5em + .5rem + 2px);
    min-height: calc(1.5em + .5rem + 2px);
    padding-top: .25rem;
    padding-bottom: .25rem;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    background-color: #fff;
    color: #495057;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.cfv2-root .cfv2-search-input {
    width: 100%;
    margin: 0;
    padding-right: 36px;
    padding-left: 36px;
}

.cfv2-local-search-control {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin: 8px 0 10px;
}

.cfv2-local-search-icon {
    position: absolute;
    left: 11px;
    width: 13px;
    height: 13px;
    border: 1.5px solid #94a3b8;
    border-radius: 50%;
    pointer-events: none;
}

.cfv2-local-search-icon::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 1.5px;
    border-radius: 2px;
    background: #94a3b8;
    transform: rotate(45deg);
    transform-origin: left center;
}

.cfv2-local-search-clear {
    position: absolute;
    right: 5px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.cfv2-local-search-clear:hover,
.cfv2-local-search-clear:focus-visible {
    background: #f1f5f9;
    color: #475569;
    outline: none;
    box-shadow: none;
}

.cfv2-local-search-clear[hidden] {
    display: none !important;
}

.cfv2-root .cfv2-global-search-input {
    padding-right: 36px;
    padding-left: 36px;
}

.cfv2-root .cfv2-search-input::-webkit-search-cancel-button,
.cfv2-root .cfv2-global-search-input::-webkit-search-cancel-button {
    display: none;
}

.cfv2-root .cfv2-search-input::placeholder,
.cfv2-root .cfv2-global-search-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.cfv2-root .cfv2-search-input:focus,
.cfv2-root .cfv2-search-input:focus-visible,
.cfv2-root .cfv2-global-search-input:focus,
.cfv2-root .cfv2-global-search-input:focus-visible,
.cfv2-root .cfv2-global-search--open .cfv2-global-search-input {
    outline: 0 !important;
    border-color: #ced4da !important;
    background-color: #fff;
    box-shadow: none !important;
}

.cfv2-root .cfv2-global-search-icon {
    left: 11px;
    width: 13px;
    height: 13px;
    border-width: 1.5px;
}

.cfv2-root .cfv2-global-search-icon::after {
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 1.5px;
}

.cfv2-root .cfv2-global-search-clear {
    right: 5px;
    width: 26px;
    height: 26px;
    font-size: 19px;
}

/* Доступные результаты всегда находятся выше недоступных, в том числе
   когда лимит выдачи составляет восемь значений на группу. */
.cfv2-global-search-unavailable-title {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 13px;
    border-top: 1px solid #dfe7f0;
    border-bottom: 1px solid #edf2f7;
    background: #f8fafc;
    color: #7b8798;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.cfv2-global-search-group--unavailable .cfv2-global-search-group-title {
    color: #8b98a9;
}



/* ===== CFV2 v83: компактные чипы и выравнивание заголовка группы ===== */
.cfv2-group-selection-summary {
    gap: 6px;
    margin: 6px 0 8px;
    padding: 8px;
    border-radius: 8px;
}

.cfv2-group-selection-chip,
.cfv2-group-selection-more {
    min-height: 24px;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.15;
}

button.cfv2-group-selection-chip {
    gap: 4px;
}

.cfv2-group-selection-chip-close {
    width: 16px;
    height: 16px;
    font-size: 11px;
}

.cfv2-group-heading {
    position: relative;
}

.cfv2-group-toggle {
    position: relative;
    padding-right: 100px;
}

.cfv2-group-arrow {
    position: absolute;
    top: 50%;
    right: 14px;
    margin-left: 0;
    transform: translateY(-50%) rotate(0deg);
}

.cfv2-group--open .cfv2-group-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.cfv2-group-reset {
    right: 36px;
    min-width: auto;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid #f1c9cf;
    border-radius: 12px;
    background: #fff5f6;
    color: #cc3142;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.cfv2-group-reset:hover,
.cfv2-group-reset:focus-visible {
    border-color: #e6a4ad;
    background: #ffecef;
    color: #b32638;
    outline: none;
}

@media (max-width: 991px) {
    .cfv2-group-selection-summary {
        gap: 5px;
        padding: 7px;
    }

    .cfv2-group-selection-chip,
    .cfv2-group-selection-more {
        min-height: 22px;
        padding: 2px 7px;
        font-size: 11px;
    }

    .cfv2-group-toggle {
        padding-right: 104px;
    }

    .cfv2-group-arrow {
        right: 14px;
    }

    .cfv2-group-reset {
        right: 34px;
        min-height: 24px;
        padding: 4px 8px;
    }
}


/* ===== CFV2 v84: без счётчика в заголовке и независимые компактные chips ===== */
/* Старый счётчик выбранных значений в заголовке группы больше не используется.
   display:none оставлен как защита при частичном обновлении старой разметки. */
.cfv2-root .cfv2-group-selected {
    display: none !important;
}

/* Не используем font shorthand: он может повторно сбросить font-size/line-height.
   !important нужен только на параметрах, которые глобальная тема задаёт через
   .btn:not(.btn-icon). Так chip остаётся компактным даже если тема добавит .btn. */
.cfv2-root button.cfv2-group-selection-chip,
.cfv2-root button.cfv2-group-selection-chip.btn:not(.btn-icon) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px !important;
    max-width: 100%;
    padding: 3px 8px !important;
    border: 1px solid #b9d8fb;
    border-radius: 14px;
    background: #e7f2ff;
    color: #075cad;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 16px !important;
    text-align: left;
    white-space: normal;
}

.cfv2-root button.cfv2-group-selection-chip:hover,
.cfv2-root button.cfv2-group-selection-chip:focus-visible {
    border-color: #1473e6;
    background: #dcebff;
    color: #075cad;
    outline: none;
}

.cfv2-root .cfv2-group-selection-chip-close {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    font-size: 11px;
    line-height: 16px;
}

@media (max-width: 991px) {
    .cfv2-root button.cfv2-group-selection-chip,
    .cfv2-root button.cfv2-group-selection-chip.btn:not(.btn-icon) {
        min-height: 24px !important;
        padding: 3px 7px !important;
        font-size: 12px !important;
        line-height: 16px !important;
    }
}


/* ===== CFV2 v87: многоколоночный глобальный поиск + "Показать ещё" ===== */
.cfv2-global-search-group {
    padding: 0 10px 8px;
}

.cfv2-global-search-group + .cfv2-global-search-group {
    border-top: 1px solid #edf2f7;
    padding-top: 4px;
}

.cfv2-global-search-group-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 3px 5px;
}

.cfv2-global-search-group-title {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

.cfv2-global-search-group-counter {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 11px;
    white-space: nowrap;
}

.cfv2-global-search-group-grid {
    display: grid;
    grid-template-columns: repeat(var(--cfv2-search-columns, 1), minmax(0, 1fr));
    gap: 2px 8px;
}

.cfv2-global-search-group-grid .cfv2-global-search-result {
    min-width: 0;
    min-height: 34px;
    padding: 5px 4px;
    border-radius: 5px;
}

.cfv2-global-search-group-grid .cfv2-global-search-result-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfv2-global-search-group-grid .cfv2-global-search-result-state {
    display: none;
}

.cfv2-global-search-result--unavailable .cfv2-global-search-result-label::after {
    content: ' · недоступно';
    color: #a3afbf;
    font-size: 10px;
}

.cfv2-global-search-group-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 5px;
    padding: 6px 3px 0;
    border-top: 1px dashed #edf2f7;
}

.cfv2-global-search-group-footer-info {
    color: #94a3b8;
    font-size: 11px;
}

.cfv2-global-search-more,
.cfv2-global-search-more-groups {
    border: 0;
    background: transparent;
    color: #126ee5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cfv2-global-search-more {
    flex: 0 0 auto;
    padding: 4px 0;
    white-space: nowrap;
}

.cfv2-global-search-more:hover,
.cfv2-global-search-more:focus-visible,
.cfv2-global-search-more-groups:hover,
.cfv2-global-search-more-groups:focus-visible {
    color: #075cad;
    text-decoration: underline;
    outline: none;
}

.cfv2-global-search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cfv2-global-search-more-groups {
    margin-left: auto;
    padding: 2px 0;
}

@media (max-width: 640px) {
    .cfv2-global-search-group {
        padding-left: 8px;
        padding-right: 8px;
    }

    .cfv2-global-search-group-grid {
        gap: 2px 6px;
    }

    .cfv2-global-search-group-counter {
        display: none;
    }
}


/* ===== CFV2 v90: полный текст результатов поиска + адаптивная плотность ===== */
.cfv2-global-search-group-grid .cfv2-global-search-result {
    height: auto;
    min-height: 34px;
    align-items: center;
}

.cfv2-global-search-group-grid .cfv2-global-search-result-label {
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.25;
}


/* ===== CFV2 v91: запрос при отсутствии совпадений в глобальном поиске ===== */
.cfv2-global-search-empty--request {
    padding: 18px 16px;
    text-align: left;
}

.cfv2-global-search-empty-title {
    color: #173a63;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.cfv2-global-search-empty-text {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.cfv2-global-search-empty--request .btn {
    width: 100%;
}


/* ===== CFV2 v92: запрос при пустом поиске внутри группы ===== */
.cfv2-search-empty--request {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    text-align: left;
}

.cfv2-search-empty-title {
    color: #173a63;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.cfv2-search-empty-text {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.cfv2-search-empty--request .btn {
    width: 100%;
}


/* ===== CFV2 v93: пустой поиск группы — запрос сразу под строкой поиска ===== */
.cfv2-group--search-empty .cfv2-options-host {
    display: none !important;
}

.cfv2-group--search-empty .cfv2-search-empty--request {
    margin-top: 8px;
}
