/* Современный интерфейс WOOF. Все правила ограничены страницами каталога. */
.catalog-page .side-filters {
    --os-filter-border: #e3e3e3;
    --os-filter-muted: #777;
    --os-filter-text: #1c1c1c;
    --os-filter-surface: #fff;
}

html.os-catalog-filters-pending .catalog-page .side-filters {
    visibility: hidden;
}

.catalog-page .side-filters .woof_list > li.os-filter-option-empty,
.catalog-page .side-filters .woof_authors > li.os-filter-option-empty,
.catalog-page .side-filters .woof_list > li:has(input:disabled:not(:checked)),
.catalog-page .side-filters .woof_authors > li:has(input:disabled:not(:checked)) {
    display: none !important;
}

.catalog-page .side-filters .woof_container {
    margin: 0 !important;
    border-bottom: 1px solid var(--os-filter-border);
}

.catalog-page .side-filters .woof_container_inner::before,
.catalog-page .side-filters .woof_container_inner > h4 {
    display: none !important;
    content: none !important;
}

.catalog-page .os-filter-section__toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 14px 34px 14px 0;
    border: 0;
    background: transparent;
    color: var(--os-filter-text);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.catalog-page .os-filter-section__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 4px;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--os-filter-text);
    border-bottom: 1.5px solid var(--os-filter-text);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 180ms ease;
}

.catalog-page .os-filter-section.is-open .os-filter-section__toggle::after {
    transform: translateY(-30%) rotate(225deg);
}

.catalog-page .os-filter-section__body {
    padding: 0 0 16px;
}

.catalog-page .os-filter-section__body[hidden] {
    display: none !important;
}

.catalog-page .side-filters .woof_list {
    margin: 0 !important;
}

.catalog-page .side-filters .woof_list > li {
    margin: 0 0 10px !important;
}

.catalog-page .side-filters .woof_list > li:last-child {
    margin-bottom: 0 !important;
}

.catalog-page .side-filters .woof_checkbox_label {
    color: var(--os-filter-text);
    font-size: 14px;
    line-height: 1.35;
}

.catalog-page .side-filters .woof_checkbox_count {
    color: var(--os-filter-muted);
    font-size: 12px;
}

.catalog-page .os-filter-price-presets {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--os-filter-border);
}

.catalog-page .side-filters .os-filter-price-preset {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: var(--os-filter-text);
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
}

.catalog-page .os-filter-price-preset__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.catalog-page .os-filter-price-preset__box {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid #6a6666;
    border-radius: 2px;
    background: #fff;
}

.catalog-page .os-filter-price-preset__input:checked + .os-filter-price-preset__box {
    border-color: #1c1c1c;
    background: #1c1c1c;
}

.catalog-page .os-filter-price-preset__input:focus-visible + .os-filter-price-preset__box {
    outline: 2px solid #006fbd;
    outline-offset: 2px;
}

.catalog-page .os-filter-shortcut {
    position: relative;
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    column-gap: 4px;
    color: var(--os-filter-text);
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
}

.catalog-page .side-filters .woof_list > li.os-filter-shortcut-item {
    display: block !important;
    padding-left: 0 !important;
}

.catalog-page .os-filter-shortcut__input {
    position: static !important;
    grid-column: 1;
    grid-row: 1;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin: 1px 0 0 !important;
    opacity: 1 !important;
    appearance: auto;
    cursor: pointer;
}

.catalog-page .os-filter-shortcut__box {
    display: none;
}

.catalog-page .os-filter-shortcut__label {
    display: block;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.catalog-page .os-filter-shortcut__input:focus-visible {
    outline: 2px solid #006fbd;
    outline-offset: 2px;
}

.catalog-page .os-filter-shortcut:hover {
    color: #006fbd;
    text-decoration: none;
}

.catalog-page .side-filters .woof_price_filter_txt_container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-page .side-filters .woof_price_filter_txt {
    width: calc(50% - 4px) !important;
    min-width: 0;
    height: 42px;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 1px solid #cfcfcf !important;
    border-radius: 4px;
    background: #fff;
    color: var(--os-filter-text);
    font-size: 14px;
}

.catalog-page .side-filters .woof_submit_search_form_container {
    display: flex;
    gap: 8px;
    clear: both;
    margin: 20px 0 0 !important;
    padding: 0;
    overflow: visible;
}

.catalog-page .side-filters .woof_submit_search_form_container button {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 14px !important;
    border-radius: 4px !important;
    font: inherit;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer;
}

.catalog-page .side-filters .woof_submit_search_form {
    border: 1px solid #1c1c1c !important;
    background: #1c1c1c !important;
    color: #fff !important;
}

.catalog-page .side-filters .woof_reset_search_form {
    border: 1px solid #bdbdbd !important;
    background: #fff !important;
    color: #1c1c1c !important;
}

.catalog-page .os-filter-mobile-header {
    display: none;
}

@media (min-width: 901px) {
    .catalog-page .side-filters {
        flex: 0 0 250px;
        width: 250px;
    }

    .catalog-page .catalog-area {
        width: calc(100% - 250px - 36px);
    }
}

@media (max-width: 900px) {
    body.os-filter-drawer-open {
        overflow: hidden !important;
        touch-action: none;
    }

    .catalog-page .catalog-area__mob-filtr-link {
        margin-bottom: 20px;
    }

    .catalog-page .catalog-area__mob-filtr-link a {
        width: 100%;
        max-width: none;
        min-height: 44px;
        padding: 10px 16px;
        border: 1px solid #1c1c1c;
        border-radius: 4px;
        background: #fff;
        color: #1c1c1c;
        font-size: 14px;
        font-weight: 500;
    }

    .catalog-page .side-filters {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        display: block !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 0 !important;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--os-filter-surface) !important;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 220ms ease, visibility 220ms ease !important;
        z-index: 999999;
    }

    .catalog-page .side-filters.side-filters_opened {
        visibility: visible;
        /* Убираем transform после открытия: иначе fixed-кнопка прокручивается вместе с панелью на мобильных. */
        transform: none;
    }

    .catalog-page .side-filters__wrapper {
        min-height: 100%;
        padding: 0 18px 104px !important;
    }

    .catalog-page .os-filter-mobile-header {
        position: sticky;
        top: 0;
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 60px;
        margin: 0 -18px;
        padding: 0 18px;
        border-bottom: 1px solid var(--os-filter-border);
        background: #fff;
    }

    .catalog-page .os-filter-mobile-header strong {
        font-size: 18px;
        font-weight: 500;
    }

    .catalog-page #mob-filtr-link-close {
        position: relative;
        top: auto;
        right: auto;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 0;
    }

    .catalog-page #mob-filtr-link-close::before,
    .catalog-page #mob-filtr-link-close::after {
        width: 18px;
        background-color: #1c1c1c;
    }

    .catalog-page .os-filter-section__toggle {
        min-height: 54px;
        font-size: 16px;
    }

    .catalog-page .side-filters.side-filters_opened .woof_submit_search_form_container {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 5;
        margin: 0 !important;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--os-filter-border);
        background: #fff;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-page .side-filters,
    .catalog-page .os-filter-section__toggle::after {
        transition: none !important;
    }
}
