/* Закрытый бар */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}
.filter-bar[data-filterbar="page"] {
    margin: 8px 0;
    padding: 16px 0;
}
#openFilter {
    position: relative;
}

#openFilter .filter-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border: 1px solid var(--white--white100, #FFF);
    border-radius: 50%;
    background: var(--red--red40, #B3261E);;
}

#openFilter.has-filters .filter-badge {
    display: block;
}
.filters__price {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.filters__price input {
    flex: 1 1 auto;
    border: 1px solid var(--grey--grey80, #D7D7D7);
    border-radius: 6px;
}

.filters__price input:active,
.filters__price input:focus {
    background-color: transparent;
    border: 1px solid var(--black--black10, #222324);
}

.filters__bids-label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 16px;
    cursor: pointer;
}

.filters__bids-checkbox {
    position: static !important;
    margin: 0 !important;
    cursor: pointer;
}
.filters__bids-checkbox:checked {
    accent-color: var(--azure--azure50, #006BE2);
}

/* Обёртка */
.type-dropdown,
.price-dropdown{
    position: relative;
    display: inline-block;
    font-family: inherit;
    height: 48px;
}
.type-dropdown-wrapper {
    display: flex;
}
.dropdown-toggle {
    position: relative;
    padding: 12px 50px 12px 24px; /* справа место под стрелку */
    border: 1px solid var(--grey--grey80, #D7D7D7);
    border-radius: 8px;
    cursor: pointer;
    background: var(--white--white100, #FFF);
    color: var(--black--black10, #222324);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    transition: border-color 0.2s ease;
    /*height: 100%;*/
}
.dropdown-toggle::after {
    content: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23222324' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    position: absolute;
    right: 24px;
    top: 25%;
    margin-top: 2px;
    pointer-events: none;
    transform: rotate(0deg);
    transition: transform 0.2s ease, margin-top .2s ease;
}


/* Состояние при открытии */
.type-dropdown.open .dropdown-toggle,
.price-dropdown.open .dropdown-toggle {
    border-color: var(--azure--azure50, #006BE2);

}

.type-dropdown.open .dropdown-toggle::after,
.price-dropdown.open .dropdown-toggle::after {
    transform: rotate(180deg);
    margin-top: 0;
}

/* Сам дропдаун */
.type-dropdown .dropdown-menu,
.price-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    padding: 16px;
    margin-top: 6px;
    border: 1px solid var(--grey--grey80, #D7D7D7);
    border-radius: 8px;
    background: var(--white--white100, #FFF);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    display: none; /* скрыт по умолчанию */
}

/* При открытии */
.type-dropdown.open .dropdown-menu,
.price-dropdown.open .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 1;
    transform: translateY(0);
}
.dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #222324;
}

.dropdown__header .reset {
    background: none;
    border: none;
    color: var(--black--black10, #222324);
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 8px;
}
.filters__options .type-option {
    padding: 10px 16px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filters__options .type-option:hover {
    background-color: var(--grey--grey90, #F7F7F7);
}

.filters__options .type-option:active {
    background-color: var(--grey--grey80, #D7D7D7);
}

/* Кнопка "Показать" снизу */
.dropdown-actions {
    padding: 0;
}

.dropdown-actions .show {
    width: 100%;
    background: #006BE2;
    color: #fff;
    border: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
/* Опции */
.filters__type {
    display: flex;
}
.filters__options {
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

.type-option {
    font-size: 16px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
}
.type-option * {
    margin: 0;
    padding: 0;
    cursor: pointer;
}
.type-option label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.type-option.selected {
    background: var(--azure--azure100, #E6F0FC);
}

.type-option.selected:hover {
    background: var(--azure--azure90, #C8D7EF);
}
.reset {
    border-radius: 8px;
    transition: background-color .2s ease;
}
.reset:hover {
    background-color: var(--grey--grey90, #F7F7F7);
}
.reset:active {
    background-color: var(--grey--grey80, #D7D7D7);
}
.dropdown-actions .show-offers-button {
    background: var(--azure--azure50, #006BE2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background .2s ease;
}
.dropdown-actions .show-offers-button:hover {
    background: var(--azure--azure40, #0056B6);
}
.dropdown-actions .show-offers-button:active {
    background: var(--azure--azure30, #004189);
}
.address__suggest {
    flex: 40 0 auto;
    position: relative;
}
.address-input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding-right: 50px !important;
}
.address-input:active,
.address-input:focus,
.address-input:focus-visible {
    padding-top: 9px;
    padding-bottom: 9px;
    border: 2px solid var(--azure--azure50, #006BE2);
}
.suggest-box {
    position: absolute;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-top: 6px;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 2000;
    background-color: white;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    /*display: block; !* Изначально скрыт *!*/
    /*height: 200px;*/
    display: none; /* Изначально скрыт */
}
.dropdown1 {
    display: flex;
    min-width: 0;
    flex: 1 0 auto; /* если horizontal scroll */
}



.suggest-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
}

.suggest-item__title {
    font-size: 16px;
    color: var(--black--black10, #222324);
}
.suggest-item__subtitle {
    font-size: 10px;
    color: var(--black--black30, #4D4D4D);
}
.suggest-item:hover {
    background-color: #f0f0f0;
}

/* Модалка */
.filter-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: none; /* скрыто по умолчанию */
    justify-content: center;
    align-items: flex-end; /* прижимаем содержимое вниз */
    background-color: rgba(0,0,0,0.6);
    z-index: 1500;
    transition: all .2s ease;
}

.filter-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--white--white100, #FFFFFF);
    border-radius: 12px 12px 0 0;
    width: 80%;
    max-height: calc(100% - 40px);

    overflow: hidden;
    padding: 0 24px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.filter-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: center; /* центрируем всё */
    position: relative;
    background: var(--white--white100, #FFFFFF);
    padding: 24px 0;
    margin: 0 -24px;
    border-bottom: 1px solid var(--grey--grey80, #D7D7D7);
}

.filter-header h2 {
    flex: 1; /* занимает всё пространство */
    text-align: center;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.filter-header #filters-reset {
    display: none;
}

.filter-header .filter-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    padding: 4px;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.filter-footer {
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-bottom: 12px;
}



.tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f0f0f0;
    margin: 5px;
    cursor: pointer;
}
.tag.active {
    background: #007aff;
    color: #fff;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-tags {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.filter-group__title {
    color: var(--black--black10, #222324);
    font-size: 20px;
    font-weight: 600;
}

.characteristic__container {
    display: flex;
    /*flex-direction: row;*/
    /*align-items: center;*/
    /*justify-content: start;*/
    gap: 8px;
    padding: 0;
    margin: 0;
}

.radio-field-container {
    flex-wrap: wrap;
}

.select-multiply-field-container {
    position: relative;
}
.select-multiply-field-container svg{
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}
.select-multiply-dropdown.open {
     border-color: var(--azure--azure50, #006BE2) !important;
     outline: none;
 }



.form-group {
    margin: 0;
}

.form-control {
    padding: 16px !important;
    height: 50px !important;
}

.custom-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 16px !important;
    border: none !important;
    border-radius: 100px !important;
    background: var(--grey--grey90, #F7F7F7) !important;
}
.custom-checkbox-label:hover {
    background: var(--grey--grey80, #D7D7D7) !important;
}
.custom-checkbox-label.checked .option-remove-btn{
    display: flex;
}
.custom-checkbox-label.checked {
    background: var(--azure--azure100, #E6F0FC) !important;
}
.custom-checkbox-label.checked:hover {
    background: var(--azure--azure95, #CCE2FA) !important;
}
.option-remove-btn {
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}
.custom-checkbox-label::before {
    content: none !important;
}
.custom-rules-button {
    padding: 12px 16px;
    border: none;
    border-radius: 100px;
    background: var(--grey--grey90, #F7F7F7);
    font-size: 16px;
}
.custom-rules-button:hover {
    background: var(--grey--grey80, #D7D7D7);
}
.custom-rules-button.active {
    background: var(--azure--azure100, #E6F0FC);
}
.custom-rules-button.active:hover {
    background: var(--azure--azure95, #CCE2FA);
}
.floor-rules {
    display: flex;
    gap: 8px;
}
.checkbox-field-container {
    flex-direction: row;
    flex-wrap: wrap;
}

.characteristic__title {
    flex: 0 0 15%;
    margin: 0;
    padding: 0;
    color: var(--black--black10, #222324);
    font-size: 16px;
    font-weight: 400;
}

.dynamic-radio-field {
    padding: 12px 16px !important;
    border: none !important;
    border-radius: 100px !important;
    background: var(--grey--grey90, #F7F7F7) !important;
    font-size: 16px !important;
}
.dynamic-radio-field:hover {
    background: var(--grey--grey80, #D7D7D7) !important;
}
.dynamic-radio-field.checked {
    background: var(--azure--azure100, #E6F0FC) !important;
}
.dynamic-radio-field.checked:hover {
    background: var(--azure--azure95, #CCE2FA) !important;
}
.error-message {
    margin-top: 5px;
    color: red;
    font-size: 12px;
}
.address-input-wrapper {
    position: relative;
}

.input-clear {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    gap: 8px;
}
.clear-divider {
    border: 1px solid var(--grey--grey80, #D7D7D7);
}
.clear-icon {
    margin-top: 2px;
    cursor: pointer;
    font-size: 16px;
    color: #ccc;
    opacity: 0.7;
    transition: opacity .2s ease;
}
.clear-icon:hover {
    opacity: 1;
}
.common-filters {
    margin-top: 20px;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filter-row__label {
    font-weight: 600;
    font-size: 15px;
}

.filter-row__options {
    display: flex;
    gap: 12px;
}

.radio-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 16px;
    border: none;
    border-radius: 100px;
    background: var(--grey--grey90, #F7F7F7);
    font-size: 16px;
}
.radio-option:hover {
    background: var(--grey--grey80, #D7D7D7);
}
.radio-option.checked {
    background: var(--azure--azure100, #E6F0FC);
}

.radio-option input[type="radio"] {
    accent-color: #4A6CF7; /* твой фирменный цвет */
}
.dropdown-menu--portal {
    display: flex !important;
    flex-direction: column;
    gap: 24px;
    opacity: 1;
    transform: translateY(0);
}

@media only screen and (max-width: 1280px){
    .filter-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Firefox */
    .filter-bar {
        scrollbar-width: none;
    }
    /* WebKit */
    .filter-bar::-webkit-scrollbar {
        display: none;
    }
    .type-dropdown .dropdown-menu,
    .price-dropdown .dropdown-menu {
        position: fixed; /* JS проставит top/left */
    }
}
@media only screen and (max-width: 768px) {
    .filter-body {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 0 15px;
        gap: 0;
        position: relative;
    }

    .filter-header {
        justify-content: flex-end;
        padding: 0;
        margin: 0 -15px 20px;
    }

    .filter-header h2 {
        display: none;
    }

    .filter-header #filters-reset {
        display: block;
    }
    .filter-footer #filters-reset {
        display: none;
    }

    .filter-header .filter-close {
        right: auto;
        left: 15px;
        padding: 0;
    }
    .filter-bar[data-filterbar="modal"] {
        overflow-x: visible;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 8px 0;
    }
    .filter-bar[data-filterbar="modal"] .address__suggest {
        grid-column: 1 / -1;
    }
    .filter-group {
        margin-top: 16px;
    }
    .type-dropdown,
    .price-dropdown{
        display: flex;
        height: 48px;
    }
    .dropdown-toggle {
        flex-grow: 1;
    }
    .characteristic__container {
        flex-direction: column;
        align-items: flex-start;
    }
    .double-select-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    .floor-rules {
        grid-column: 1 / -1;
    }
    .filter-tags {
        padding-bottom: 80px;
    }
    .filter-footer {
        position: absolute;
        bottom: 0;
        left: 24px;
        right: 24px;
        background: transparent;
    }
    .show-offers-button {
        width: 100%;
    }
}