/* Стили для результатов поиска */

/* Основной контейнер */
.results-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
}

.objects-container {
    flex: 1;
    max-width: 100%;
    transition: max-width 0.3s ease;
}

.map-container {
    display: none;
    flex: 1;
    position: sticky;
    top: 76px;
    padding-left: 20px;
    height: calc(100vh - 40px);
}

@media (min-width: 1200px) {
    .objects-container.with-map {
        max-width: 890px;
    }
    .map-container.show-on-desktop {
        display: block;
    }
}

/* Отображение цены */
.price {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b6b;
    margin: 10px 0 0;
}

/* Стили для фильтра и сортировки */
.filter-container {
    text-align: center;
    margin-bottom: 20px;
}

.filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: auto;
    gap: 24px;
}

/* Стики-поведение для десктопа */
@media (min-width: 769px) {
    /* Сначала делаем все родительские контейнеры с position: static */
    .search-results, .results-container, .objects-container {
        position: static !important;
        overflow: visible !important;
    }
    
    /* Затем настраиваем sticky-позиционирование для фильтра */
    .filter-container {
        position: sticky;
        top: 64px;
        z-index: 1000;
        background-color: white;
        padding: 20px 0;
        border-bottom: 1px solid #f5f5f5;
        width: 100%;
        margin-top: -1px;
    }
}

/* Стили для фильтра спален */
.bedroom-filter {
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.filter-label {
    font-weight: 500;
    margin-right: 8px;
}

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

.bedroom-option {
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.bedroom-option:hover {
    background-color: #f5f5f5;
}

.bedroom-option.active {
    background-color: #E61F4E;
    color: white;
}

/* Сортировка */
.sort-container {
    display: flex;
    align-items: center;
}

.price-toggle button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.price-toggle button:hover, .price-toggle button.active {
    background-color: #f5f5f5;
    border-color: #aaa;
}

.sort-arrow {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.sort-arrow-up svg {
    transform: rotate(0deg);
}

.sort-arrow-down svg {
    transform: rotate(180deg);
}

.sort-dropdown select {
    display: none;
}

/* Стили для ленивой загрузки */
.lazy-property {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.lazy-property img {
    opacity: 0;
    transition: opacity 0.5s;
}

.lazy-property img.loaded {
    opacity: 1;
}

@keyframes fadeIn {
    to { opacity: 1; }
}





/* Модальное окно фильтров */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.filter-modal.active {
    display: block;
    opacity: 1;
}

.filter-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.filter-modal.active .filter-modal-content {
    transform: translateY(0);
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-filter-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.filter-modal-body {
    padding: 16px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.filter-section .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bedroom-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.bedroom-pill {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    flex: 1;
    min-width: 40px;
}

.bedroom-pill.active {
    background-color: #E61F4E;
    color: white;
    border-color: #E61F4E;
}

.filter-modal-footer {
    padding: 16px;
    border-top: 1px solid #eee;
    text-align: center;
    display: none;
}

.filter-modal-footer.visible {
    display: block;
}

.apply-filters {
    width: 100%;
    padding: 12px;
    background-color: #E61F4E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.filter-options .modal-option {
    padding: 8px 16px;
}

.modal-option {
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-option.active {
    background-color: #E61F4E;
    color: white;
    border-color: #E61F4E;
}

.filter-section .sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Сортировка в модальном окне */
.price-toggle-modal button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100px;
    padding: 8px 16px;
}

#priceToggleModal.active {
    background-color: white;
    color: initial;
    border-color: #ccc;
}

.sort-arrow-modal {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.sort-arrow-up-modal svg {
    transform: rotate(0deg);
}

.sort-arrow-down-modal svg {
    transform: rotate(180deg);
}

/* Адаптивность */
@media (max-width: 768px) {
    /* Скрываем основной блок фильтров на мобильных устройствах */
    .filter-container {
        display: none;
    }
    
    .filter-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .bedroom-filter, .price-toggle button {
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .filter-label {
        margin-right: 4px;
    }
    
    .filter-options {
        gap: 4px;
    }
    
    .bedroom-option {
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    
    .sticky-left-content {
        padding-right: 5px;
    }
    
    .sticky-left-content .start-search-button {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* Сообщение о отсутствии результатов */
.no-results-message {
    text-align: center;
    padding: 50px 20px;
} 