/* Стили для горизонтальных фильтров */

.filters__top {
    margin-bottom: 20px;
}

.filters__top form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-wrapper {
    position: relative;
}

.filter {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.filter:hover {
    border-color: #f0cf4c;
    background: #fefcf0;
}

.filter.active,
.filter.open {
    border-color: #f0cf4c;
    background: #fff8e1;
}

.filter__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filter__label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.filter__tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.filter-tag--blue {
    background-color: #f0cf4c;
    color: #333;
}

.filter__btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter__btn-clear,
.filter__btn-add {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #999;
    font-size: 16px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.filter__btn-clear:hover,
.filter__btn-add:hover {
    color: #f0cf4c;
}

.filter__btn-add.active i,
.filter.open .filter__btn-add i {
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

/* Мобильный заголовок фильтра */
.filter-header {
    display: none;
}

/* Выпадающее меню фильтра */
.filter-collapse {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1000;
    width: 280px !important;
    max-width: 280px !important;
    min-width: 280px !important;
    box-sizing: border-box;
}

.filter-collapse.show {
    display: block;
}

.filter-collapse.align-right {
    left: auto;
    right: 0;
}

.filter-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    box-sizing: border-box;
}

.filter-dropdown__inner {
    padding: 12px !important;
    box-sizing: border-box;
    width: 100%;
}

.filter-dropdown__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-dropdown__reset {
    background: none;
    border: none;
    color: #f0cf4c;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 0;
}

.filter-dropdown__reset:hover {
    color: #d4b83f;
}

.filter-dropdown__search {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.filter-dropdown__search-input {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px !important;
    color: #333;
    transition: border-color 0.3s ease;
    box-sizing: border-box !important;
    max-width: 100%;
}

.filter-dropdown__search-input:focus {
    outline: none;
    border-color: #f0cf4c;
}

.filter-dropdown__search-input::placeholder {
    color: #999;
}

.filter-dropdown__list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.filter-dropdown__list::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown__list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-dropdown__list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-dropdown__list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #fff;
}

.filter-checkbox:hover {
    border-color: #f0cf4c;
    background-color: #fefcf0;
}

.filter-checkbox.active {
    border-color: #f0cf4c;
    background-color: #fff8e1;
    box-shadow: 0 2px 4px rgba(240, 207, 76, 0.2);
}

.filter-checkbox__input {
    display: none;
}

.filter-checkbox__value {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    pointer-events: none;
}

.filter-checkbox.active .filter-checkbox__value {
    color: #333;
}

.filter-dropdown__foot {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
}

.filter-dropdown__btn {
    width: 100% !important;
    padding: 10px 16px !important;
    background: #fff;
    border: 2px solid #f0cf4c;
    border-radius: 8px;
    font-size: 13px !important;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: lowercase;
    box-sizing: border-box !important;
    max-width: 100%;
}

.filter-dropdown__btn:hover {
    background: #f0cf4c;
    border-color: #d4b83f;
}

.filter-checkbox.hidden {
    display: none;
}

.filter-dropdown__no-results {
    width: 100%;
    padding: 20px 10px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 768px) {
    .filter-header {
        display: flex !important;
        width: 100%;
        padding: 12px 16px;
        background: #f5f5f5;
        border-bottom: 1px solid #e0e0e0;
        cursor: pointer;
        box-sizing: border-box;
        margin: 0;
    }
    
    .filter-header__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 10px;
    }
    
    .filter-header__inner-txt {
        font-size: 14px;
        font-weight: 500;
        color: #333;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .filter-header__inner-right {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
    
    .filter-header__inner-right i {
        color: #666;
        font-size: 16px;
        transition: transform 0.3s ease;
    }
    
    .filter-header.active .filter-header__inner-right i {
        transform: rotate(180deg);
    }
    
    .filter-header__inner-right .link {
        color: #f0cf4c;
        text-decoration: none;
        font-weight: 500;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .filter {
        display: none;
    }
    
    .filter-collapse {
        position: static;
        margin-top: 0;
        border: none;
        box-shadow: none;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
    }
    
    .filter-dropdown {
        border: none;
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .filter-dropdown__inner {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px !important;
    }
    
    .filter-dropdown__search {
        width: 100%;
        box-sizing: border-box;
    }
    
    .filter-dropdown__search-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .filter-dropdown__list {
        width: 100%;
        box-sizing: border-box;
    }
    
    .filter-dropdown__foot {
        width: 100%;
        box-sizing: border-box;
    }
    
    .filter-dropdown__btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}
