/* ===========================
   Map styles (RIABITARE)
   =========================== */

:root {
    --brand: #34546A;
    --bg: #f5f5f5;
    --card-radius: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,.15);
}

/* Card contenitore mappa */
.map-card {
    width: min(100%, 720px);
    border-radius: var(--card-radius);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.04);
    margin: 30px auto;
}

.map-header {
    padding: 14px 18px;
    font-weight: 600;
    color: #223;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(52,84,106,.15);
}

.map-header-icon {
    width: 24px;   /* ingrandisci qui */
    height: 24px;  /* mantieni proporzioni */
    margin-right: 8px; /* un po' di spazio dal testo */
}

/* Contenitore mappa */
#map { height: 420px; width: 100%; }

/* Controlli: spostati in basso-dx, nessun "riquadro grigio",
   container non blocca il drag ma i bottoni restano cliccabili */
#map .ol-zoom, #map .ol-rotate {
    top: 12px !important; /* Sposta in alto */
    left: 12px !important; /* Sposta a sinistra */
    right: auto !important;
    bottom: auto !important;
}
#map .ol-control {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    pointer-events: none;         /* il container NON cattura il drag */
}
#map .ol-control button {
    pointer-events: auto;         /* i bottoni restano cliccabili */
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid rgba(0,0,0,.08);
    width: 34px; height: 34px; font-size: 18px;
    background: #fff; color: #1f2a37;
}
#map .ol-control button:hover { background: #f2f4f7; }

/* UX: cursore “grab” durante il drag */
#map .ol-viewport { cursor: grab; }
#map .ol-viewport:active { cursor: grabbing; }

/* === Fumetto elegante (come foto 2) === */
.map-bubble {
    position: absolute;
    pointer-events: none;               /* pass-through per il drag */
    z-index: 1000;
    background: #fff;
    color: #1f2937;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
    border: 1px solid rgba(0,0,0,.06);
    min-width: 240px;
    max-width: 320px;
    text-align: left;
    line-height: 1.35;
}
.map-bubble .title {
    font: 700 15px "Poppins", system-ui, -apple-system, sans-serif;
    letter-spacing: .2px;
    margin-bottom: 4px;
}
.map-bubble .addr {
    font: 500 14px "Poppins", system-ui, -apple-system, sans-serif;
    color: #4b5563;
}

/* Triangolino sotto al fumetto — deve combaciare con TRIANGLE_H nel JS */
.map-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;                      /* = TRIANGLE_H in JS */
    border-width: 10px 10px 0 10px;     /* = TRIANGLE_H */
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    filter: drop-shadow(0 -1px 0 rgba(0,0,0,.08));
}

/* Responsive */
@media (max-width: 560px) {
    #map { height: 360px; }
}
