:root {
    --mapa-bordo: #961f27;
    --mapa-bordo-oscuro: #71151c;
    --mapa-dorado: #d5a235;
    --mapa-tinta: #171717;
    --mapa-suave: #686762;
    --mapa-fondo: #f4f4f1;
    --mapa-borde: rgba(23, 23, 23, .12);
}

@keyframes mapa-pulso { 50% { opacity: .55; } }

body.mapa-beta-is-embedded { overflow: hidden; }
body.mapa-beta-is-embedded > .punto-sticky-header,
body.mapa-beta-is-embedded > .punto-footer,
body.mapa-beta-is-embedded > .punto-whatsapp-float { display: none !important; }
body.mapa-beta-is-embedded main { min-height: 0; }
body.mapa-beta-is-embedded .mapa-beta-page { height: 100dvh; min-height: 520px; }
body.mapa-beta-is-embedded .mapa-beta-topbar { display: none; }

.mapa-beta-page { display: flex; height: calc(100dvh - 82px); min-height: 650px; flex-direction: column; background: var(--mapa-fondo); color: var(--mapa-tinta); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.mapa-beta-topbar { position: relative; z-index: 8; display: grid; grid-template-columns: minmax(300px, .75fr) minmax(380px, 1.25fr); gap: clamp(2rem, 5vw, 7rem); align-items: center; padding: 1.05rem clamp(1rem, 3vw, 3rem); border-bottom: 1px solid var(--mapa-borde); background: rgba(255,255,255,.96); }
.mapa-beta-topbar h1 { margin: .12rem 0 0; font-size: clamp(1.4rem, 2.2vw, 2.15rem); font-weight: 850; letter-spacing: -.05em; }
.mapa-beta-topbar h1 span { display: inline-block; padding: .16rem .45rem; border-radius: 999px; background: rgba(213,162,53,.2); color: #79570f; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.mapa-beta-topbar p { margin: .15rem 0 0; color: var(--mapa-suave); font-size: .88rem; }
.mapa-beta-kicker, .mapa-beta-overline { color: var(--mapa-bordo); font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }

.mapa-beta-search-wrap { position: relative; width: min(100%, 760px); justify-self: end; }
.mapa-beta-search { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: .65rem; align-items: center; min-height: 3.3rem; padding: .25rem .45rem .25rem 1rem; border: 1px solid rgba(23,23,23,.17); border-radius: 1rem; background: #fff; box-shadow: 0 9px 28px rgba(20,20,20,.08); transition: border-color .18s ease, box-shadow .18s ease; }
.mapa-beta-search:focus-within { border-color: var(--mapa-bordo); box-shadow: 0 0 0 4px rgba(150,31,39,.1), 0 12px 30px rgba(20,20,20,.1); }
.mapa-beta-search svg { width: 1.3rem; fill: none; stroke: var(--mapa-bordo); stroke-width: 2; stroke-linecap: round; }
.mapa-beta-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--mapa-tinta); font: inherit; font-weight: 650; }
.mapa-beta-search input::placeholder { color: #898883; font-weight: 500; }
.mapa-beta-search button { width: 2.4rem; height: 2.4rem; border: 0; border-radius: .75rem; background: #f0efeb; color: var(--mapa-suave); font-size: 1.5rem; line-height: 1; }
.mapa-beta-results { position: absolute; inset: calc(100% + .45rem) 0 auto; z-index: 20; max-height: min(440px, 55vh); overflow: auto; padding: .45rem; border: 1px solid var(--mapa-borde); border-radius: 1rem; background: #fff; box-shadow: 0 22px 50px rgba(20,20,20,.18); }
.mapa-beta-result { display: grid; grid-template-columns: 2.25rem 1fr; gap: .7rem; width: 100%; padding: .65rem; border: 0; border-radius: .75rem; background: transparent; color: var(--mapa-tinta); text-align: left; }
.mapa-beta-result:hover, .mapa-beta-result:focus { outline: 0; background: #f2f1ed; }
.mapa-beta-result-icon { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border-radius: .7rem; background: rgba(150,31,39,.1); }
.mapa-beta-result strong, .mapa-beta-result small { display: block; }
.mapa-beta-result small { margin-top: .1rem; color: var(--mapa-suave); }
.mapa-beta-result-empty { padding: 1rem; color: var(--mapa-suave); text-align: center; }
.mapa-beta-result-external { margin-top: .35rem; border-top: 1px solid var(--mapa-borde); border-radius: .25rem .25rem .75rem .75rem; }
.mapa-beta-result-external .mapa-beta-result-icon { background: rgba(213,162,53,.2); color: var(--mapa-bordo); font-size: 1.15rem; font-weight: 900; }
.mapa-beta-result-external strong { color: var(--mapa-bordo); }
.mapa-beta-result-loading { animation: mapa-pulso 1.2s ease-in-out infinite; }
.mapa-beta-detail-source { margin: .7rem 0 0; padding-top: .6rem; border-top: 1px solid var(--mapa-borde); color: var(--mapa-suave); font-size: .7rem; }

.mapa-beta-workspace { display: grid; min-height: 0; flex: 1 1 auto; grid-template-columns: 330px minmax(0,1fr); }
.mapa-beta-sidebar { position: relative; z-index: 5; overflow-y: auto; padding: 1rem; border-right: 1px solid var(--mapa-borde); background: #f7f7f4; }
.mapa-beta-card { padding: 1rem; border: 1px solid var(--mapa-borde); border-radius: 1.15rem; background: #fff; box-shadow: 0 8px 25px rgba(20,20,20,.055); }
.mapa-beta-card + .mapa-beta-card { margin-top: .85rem; }
.mapa-beta-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; }
.mapa-beta-card-heading h2, .mapa-beta-detail h2, .mapa-beta-popup-card h2 { margin: .1rem 0 0; font-size: 1.05rem; font-weight: 850; }
.mapa-beta-card-heading button { border: 0; background: transparent; color: var(--mapa-bordo); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.mapa-beta-layers > label { display: grid; grid-template-columns: 1.1rem .8rem 1fr; gap: .6rem; align-items: center; padding: .58rem .2rem; border-top: 1px solid rgba(23,23,23,.07); cursor: pointer; }
.mapa-beta-layers > label:hover { color: var(--mapa-bordo); }
.mapa-beta-layers input { width: 1rem; height: 1rem; accent-color: var(--mapa-bordo); }
.mapa-beta-layers label > span:last-child { font-size: .86rem; font-weight: 750; }
.mapa-beta-layers small { display: block; margin-top: .05rem; color: var(--mapa-suave); font-size: .68rem; font-weight: 500; }
.mapa-beta-swatch { width: .68rem; height: .68rem; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.mapa-beta-swatch.is-instituciones { background: #3f51a3; }
.mapa-beta-swatch.is-plazas { background: #2f855a; }
.mapa-beta-swatch.is-comercios { background: #16836b; }
.mapa-beta-swatch.is-farmacias { background: #278344; }
.mapa-beta-secondary-layers { margin: .45rem 0 .8rem; border-top: 1px solid #e2ddd8; border-bottom: 1px solid #e2ddd8; }
.mapa-beta-secondary-layers summary { cursor: pointer; padding: .7rem 0; color: #7a171b; font-weight: 700; }
.mapa-beta-swatch.is-lugares { background: #b63f82; }
.mapa-beta-swatch.is-cpcs { background: #961f27; }
.mapa-beta-swatch.is-reclamos { background: #d97706; }
.mapa-beta-swatch.is-barrios { border: 2px solid #961f27; background: rgba(213,162,53,.28); }
.mapa-beta-topics { margin: .8rem -.2rem -.2rem; padding: .85rem .2rem .1rem; border-top: 1px solid var(--mapa-borde); }
.mapa-beta-topics-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .55rem; }
.mapa-beta-topics-heading p { margin: .08rem 0 0; color: var(--mapa-suave); font-size: .7rem; }
.mapa-beta-topics-heading button { padding: .15rem 0; }
.mapa-beta-topic-grid { display: grid; grid-template-columns: 1fr; gap: .36rem; }
.mapa-beta-topic-grid label { position: relative; display: grid; grid-template-columns: 1.75rem minmax(0,1fr); gap: .58rem; align-items: center; min-height: 2.75rem; padding: .42rem .55rem; border: 1px solid rgba(23,23,23,.09); border-radius: .7rem; background: #fafaf8; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.mapa-beta-topic-grid label:hover { border-color: color-mix(in srgb, var(--topic-color) 65%, white); background: #fff; }
.mapa-beta-topic-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mapa-beta-topic-icon { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border-radius: .52rem; background: color-mix(in srgb, var(--topic-color) 14%, white); color: var(--topic-color); font-size: .58rem; font-weight: 900; }
.mapa-beta-topic-grid label > span:last-child { min-width: 0; overflow-wrap: anywhere; font-size: .76rem; font-weight: 760; line-height: 1.2; }
.mapa-beta-topic-grid label small { display: inline; margin-left: .35rem; color: var(--mapa-suave); font-size: .66rem; font-weight: 650; white-space: nowrap; }
.mapa-beta-topic-grid label:has(input:checked) { border-color: var(--topic-color); background: var(--topic-color); color: #fff; }
.mapa-beta-topic-grid label:has(input:checked) .mapa-beta-topic-icon { background: #fff; }
.mapa-beta-topic-grid label:has(input:checked) small { color: rgba(255,255,255,.78); }
.mapa-beta-topics-note { margin: .55rem 0 0; color: var(--mapa-suave); font-size: .62rem; line-height: 1.35; }
.mapa-beta-agenda-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(23,23,23,.07); }
.mapa-beta-agenda-links a { padding: .28rem .52rem; border: 1px solid rgba(150,31,39,.2); border-radius: 999px; color: var(--mapa-bordo); font-size: .65rem; font-weight: 800; text-decoration: none; }
.mapa-beta-agenda-links small { flex: 1 0 100%; color: var(--mapa-suave); font-size: .58rem; line-height: 1.3; }

.mapa-beta-detail { position: relative; }
.mapa-beta-detail-close { position: absolute; top: .65rem; right: .65rem; z-index: 1; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: #efefeb; color: var(--mapa-suave); font-size: 1.25rem; line-height: 1; }
.mapa-beta-detail-empty { padding: .35rem 0; text-align: center; }
.mapa-beta-detail-empty p { color: var(--mapa-suave); font-size: .82rem; }
.mapa-beta-compass { display: grid; width: 3rem; height: 3rem; margin: 0 auto .7rem; place-items: center; border-radius: 50%; background: rgba(213,162,53,.2); color: var(--mapa-bordo); font-size: 1.55rem; }
.mapa-beta-hint { margin-bottom: 0; padding: .55rem; border-radius: .65rem; background: #f5f4f0; }
.mapa-beta-detail-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .48rem; border-radius: 999px; background: rgba(150,31,39,.09); color: var(--mapa-bordo); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.mapa-beta-detail-content h2 { margin: .65rem 2rem .25rem 0; font-size: 1.2rem; }
.mapa-beta-detail-meta { margin: 0; color: var(--mapa-suave); font-size: .8rem; }
.mapa-beta-detail-description { margin: .65rem 0 0; color: #393939; font-size: .79rem; line-height: 1.45; }
.mapa-beta-detail-address { margin: .65rem 0 0; padding-top: .65rem; border-top: 1px solid var(--mapa-borde); font-size: .82rem; }
.mapa-beta-detail-row { margin: .65rem 0 0; font-size: .79rem; line-height: 1.4; }
.mapa-beta-detail-row span { color: var(--mapa-suave); }
.mapa-beta-detail-contact { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; margin-top: .65rem; }
.mapa-beta-detail-contact p { min-width: 0; margin: 0; padding: .48rem; border-radius: .6rem; background: #f5f4f0; font-size: .72rem; overflow-wrap: anywhere; }
.mapa-beta-detail-count { margin-top: .65rem; }
.mapa-beta-detail-privacy { margin: .65rem 0 0; padding: .55rem; border-radius: .65rem; background: #fff7e7; color: #785715; font-size: .72rem; }
.mapa-beta-detail-link { display: inline-flex; align-items: center; margin-top: .75rem; padding: .52rem .78rem; border: 0; border-radius: .68rem; outline: none; background: var(--mapa-bordo); box-shadow: none; color: #fff !important; font-size: .75rem; font-weight: 800; line-height: 1.2; text-decoration: none; }
.mapa-beta-detail-link:hover { background: #7d1920; color: #fff !important; }
.mapa-beta-detail-link:focus-visible { outline: 3px solid rgba(213,162,53,.55); outline-offset: 2px; }
.mapa-beta-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; margin-top: .8rem; }
.mapa-beta-stat { padding: .55rem .25rem; border-radius: .7rem; background: #f5f4f0; text-align: center; }
.mapa-beta-stat strong, .mapa-beta-stat span { display: block; }
.mapa-beta-stat strong { color: var(--mapa-bordo); font-size: 1.05rem; }
.mapa-beta-stat span { margin-top: .05rem; color: var(--mapa-suave); font-size: .62rem; }
.mapa-beta-data-note { padding: .9rem .25rem .25rem; color: var(--mapa-suave); font-size: .7rem; }
.mapa-beta-data-note strong { color: var(--mapa-tinta); }
.mapa-beta-data-note p { margin: .2rem 0 0; }

.mapa-beta-canvas-wrap { position: relative; min-width: 0; overflow: hidden; background: #dce5e3; }
.mapa-beta-canvas { width: 100%; height: 100%; }
.mapa-beta-loading, .mapa-beta-status { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); border: 1px solid rgba(23,23,23,.12); border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(20,20,20,.12); color: var(--mapa-suave); font-size: .75rem; font-weight: 750; }
.mapa-beta-loading { top: 1rem; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; }
.mapa-beta-loading[hidden] { display: none; }
.mapa-beta-loading span { width: .8rem; height: .8rem; border: 2px solid rgba(150,31,39,.2); border-top-color: var(--mapa-bordo); border-radius: 50%; animation: mapa-girar .8s linear infinite; }
.mapa-beta-status { bottom: 1rem; max-width: calc(100% - 8rem); padding: .45rem .7rem; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.mapa-beta-status.is-visible { opacity: 1; }
@keyframes mapa-girar { to { transform: rotate(360deg); } }
.mapa-beta-location { position: absolute; z-index: 4; top: 5rem; right: 10px; display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.mapa-beta-location svg { width: 1.2rem; fill: none; stroke: var(--mapa-tinta); stroke-width: 1.8; }
.mapa-beta-location.is-active { background: var(--mapa-bordo); }
.mapa-beta-location.is-active svg { stroke: #fff; }
.mapa-beta-mobile-layers { display: none; }
.mapa-beta-page .maplibregl-ctrl-group { overflow: hidden; border-radius: .65rem; box-shadow: 0 2px 8px rgba(20,20,20,.2); }
.mapa-beta-page .maplibregl-ctrl-attrib { font-size: 10px; }
.mapa-beta-page .maplibregl-popup-content { border-radius: .8rem; font-family: inherit; }
.mapa-beta-page .mapa-beta-feature-popup .maplibregl-popup-content { overflow: hidden; padding: 0; border: 1px solid rgba(122,23,27,.12); border-radius: .9rem; box-shadow: 0 12px 30px rgba(20,20,20,.17); }
.mapa-beta-page .mapa-beta-feature-popup .maplibregl-popup-close-button { z-index: 2; top: .55rem; right: .55rem; width: 2rem; height: 2rem; border-radius: 50%; background: #efefeb; color: #6d7074; font-size: 1.25rem; line-height: 1; }
.mapa-beta-page .mapa-beta-feature-popup .maplibregl-popup-close-button:hover { background: #e6e3dd; color: var(--mapa-bordo); }
.mapa-beta-popup-card { width: min(288px, calc(100vw - 3rem)); max-height: min(400px, 62vh); overflow-y: auto; padding: .9rem; color: #202020; }
.mapa-beta-popup-card h2 { margin: .55rem 2.2rem .2rem 0; font-size: 1.05rem; line-height: 1.15; }
.mapa-beta-popup-card .mapa-beta-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.mapa-beta-localidad-stats .mapa-beta-stat { min-width: 0; }
.mapa-beta-localidad-stats .mapa-beta-stat strong { overflow-wrap: anywhere; }

@media (max-width: 1199.98px) {
    .mapa-beta-topbar { grid-template-columns: minmax(260px,.75fr) minmax(330px,1.25fr); gap: 1.5rem; }
    .mapa-beta-workspace { grid-template-columns: 290px minmax(0,1fr); }
}

@media (max-width: 767.98px) {
    .mapa-beta-page { height: calc(100dvh - 85px); min-height: 530px; }
    .mapa-beta-topbar { display: block; padding: .85rem 1rem 1rem; }
    .mapa-beta-topbar h1 { font-size: 1.45rem; }
    .mapa-beta-topbar p { display: none; }
    .mapa-beta-search-wrap { width: 100%; margin-top: .7rem; }
    .mapa-beta-search { min-height: 3rem; border-radius: .85rem; }
    .mapa-beta-workspace { position: relative; display: block; min-height: 0; }
    .mapa-beta-canvas-wrap { width: 100%; height: 100%; }
    .mapa-beta-sidebar { position: absolute; z-index: 8; inset: auto .55rem .55rem; max-height: min(58%, 440px); overflow-y: auto; padding: 0; border: 0; border-radius: 1.2rem; background: transparent; pointer-events: none; }
    .mapa-beta-sidebar > * { display: none; }
    .mapa-beta-sidebar.is-layers-open .mapa-beta-layers,
    .mapa-beta-sidebar.is-detail-open .mapa-beta-detail { display: block; pointer-events: auto; animation: mapa-sheet .2s ease-out; }
    .mapa-beta-sidebar.is-layers-open,
    .mapa-beta-sidebar.is-detail-open { padding: .25rem; background: rgba(247,247,244,.94); box-shadow: 0 12px 36px rgba(20,20,20,.23); pointer-events: auto; }
    .mapa-beta-card { margin: 0; border-radius: 1rem; }
    .mapa-beta-detail-empty { display: none; }
    .mapa-beta-mobile-layers { position: absolute; z-index: 6; top: .75rem; left: .75rem; display: block; padding: .58rem .85rem; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 4px 16px rgba(20,20,20,.2); color: var(--mapa-bordo); font-size: .78rem; font-weight: 850; }
    .mapa-beta-location { top: .75rem; }
    .mapa-beta-results { max-height: 48vh; }
    .mapa-beta-loading { top: 3.8rem; }
    .mapa-beta-status { bottom: 1rem; max-width: calc(100% - 2rem); text-align: center; }
    @keyframes mapa-sheet { from { opacity: 0; transform: translateY(20px); } }
}

@media (prefers-reduced-motion: reduce) {
    .mapa-beta-loading span { animation: none; }
    .mapa-beta-sidebar.is-layers-open .mapa-beta-layers,
    .mapa-beta-sidebar.is-detail-open .mapa-beta-detail { animation: none; }
}
