/* =========================================================
   BATZ · Mapa interactivo de ubicaciones (ventana emergente)
   ========================================================= */

body.batz-map-abierto { overflow: hidden; }

.batz-map-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background-color: rgba(11, 20, 28, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .26s ease;
}
.batz-map-modal.is-open { opacity: 1; }
.batz-map-modal[hidden] { display: none !important; }

.batz-map__dialog {
  width: 100%;
  max-width: 1080px;
  max-height: calc(100dvh - 44px);
  overflow: auto;
  background-color: #FFFFFF;
  border-radius: 25px;
  padding: 24px 26px 20px;
  transform: translateY(14px) scale(.985);
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.batz-map-modal.is-open .batz-map__dialog { transform: none; }

.batz-map__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  column-gap: 24px;
  margin-bottom: 18px;
}
.batz-map__title {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #1B1810;
}
.batz-map__sub {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(27,24,16,.7);
}
.batz-map__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background-color: #15222F;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform .25s ease, background-color .25s ease;
}
.batz-map__close:hover { transform: rotate(90deg); background-color: #50A4FF; }

.batz-map__canvas {
  position: relative;
  width: min(100%, calc((100vh - 232px) * 2.0012));
  width: min(100%, calc((100dvh - 232px) * 2.0012));
  margin-inline: auto;
  aspect-ratio: 1667 / 833;
  border-radius: 18px;
}
.batz-map__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

/* ---------- Puntos ---------- */
.batz-map__pin {
  position: absolute;
  width: 15px;
  height: 15px;
  padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 100px;
  border: 3px solid #FFFFFF;
  background-color: #50A4FF;
  cursor: pointer;
  z-index: 3;
  transition: box-shadow .3s ease;
  /* El halo fino separa el punto del azul del oceano sin tocar su color */
  box-shadow: 0 0 0 0 rgba(21,34,47,.35), 0 0 0 1px rgba(27,24,16,.22);
}
/* Mismo codigo de color que el mapa de Contacto */
.batz-map__pin--oficina { background-color: #15222F; }
.batz-map__pin--acuerdo { background-color: #A8C758; }
.batz-map__pin:hover,
.batz-map__pin:focus-visible,
.batz-map__pin.is-open {
  box-shadow: 0 0 0 9px rgba(80,164,255,.28), 0 0 0 1px rgba(27,24,16,.22);
  z-index: 6;
  outline: none;
}

/* ---------- Ficha ---------- */
.batz-map__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  row-gap: 2px;
  width: max-content;
  max-width: 250px;
  padding: 14px 16px;
  border-radius: 14px;
  background-color: rgba(21,34,47,.95);
  box-shadow: 0 14px 34px rgba(11,20,28,.28);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.batz-map__pin:hover .batz-map__tip,
.batz-map__pin:focus-visible .batz-map__tip,
.batz-map__pin.is-open .batz-map__tip { opacity: 1; visibility: visible; }

.batz-map__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: rgba(21,34,47,.95);
}
.batz-map__tip-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #FFFFFF;
  margin-bottom: 4px;
}
.batz-map__tip-line {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255,255,255,.78);
  min-height: 1px;
}

.batz-map__tip-gap { height: 10px; }
.batz-map__tip-title--sub { margin-top: 0; }

/* ---------- Leyenda ---------- */
.batz-map__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 30px;
  row-gap: 10px;
  margin-top: 18px;
}
.batz-map__legend-item {
  display: flex;
  align-items: center;
  column-gap: 9px;
  font-size: 14px;
  color: rgba(27,24,16,.75);
}
.batz-map__dot {
  width: 11px;
  height: 11px;
  border-radius: 100px;
  border: 2px solid #FFFFFF;
  background-color: #50A4FF;
  box-shadow: 0 0 0 1px rgba(27,24,16,.18);
}
.batz-map__dot--oficina { background-color: #15222F; }
.batz-map__dot--acuerdo { background-color: #A8C758; }

@media (max-width: 991px) {
  .batz-map-modal { padding: 16px; }
  .batz-map__dialog { padding: 22px 18px 20px; border-radius: 20px; }
  .batz-map__title { font-size: 26px; }
  .batz-map__pin { width: 13px; height: 13px; border-width: 2px; }
  .batz-map__tip { max-width: 200px; padding: 11px 13px; }
  .batz-map__tip-title { font-size: 14px; }
  .batz-map__tip-line { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .batz-map-modal,
  .batz-map__dialog,
  .batz-map__pin,
  .batz-map__tip,
  .batz-map__close { transition: none !important; }
}

/* Pantallas bajas: se recorta el encabezado para que el mapa no pida scroll */
@media (max-height: 720px) {
  .batz-map__title { font-size: 24px; }
  .batz-map__sub { display: none; }
  .batz-map__head { margin-bottom: 14px; }
  .batz-map__legend { margin-top: 14px; font-size: 13px; }
  .batz-map__dialog { padding: 18px 20px 16px; }
  .batz-map__canvas { width: min(100%, calc((100dvh - 178px) * 2.0012)); }
}
