/**
 * Map Search Styles
 * Marker clusters, price markers, popups, split-view
 */

/* ── Marker Clusters ── */
.map-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-cluster .cluster-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.map-cluster-small .cluster-inner {
    background: #525AFF;
}

.map-cluster-medium .cluster-inner {
    background: #3538bf;
}

.map-cluster-large .cluster-inner {
    background: #D3045D;
}

/* ── Price Markers ── */
.price-marker-container {
    background: none !important;
    border: none !important;
}

.price-marker {
    background: #fff;
    color: #1e1f66;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid #525AFF;
    transform: translate(-50%, -100%);
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
}

.price-marker::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #525AFF;
}

.price-marker.marker-venta {
    border-color: #16a34a;
}
.price-marker.marker-venta::after {
    border-top-color: #16a34a;
}

.price-marker.marker-arriendo {
    border-color: #2563eb;
}
.price-marker.marker-arriendo::after {
    border-top-color: #2563eb;
}

.marker-highlight .price-marker,
.price-marker:hover {
    background: #525AFF;
    color: #fff;
    transform: translate(-50%, -100%) scale(1.1);
    z-index: 10000 !important;
}

/* ── Property Popup ── */
.property-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.property-popup .leaflet-popup-content {
    margin: 0;
    min-width: 240px;
    max-width: 280px;
}

.property-popup .leaflet-popup-tip {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ── Map Card hover effect ── */
.map-card {
    transition: background-color 0.15s ease;
}

.map-card:hover {
    background-color: rgba(82, 90, 255, 0.04);
}

/* ── Hide Leaflet attribution on small screens ── */
@media (max-width: 768px) {
    .leaflet-control-attribution {
        display: none;
    }

    #map-properties-panel {
        display: none;
    }

    #map-container {
        width: 100% !important;
    }
}

/* ── Leaflet cluster animation ── */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

/* ── Scrollbar styling for panel ── */
#map-properties-panel::-webkit-scrollbar {
    width: 6px;
}

#map-properties-panel::-webkit-scrollbar-track {
    background: transparent;
}

#map-properties-panel::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#map-properties-panel::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
