/* Встроенная карта каталога */
.catalog-map-container {
    display: none;
    width: 100%;
    background: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 30px 0 40px 0;
    height: clamp(400px, calc(400px + (900 - 400) * ((100vw - 576px) / (1920 - 576))), 900px);
    position: relative;
}

.catalog-map {
    position: relative;
    background: #F5F5F5;
    width: 100%;
    height: 100%;
}

#catalog-map {
    width: 100%;
    height: 100%;
}

.catalog-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #353331;
    text-align: center;
}

.loading-text.error {
    color: #E53E3E;
}

.catalog-map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
}

.catalog-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #353331;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-marker-available {
    background: #4CAF50;
}

.legend-marker-sold {
    background: #999999;
}

/* Стили для балунов карты */
.map-balloon {
    font-family: 'Commissioner', sans-serif;
    max-width: 250px;
}

.balloon-price {
    font-weight: 600;
    font-size: 18px;
    color: #353331;
    margin-bottom: 8px;
}

.balloon-location {
    font-weight: 400;
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
}

.balloon-country-city {
    font-weight: 500;
    font-size: 13px;
    color: #353331;
    margin-bottom: 12px;
    padding: 4px 8px;
    background: rgba(53, 51, 49, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.balloon-link a {
    display: inline-block;
    background: #353331;
    color: #FFFFFF;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.3s ease;
}

.balloon-link a:hover {
    background: #2A2825;
}

/* Планшет */
@media (max-width: 991px) {
    .catalog-map-container {
        margin: 25px 0 35px 0;
        border-radius: 8px;
        height: 850px;
    }
}

/* Мобайл */
@media (max-width: 575px) {
    .catalog-map-container {
        margin: 20px 0 30px 0;
        border-radius: 8px;
        height: 400px;
    }
    
    .catalog-map-legend {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 12px;
        flex-direction: row;
        justify-content: space-around;
    }
    
    .catalog-map-legend-item {
        font-size: 12px;
    }
    
    .legend-marker {
        width: 10px;
        height: 10px;
    }
}

/* Дополнительные стили для Яндекс карт */
.catalog-map [class*="ymaps"] {
    font-family: 'Commissioner', sans-serif !important;
}

/* Анимация появления карты */
.catalog-map-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кластеризация маркеров */
.catalog-map [class*="ymaps"][class*="cluster"] {
    background: #353331 !important;
    color: #FFFFFF !important;
    border-radius: 50% !important;
    font-family: 'Commissioner', sans-serif !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(53, 51, 49, 0.3) !important;
    border: 3px solid #FFFFFF !important;
}

/* Стили для подписей маркеров */
.catalog-map [class*="ymaps"][class*="caption"] {
    font-family: 'Commissioner', sans-serif !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(5px) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    color: #353331 !important;
}

/* Улучшенные балуны */
.catalog-map [class*="ymaps"][class*="balloon"] {
    font-family: 'Commissioner', sans-serif !important;
}

/* Анимация для маркеров */
.catalog-map [class*="ymaps"][class*="placemark"] {
    transition: transform 0.2s ease !important;
}

.catalog-map [class*="ymaps"][class*="placemark"]:hover {
    transform: scale(1.1) !important;
    z-index: 1000 !important;
}