.mapa-locales-body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    background: #f5f7fa;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

.mapa-locales-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #c8102e;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(151, 0, 23, 0.25);
    z-index: 5;
}

.mapa-locales-volver {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.mapa-locales-volver:active {
    background: rgba(255, 255, 255, 0.28);
}

.mapa-locales-titulo h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

.mapa-locales-titulo p {
    margin: 2px 0 0 0;
    font-size: 12.5px;
    opacity: 0.85;
}

.mapa-locales-stage {
    position: relative;
    flex: 1;
    min-height: 0;
}

.mapa-locales-canvas {
    position: absolute;
    inset: 0;
}

.mapa-locales-resumen {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    z-index: 3;
}

.mapa-locales-controles {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
}

.mapa-locales-controles button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #ffffff;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    cursor: pointer;
}

.mapa-locales-controles button:active {
    background: #f1f5f9;
}

/* MARCADORES */
.mapa-locales-marker-anchor {
    display: block;
}

.mapa-locales-marker {
    --marcador-tamano: 34px;
    width: var(--marcador-tamano);
    height: var(--marcador-tamano);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.35));
    transition: width 0.12s ease, height 0.12s ease, transform 0.12s ease;
    transform-origin: bottom center;
}

.mapa-locales-marker svg {
    width: 100%;
    height: 100%;
    fill: #c8102e;
    stroke: #ffffff;
    stroke-width: 1;
}

.mapa-locales-marker.selected {
    filter: drop-shadow(0 3px 6px rgba(151, 0, 23, 0.45));
    transform: scale(1.25);
}

.mapa-locales-marker.selected svg {
    fill: #970017;
}

/* SIDEBAR LISTA */
.mapa-locales-sidebar {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 300px;
    max-height: calc(100% - 90px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 4;
}

.mapa-locales-sidebar.colapsado .mapa-locales-lista,
.mapa-locales-sidebar.colapsado .mapa-locales-buscador {
    display: none;
}

.mapa-locales-sidebar-header {
    padding: 14px 14px 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.mapa-locales-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.mapa-locales-sidebar-heading h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
}

.mapa-locales-sidebar-toggle {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mapa-locales-sidebar.colapsado .mapa-locales-sidebar-toggle svg {
    transform: rotate(180deg);
}

.mapa-locales-buscador {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 8px 10px;
}

.mapa-locales-buscador input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-family: inherit;
    color: #0f172a;
}

.mapa-locales-lista {
    overflow-y: auto;
    padding: 6px;
}

.mapa-locales-lista button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    text-align: left;
    padding: 9px 8px;
    border-radius: 10px;
    cursor: pointer;
    color: #0f172a;
}

.mapa-locales-lista button:hover {
    background: #f8fafc;
}

.mapa-locales-lista button.selected {
    background: #fdecee;
}

.mapa-locales-lista button i {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mapa-locales-lista button.selected i {
    background: #c8102e;
    color: #ffffff;
}

.mapa-locales-lista button span {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mapa-locales-lista button b {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapa-locales-lista button small {
    font-size: 11px;
    color: #64748b;
}

.mapa-locales-lista button svg {
    flex-shrink: 0;
    color: #cbd5e1;
}

.mapa-locales-lista-vacio {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    padding: 20px 10px;
}

/* PANEL DE DETALLE */
.mapa-locales-detalle {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 56px;
    max-width: 420px;
    max-height: min(260px, 42vh);
    max-height: min(260px, 42dvh);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    padding: 14px 34px 14px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 4;
    flex-wrap: wrap;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mapa-locales-detalle-cerrar {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1;
}

.mapa-locales-detalle-cerrar:active {
    background: #e2e8f0;
}

.mapa-locales-detalle-icono {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fdecee;
    color: #c8102e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mapa-locales-detalle-cuerpo {
    flex: 1;
    min-width: 160px;
}

.mapa-locales-detalle-cuerpo small {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mapa-locales-detalle-cuerpo h2 {
    margin: 3px 0 8px 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.mapa-locales-detalle-cuerpo ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
}

.mapa-locales-detalle-cuerpo li {
    font-size: 12px;
    color: #64748b;
}

.mapa-locales-detalle-cuerpo li b {
    display: block;
    font-size: 16px;
    color: #0f172a;
    font-weight: 800;
}

.mapa-locales-detalle-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #c8102e;
    color: #ffffff;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .mapa-locales-sidebar {
        left: 10px;
        right: 10px;
        top: 10px;
        width: auto;
        max-height: 45%;
    }

    .mapa-locales-detalle {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 52px;
    }

    .mapa-locales-controles {
        right: 10px;
        top: calc(45% + 10px);
    }

    .mapa-locales-resumen {
        left: 10px;
        bottom: auto;
        top: 10px;
        display: none;
    }
}
