/* ==========================================================================
   Omnicasa map view — Mapbox list + map layout, single-property map, popups
   Expected containers (placed by the theme / Elementor):
     #properties-map-container  — outer wrapper (sets height)
     #properties-map            — map canvas target
     #properties-map-list       — Elementor Loop Grid (CSS ID)
     #property-map              — single-property map ([property_map])
   ========================================================================== */

.--hide {
    display: none !important;
}

#properties-map-container {
    height: 80vh;
    min-height: 400px;
    max-height: 900px;
}

#properties-map {
    height: 100%;
    width: 100%;
    border-radius: 5px;
}

#properties-map-list .e-loop-item {
    cursor: pointer;
    transition: background .3s ease-in-out;
}

#properties-map-list .e-loop-item:hover,
#properties-map-list .e-loop-item.active {
    background-color: var(--e-global-color-6ebdad1, #f5f1ea);
}

#property-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.property-map-container,
.property-map-container .elementor-shortcode {
    height: 100%;
}

/* Markers */

.oc-map-marker {
    cursor: pointer;
    transition: opacity .3s ease;
    z-index: 1;
}

.oc-map-marker svg {
    width: 32px;
    height: auto;
    display: block;
    transition: transform .3s ease;
    transform-origin: 50% 100%;
}

.oc-map-marker.active svg,
.oc-map-marker:hover svg {
    transform: scale(1.2);
}

.oc-map-marker.active {
    z-index: 10;
}

/* Progressive-load spinner pinned to the map's bottom-right while the full
   marker set is being fetched over AJAX. */
.oc-map-loading {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

/* Popup card */

.oc-map-popup {
    display: block;
    width: 220px;
    color: inherit;
    text-decoration: none !important;
    overflow: hidden;
    border-radius: 4px;
}

.oc-map-popup--loading {
    width: 80px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oc-map-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--e-global-color-primary, #b5a07c);
    border-radius: 50%;
    animation: oc-map-spin .8s linear infinite;
}

@keyframes oc-map-spin {
    to { transform: rotate(360deg); }
}

.oc-map-popup__image {
    display: block;
    width: 100%;
    height: 130px !important;
    object-fit: cover;
}

.oc-map-popup__body {
    padding: 15px;
}

.oc-map-popup h3 {
    margin: 0 0 4px;
    font-size: .95rem !important;
    line-height: inherit !important;
}

.oc-map-popup p {
    margin: 0;
    font-size: .85rem;
}

.oc-map-popup__price {
    font-weight: 600;
    margin-top: 4px !important;
}

.oc-map-popup__link {
    display: block;
    font-size: .8rem !important;
    text-transform: uppercase;
    color: var(--e-global-color-primary);
    margin-top: 10px;
    text-decoration: none !important;
}

/* Mapbox control overrides */

.mapboxgl-ctrl-logo {
    display: none !important;
}

.mapboxgl-ctrl button {
    background: transparent !important;
    padding: 0 !important;
    border: 0 !important;
}

.mapboxgl-popup {
    margin-top: -35px;
    max-width: none !important;
    z-index: 1;
}

.mapboxgl-popup-content {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 6px;
}

.mapboxgl-popup-close-button {
    padding: 0 5px !important;
    color: #fff !important;
    border: none !important;
    background: none !important;
    top: 4px !important;
    right: 4px !important;
    font-size: 1.2rem !important;
}

@media only screen and (max-width: 1024px) {
    #properties-map {
        height: 55vh;
        height: 55svh;
    }

    #properties-map-list {
        max-height: 45vh;
        max-height: 45svh;
    }

    #properties-map-container {
        height: auto;
        min-height: unset;
        max-height: unset;
    }
}
