/* Mapa Places nearby — MapLibre + CARTO */
.nearby-map__header {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.nearby-map__eyebrow { color: var(--color-terracotta); }
.nearby-map__title {
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
.nearby-map__lead {
  margin-top: 20px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-muted);
}

.nearby-map__panel {
  margin-top: 48px;
  max-width: 1200px;
  margin-inline: auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(26, 17, 16, 0.08);
  background: var(--color-bg);
  box-shadow: 0 24px 60px rgba(26, 17, 16, 0.06);
}

.nearby-map__filters {
  padding: 16px;
  border-bottom: 1px solid rgba(26, 17, 16, 0.08);
  background: var(--color-surface);
}

/* Escritorio: pills */
.nearby-map__filters-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nearby-map__filter {
  appearance: none;
  border: 1px solid rgba(26, 17, 16, 0.12);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nearby-map__filter:hover { border-color: var(--color-terracotta); }
.nearby-map__filter.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #fff;
}

/* Móvil: dropdown */
.nearby-map__filters-select {
  display: none;
  width: 100%;
  appearance: none;
  border: 1px solid rgba(26, 17, 16, 0.12);
  background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231a1110' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 12px 40px 12px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.nearby-map__canvas {
  position: relative;
  width: 100%;
  height: min(62vh, 560px);
  min-height: 360px;
  background: #e8e4df;
}
.nearby-map__canvas .maplibregl-canvas { outline: none; }
.nearby-map__canvas .maplibregl-ctrl-attrib,
.nearby-map__canvas .maplibregl-ctrl-logo {
  display: none !important;
}

/* Marcador + tarjeta pin al hacer clic */
/* IMPORTANTE: no usar position:relative aquí — pisa el absolute de MapLibre
   y mete los markers en flujo normal (ancho 100%), desplazando pines al abrir la card. */
.nearby-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: none;
  cursor: default;
  /* position lo controla .maplibregl-marker (absolute) */
}

/* La burbuja activa debe quedar sobre todos los demás pines. */
.nearby-marker.is-open {
  z-index: 20 !important;
}

.nearby-pin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  background: var(--color-terracotta);
  position: relative;
  z-index: 1;
}
.nearby-pin:hover { transform: scale(1.08); }
.nearby-pin.is-active {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.nearby-pin__inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
}
.nearby-pin__inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  box-sizing: border-box;
}
.nearby-pin--has-icon {
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.nearby-pin--has-icon .nearby-pin__inner img {
  padding: 4px;
}
.nearby-pin__letter {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

/* Tarjeta compacta encima del pin — absolute para no cambiar el tamaño del marker */
.nearby-pin-card {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  align-items: center;
  gap: 8px;
  max-width: min(220px, 70vw);
  padding: 6px 12px 6px 6px;
  background: #fff;
  border: 1px solid rgba(26, 17, 16, 0.1);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(26, 17, 16, 0.14);
  z-index: 21;
  animation: nearby-card-in 0.22s ease;
  pointer-events: auto;
}
.nearby-pin-card.is-open { display: flex; }
.nearby-pin-card::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid rgba(26, 17, 16, 0.1);
  border-bottom: 1px solid rgba(26, 17, 16, 0.1);
  transform: translateX(-50%) rotate(45deg);
}

@keyframes nearby-card-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.nearby-pin-card__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.nearby-pin-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  box-sizing: border-box;
}
.nearby-pin-card__letter {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}
.nearby-pin-card__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.nearby-pin-card__name {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nearby-pin-card__note {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  .nearby-map__canvas { height: 52vh; min-height: 300px; }
  .nearby-map__filters { padding: 12px; }
  .nearby-map__filters-pills { display: none; }
  .nearby-map__filters-select { display: block; }
}
