/* ================================================================
   MAPA INTERACTIVO — estilos compartidos
   Cada página define --mapa-color en .mapa-seccion para el tema.
   ================================================================ */

.mapa-seccion {
  width: 96%;
  max-width: 1500px;
  margin: 5px auto 0;
  background: color-mix(in srgb, var(--mapa-color, #851f23) 5%, #fff);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  padding: 20px 20px 24px;
}

.mapa-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}

.mapa-inner {
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
  --map-scale: 1;
}

.mapa-inner img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.mapa-hint {
  text-align: center;
  font-size: .75rem;
  color: #aaa;
  margin-top: .4rem;
  font-family: 'Roboto Condensed', sans-serif;
}

@media (max-width: 599px) {
  .mapa-container {
    height: 33vh;
  }
}

@media (min-width: 600px) {
  .mapa-hint { display: none; }
}

/* ---- Marcadores ---- */

.marcador-mapa {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--zc, var(--mapa-color, #851f23));
  color: #fff;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(calc(1 / var(--map-scale, 1)));
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 0 3px color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 20%, transparent);
  cursor: pointer;
  transition: transform .15s;
}

.marcador-mapa:hover {
  transform: translate(-50%, -50%) scale(calc(1.25 / var(--map-scale, 1)));
}

.marcador-mapa.destacado {
  background: #fff !important;
  color: var(--zc, var(--mapa-color, #851f23));
  border-color: var(--zc, var(--mapa-color, #851f23));
  transform: translate(-50%, -50%) scale(calc(1.5 / var(--map-scale, 1)));
  box-shadow: 0 0 0 4px var(--zc, var(--mapa-color, #851f23)), 0 0 0 8px color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 25%, transparent), 0 4px 12px rgba(0,0,0,.4);
  z-index: 10;
  animation: marcador-pulso 1.2s ease-in-out infinite;
}

@keyframes marcador-pulso {
  0%, 100% { box-shadow: 0 0 0 4px var(--zc, var(--mapa-color, #851f23)), 0 0 0 8px  color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 25%, transparent), 0 4px 12px rgba(0,0,0,.4); }
  50%       { box-shadow: 0 0 0 4px var(--zc, var(--mapa-color, #851f23)), 0 0 0 14px color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 0%,  transparent), 0 4px 12px rgba(0,0,0,.4); }
}

/* ---- Leyenda ---- */

.leyenda-mapa {
  margin: 1rem auto 0;
  max-width: 800px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
  text-align: left;
}

.leyenda-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: 'Roboto Condensed', sans-serif;
  color: #333;
  background: #fff;
  padding: .55rem .8rem;
  border-radius: 6px;
  border-left: 3px solid var(--zc, var(--mapa-color, #851f23));
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.leyenda-item:hover {
  background: color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 8%, #fff);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 20%, transparent);
}

.leyenda-item.activo {
  background: var(--zc, var(--mapa-color, #851f23));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--zc, var(--mapa-color, #851f23)) 40%, transparent);
}

.leyenda-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--zc, var(--mapa-color, #851f23));
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leyenda-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.leyenda-texto {
  font-size: .83rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.leyenda-nombre,
.leyenda-texto strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--zc, #222);
}

.leyenda-shows,
.leyenda-texto small {
  font-size: .8rem;
  color: #777;
  line-height: 1.2;
}

.leyenda-item.activo .leyenda-nombre,
.leyenda-item.activo .leyenda-texto strong {
  color: #fff;
}

.leyenda-item.activo .leyenda-shows,
.leyenda-item.activo .leyenda-texto small {
  color: rgba(255,255,255,.8);
}
