<?php

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");

/**
 * @global CMain $APPLICATION
 */

$APPLICATION->SetTitle("");
?>/* ============================================================ */
/* УМНЫЙ ФИЛЬТР (адаптированный под DNS-стиль)                  */
/* ============================================================ */

/* ===== 1. ОСНОВНЫЕ СТИЛИ ФИЛЬТРА ===== */
.bx-filter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 20px;
}

.bx-filter .bx-filter-section {
    position: relative;
    padding-top: 0;
    overflow: hidden;
}

.bx-filter .bx-filter-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    padding-bottom: 12px;
    border-bottom: 1px solid #eae8e8;
}

/* ===== 2. ПАРАМЕТРЫ ФИЛЬТРА ===== */
.bx-filter .bx-filter-parameters-box {
    position: relative;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 4px;
    overflow: hidden;
}

.bx-filter .bx-filter-parameters-box:last-child {
    border-bottom: none;
}

.bx-filter .bx-filter-parameters-box-title {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0 8px;
    cursor: pointer;
    color: #333333;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bx-filter .bx-filter-parameters-box-title span {
    display: block;
    color: #333333;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.bx-filter .bx-filter-parameters-box-title span:hover {
    color: #0055cc;
}

.bx-filter .bx-filter-parameters-box-title::after {
    content: '▼';
    font-size: 10px;
    color: #a7a5a5;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.bx-filter .bx-filter-parameters-box.bx-active .bx-filter-parameters-box-title::after {
    transform: rotate(180deg);
}

.bx-filter .bx-filter-block {
    display: none;
    padding: 4px 0 12px 0;
    transition: padding 0.3s ease;
}

.bx-filter .bx-filter-parameters-box.bx-active .bx-filter-block {
    display: block;
}

.bx-filter-parameters-box-container {
    padding-bottom: 4px;
}

.bx-filter-parameters-box-container .checkbox:first-child {
    margin-top: 0;
}

/* ===== 3. ЭЛЕМЕНТЫ ФИЛЬТРА ===== */
.bx-filter .bx-filter-param-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px;
    color: #333333;
    transition: color 0.2s ease;
    overflow: hidden;
}

.bx-filter .bx-filter-param-label:hover {
    color: #0055cc;
}

.bx-filter .bx-filter-param-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bx-filter .bx-filter-param-label.disabled .bx-filter-param-text {
    color: #bbbbbb;
}

.bx-filter .bx-filter-param-text {
    display: block;
    font-weight: 400;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ===== 4. ЧЕКБОКСЫ И РАДИО ===== */
.bx-filter .bx-filter-input-checkbox input[type="checkbox"],
.bx-filter .bx-filter-input-checkbox input[type="radio"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #0055cc;
}

/* ===== 5. ВВОД ДИАПАЗОНА ЦЕН ===== */
.bx-filter .bx-filter-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.bx-filter .bx-filter-input-container input {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    font-size: 14px;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #d2d1d1;
    border-radius: 8px;
    background: #ffffff;
    outline: none;
    color: #333333;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bx-filter .bx-filter-input-container input:focus {
    border-color: #0055cc;
    box-shadow: 0 0 0 3px rgba(0, 85, 204, 0.12);
}

.bx-filter .bx-filter-input-container input::placeholder {
    color: #bbbbbb;
}

/* ===== 6. СЛАЙДЕР ===== */
.bx-filter .bx-ui-slider-track-container {
    padding-top: 30px;
    padding-bottom: 20px;
    overflow: hidden;
}

.bx-filter .bx-ui-slider-track {
    position: relative;
    height: 4px;
    background: #eae8e8;
    border-radius: 2px;
    width: 100%;
}

.bx-filter .bx-ui-slider-part {
    position: absolute;
    top: -6px;
    width: 1px;
    height: 16px;
    background: #d2d1d1;
}

.bx-filter .bx-ui-slider-part.p1 { left: -1px; }
.bx-filter .bx-ui-slider-part.p2 { left: 25%; }
.bx-filter .bx-ui-slider-part.p3 { left: 50%; }
.bx-filter .bx-ui-slider-part.p4 { left: 75%; }
.bx-filter .bx-ui-slider-part.p5 { right: -1px; }

.bx-filter .bx-ui-slider-part span {
    font-size: 11px;
    position: absolute;
    top: -18px;
    left: 50%;
    display: block;
    width: 100px;
    margin-left: -50px;
    text-align: center;
    color: #7d7c7c;
}

.bx-filter .bx-ui-slider-part.p2 span,
.bx-filter .bx-ui-slider-part.p3 span,
.bx-filter .bx-ui-slider-part.p4 span {
    color: #7d7c7c;
}

.bx-filter .bx-ui-slider-range,
.bx-filter .bx-ui-slider-pricebar,
.bx-filter .bx-ui-slider-pricebar-vd,
.bx-filter .bx-ui-slider-pricebar-vn,
.bx-filter .bx-ui-slider-pricebar-v {
    position: absolute;
    top: 0;
    bottom: 0;
}

.bx-filter .bx-ui-slider-range {
    z-index: 50;
}

.bx-filter .bx-ui-slider-pricebar {
    z-index: 100;
}

.bx-filter .bx-ui-slider-pricebar-vd {
    z-index: 60;
    background: #eae8e8;
}

.bx-filter .bx-ui-slider-pricebar-vn {
    z-index: 70;
    background: #b8d3ff;
}

.bx-filter .bx-ui-slider-pricebar-v {
    z-index: 80;
    background: #0055cc;
}

.bx-filter .bx-ui-slider-handle {
    position: absolute;
    top: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0055cc;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.bx-filter .bx-ui-slider-handle:hover {
    box-shadow: 0 2px 6px rgba(0, 85, 204, 0.3);
}

.bx-filter .bx-ui-slider-handle.left {
    left: 0;
    margin-left: -8px;
}

.bx-filter .bx-ui-slider-handle.right {
    right: 0;
    margin-right: -8px;
}

/* ===== 7. СЕЛЕКТ ===== */
.bx-filter .bx-filter-select-container {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #d2d1d1;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bx-filter .bx-filter-select-container:hover {
    border-color: #a7a5a5;
}

.bx-filter .bx-filter-select-container.bx-active,
.bx-filter .bx-filter-select-container:focus {
    border-color: #0055cc;
    box-shadow: 0 0 0 3px rgba(0, 85, 204, 0.12);
}

.bx-filter .bx-filter-select-block {
    position: relative;
    display: block;
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 33px 0 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
}

.bx-filter .bx-filter-select-text {
    font-size: 14px;
    line-height: 36px;
    overflow: hidden;
    max-width: 100%;
    height: 36px;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #333333;
}

.bx-filter .bx-filter-select-text label {
    cursor: pointer;
}

.bx-filter .bx-filter-select-arrow {
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 36px;
    cursor: pointer;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23a7a5a5"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat center;
}

/* ===== 8. ПОПАП СЕЛЕКТА ===== */
.bx-filter-select-popup {
    background: #ffffff;
    padding: 0;
    min-width: 173px;
    max-width: 280px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eae8e8;
    overflow: hidden;
}

.bx-filter-select-popup ul {
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.bx-filter-select-popup ul li {
    display: block;
    text-align: left;
    vertical-align: middle;
}

.bx-filter-select-popup ul li:first-child {
    border-bottom: 1px solid #eae8e8;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.bx-filter-select-popup ul li label {
    font-size: 14px;
    line-height: 36px;
    display: block;
    overflow: hidden;
    padding: 0 16px;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #333333;
    transition: background 0.2s ease, color 0.2s ease;
}

.bx-filter-select-popup ul li label.selected,
.bx-filter-select-popup ul li label:hover {
    color: #0055cc;
    background: #f0f5ff;
}

.bx-filter-select-popup ul li label.disabled {
    color: #bbbbbb;
    background: transparent;
    cursor: not-allowed;
}

/* ===== 9. КНОПКИ ===== */
.bx-filter .bx-filter-button-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eae8e8;
}

.bx-filter .bx-filter-button-box .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    font-family: inherit;
    min-height: 40px;
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.bx-filter .bx-filter-button-box .btn:active {
    transform: scale(0.96);
}

.btn-themes {
    background: #0055cc;
    color: #ffffff;
}

.btn-themes:hover {
    background: #003d99;
}

.btn-themes.bx-active,
.btn-themes:active,
.btn-themes:focus {
    background: #003d99;
    color: #ffffff;
}

.btn-link {
    background: transparent;
    color: #7d7c7c;
    border: 1px solid #d2d1d1;
}

.btn-link:hover {
    background: #f7f7f7;
    border-color: #a7a5a5;
}

.btn-link:active {
    background: #f7f7f7;
}

/* ===== 10. РЕЗУЛЬТАТ ПОПАП ===== */
.bx-filter .bx-filter-popup-result {
    font-size: 13px;
    font-weight: 400;
    position: absolute;
    z-index: 915;
    display: none;
    line-height: normal;
    margin-top: -7px;
    margin-left: 10px;
    padding: 8px 16px;
    white-space: nowrap;
    color: #333333;
    min-height: 37px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eae8e8;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bx-filter .bx-filter-popup-result.right {
    left: 97%;
}

.bx-filter .bx-filter-popup-result.left {
    right: 97%;
}

.bx-filter .bx-filter-popup-result a {
    color: #007de3;
    text-decoration: none;
}

.bx-filter .bx-filter-popup-result a:hover {
    text-decoration: underline;
}

.bx-filter .bx-filter-popup-result-close {
    display: none;
}

/* ===== 11. ТЕГИ ===== */
.bx-filter .bx-filter-tag {
    padding: 12px 0;
    border-top: 1px solid #eae8e8;
    border-bottom: 1px solid #eae8e8;
    margin-bottom: 12px;
    overflow: hidden;
}

.bx-filter .bx-tag-link {
    font-size: 12px;
    text-decoration: none;
    color: #007de3;
    display: inline-block;
    padding: 4px 10px;
    background: #f0f5ff;
    border-radius: 12px;
    margin: 2px 4px 2px 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    transition: background 0.2s ease, color 0.2s ease;
}

.bx-filter .bx-tag-link.bx-active,
.bx-filter .bx-tag-link:hover {
    background: #0055cc;
    color: #ffffff;
}

/* ===== 12. КНОПКИ +/- ===== */
.bx-filter .bx-filter-param-btn.bx-spm {
    width: 28px;
    min-width: 28px;
    height: 28px;
    line-height: 28px;
    font-weight: 400;
    padding: 0;
    font-size: 16px;
    color: #333333;
    vertical-align: middle;
    border-radius: 50%;
    background-color: #f7f7f7;
    border: 1px solid #d2d1d1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.bx-filter .bx-filter-param-btn.bx-spm:hover {
    background: #eae8e8;
    border-color: #a7a5a5;
}

.bx-filter .bx-filter-param-btn.bx-spm:active {
    outline: none !important;
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.1);
}

.bx-filter .bx-filter-param-btn.bx-spm.bx-plus {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'><path d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/></svg>");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.bx-filter .bx-filter-param-btn.bx-spm.bx-minus {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'><path d='M19 13H5v-2h14v2z'/></svg>");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.bx-filter span.bx-spm {
    font-size: 16px;
    font-weight: 600;
    line-height: 28px;
    display: inline-block;
    height: 28px;
    margin: 0 8px;
    vertical-align: middle;
    color: #333333;
}

/* ===== 13. АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .catalog-filter-sidebar {
        flex: 1;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        position: static;
        overflow: visible;
    }
    
    .bx-filter {
        max-width: 100% !important;
    }
    
    .bx-filter-select-popup {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .bx-touch .bx-filter .bx-filter-popup-result {
        font-size: 12px;
        line-height: 14px;
        position: fixed !important;
        z-index: 1001;
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        margin-top: 0;
        margin-left: 0;
        width: auto;
        height: auto;
        padding: 12px 16px;
        border-radius: 12px 12px 0 0;
        border: 1px solid #eae8e8;
        background: rgba(255, 255, 255, 0.98);
        max-width: 100%;
    }
    
    .bx-touch .bx-filter .bx-filter-popup-result br {
        display: none;
    }
    
    .bx-filter .bx-filter-popup-result .arrow {
        display: none;
    }
    
    .bx-filter .bx-filter-parameters-box-title {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .bx-filter {
        padding: 16px;
        border-radius: 12px;
    }
    
    .bx-filter .bx-filter-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .bx-filter {
        padding: 12px;
        border-radius: 8px;
    }
    
    .bx-filter .bx-filter-title {
        font-size: 15px;
    }
    
    .bx-filter .bx-filter-param-label {
        font-size: 13px;
        padding: 3px 0;
    }
    
    .bx-filter .bx-filter-input-container input {
        font-size: 13px;
        height: 34px;
        padding: 0 10px;
    }
    
    .bx-filter .bx-filter-select-container {
        height: 34px;
    }
    
    .bx-filter .bx-filter-select-block {
        height: 32px;
    }
    
    .bx-filter .bx-filter-select-text {
        font-size: 13px;
        line-height: 32px;
        height: 32px;
    }
    
    .bx-filter .bx-filter-select-arrow {
        height: 32px;
    }
    
    .bx-filter .bx-filter-button-box .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
        flex: 1 1 100%;
    }
}