/* CasaTransparente — mapa protagonista, responsive (patrón AguaLimpia). */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

body {
    display: flex;
    flex-direction: column;
    background: #f5f6f8;
    color: #263238;
}

/* ---------- Barra superior ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #263238;
    color: #fff;
    z-index: 5;
}

.topbar-title h1 { font-size: 1.25rem; }
.topbar-title .subtitle { font-size: 0.8rem; color: #b0bec5; }

.leyenda { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; color: #eceff1; }
.dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Mapa + resumen ---------- */
.map-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
}

#map { position: absolute; inset: 0; }

.map-notice {
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    background: #fff3cd;
    border: 1px solid #ffe082;
    color: #795548;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 3;
    max-width: 90%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.hidden { display: none !important; }

.summary {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(255,255,255,.96);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    padding: 12px 16px;
    min-width: 190px;
    z-index: 2;
    font-size: 0.85rem;
}

.summary-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.summary-numbers { font-size: 2rem; font-weight: 800; color: #e65100; line-height: 1.1; }
.summary-note { color: #546e7a; }
.summary-caption { color: #90a4ae; font-size: 0.75rem; margin-top: 2px; }
.summary-detail { margin-top: 8px; border-top: 1px solid #eceff1; padding-top: 6px; color: #455a64; font-size: 0.78rem; }
.summary-detail div { display: flex; justify-content: space-between; gap: 12px; }
.summary-detail b { font-weight: 700; color: #263238; }

/* ---------- Ficha (InfoWindow personalizada) ---------- */
.ficha { font-size: 0.82rem; line-height: 1.45; min-width: 210px; }
.ficha h3 { font-size: 0.95rem; margin-bottom: 4px; color: #263238; }
.ficha .ref { font-family: ui-monospace, monospace; font-size: 0.75rem; word-break: break-all; color: #546e7a; }
.ficha table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ficha td { padding: 2px 0; vertical-align: top; }
.ficha td.k { color: #78909c; padding-right: 8px; white-space: nowrap; }
.ficha .etiqueta { display: inline-block; padding: 1px 8px; border-radius: 10px; color: #fff; font-size: 0.72rem; }

/* ---------- Pie ---------- */
.foot {
    padding: 8px 16px;
    background: #eceff1;
    font-size: 0.75rem;
    color: #546e7a;
    text-align: center;
    z-index: 5;
}
.foot a { color: #1565c0; }

/* ---------- Móvil: el mapa manda, el resumen se compacta ---------- */
@media (max-width: 640px) {
    .topbar { padding: 8px 12px; }
    .topbar-title h1 { font-size: 1.05rem; }
    .summary {
        top: auto; right: auto;
        left: 10px; bottom: 10px;
        min-width: 0;
        padding: 8px 12px;
    }
    .summary-numbers { font-size: 1.4rem; }
    .summary-note, .summary-caption { display: none; }
    .summary-detail { display: none; }
    .leyenda { font-size: 0.7rem; }
}
