@media (max-width: 768px) {
    .mobile-map-container {
        height: 50vh;
        width: 100%;
        position: relative;
        margin-bottom: 0;
        display: block;
        overflow: hidden;
    }
    .mobile-map-container #mobile-map {
        height: 100%;
        width: 100%;
    }
    
    .map-expanded #mobile-map {
        height: 100vh;  /* Fallback */
        height: 100dvh; /* Dynamic viewport */
        height: var(--real-viewport-height, 100vh); /* iOS 26+ fix */
    }
    .map-expand-btn {
        position: absolute;
        bottom: 10px;
        right: 10px;
        z-index: 1000;
        background: white;
        border: none;
        border-radius: 4px;
        padding: 8px 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        font-weight: 500;
    }
    .map-expanded .mobile-map-container {
        position: absolute;
        top: 55px;
        left: 0;
        height: 100vh;  /* Fallback для старых браузеров */
        height: 100dvh; /* Dynamic viewport height - учитывает адресную строку */
        height: var(--real-viewport-height, 100vh); /* JS-based height для iOS 18+ */
        width: 100vw;
        z-index: 2000;
        border-radius: 0;
    }
    .map-expanded .map-expand-btn {
        content: 'Collapse';
    }
    .map-close-btn {
        display: none;
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2001;
        background: white;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 18px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .map-expanded .map-close-btn {
        display: block;
    }
    
    /* Скрываем элементы, которые не нужны на мобильных */
    .map-preview-container-wrapper, 
    .map-popup,
    .map-container {
        display: none;
    }
    
    
    .map-popup-object h2 {
        font-size: 14px !important;
    }
}

@media (min-width: 769px) {
    .mobile-map-container {
        display: none;
    }
}

/* Стили для маркеров с ценой (как в десктопной версии) */
.price-marker-container {
    background: none;
    border: none;
}

.custom-price-marker {
    position: relative;
    width: 100%;
    height: 100%;
}

.price-marker {
    position: absolute;
    background-color: white;
    padding: 4px 8px;
    border-radius: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    color: #333;
    white-space: nowrap;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    transform-origin: center center;
    will-change: transform, z-index;
    z-index: 2;
}

.price-marker:hover,
.price-marker.highlight {
    background-color: #E61F4E;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transform: scale(1.15);
    z-index: 2000 !important;
}

/* Обеспечиваем контейнер Leaflet правильным стекингом */
.leaflet-marker-pane > * {
    transition: z-index 0.1s ease;
}

/* Стили для попапов на карте */
.leaflet-popup-content {
    margin: 0 !important;
    padding: 0;
}

.map-popup-object {
    padding: 10px;
}

.map-popup-object img {
    display: block;
    border-radius: 4px;
    margin-bottom: 10px;
    height: 150px;
    width: 100%;
    object-fit: cover;
}

.map-popup-object h2 {
    margin: 0;
    font-size: 16px;
}

.map-object-popup .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
}

/* Стили для информационного блока фильтра */
.map-filter-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px 15px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
    display: none;
}

.map-filter-info.active {
    display: block;
}

.filter-count {
    font-weight: bold;
    color: #E61F4E;
}

.reset-filter-btn, .reset-map-btn {
    background-color: #E61F4E;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
}

/* Стили для скрытия объектов, находящихся вне видимой области карты */
#properties-list li.outside-bounds {
    display: none;
}

/* Стили для сообщения об отсутствии результатов */
.filter-no-results-message {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 50px 20px;
    margin: 20px 0;
    text-align: center;
}

.filter-no-results-message h3 {
    margin-top: 0;
    color: #333;
}

.filter-no-results-message p {
    margin-bottom: 0;
    color: #666;
}

/* Стили для точечных маркеров */
.dot-marker-container {
    background: none;
    border: none;
}

.custom-dot-marker {
    position: relative;
    width: 100%;
    height: 100%;
}

.dot-marker {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.single-dot {
    background-color: #E61F4E;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cluster-dot {
    background-color: #FF6B35;
    color: white;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    font-size: 10px;
}

.dot-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* Стили для попапа кластера */
.map-popup-cluster {
    padding: 15px;
    text-align: center;
}

.map-popup-cluster h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.map-popup-cluster p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.map-cluster-popup .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
} 