
.mapa {
    --mapa-ancho-ficha: min(400px, calc(100% - 1.8rem));
    position: relative;
    margin-top: -78px;
    height: 100vh;
    height: 100svh;
    min-height: 520px;
}

.pagina-mapa .nav-shell { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.pagina-mapa:not(.menu-visible) .nav-shell { transform: translateY(-101%); box-shadow: none; }

body.pagina-mapa { overflow: hidden; }
.pagina-mapa .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    max-height: 75vh;
    overflow-y: auto;
    transition: transform 0.25s ease;
}
.pagina-mapa:not(.pie-visible) .site-footer { transform: translateY(101%); }

.mapa-borde-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 49;
    height: 8px;
}
.mapa-tirador {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 49;
    width: 56px;
    height: 16px;
    padding: 0;
    transform: translateX(-50%);
    color: #fffffe;
    background: var(--lake-dark);
    border: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}
.mapa-tirador:hover { opacity: 1; }
.mapa-borde-menu.mapa-abajo { top: auto; bottom: 0; }
.mapa-tirador.mapa-abajo { top: auto; bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3); }
.mapa-tirador.mapa-abajo svg { transform: rotate(180deg); margin: 0 auto; }
.mapa-tirador svg { display: block; width: 14px; height: 14px; margin: 1px auto 0; }
.pagina-mapa.menu-visible .mapa-tirador.mapa-arriba,
.pagina-mapa.pie-visible .mapa-tirador.mapa-abajo { opacity: 0; pointer-events: none; }

.mapa-buscador {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(420px, calc(100% - 1.8rem));
    max-height: calc(100% - 1.8rem);
    pointer-events: none;
}
.mapa-buscador > * { pointer-events: auto; }
.mapa-buscador > .mapa-titulo { pointer-events: none; }

.mapa-titulo {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mapa-buscar-icono {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--ink);
    background: #fffffe;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}
.mapa-buscar-icono:hover { background: #f8f6f1; }
.mapa-buscar-icono svg { display: block; width: 20px; height: 20px; margin: auto; }
.mapa-buscador.compacto .mapa-buscar-icono { display: block; }
.mapa-buscador.compacto .mapa-buscar,
.mapa-buscador.compacto .mapa-categorias { display: none; }

.mapa-buscar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.6rem 0 0.95rem;
    background: #fffffe;
    border: 1.5px solid transparent;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.mapa-buscar:focus-within {
    border-color: var(--lake);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(145, 56, 40, 0.2);
}
.mapa-buscar > svg { flex: none; width: 18px; height: 18px; color: var(--ink-soft); }
.mapa-buscar input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.2rem;
    font: inherit;
    font-size: 1.02rem;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: none;
}
.mapa-buscar input::-webkit-search-cancel-button,
.mapa-buscar input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.mapa-buscar-borrar {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--ink-soft);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.mapa-buscar-borrar:hover { color: var(--copper-dark); background: #f8f6f1; }
.mapa-buscar-borrar svg,
.mapa-token button svg { display: block; width: 14px; height: 14px; margin: auto; }
.mapa-buscar input:placeholder-shown ~ .mapa-buscar-borrar { display: none; }

.mapa-token {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 55%;
    padding: 0.2rem 0.25rem 0.2rem 0.7rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--copper-dark);
    background: #fbf1e8;
    border: 1px solid var(--copper);
    border-radius: 999px;
}
.mapa-token[hidden] { display: none; }
.mapa-token > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-token button {
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.mapa-token button:hover { background: rgba(168, 93, 52, 0.18); }

.mapa-estado {
    align-self: flex-start;
    margin: 0;
    padding: 0.3rem 0.8rem;
    font-size: 0.86rem;
    color: var(--ink-soft);
    background: #fffffe;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.mapa-estado:empty { display: none; }

.mapa-resultados { list-style: none; margin: 0; padding: 0; }

.mapa-ubicacion {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.6rem 0.75rem;
    background: var(--paper-raised);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.mapa-ubicacion[hidden] { display: none; }
.mapa-ubicacion-fila { display: flex; align-items: center; gap: 0.6rem; }
.mapa-ubicacion-titulo {
    flex: none;
    width: 4.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.mapa-ubicacion-opciones { display: flex; flex-wrap: nowrap; gap: 0.3rem; }
.mapa-ubicacion-opciones button {
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    background: #fffffe;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}
.mapa-ubicacion-opciones button:hover { border-color: var(--lake); }
.mapa-ubicacion-opciones button[aria-pressed="true"] { background: var(--lake); border-color: var(--lake); color: #fffffe; }
.mapa-categorias ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.1rem 0.3rem; }
.mapa-categorias {
    padding: 0.4rem 0.6rem 0.7rem;
    max-height: min(52svh, 480px);
    overflow-y: auto;
    background: var(--paper-raised);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.mapa-categorias[hidden] { display: none; }
.mapa-categorias h2 {
    margin: 0.5rem 0.3rem 0.25rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.mapa-categorias button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}
.mapa-categorias button:hover { background: #f8f6f1; }
.mapa-categorias button.activo { background: #fbf1e8; color: var(--copper-dark); font-weight: 600; }
.mapa-categorias .nombre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mapa-categorias .cuenta { font-size: 0.76rem; color: var(--ink-soft); }

.mapa-resultados {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    overflow-y: auto;
    background: var(--paper-raised);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.mapa-resultados:empty,
.mapa-resultados[hidden] { display: none; }
.mapa-resultados button {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font: inherit;
    text-align: left;
    color: var(--ink);
    background: #fffffe;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}
.mapa-resultados button:hover { border-color: var(--lake); }
.mapa-resultados button.activo { border-color: var(--copper); background: #fbf1e8; }
.mapa-resultados strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.mapa-resultados span { display: block; margin-top: 0.1rem; font-size: 0.83rem; color: var(--ink-soft); }
.mapa-mas { padding: 0.3rem 0.2rem 0; font-size: 0.85rem; color: var(--ink-soft); }

.mapa-ficha {
    position: absolute;
    top: 4.6rem;
    right: 0.9rem;
    z-index: 3;
    width: var(--mapa-ancho-ficha);
    max-height: calc(100% - 9.4rem);
    overflow-y: auto;
    background: #fffffe;
    border: 6px solid #fffffe;
    border-radius: 18px;
    box-shadow: 0 0 0 1px var(--line), 0 10px 34px rgba(0, 0, 0, 0.35);
    animation: ficha-entra 0.28s ease-out;
}
.mapa-ficha[hidden] { display: none; }
@keyframes ficha-entra { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mapa-ficha { animation: none; } }
.mapa-ficha-imagen { position: relative; margin: 1rem 1.1rem 0; }
.mapa-ficha-foto { display: block; width: 100%; height: 210px; object-fit: cover; border-radius: 12px; }
.mapa-ficha-imagen + .mapa-ficha-cuerpo { padding-top: 0.9rem; }
/* La etiqueta abierto/cerrado de la foto pasa por debajo del encabezado fijo al desplazar la ficha */
.mapa-ficha-imagen .estado-local--tarjeta { z-index: 0; }
.mapa-ficha-cuerpo { padding: 1rem 1.1rem 1.8rem; }
.mapa-ficha-cuerpo > :last-child { margin-bottom: 0; }
.mapa-ficha-categoria {
    margin: 0 0 0.3rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--lake);
}
.mapa-ficha h2 {
    margin: 0 2rem 0.35rem 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.mapa-ficha p { margin: 0 0 0.7rem; font-size: 0.93rem; }
.mapa-ficha .mapa-ficha-ubicacion { font-weight: 600; color: var(--copper-dark); }
.mapa-ficha-productos { list-style: none; margin: 0 0 0.9rem; padding: 0; font-size: 0.9rem; }
.mapa-ficha-productos li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.32rem 0;
    border-top: 1px solid var(--line);
}
.mapa-ficha-productos strong { font-weight: 600; white-space: nowrap; }
.mapa-ficha-productos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}
.mapa-ficha-productos li {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0;
    border-top: 0;
}
.mapa-ficha-prod-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--paper);
}
.mapa-ficha-prod-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mapa-ficha-prod-foto--vacia { color: var(--copper); background: linear-gradient(135deg, var(--paper), var(--line)); }
.mapa-ficha-prod-foto--vacia svg { width: 30px; height: 30px; opacity: 0.55; }
.mapa-ficha-prod-nombre {
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mapa-ficha-productos strong { margin-top: auto; color: var(--copper); }
.mapa-ficha-productos + .mapa-ficha-productos { margin-top: -0.3rem; }
.mapa-ficha-productos--lista { display: block; }
.mapa-ficha-productos--lista li {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.32rem 0;
    border-top: 1px solid var(--line);
}
.mapa-ficha-productos--lista strong { margin-top: 0; }
.mapa-ficha .btn { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.mapa-ficha-cerrar {
    position: sticky;
    top: 0.55rem;
    display: block;
    margin: 0.55rem 0.55rem -30px auto;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--ink);
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
}
.mapa-ficha-cerrar:hover { border-color: var(--copper); color: var(--copper-dark); }

.mapa-lienzo {
    position: relative;
    height: 100%;
    min-width: 0;
    background: var(--p-fondo, var(--lake-dark));
    overflow: hidden;
    transition: background-color 0.35s ease;
}

.mapa-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.mapa-svg.arrastrando { cursor: grabbing; }

.mapa-svg .edificio-nombre {
    fill: #f7f2e6;
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 600;
    opacity: 0.9;
}

.mapa-svg .elem { vector-effect: non-scaling-stroke; transition: fill 0.15s ease, opacity 0.15s ease; }
.mapa-svg .edificio { fill: #f1ead9; stroke: #6f6249; stroke-width: 2.5; stroke-linejoin: round; }
.mapa-svg .puente { fill: #e4dbc5; stroke: #6f6249; stroke-width: 1.5; }
.mapa-svg .puente_alto { fill: rgba(227, 214, 187, 0.1); stroke: #b9aa88; stroke-width: 1.5; stroke-dasharray: 8 6; }
.mapa-svg .patio { fill: url(#mapaAdoquin); stroke: #8a7a58; stroke-width: 2; stroke-linejoin: round; }
.mapa-svg .adoquin-fondo { fill: #f3ede0; }
.mapa-svg .adoquin-junta { fill: none; stroke: #cdbf9f; stroke-width: 1.2; }
.mapa-svg .pescado { fill: #d6e3e0; stroke: #9db8b3; stroke-width: 1; stroke-dasharray: 6 4; }
.mapa-svg .rampa { fill: url(#mapaPendiente); stroke: #a39373; stroke-width: 1; }
.mapa-svg .vacio { fill: #1b4a44; stroke: #6f6249; stroke-width: 1.5; }
.mapa-svg .oficinas { fill: #cdbf9f; stroke: #8f7f5e; stroke-width: 1; }
.mapa-svg .banos { fill: #bdd6d1; stroke: #6f9b93; stroke-width: 1; }
.mapa-svg .elem-clic { cursor: pointer; }
.mapa-svg .elem-clic:hover { filter: brightness(0.94); }
.mapa-svg .escalera { fill: url(#mapaEscalones); stroke: #8f7f5e; stroke-width: 1; }
.mapa-svg .elevador { fill: #b9ab8b; stroke: #6f6249; stroke-width: 1; }
.mapa-svg .barra { fill: #fefdfa; stroke: #9db8b3; stroke-width: 1; }
.mapa-svg .acceso { fill: var(--maize); stroke: #6f6249; stroke-width: 1; }
.mapa-svg .trama-fondo { fill: #d6c9ab; }
.mapa-svg .trama-linea { stroke: #a39373; stroke-width: 1.6; }

.mapa-svg.atenuar .elem:not(.edificio):not(.puente):not(.coincide):not(.activo) { opacity: 0.45; }
.mapa-svg .elem.coincide { fill: var(--maize); stroke: #8a6412; stroke-width: 1.5; opacity: 1; }
.mapa-svg .elem.activo { fill: var(--copper); stroke: #fffffe; stroke-width: 2.5; opacity: 1; }

.mapa-svg .rotulo {
    display: none;
    font-family: var(--font-body);
    font-weight: 600;
    fill: #4a3f2e;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}
.mapa-svg.con-rotulos .rotulo { display: block; }
.mapa-svg .rotulo-vacio { fill: #cfe0dc; font-weight: 500; }
.mapa-svg .rotulo-puente_alto { fill: #9fb9b3; font-weight: 500; }
.mapa-svg .rotulo-rotulo { fill: #9fb9b3; font-family: var(--font-display); font-weight: 500; letter-spacing: 0.02em; }
.mapa-svg .rotulo-barra { fill: #5d7d78; font-weight: 500; }
.mapa-svg .rotulo-cajeros { font-size: 15px; }

.mapa-svg .esp {
    fill: #fefdfa;
    stroke: #b3a482;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: fill 0.15s ease, opacity 0.15s ease;
}
.mapa-svg .esp.vacio { fill: #d9cdb4; }
.mapa-svg .esp:hover { fill: #f1e2c6; }
.mapa-svg.atenuar .esp:not(.coincide):not(.activo) { opacity: 0.2; }
.mapa-svg .esp.coincide { fill: var(--maize); stroke: rgba(42, 33, 24, 0.18); opacity: 1; }
.mapa-svg .esp.activo { fill: var(--copper); stroke: #fffffe; stroke-width: 2.5; opacity: 1; }

.mapa-svg .esp-num {
    display: none;
    font-family: var(--font-body);
    font-size: var(--mapa-letra-numero, 13px);
    font-weight: 600;
    fill: var(--ink-soft);
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}
.mapa-svg.con-numeros .esp-num { display: block; }
.mapa-svg .esp-num.activo { fill: #fffffe; }

.mapa-svg .marcador { pointer-events: none; filter: drop-shadow(0 2px 3px rgba(20, 20, 20, 0.45)); }
.mapa-svg .marcador path { fill: #fffffe; stroke: var(--copper-dark); stroke-width: 2; }
.mapa-svg .marcador circle { fill: var(--copper); }

.mapa-svg.vista-general { cursor: pointer; }
.mapa-nota {
    position: absolute;
    left: 50%;
    bottom: 1.2rem;
    z-index: 5;
    margin: 0;
    padding: 0.55rem 1.1rem;
    transform: translateX(-50%);
    color: #fffffe;
    background: rgba(145, 56, 40, 0.94);
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}
.mapa-nota[hidden] { display: none; }

.mapa-barra {
    position: absolute;
    top: 0.9rem;
    left: calc(min(420px, 100% - 1.8rem) + 1.8rem);
    right: 0.9rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    pointer-events: none;
}
.mapa-barra[hidden] { display: none; }
.mapa-grupo {
    display: inline-flex;
    padding: 3px;
    background: #fffffe;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
}
.mapa-grupo button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.mapa-grupo button:hover { background: #f8f6f1; }
.mapa-grupo button[aria-pressed="true"] { background: var(--lake); color: #fffffe; }
.mapa-cuenta {
    min-width: 1.35em;
    padding: 0.05em 0.4em;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    color: var(--ink);
    background: var(--maize);
    border-radius: 999px;
}

.mapa-zoom {
    position: absolute;
    right: 0.9rem;
    bottom: 0.9rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.mapa-zoom button {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1;
    color: var(--ink);
    background: #fffffe;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}
.mapa-zoom button:hover { background: #f8f6f1; }
.mapa.con-ficha .mapa-zoom { flex-direction: row; }
.mapa-zoom svg { display: block; width: 20px; height: 20px; margin: auto; }

.mapa button:focus-visible,
.mapa a:focus-visible { outline: 2px solid var(--maize); outline-offset: 2px; }

@media (max-width: 860px) {
    .mapa-buscador { right: 0.9rem; width: auto; }
    .mapa-resultados { max-height: 40svh; }
    .mapa-barra { top: auto; bottom: 0.9rem; left: 0.9rem; right: 4.6rem; justify-content: flex-start; }
    .mapa-ficha { top: auto; bottom: 0.9rem; left: 0.9rem; right: 0.9rem; width: auto; max-height: 52%; }
    .mapa.con-ficha .mapa-barra,
    .mapa.con-ficha .mapa-zoom { display: none; }
    .mapa-grupo button { padding: 0.42rem 0.7rem; font-size: 0.82rem; }
}

.cat-servicios { --cat: #c3c9d1; }
.cat-fondas-comida { --cat: #f0a67f; }
.cat-jugos-aguas { --cat: #a6d6e0; }
.cat-frutas-verduras { --cat: #b3d58f; }
.cat-carnes { --cat: #e0958d; }
.cat-pescados-mariscos { --cat: #8fb8dc; }
.cat-cremeria-lacteos { --cat: #f1e6b8; }
.cat-hierbas-chiles { --cat: #8ccab0; }
.cat-abarrotes { --cat: #d6bf94; }
.cat-flores { --cat: #f6c1cf; }
.cat-artesanias { --cat: #c9a0d8; }
.cat-calzado { --cat: #b79a85; }
.cat-ropa-textiles { --cat: #a5b0e3; }
.cat-fantasia-accesorios { --cat: #d88fc4; }
.cat-hogar-varios { --cat: #bfbfb0; }
.cat-panaderia { --cat: #e8cf9f; }

.mapa-svg .esp.cat:not(.coincide):not(.activo) { fill: var(--cat); }
.mapa-svg .esp.cat:not(.coincide):not(.activo):hover { fill: var(--cat); filter: brightness(1.08); }

.con-color::before,
.mapa-categorias .con-color button::before {
    content: "";
    display: inline-block;
    width: 0.65em;
    height: 0.65em;
    margin-right: 0.45em;
    vertical-align: 0.02em;
    background: var(--cat, var(--line));
    border: 1px solid rgba(42, 33, 24, 0.35);
    border-radius: 50%;
}

.mapa-categorias .con-color::before { content: none; }

.mapa-demo {
    position: absolute;
    left: 50%;
    bottom: 1.4rem;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.7rem 1.5rem;
    background: rgba(253, 252, 250, 0.96);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(20, 20, 20, 0.28);
    text-align: center;
    pointer-events: none;
    animation: mapa-pulso 2.4s ease-in-out infinite;
}
.mapa-demo[hidden] { display: none; }
.mapa-demo strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--lake-dark); }
.mapa-demo span { font-size: 0.85rem; color: var(--ink-soft); }
@keyframes mapa-pulso { 50% { box-shadow: 0 6px 22px rgba(217, 160, 42, 0.55); } }

.mapa-buscar.demo-escribiendo { border-color: var(--copper); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(168, 93, 52, 0.22); }

@media (prefers-reduced-motion: reduce) {
    .mapa-demo { animation: none; }
}

.mapa-ficha-acciones { display: flex; gap: 0.5rem; }
.mapa-ficha-acciones .btn { flex: 1 1 0; min-width: 0; text-align: center; }

.mapa-ruta { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.mapa-ruta .btn:disabled { opacity: 0.7; cursor: progress; }
.mapa-ruta .mapa-ruta-error { margin: 0.6rem 0 0; color: var(--copper-dark); }

.mapa-ruta-preferencia { margin: 0 0 1.7rem; }
.mapa-ruta .mapa-ruta-pref-titulo { margin: 0 0 0.6rem; font-size: 1rem; font-weight: 700; }
.mapa-ruta-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.mapa-ruta-opciones button { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; font: inherit; text-align: left; color: var(--ink); background: #fffffe; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.mapa-ruta-opciones button:hover { border-color: var(--copper); }
.mapa-ruta-opciones .i { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f7edc9; color: var(--ruta-oscuro); }
.mapa-ruta-opciones .i svg { width: 20px; height: 20px; }
.mapa-ruta-opciones b { display: block; font-size: 0.88rem; line-height: 1.2; }
.mapa-ruta-opciones small { display: flex; align-items: center; gap: 0.2rem; margin-top: 0.15rem; font-size: 0.75rem; line-height: 1.2; color: var(--ink-soft); }
.mapa-ruta-opciones small svg { width: 13px; height: 13px; flex: none; }
.mapa-ruta-opciones .acc { color: #2f5a56; }
.mapa-ruta-opciones button[aria-pressed="true"] { background: #f8ece8; border-color: var(--copper); }
.mapa-ruta-opciones button[aria-pressed="true"] .i { background: var(--copper); color: #fffffe; }


.mapa-svg .ruta { pointer-events: none; }
.mapa-svg .ruta-borde,
.mapa-svg .ruta-linea { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapa-svg .ruta-borde { stroke: #fffffe; stroke-width: 9px; }
.mapa-svg .ruta-linea { stroke: var(--ruta); stroke-width: 4.5px; }
.mapa-svg .ruta-punto circle { stroke: #fffffe; stroke-width: 3px; }
.mapa-svg .ruta-origen circle { fill: var(--ruta-oscuro); }
.mapa-svg .ruta-destino circle { fill: #fffffe; stroke: var(--ruta); stroke-width: 3px; }
.mapa-svg .ruta-cambio circle { fill: #fffffe; stroke: var(--ruta); stroke-width: 3px; }
/* Al marcar el punto de inicio, el cursor es un pin cuya punta (16, 38) señala el sitio */
.mapa-svg.eligiendo { --cursor-pin: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2240%22 viewBox=%220 0 32 40%22%3E%3Cpath d=%22M16 38C16 38 4 25 4 15a12 12 0 0 1 24 0c0 10-12 23-12 23z%22 fill=%22%237a5600%22 stroke=%22%23fffffe%22 stroke-width=%222.5%22 stroke-linejoin=%22round%22/%3E%3Ccircle cx=%2216%22 cy=%2215%22 r=%224.5%22 fill=%22%23fffffe%22/%3E%3C/svg%3E") 16 38, crosshair; }
/* También sobre los locales y demás figuras del plano, que tienen su propio cursor */
.mapa-svg.eligiendo,
.mapa-svg.eligiendo * { cursor: var(--cursor-pin) !important; }
.mapa-svg.eligiendo.arrastrando,
.mapa-svg.eligiendo.arrastrando * { cursor: grabbing !important; }

.mapa-guia {
    position: absolute;
    left: 0.9rem;
    bottom: 0.9rem;
    z-index: 60;
    width: min(340px, calc(100% - 5.5rem));
    padding: 0.9rem 1rem 0.85rem;
    color: var(--ink);
    background: #fffffe;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
}
.mapa-guia.cambia { animation: guia-entra 0.35s ease-out; }
@keyframes guia-entra { from { opacity: 0.4; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mapa-guia-cabeza { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; font-size: 0.8rem; }
.mapa-guia-cabeza strong { flex: 1; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lake); }
.mapa-guia-contador { color: var(--ink-soft); }
.mapa-guia .mapa-guia-cerrar {
    width: 26px; height: 26px; padding: 0; font-size: 1.1rem; line-height: 1;
    color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
}
.mapa-guia .mapa-guia-titulo { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 1.1rem; }
.mapa-guia .mapa-guia-texto { margin: 0 0 0.7rem; font-size: 0.9rem; line-height: 1.4; }
.mapa-guia-puntos { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.mapa-guia .mapa-guia-punto {
    flex: 1; height: 6px; padding: 0; background: var(--line); border: 0; border-radius: 3px; cursor: pointer;
    transition: background 0.3s;
}
.mapa-guia .mapa-guia-punto.hecho { background: #9fb9b3; }
.mapa-guia .mapa-guia-punto.actual { background: var(--copper); }
.mapa-guia-pie { display: flex; gap: 0.4rem; }
.mapa-guia-pie button {
    padding: 0.4rem 0.8rem; font: inherit; font-size: 0.83rem; color: var(--ink);
    background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.mapa-guia-pie button:disabled { opacity: 0.45; cursor: default; }
.mapa-guia-pie .mapa-guia-principal { margin-left: auto; color: #fffffe; background: var(--lake); border-color: var(--lake); }

.mapa-guia-aro {
    position: fixed; z-index: 70; left: 0; top: 0; width: 0; height: 0;
    border: 3px solid var(--maize); border-radius: 12px; pointer-events: none; opacity: 0;
    transition: left 0.6s ease, top 0.6s ease, width 0.6s ease, height 0.6s ease, opacity 0.3s;
    animation: guia-aro 1.4s ease-in-out infinite;
}
.mapa-guia-aro.visible { opacity: 1; }
@keyframes guia-aro { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 160, 42, 0.55); } 50% { box-shadow: 0 0 0 9px rgba(217, 160, 42, 0); } }

.mapa-guia-cursor {
    position: fixed; z-index: 80; left: -4px; top: -2px; pointer-events: none; opacity: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.3s;
}
.mapa-guia-cursor.visible { opacity: 1; }
.mapa-guia-cursor::after {
    content: ""; position: absolute; left: -9px; top: -9px; width: 22px; height: 22px;
    border: 2px solid var(--copper); border-radius: 50%; opacity: 0;
}
.mapa-guia-cursor.pulsa::after { animation: guia-clic 0.6s ease-out; }
@keyframes guia-clic { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.2); } }

.mapa-grupo .mapa-guia-abrir { color: var(--copper-dark); }

@media (prefers-reduced-motion: reduce) {
    .mapa-guia.cambia, .mapa-guia-aro, .mapa-guia-cursor::after { animation: none; }
    .mapa-guia-aro, .mapa-guia-cursor { transition: none; }
}

.mapa-svg .calle { fill: var(--p-calle, #1f554e); stroke: var(--p-calle-borde, #3d7c73); stroke-width: 1.5; stroke-dasharray: 10 8; vector-effect: non-scaling-stroke; pointer-events: none; }
.mapa-svg .calle-nombre {
    fill: var(--p-calle-texto, #a9c7c1);
    font-family: var(--font-body);
    font-size: 46px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-anchor: middle;
    text-transform: uppercase;
    pointer-events: none;
}


.mapa-categorias::-webkit-scrollbar-track,
.mapa-resultados::-webkit-scrollbar-track { margin: 14px 0; }

.mapa-ficha,
.mapa-ruta-panel { scrollbar-width: none; }
.mapa-ficha::-webkit-scrollbar,
.mapa-ruta-panel::-webkit-scrollbar { display: none; }
.mapa-ficha-mas {
    position: sticky;
    bottom: 0;
    z-index: 2;
    height: 0;
    overflow: visible;
    text-align: center;
    pointer-events: none;
}
.mapa-ficha-mas button {
    position: absolute;
    left: 50%;
    bottom: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateX(-50%);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fffffe;
    background: var(--lake);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.2s ease, background 0.15s ease;
}
.mapa-ficha-mas button:hover { background: var(--lake-dark); }
.mapa-ficha-mas button:focus-visible { outline: 2px solid var(--maize); outline-offset: 2px; }
.mapa-ficha-mas button svg { width: 20px; height: 20px; }
.mapa-ficha-mas.oculto button { opacity: 0; pointer-events: none; }

.mapa-ficha .btn.mapa-como-llegar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: fit-content;
    margin: 0.2rem 0 0.9rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(145, 56, 40, 0.3);
}
.mapa-como-llegar svg { flex: none; width: 1.1rem; height: 1.1rem; }

.mapa-ruta-panel {
    position: absolute;
    top: 4.6rem;
    right: 0.9rem;
    z-index: 3;
    width: var(--mapa-ancho-ficha);
    max-height: calc(100% - 9.4rem);
    overflow-y: auto;
    background: #fffffe;
    border: 6px solid #fffffe;
    border-radius: 18px;
    box-shadow: 0 0 0 1px var(--line), 0 10px 34px rgba(0, 0, 0, 0.35);
    animation: ruta-entra 0.28s ease-out;
}
.mapa-ruta-panel[hidden] { display: none; }
@keyframes ruta-entra { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mapa-ruta-panel { animation: none; } }
.mapa-ruta-cabeza {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 3rem 0.85rem 1.1rem;
    color: #fffffe;
    background: var(--encabezado);
    border-bottom: 3px solid var(--maize);
}
.mapa-ruta-foto { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255, 253, 248, 0.85); }
.mapa-ruta-titulo { min-width: 0; }
.mapa-ruta-cabeza h2 { margin: 0.1rem 0 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.15; color: inherit; overflow-wrap: anywhere; }
.mapa-ruta-cabeza p { margin: 0; font-size: 0.82rem; opacity: 0.9; overflow-wrap: anywhere; }
.mapa-ruta-cabeza .mapa-ruta-lugar { margin-top: 0.25rem; }
.mapa-ruta-cabeza .mapa-ruta-etiqueta { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--maize); opacity: 1; }
.mapa-ruta.mapa-ruta-cuerpo { margin: 0; padding: 1rem 1.1rem 1.2rem; border-top: 0; }
.mapa-ruta-cuerpo > p { margin: 0 0 0.7rem; font-size: 0.93rem; }
.mapa-ruta-cuerpo > p:last-child { margin-bottom: 0; }
.mapa-ruta-cuerpo > button:not(.btn) {
    padding: 0.4rem 0.9rem;
    font: inherit;
    font-size: 0.88rem;
    color: var(--ink);
    background: #fffffe;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}
.mapa-ruta-cuerpo > button:not(.btn):hover { border-color: var(--lake); color: var(--lake-dark); }

.mapa-svg .ruta-cambio { pointer-events: all; cursor: pointer; }
.mapa-svg .ruta-toque { fill: transparent; stroke: none !important; }
.mapa-svg .ruta-halo { stroke: var(--ruta); stroke-width: 3px; pointer-events: none; }
.mapa-svg .ruta-cambio-texto {
    font-family: inherit; font-weight: 700; font-size: 13px; fill: var(--ruta-oscuro);
    paint-order: stroke; stroke: #fffffe; stroke-width: 4px; stroke-linejoin: round; pointer-events: none;
}
.mapa-ruta-guia { margin: 0 0 2rem; padding: 0.9rem 1rem 1rem; background: #fffffe; border: 1px solid var(--line); border-radius: 16px; }
.mapa-ruta .mapa-ruta-paso { margin: 0 0 0.45rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--copper); }
.mapa-ruta-progreso { display: flex; gap: 4px; margin: 0 0 1.3rem; }
.mapa-ruta-progreso span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.mapa-ruta-progreso span.actual { background: var(--ruta); }
.mapa-ruta-progreso span.hecho { background: var(--copper); }
.mapa-ruta-instruccion { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.4rem; }
.mapa-ruta-icono { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f7edc9; color: var(--ruta-oscuro); }
.mapa-ruta-icono svg { width: 26px; height: 26px; }
.mapa-ruta .mapa-ruta-instr-titulo { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.mapa-ruta-botones { display: flex; flex-direction: column; gap: 0.5rem; }
.mapa-ruta-botones .btn { width: 100%; margin: 0; padding: 0.7rem 0.8rem; font-size: 0.95rem; text-align: center; }
.mapa-ruta-botones .mapa-ruta-anterior { color: var(--ink-soft); background: #fffffe; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; }
.mapa-ruta-botones .mapa-ruta-anterior:hover { border-color: var(--ink-soft); color: var(--ink); }
.mapa-ruta-siguiente { width: 100%; margin: 0 0 0.7rem; padding: 0.6rem 0.8rem; font-size: 0.92rem; text-align: center; }
.mapa-ruta-siguiente.late { animation: mapa-late 1.6s ease-out infinite; }
@keyframes mapa-late {
    0% { box-shadow: 0 0 0 0 rgba(31, 94, 87, 0.55); }
    70%, 100% { box-shadow: 0 0 0 12px rgba(31, 94, 87, 0); }
}
@media (prefers-reduced-motion: reduce) { .mapa-ruta-siguiente.late { animation: none; } }

/* Acciones de la ruta: dos botones de texto en forma de píldora, sin iconos */
.mapa-ruta-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 1rem 0 0.8rem; }
.mapa-ruta-acciones button {
    padding: 0.8rem 0.5rem; font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.2; text-align: center;
    background: #fffffe; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
}
.mapa-ruta-acciones .mapa-ruta-cambiar { color: #fffffe; background: var(--lake); border-color: var(--lake); }
.mapa-ruta-acciones .mapa-ruta-cambiar:hover { background: var(--lake-dark); border-color: var(--lake-dark); }
.mapa-ruta-acciones .mapa-ruta-quitar { color: #6b5a55; background: #fffffe; border-color: var(--line); }
.mapa-ruta-acciones .mapa-ruta-quitar:hover { background: #f6f1ef; color: #99452c; border-color: #99452c; }

.mapa-tabs {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    background: #fffffe;
    border-top: 1px solid var(--line);
}
.mapa-tabs button {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.6rem 0.8rem;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: none;
    border: 0;
    border-top: 3px solid transparent;
    margin-top: -1px;
    cursor: pointer;
}
.mapa-tabs button svg { width: 1.05rem; height: 1.05rem; }
.mapa-tabs button:hover { color: var(--ink); }
.mapa-tabs button[aria-pressed="true"]:hover { color: var(--encabezado-texto); }
.mapa-tabs button[aria-pressed="true"] { color: var(--encabezado-texto); background: var(--encabezado); border-top-color: var(--maize); }

.mapa-ficha.con-pestanas:not([hidden]),
.mapa-ruta-panel.con-pestanas:not([hidden]) {
    display: flex;
    flex-direction: column;
    height: min(640px, calc(100% - 9.4rem));
    max-height: none;
}
.mapa-ficha.con-pestanas > *,
.mapa-ruta-panel.con-pestanas > * { flex-shrink: 0; }
.mapa-ficha.con-pestanas .mapa-ficha-cuerpo,
.mapa-ruta-panel.con-pestanas .mapa-ruta-cuerpo { flex: 1 0 auto; }
.mapa-ficha.con-pestanas .mapa-ficha-mas button,
.mapa-ruta-panel.con-pestanas .mapa-ficha-mas button { bottom: 3.9rem; }
.mapa-ficha-cerrar { z-index: 3; }
.mapa-ruta-cabeza { position: sticky; top: 0; z-index: 1; }

@media (max-width: 860px) {
    .mapa-ruta-panel { top: auto; bottom: 0.9rem; left: 0.9rem; right: 0.9rem; width: auto; max-height: 52%; }
    .mapa-ficha.con-pestanas:not([hidden]),
    .mapa-ruta-panel.con-pestanas:not([hidden]) { height: 52%; }
}

.mapa.con-ruta .mapa-ficha,
.mapa.con-ruta .mapa-ficha.con-pestanas:not([hidden]) { display: none; }

.mapa-lienzo[data-nivel="0"] { --p-fondo: #143d38; --p-calle: #1f554e; --p-calle-borde: #3d7c73; --p-calle-texto: #a9c7c1; --p-acento: #1f5c56; --p-texto: #fffffe; }
.mapa-lienzo[data-nivel="1"] { --p-fondo: #44281a; --p-calle: #603723; --p-calle-borde: #94603f; --p-calle-texto: #e3c4ad; --p-acento: #a85d34; --p-texto: #fffffe; }
.mapa-lienzo[data-nivel="2"] { --p-fondo: #3f3410; --p-calle: #5c4a17; --p-calle-borde: #9a7f2c; --p-calle-texto: #ead9a0; --p-acento: #d9a02a; --p-texto: #2a2008; }
.mapa-lienzo[data-nivel="3"] { --p-fondo: #2c2a4a; --p-calle: #3f3c6a; --p-calle-borde: #6f6bb0; --p-calle-texto: #c9c7ee; --p-acento: #6f6bb0; --p-texto: #fffffe; }

#mapaNiveles button[aria-pressed="true"] { background: var(--p-acento, var(--lake)); color: var(--p-texto, #fffffe); }

.mapa-svg .edificio-planta { fill: var(--p-calle-texto, #a9c7c1); font-family: var(--font-body); font-size: 34px; font-weight: 600; }

.mapa-planta-actual {
    position: absolute;
    left: 0.9rem;
    bottom: 0.9rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 76px;
    padding: 0.5rem 0.9rem 0.4rem;
    color: var(--p-texto, #fffffe);
    background: var(--p-acento, var(--lake));
    border: 3px solid #fffffe;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    line-height: 1;
}
.mapa-planta-etiqueta { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.mapa-planta-actual strong { font-family: var(--font-display); font-size: 3rem; font-weight: 600; line-height: 1.05; }

@keyframes planta-fundido { from { opacity: 0.35; } to { opacity: 1; } }
.mapa-svg.cambia-sube, .mapa-svg.cambia-baja { animation: planta-fundido 0.25s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .mapa-svg.cambia-sube, .mapa-svg.cambia-baja { animation: none; }
}
@media (max-width: 860px) {
    .mapa.con-ficha .mapa-planta-actual { display: none; }
    .mapa-planta-actual { left: auto; right: 0.9rem; bottom: 9.5rem; min-width: 56px; padding: 0.3rem 0.6rem 0.25rem; }
    .mapa-planta-actual strong { font-size: 2rem; }
}

.mapa-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.mapa-3d:active { cursor: grabbing; }
.mapa.modo-3d .mapa-svg { visibility: hidden; pointer-events: none; }
.mapa.modo-3d #mapaVistas,
.mapa.modo-3d .mapa-nota { display: none; }

.mapa-modo { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 3; }
.mapa-barra { right: calc(0.9rem + 12.4rem); }
@media (max-width: 860px) {
    .mapa-modo { top: auto; right: 0.9rem; bottom: 15rem; }
    .mapa-barra { right: 4.6rem; }
    .mapa.con-ficha .mapa-modo { display: none; }
}

.mapa-recorrer-abrir {
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    z-index: 4;
    transform: translateX(-50%);
    padding: 0.7rem 1.6rem;
    font: inherit;
    font-weight: 700;
    color: #fffffe;
    background: var(--copper);
    border: 3px solid #fffffe;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
.mapa-recorrer-abrir:hover { background: var(--copper-dark); }
.mapa-recorrer-abrir[hidden] { display: none; }

.mapa-recorrido {
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    z-index: 4;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 1.8rem));
    padding: 0.9rem 1.2rem 0.8rem;
    text-align: center;
    background: rgba(255, 253, 248, 0.97);
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.mapa-recorrido[hidden] { display: none; }
.mapa-recorrido-texto { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--lake-dark); }
.mapa-recorrido-detalle { margin: 0.15rem 0 0.6rem; font-size: 0.92rem; color: var(--ink-soft); }
.mapa-recorrido-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.mapa-recorrido-botones button {
    padding: 0.4rem 0.95rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}
.mapa-recorrido-botones button:hover { border-color: var(--copper); color: var(--copper-dark); }
@media (max-width: 860px) {
    .mapa-recorrer-abrir, .mapa-recorrido { bottom: 0.9rem; }
    .mapa.con-ficha .mapa-recorrer-abrir { bottom: 0.9rem; }
}

.mapa-libre {
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    z-index: 4;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.1rem;
    background: rgba(255, 253, 248, 0.97);
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.mapa-libre[hidden] { display: none; }
.mapa-libre .mapa-recorrido-detalle { margin: 0; }
.mapa-libre .mapa-recorrido-detalle:empty { display: none; }
.mapa-libre.eligiendo .mapa-libre-flechas { display: none; }
.mapa-libre-flechas { display: grid; grid-template-columns: repeat(3, 3rem); grid-template-rows: repeat(2, 3rem); gap: 0.3rem; }
.mapa-libre-flechas button {
    font: inherit;
    font-size: 1.1rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}
.mapa-libre-flechas button:active { background: var(--copper); color: #fffffe; border-color: var(--copper); }
.mapa-libre-adelante { grid-column: 2; grid-row: 1; }
.mapa-libre-izquierda { grid-column: 1; grid-row: 2; }
.mapa-libre-atras { grid-column: 2; grid-row: 2; }
.mapa-libre-derecha { grid-column: 3; grid-row: 2; }
.mapa-libre-escalon { display: flex; gap: 0.4rem; }
.mapa-libre-escalon:empty { display: none; }
.mapa-libre-escalon button,
.mapa-libre-salir {
    padding: 0.4rem 0.95rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}
.mapa-libre-escalon button { color: #fffffe; background: var(--lake); border-color: var(--lake); }
.mapa-libre-salir:hover { border-color: var(--copper); color: var(--copper-dark); }

.mapa {
    --encabezado: #5c1f27;
    --encabezado-texto: #ffffff;
    --lake: var(--copper);
    --lake-dark: var(--copper-dark);
    --ruta: #e0a800;
    --ruta-oscuro: #7a5600;
}

.mapa-lienzo { --p-fondo: #faf7f0; }

.mapa-lienzo[data-nivel="0"] { --p-fondo: #faf7f0; --p-calle: #f6f1e4; --p-calle-borde: #c2ad82; --p-calle-texto: #7a6a48; --p-acento: #913828; --p-texto: #fffffe; }
.mapa-lienzo[data-nivel="1"] { --p-fondo: #fbf3ee; --p-calle: #f8ece3; --p-calle-borde: #cf9f84; --p-calle-texto: #8a5239; --p-acento: #a85d34; --p-texto: #fffffe; }
.mapa-lienzo[data-nivel="2"] { --p-fondo: #fbf7e8; --p-calle: #f7efd2; --p-calle-borde: #c9b05a; --p-calle-texto: #7a6218; --p-acento: #d9a02a; --p-texto: #2a2008; }
.mapa-lienzo[data-nivel="3"] { --p-fondo: #f3f2f9; --p-calle: #eae9f5; --p-calle-borde: #a9a4d2; --p-calle-texto: #5d5a8c; --p-acento: #6f6bb0; --p-texto: #fffffe; }

.mapa-svg .edificio-nombre { fill: #4a3f2e; opacity: 0.6; }
.mapa-svg .vacio { fill: #d6e3e0; stroke: #8fa9a4; }
.mapa-svg .rotulo-vacio { fill: #4f6f69; }
.mapa-svg .rotulo-puente_alto,
.mapa-svg .rotulo-rotulo { fill: #7c8f8a; }

.mapa-tirador {
    background: var(--boton, var(--copper));
    box-shadow: 0 2px 8px rgba(80, 30, 20, 0.25);
    opacity: 0.95;
}

.mapa-tirador.mapa-abajo {
    box-shadow: 0 -2px 8px rgba(80, 30, 20, 0.25);
}

.mapa-nota {
    bottom: 3.2rem;
}

.mapa-barra,
.mapa-modo {
    top: 1.2rem;
}

.mapa-tirador {
    height: 12px;
}

.mapa-tirador svg {
    width: 12px;
    height: 12px;
    margin-top: 0;
}

@media (max-width: 860px) {
    .mapa-modo { top: auto; }
}

.mapa-barra,
.mapa-modo {
    top: 1.7rem;
}

@media (min-width: 861px) {
    .mapa-ficha {
        top: 5rem;
        max-height: calc(100% - 9.8rem);
    }
}

@media (max-width: 860px) {
    .mapa-modo { top: auto; }
}

.mapa-buscador {
    top: 1.2rem;
    left: 1.5rem;
}

.mapa-barra {
    left: calc(min(420px, 100% - 1.8rem) + 2.4rem);
}

.mapa-buscador {
    top: 1.7rem;
}

@media (min-width: 861px) {
    .mapa-buscador {
        top: 1.7rem;
    }

    .mapa-barra,
    .mapa-modo {
        top: calc(1.7rem + 8.5px);
    }

    .mapa-ficha {
        top: 5.7rem;
        max-height: calc(100% - 10.5rem);
    }
}

.mapa-demo { z-index: 100; }
.mapa-guia { z-index: 100; }
.mapa-guia-aro { z-index: 110; }
.mapa-guia-cursor { z-index: 120; }

.mapa-barra {
    right: 0.9rem;
}

@media (max-width: 860px) {
    .mapa-barra { right: 0.9rem; }
}

@media (max-width: 860px) {
    .mapa-barra {
        top: auto;
        bottom: 0.9rem;
        left: 0.9rem;
        right: 4.6rem;
        justify-content: flex-start;
    }

    .mapa-planta-actual {
        left: 0.9rem;
        right: auto;
        bottom: 6.6rem;
    }
}

@media (max-width: 860px) {
    .mapa-nota {
        top: 5.6rem;
        bottom: auto;
        max-width: calc(100% - 7rem);
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 860px) {
    .mapa-planta-actual {
        box-sizing: border-box;
        height: 3.2rem;
        justify-content: center;
        left: 0.9rem;
        right: auto;
        bottom: 0.9rem;
    }

    .mapa-barra {
        top: auto;
        bottom: calc(0.9rem + 3.2rem + 0.6rem);
        left: 0.9rem;
        right: 4.6rem;
        flex-direction: column-reverse;
        flex-wrap: nowrap;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.6rem;
    }

    .mapa-nota {
        top: 10.5rem;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 860px) {
    .mapa-planta-actual {
        bottom: 1.7rem;
    }

    .mapa-barra {
        bottom: calc(1.7rem + 3.2rem + 0.6rem);
    }
}

@media (max-width: 860px) {
    .mapa-planta-actual {
        height: 3.7rem;
        bottom: 0.9rem;
    }

    .mapa-barra {
        bottom: calc(0.9rem + 3.7rem + 0.6rem);
    }
}

@media (max-width: 860px) {
    .mapa-nota {
        top: 9.2rem;
    }
}

.mapa-ficha-herramientas {
    position: sticky;
    top: 0.55rem;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    width: fit-content;
    margin: 0.55rem 0.55rem -30px auto;
}
.mapa-ficha-herramientas .mapa-ficha-cerrar {
    position: static;
    margin: 0;
}
.mapa-minimizar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--ink);
    background: rgba(255, 254, 252, 0.92);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.mapa-minimizar:hover { border-color: var(--copper); color: var(--copper-dark); }
.mapa-minimizar svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.min .mapa-minimizar svg { transform: rotate(180deg); }
/* Los botones flotan sobre el encabezado cobre, sin ocupar alto, y bajan 0.55rem desde el borde */
.mapa-ficha-herramientas { top: 0; height: 0; margin: 0 0.55rem 0 auto; }
.mapa-ficha-herramientas > button { position: relative; top: 0.55rem; }
.mapa-ruta-cabeza { padding-right: 5.7rem; }

.mapa-ficha-minititulo { display: none; }
.mapa-ficha.min:not([hidden]) {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    height: auto !important;
    max-height: none;
    overflow: hidden;
    padding: 0.5rem 0.5rem 0.5rem 0.9rem;
}
.mapa-ficha.min > :not(.mapa-ficha-minititulo):not(.mapa-ruta-cabeza) { display: none !important; }
.mapa-ficha.min .mapa-ficha-minititulo {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-display);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mapa-ficha.min .mapa-ficha-herramientas {
    position: static;
    margin: 0;
    flex: none;
}
.mapa-ruta-panel.min:not([hidden]) {
    height: auto !important;
    max-height: none;
    overflow: hidden;
}
.mapa-ruta-panel.min > :not(.mapa-ruta-cabeza) { display: none !important; }
.mapa-ruta-panel.min .mapa-ruta-foto,

/* Movil: sin recarga al deslizar hacia abajo, tiradores y botones mas grandes */
.pagina-mapa .site-footer, .mapa-ficha, .mapa-ruta-panel, .mapa-resultados { overscroll-behavior: contain; }
.mapa-tirador { touch-action: none; }
.mapa-tirador::before { content: ""; position: absolute; inset: -6px -14px -10px; }
.mapa-tirador.mapa-abajo::before { inset: -10px -14px -6px; }
@media (max-width: 860px) {
    .mapa-tirador { width: 104px; height: 30px; }
    .mapa-tirador svg { width: 22px; height: 22px; margin: 4px auto 0; }
    .mapa-tirador.mapa-abajo svg { margin: 4px auto 0; }
    .mapa-minimizar,
    .mapa-ficha-herramientas .mapa-ficha-cerrar { width: 42px; height: 42px; }
    .mapa-minimizar svg { width: 22px; height: 22px; }
    .mapa-ficha-herramientas .mapa-ficha-cerrar { font-size: 1.7rem; }
    .mapa-ficha.min .mapa-ficha-herramientas { margin: 0; }
    .mapa-ficha.min .mapa-ficha-minititulo { cursor: pointer; }
}

/* Movil: boton de menu dentro de la columna del zoom, pie compacto */
.mapa-zoom .flotante-menu { display: none; }
@media (max-width: 860px) {
    .mapa-tirador { display: none; }
    .mapa-zoom .flotante-menu { display: block; }
    .pagina-mapa.menu-visible .mapa-zoom .flotante-menu,
    .pagina-mapa.pie-visible .mapa-zoom .flotante-menu { color: #fff; background: var(--boton, var(--copper)); }

    .pagina-mapa .site-footer .footer-brand,
    .pagina-mapa .site-footer .footer-nav .footer-col + .footer-col,
    .pagina-mapa .site-footer .footer-nav .footer-col:first-child li:nth-child(-n+3) { display: none; }
    .pagina-mapa .site-footer .footer-top { gap: 1rem; padding-top: 1.2rem; padding-bottom: 1rem; }
    .pagina-mapa .site-footer .footer-nav { grid-template-columns: 1fr; }
    .pagina-mapa .site-footer .footer-col ul { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }

    /* Pie bajo y corto: solo "¿Cómo llegar?" y el aviso final; la navegación ya está en el menú */
    .pagina-mapa .site-footer { max-height: 34vh; }
    .pagina-mapa .site-footer .footer-nav { display: none; }
    .pagina-mapa .site-footer .footer-top { padding-top: 0.9rem; padding-bottom: 0.6rem; }
    .pagina-mapa .site-footer .footer-llegar li:first-child { display: none; }
    .pagina-mapa .site-footer .footer-bottom { padding-top: 0.6rem; padding-bottom: 0.8rem; }
}


/* Colores por planta: verde lago, cobre, ciruela */
.mapa-lienzo[data-nivel="0"] { --p-fondo: #f6f8f4; --p-calle: #ecf2ec; --p-calle-borde: #9bb8ac; --p-calle-texto: #2f6a60; --p-acento: #1f5c56; --p-texto: #fffffe; }
.mapa-lienzo[data-nivel="2"] { --p-fondo: #faf4f5; --p-calle: #f4e8ea; --p-calle-borde: #c99aa6; --p-calle-texto: #7b3b4f; --p-acento: #8a3f56; --p-texto: #fffffe; }

/* Sin destello azul al tocar */
.mapa, .mapa * { -webkit-tap-highlight-color: transparent; }
.mapa-svg, .mapa-svg * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mapa-svg :focus:not(:focus-visible), .mapa :focus:not(:focus-visible) { outline: none; }

/* Etiqueta de planta mas grande */
.mapa-planta-etiqueta { font-size: 0.82rem; }
.mapa-planta-actual { min-width: 92px; padding: 0.6rem 1.1rem 0.5rem; }
.mapa-planta-actual strong { font-size: 3.6rem; }
@media (max-width: 860px) {
    .mapa-planta-actual { height: 4.6rem; min-width: 76px; padding: 0.35rem 0.8rem 0.3rem; bottom: 0.9rem; }
    .mapa-planta-etiqueta { font-size: 0.74rem; }
    .mapa-planta-actual strong { font-size: 2.6rem; }
    .mapa-barra { bottom: calc(0.9rem + 4.6rem + 0.6rem); }
}

/* Movil: objetivos tactiles de al menos 44 px */
@media (max-width: 860px) {
    .mapa-grupo button { min-height: 44px; padding: 0.5rem 1.1rem; font-size: 0.95rem; }
    .mapa-zoom button { width: 48px; height: 48px; }
    .mapa-zoom svg { width: 22px; height: 22px; }
    .mapa-buscar-icono, .mapa-buscar-borrar { min-width: 44px; min-height: 44px; }
    .mapa-categorias button, .mapa-ubicacion button { min-height: 44px; }
    .mapa-resultados button { min-height: 48px; }
    .mapa .btn { min-height: 44px; }
}

.mapa-ficha-acciones { margin: 0.2rem 0 0.9rem; align-items: stretch; }
.mapa-ficha-acciones .btn { flex: 0 1 auto; display: inline-flex; align-items: center; justify-content: center; }
.mapa-ficha-acciones .btn.mapa-como-llegar { margin: 0; width: auto; }
.mapa-ficha-acciones .mapa-compartir { flex: none; width: 42px; padding: 0; }
.mapa-ficha-acciones .mapa-compartir svg { width: 18px; height: 18px; }
@media (max-width: 860px) {
    .mapa-ficha-acciones .mapa-compartir { width: 44px; min-height: 44px; }
}


.mapa-ficha-acciones { width: 100%; gap: 0.5rem; }
.mapa-ficha-acciones .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.mapa-ficha-acciones .btn.mapa-como-llegar { flex: 1.4 1 0; width: auto; }
.mapa-ficha-acciones .btn.mapa-compartir { flex: 0 0 auto; }

/* Movil: selectores de edificio y planta, y etiqueta de planta, mas compactos */
@media (max-width: 860px) {
    .mapa-grupo button { min-height: 34px; padding: 0.3rem 0.75rem; font-size: 0.78rem; }
    .mapa-planta-actual { height: 3.3rem; min-width: 56px; padding: 0.2rem 0.55rem 0.15rem; }
    .mapa-planta-etiqueta { font-size: 0.58rem; }
    .mapa-planta-actual strong { font-size: 1.7rem; }
    .mapa-barra { bottom: calc(0.9rem + 3.3rem + 0.6rem); }
}

@media (max-width: 860px) {
    .mapa-nota { top: 7.4rem; }
}


/* Locales sin ficha (sin foto): se ven apagados y no se pueden tocar */
.mapa-svg .esp.sin-ficha {
    fill: #e3ddcf;
    stroke: #cfc6b2;
    pointer-events: auto;
    cursor: default;
}
.mapa-svg .esp-num.sin-ficha { fill: #9a8f7a; opacity: 0.7; pointer-events: none; }
.mapa-svg.atenuar .esp.sin-ficha { opacity: 0.2; }

/* Los mensajes de ayuda quedan por debajo del buscador y se esconden mientras su panel
   (categorías o resultados) está abierto, para que nunca se encimen */
.mapa-nota { z-index: 1; }
.mapa.panel-abierto .mapa-nota { display: none; }
/* Durante la demostración en reposo se esconden los avisos cobre para que solo se vean los pasos */
.mapa.demo-activa .mapa-nota { display: none; }

/* Móvil: asa al pie del panel de búsqueda; deslizarla hacia arriba (o "atrás") lo cierra */
.mapa-panel-asa { display: none; }
@media (max-width: 860px) {
    .mapa.panel-abierto .mapa-panel-asa {
        display: flex;
        justify-content: center;
        align-items: center;
        align-self: center;
        width: 84px;
        height: 30px;
        color: var(--copper-dark);
        background: #fffffe;
        border: 1px solid var(--line);
        border-radius: 999px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
        touch-action: none;
        cursor: grab;
    }
    .mapa-panel-asa svg { width: 22px; height: 22px; }
}

/* Mientras se busca, lo que no coincide se desenfoca y lo que coincide queda nítido encima */
.mapa-svg .capa-resaltados { pointer-events: none; }

/* Pantalla completa de filtros */
.mapa-cat-pantalla {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    flex-direction: column;
    background: #f7f1e4;
}
.mapa-cat-pantalla[hidden] { display: none; }
.mapa-cat-barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(0.9rem, env(safe-area-inset-top)) 0.9rem 0.8rem 1.2rem;
    color: #fffffe;
    background: var(--boton, var(--copper));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.mapa-cat-barra h2 { margin: 0; font-family: var(--font-display); font-size: 1.4rem; color: #fffffe; }
.mapa-cat-acciones { display: flex; align-items: center; gap: 0.5rem; }
.mapa-cat-limpiar {
    min-height: 44px;
    padding: 0 0.9rem;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fffffe;
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.mapa-cat-cerrar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--copper-dark);
    background: #fffffe;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.mapa-cat-cerrar svg { width: 20px; height: 20px; }
.mapa-cat-cuerpo {
    flex: 1;
    padding: 1.1rem 1rem 1.4rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.mapa-cat-cuerpo h3 {
    margin: 0.2rem 0.2rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--copper-dark);
}
.mapa-cat-opciones { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.3rem; }
.mapa-cat-opcion {
    flex: 1 1 4.5rem;
    min-height: 48px;
    padding: 0.4rem 0.9rem;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: #fffffe;
    border: 1.5px solid #d9ccb4;
    border-radius: 14px;
    cursor: pointer;
}
.mapa-cat-opcion.activo { color: #fffffe; background: var(--boton, var(--copper)); border-color: var(--boton, var(--copper)); }
.mapa-cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.mapa-cat-tarjeta {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 124px;
    padding: 0.95rem 0.5rem;
    font: inherit;
    text-align: center;
    color: var(--ink);
    background: #fffffe;
    background: color-mix(in srgb, var(--cat, #e6dcc8) 34%, #fffffe);
    border: 1.5px solid #d9ccb4;
    border-color: color-mix(in srgb, var(--cat, #cfc6b2) 75%, #fffffe);
    border-radius: 18px;
    cursor: pointer;
}
.mapa-cat-tarjeta.es-lugar { --cat: #bcd9d2; }
.mapa-cat-tarjeta.activo { border-color: var(--boton, var(--copper)); box-shadow: 0 0 0 2px var(--boton, var(--copper)); }
.mapa-cat-tarjeta.activo::after {
    content: "";
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.3rem;
    height: 1.3rem;
    background: var(--boton, var(--copper)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.500 4.500L19 7'/%3E%3C/svg%3E") center / 70% no-repeat;
    border-radius: 50%;
}
.mapa-cat-tarjeta .icono {
    box-sizing: border-box;
    width: 58px;
    height: 58px;
    padding: 11px;
    color: #3b2a1c;
    background: var(--cat, #e6dcc8);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 254, 0.7);
}
.mapa-cat-tarjeta .icono svg { display: block; width: 100%; height: 100%; }
.mapa-cat-tarjeta .nombre { font-size: 0.93rem; font-weight: 700; line-height: 1.2; }
.mapa-cat-tarjeta .cuenta { font-size: 0.76rem; color: #5b5240; }
.mapa-cat-pie {
    padding: 0.8rem 1rem max(0.9rem, env(safe-area-inset-bottom));
    background: #f7f1e4;
    border-top: 1px solid #d9ccb4;
}
.mapa-cat-ver {
    width: 100%;
    min-height: 50px;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fffffe;
    background: var(--boton, var(--copper));
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.cat-pantalla-abierta, .cat-pantalla-abierta body { overflow: hidden; }
@media (min-width: 861px) { .mapa-cat-pantalla { display: none; } }

.mapa-ficha-foto-enlace { display: block; cursor: pointer; }
.mapa-ficha-subtitulo {
    margin: 1.3rem 0 0.8rem;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    color: var(--copper);
    background: #f8ece8;
    border-radius: 2px;
    cursor: default;
    user-select: none;
}

/* Teléfono girado (horizontal): se pide volver a vertical, que es como está pensado el mapa */
.mapa-girar { display: none; }
@media (max-width: 860px) and (max-height: 520px) and (orientation: landscape) {
    .mapa { min-height: 0; }
    .mapa-girar {
        position: absolute;
        inset: 0;
        z-index: 200;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
        padding: 1rem;
        text-align: center;
        color: #fffffe;
        background: var(--copper);
    }
    .mapa-girar svg { width: 56px; height: 56px; }
    .mapa-girar p { margin: 0; max-width: 20rem; font-size: 1.05rem; font-weight: 600; }
}

/* El mapa no se arrastra ni se selecciona como si fuera una imagen o texto de la página */
.mapa-lienzo { -webkit-user-select: none; user-select: none; }
.mapa-lienzo input, .mapa-ficha, .mapa-ruta-panel { -webkit-user-select: text; user-select: text; }
.mapa-lienzo img, .mapa-lienzo svg { -webkit-user-drag: none; }

/* Móvil: al elegir el punto de partida la ficha de ruta queda minimizada abajo y los selectores de planta y edificio van justo encima */
@media (max-width: 860px) {
    .mapa.con-ficha.eligiendo-origen .mapa-barra {
        display: flex;
        top: auto;
        bottom: calc(0.9rem + var(--alto-ruta, 5.5rem) + 1.3rem);
        left: 0.9rem;
        right: 0.9rem;
        justify-content: flex-start;
    }
    .mapa-ruta-cabeza { padding-right: calc(0.55rem + 84px + 0.4rem + 0.5rem); }
}

/* Móvil: el aviso de "dónde estás" cabe en una sola línea */
@media (max-width: 860px) {
    .mapa.eligiendo-origen .mapa-nota { max-width: calc(100% - 1.8rem); white-space: nowrap; }
}

/* Móvil: con el panel de búsqueda abierto, los selectores de planta no reciben toques,
   para no cambiar de planta por error al tocar la flecha de cerrar; un toque ahí solo cierra el panel */
@media (max-width: 860px) {
    .mapa.panel-abierto .mapa-barra,
    .mapa.panel-abierto .mapa-barra *,
    .mapa.panel-abierto .mapa-zoom,
    .mapa.panel-abierto .mapa-zoom *,
    .mapa.panel-abierto .mapa-planta-actual,
    .mapa.panel-abierto .mapa-modo,
    .mapa.panel-abierto .mapa-modo * { pointer-events: none; }
}

@media (max-width: 860px) {
    /* Selectores de edificio y planta del panel: las dos filas ocupan el mismo largo */
    .mapa-ubicacion-opciones { flex: 1; min-width: 0; }
    .mapa-ubicacion-opciones button { flex: 1 1 0; min-width: 0; padding-left: 0.3rem; padding-right: 0.3rem; text-align: center; }

    /* Con la búsqueda abierta el plano queda desenfocado detrás */
    .mapa-svg, .mapa-barra, .mapa-zoom, .mapa-planta-actual, .mapa-modo { transition: filter 0.15s ease; }
    .mapa.panel-abierto .mapa-svg,
    .mapa.panel-abierto .mapa-barra,
    .mapa.panel-abierto .mapa-zoom,
    .mapa.panel-abierto .mapa-planta-actual,
    .mapa.panel-abierto .mapa-modo { filter: blur(3px); }

    /* Selectores de planta y vista: no se ensanchan más allá del espacio libre (el contador va sobre el botón,
       no al lado), para que nunca lleguen debajo de los botones de zoom */
    .mapa-barra .mapa-grupo { max-width: 100%; }
    .mapa-barra .mapa-grupo button { position: relative; min-width: 0; padding-left: 0.8rem; padding-right: 0.8rem; }
    .mapa-barra .mapa-cuenta { position: absolute; top: -7px; right: -2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
}

/* Escritorio: la ficha y el panel de ruta quedan más despegados de los selectores de edificio y planta */
@media (min-width: 861px) {
    .mapa-ficha,
    .mapa-ruta-panel {
        top: 6.7rem;
        max-height: calc(100% - 11.5rem);
    }
    /* Con pestañas (ruta trazada) la altura también se mide desde el nuevo borde superior, para no tapar el zoom */
    .mapa-ficha.con-pestanas:not([hidden]),
    .mapa-ruta-panel.con-pestanas:not([hidden]) {
        height: min(640px, calc(100% - 11.5rem));
    }
}
@media (max-width: 860px) {
    .mapa-ruta-foto { cursor: pointer; }
}

/* Girar el plano: A abajo y B arriba */
.mapa-svg.girando { opacity: 0; transition: opacity 0.15s ease; }
.mapa-svg.girando-entra { animation: mapa-gira-entra 0.28s ease both; }
@keyframes mapa-gira-entra { from { opacity: 0; } to { opacity: 1; } }
.mapa-zoom #mapaGirar[aria-pressed="true"] { color: #fff; background: var(--boton, var(--copper)); }
@media (prefers-reduced-motion: reduce) { .mapa-svg.girando-entra { animation: none; } }

/* Escritorio: zona de clic de las pestañas del menú y del pie más grande que el dibujo (el botón se ve igual) */
@media (min-width: 861px) {
    .mapa-tirador::before { inset: -8px -56px -22px; }
    .mapa-tirador.mapa-abajo::before { inset: -22px -56px -8px; }
}

/* El svg va dentro de un contenedor propio. Con ZOOM_FLUIDO activado (mapa.js) esa capa se mueve con una transformación durante el gesto */
.mapa-svg-capa { position: absolute; }

/* Mientras se mueve el mapa (zoom, arrastre) se simplifica el dibujo para que el celular no se trabe;
   al soltar vuelve todo a la calidad normal */
.mapa-svg.moviendo { text-rendering: optimizeSpeed; shape-rendering: optimizeSpeed; }
.mapa-svg.moviendo * { filter: none !important; }

/* Móvil: la tarjeta va abajo, así que la sombra se proyecta hacia arriba y alrededor */
@media (max-width: 860px) {
    .mapa-ficha,
    .mapa-ruta-panel {
        box-shadow: 0 0 0 1px var(--line), 0 -6px 26px rgba(0, 0, 0, 0.32), 0 4px 16px rgba(0, 0, 0, 0.2);
    }
}

/* Móvil: las tarjetas suben desde abajo en vez de entrar de lado */
@keyframes ficha-sube { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
    .mapa-ficha { animation-name: ficha-sube; }
    .mapa-ruta-panel { animation-name: ficha-sube; }
}

/* En lugar del botón, un desvanecido blanco al pie indica que hay más contenido */
.mapa-ficha-mas button { display: none; }
.mapa-ficha-mas::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.4rem;
    background: linear-gradient(to bottom, rgba(255, 255, 254, 0), #fffffe 90%);
    pointer-events: none;
}
.mapa-ficha.con-pestanas .mapa-ficha-mas::before,
.mapa-ruta-panel.con-pestanas .mapa-ficha-mas::before { bottom: 2.95rem; }

/* Móvil: el desvanecido es más bajo para tapar menos contenido */
@media (max-width: 860px) {
    .mapa-ficha-mas::before { height: 1.9rem; }
}

/* Ficha de información: el encabezado cobre (categoría, nombre y ubicación) es la barra fija, igual que en la ruta;
   los botones flotan sobre él y la foto va debajo */
.mapa-ficha.min .mapa-ficha-herramientas { height: auto; margin: 0; }
.mapa-ficha.min .mapa-ficha-herramientas > button { top: 0; }
.mapa-ficha .mapa-ficha-imagen { margin-top: 1rem; }

/* Botones de minimizar y cerrar: mismo estilo en la ficha de información y en la de ruta (sobre fondo cobre oscuro) */
.mapa-ficha-herramientas .mapa-minimizar,
.mapa-ficha-herramientas .mapa-ficha-cerrar {
    color: #fffffe;
    background: rgba(255, 254, 252, 0.16);
    border: 1.5px solid rgba(255, 254, 252, 0.55);
    box-shadow: none;
}
.mapa-ficha-herramientas .mapa-minimizar:hover,
.mapa-ficha-herramientas .mapa-ficha-cerrar:hover {
    color: #fffffe;
    background: rgba(255, 254, 252, 0.3);
    border-color: #fffffe;
}
/* Minimizada, la ficha vuelve a fondo claro: botones oscuros */
.mapa-ficha.min .mapa-ficha-herramientas .mapa-minimizar,
.mapa-ficha.min .mapa-ficha-herramientas .mapa-ficha-cerrar {
    color: var(--ink);
    background: #f6f2ea;
    border-color: var(--line);
}

/* Los botones de minimizar y cerrar van dentro del encabezado cobre, centrados en vertical a la derecha */
.mapa-ruta-cabeza .mapa-ficha-herramientas {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    height: auto;
    margin: 0;
    transform: translateY(-50%);
}
.mapa-ruta-cabeza .mapa-ficha-herramientas > button { position: static; top: auto; }
/* Ficha minimizada: el encabezado se deshace y solo quedan el título corto y los botones en fila */
.mapa-ficha.min .mapa-ruta-cabeza { display: contents; }
.mapa-ficha.min .mapa-ruta-titulo { display: none; }
.mapa-ficha.min .mapa-ruta-cabeza .mapa-ficha-herramientas { position: static; transform: none; flex: none; }

/* Resumen de la ruta (distancia y tiempo): mismas etiquetas con icono que la ubicación, en el amarillo de la ruta */
.mapa-ruta-cuerpo .mapa-ficha-donde-titulo { margin: 0 0 0.45rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.mapa-ruta-resumen { margin-bottom: 1.2rem; }
.mapa-ficha-chips--ruta .mapa-ficha-chip { color: var(--ruta-oscuro); background: #f7edc9; }

/* Ubicación del local: título y una sola fila de etiquetas con icono (edificio, planta, número) */
.mapa-ficha-donde { margin: 0 0 1.6rem; }
.mapa-ficha .mapa-ficha-donde-titulo { margin: 0 0 0.45rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.mapa-ficha-chips { display: flex; flex-wrap: nowrap; gap: 0.35rem; }
.mapa-ficha-chip { display: inline-flex; align-items: center; gap: 0.3rem; flex: 0 1 auto; min-width: 0; padding: 0.32rem 0.75rem 0.32rem 0.6rem; font-size: 0.87rem; font-weight: 600; line-height: 1.3; white-space: nowrap; color: var(--copper); background: #f8ece8; border-radius: 999px; }
.mapa-ficha-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mapa-ficha-chip svg { width: 16px; height: 16px; flex: none; }

/* Móvil: etiquetas de edificio, planta y número en una sola fila; la letra se achica (--ajuste-chip, lo calcula mapa.js)
   solo si hace falta para que no se corte ninguna */
@media (max-width: 860px) {
    .mapa-ficha .mapa-ficha-donde-titulo { font-size: 0.66rem; }
    .mapa-ficha-chips { gap: 0.3rem; flex-wrap: nowrap; }
    .mapa-ficha-chip {
        flex: 0 0 auto;
        gap: 0.25rem;
        padding: 0.28rem 0.65rem 0.28rem 0.55rem;
        font-size: calc(0.8rem * var(--ajuste-chip, 1));
    }
    .mapa-ficha-chip span { overflow: visible; text-overflow: clip; }
    .mapa-ficha-chip svg { width: calc(14px * var(--ajuste-chip, 1)); height: calc(14px * var(--ajuste-chip, 1)); }
}

/* Encabezado claro: texto oscuro, categoría en ocre y botones de minimizar y cerrar en tono verde oscuro */
.mapa-ruta-cabeza { color: var(--encabezado-texto); }
.mapa-ruta-cabeza .mapa-ruta-etiqueta { color: #f3d27a; }
.mapa-ruta-cabeza .mapa-ficha-herramientas .mapa-minimizar,
.mapa-ruta-cabeza .mapa-ficha-herramientas .mapa-ficha-cerrar {
    color: var(--encabezado-texto);
    background: rgba(255, 255, 255, 0.14);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.mapa-ruta-cabeza .mapa-ficha-herramientas .mapa-minimizar:hover,
.mapa-ruta-cabeza .mapa-ficha-herramientas .mapa-ficha-cerrar:hover {
    color: var(--encabezado-texto);
    background: rgba(255, 255, 255, 0.26);
    border-color: var(--encabezado-texto);
}

/* Ficha de información minimizada: conserva el mismo encabezado de color que la ficha abierta y que la ruta minimizada
   (categoría y nombre, con los botones en blanco a la derecha); el título corto deja de usarse */
.mapa-ficha.min:not([hidden]) { display: block !important; padding: 0; }
.mapa-ficha.min .mapa-ficha-minititulo { display: none; }
.mapa-ficha.min .mapa-ruta-cabeza { display: flex; }
.mapa-ficha.min .mapa-ruta-titulo { display: block; }
.mapa-ficha.min .mapa-ruta-cabeza .mapa-ficha-herramientas { position: absolute; top: 50%; right: 0.55rem; transform: translateY(-50%); }
.mapa-ficha.min .mapa-ficha-herramientas .mapa-minimizar,
.mapa-ficha.min .mapa-ficha-herramientas .mapa-ficha-cerrar {
    color: var(--encabezado-texto);
    background: rgba(255, 255, 255, 0.14);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
}

/* Aviso de que no se pudo calcular la ruta: mismo cuerpo que las demás tarjetas (texto a la izquierda) y botón principal de ancho completo */
.mapa-ruta-panel .mapa-ruta-sinruta { padding: 1.1rem 1.1rem 1.2rem; }
.mapa-ruta-panel .mapa-ruta-sinruta-titulo { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.mapa-ruta-panel .mapa-ruta-sinruta .mapa-ruta-error { margin: 0 0 1.3rem; font-size: 0.95rem; line-height: 1.45; color: var(--ink-soft); }
.mapa-ruta-panel .mapa-ruta-sinruta .mapa-ruta-sinruta-boton { display: block; width: 100%; }
.mapa-ruta-panel .mapa-ruta-sinruta .mapa-ruta-sinruta-boton {
    padding: 0.7rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fffffe;
    background: var(--lake);
    border: 1.5px solid var(--lake);
    border-radius: 999px;
    cursor: pointer;
}
.mapa-ruta-panel .mapa-ruta-sinruta .mapa-ruta-sinruta-boton:hover { background: var(--lake-dark); border-color: var(--lake-dark); }

/* Pin tachado: el cursor, fuera de la zona donde se puede elegir el inicio */
.mapa-svg.eligiendo.fuera { --cursor-pin: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2240%22 viewBox=%220 0 32 40%22%3E%3Cdefs%3E%3Cmask id=%22m%22 maskUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%2232%22 height=%2240%22%3E%3Crect width=%2232%22 height=%2240%22 fill=%22white%22/%3E%3Cpath d=%22M31.5 -0.6L0.5 38.6%22 stroke=%22black%22 stroke-width=%227%22/%3E%3C/mask%3E%3C/defs%3E%3Cg mask=%22url(%23m)%22%3E%3Cpath d=%22M16 38C16 38 4 25 4 15a12 12 0 0 1 24 0c0 10-12 23-12 23z%22 fill=%22%237a5600%22 stroke=%22%23fffffe%22 stroke-width=%222.5%22 stroke-linejoin=%22round%22/%3E%3Ccircle cx=%2216%22 cy=%2215%22 r=%224.5%22 fill=%22%23fffffe%22/%3E%3C/g%3E%3Cpath d=%22M29 2.6L4.6 33.3%22 stroke=%22%23fffffe%22 stroke-width=%225.8%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M29 2.6L4.6 33.3%22 stroke=%22%237a5600%22 stroke-width=%222.8%22 stroke-linecap=%22round%22/%3E%3C/svg%3E") 16 38, not-allowed; }

/* Total de "me gusta" de un local en su ficha del mapa (solo lectura) */
.mapa-megusta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #d93a55;
    background: rgba(255, 252, 247, 0.94);
    border-radius: 999px;
    box-shadow: 0 1px 5px rgba(20, 14, 8, 0.25);
}
.mapa-megusta svg { width: 14px; height: 14px; }
.mapa-ficha-imagen .mapa-megusta { position: absolute; right: 0.7rem; top: 0.7rem; z-index: 0; }
.mapa-ficha-imagen .estado-local--tarjeta { left: 0.7rem; right: auto; }
.mapa-ficha-cuerpo > .mapa-megusta { margin-bottom: 0.6rem; }
