/* Leaflet map containers */
#gmap,
.leaflet-map-container {
    width: 100%;
    height: 450px;
    z-index: 1;
}

#map {
    width: 100%;
    z-index: 1;
}

/* Mappa elenco immobili: altezza contenuta per non coprire il footer */
#mappa-ricerca #map {
    height: 280px;
    max-height: 35vh;
    margin-bottom: 20px;
}

@media (min-width: 1000px) {
    #mappa-ricerca #map {
        height: 615px;
        max-height: 55vh; 
    }
}

/* Polygon search modal */
.leaflet-polygon-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.leaflet-polygon-modal.is-open {
    display: flex;
}

.leaflet-polygon-dialog {
    background: #fff;
    border-radius: 4px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.leaflet-polygon-header {
    padding: 15px 20px;
    background: #014889;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.leaflet-polygon-header .leaflet-polygon-title {
    flex: 1;
}

.leaflet-polygon-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
}

.leaflet-polygon-close:hover {
    opacity: 1;
}

.leaflet-polygon-body {
    flex: 1;
    min-height: 400px;
}

.leaflet-polygon-body .leaflet-map-container {
    height: 400px;
}

.leaflet-polygon-footer {
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
}

.leaflet-polygon-footer button {
    padding: 8px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.leaflet-polygon-footer .btn-reset {
    background: #eee;
    color: #333;
}

.leaflet-polygon-footer .btn-confirm {
    background: #014889;
    color: #fff;
}

.ricerca-mappa-btn {
    width: 100%;
    padding: 8px 12px;
    background: #014889;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.ricerca-mappa-btn:hover {
    background: #013a6d;
}

.leaflet-polygon-hint {
    padding: 8px 20px;
    background: #f5f5f5;
    font-size: 13px;
    color: #666;
}
