/* ===== BLOCK: spaces-map ===== */
.spaces-map { margin-top: clamp(40px, 4vw, 64px); }

.spaces-map__frame {
  position: relative;
  padding: 10px;
  border-radius: calc(var(--r-xl) + 10px);
  background: var(--c-white);
  box-shadow: var(--sh-card);
}
.spaces-map__canvas {
  position: relative;
  z-index: 0;
  height: clamp(380px, 41vw, 795px);
  overflow: hidden;
  border-radius: var(--r-xl);
  background: #EEF0F2;
  font-family: var(--ff-body);
}
.spaces-map__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--c-ink-2);
  font-size: var(--fs-sm);
  text-align: center;
}
.spaces-map.is-ready .spaces-map__fallback { display: none; }

/* ---- Фільтр-легенда ---- */
.spaces-map__filters {
  position: absolute;
  z-index: 500;
  left: clamp(20px, 2vw, 34px);
  bottom: clamp(20px, 2vw, 34px);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 140px);
  padding: 8px;
  border-radius: var(--r-pill);
  background: var(--c-white);
  box-shadow: var(--sh-float);
}
.map-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 10px;
  border-radius: var(--r-pill);
  font-family: var(--ff-head);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color .2s ease;
}
.map-filter:hover { background: var(--c-gray-100); }
.map-filter[aria-pressed="true"] { background: var(--c-apricot-100); font-weight: 700; }
.map-filter__swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--c-white);
  box-shadow: 0 2px 6px rgba(31,26,23,.25);
  flex-shrink: 0;
}
.map-filter__swatch--all {
  background: conic-gradient(var(--c-honey) 0 50%, var(--c-orange) 50% 100%);
}
.map-filter__count {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--c-gray-100);
  color: var(--c-ink-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
}
.map-filter[aria-pressed="true"] .map-filter__count { background: var(--c-white); color: var(--c-ink); }

/* ---- Підказка про масштаб ---- */
.spaces-map__hint {
  position: absolute;
  z-index: 600;
  inset: 10px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: var(--r-xl);
  background: rgba(31,26,23,.55);
  color: var(--c-white);
  font-family: var(--ff-head);
  font-size: clamp(1rem, .9rem + .4vw, 1.25rem);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.spaces-map__hint.is-visible { opacity: 1; }

/* ---- Leaflet: стилі в дусі сайту ---- */
.spaces-map .leaflet-container { font-family: var(--ff-body); background: #EEF0F2; }
/* Підкладка OSM знебарвлена до світло-сірої, щоб не сперечалася з кольорами сайту */
.spaces-map .leaflet-tile-pane { filter: grayscale(1) contrast(.86) brightness(1.07); }
.spaces-map .leaflet-container:focus-visible { outline: 2px solid var(--c-orange); outline-offset: -2px; }
.spaces-map .leaflet-bottom.leaflet-right { right: clamp(10px, 1.2vw, 24px); bottom: clamp(10px, 1.2vw, 24px); }
.spaces-map .leaflet-control-zoom {
  margin: 0 0 34px 0 !important;
  border: 0 !important;
  border-radius: var(--r-md) !important;
  overflow: hidden;
  box-shadow: var(--sh-float) !important;
}
.spaces-map .leaflet-control-zoom a {
  width: 46px !important;
  height: 46px !important;
  line-height: 44px !important;
  border: 0 !important;
  background: var(--c-white) !important;
  color: var(--c-ink) !important;
  font-family: var(--ff-head);
  font-size: 1.375rem !important;
  font-weight: 600;
}
.spaces-map .leaflet-control-zoom a + a { border-top: 1px solid var(--c-gray-200) !important; }
.spaces-map .leaflet-control-zoom a:hover { background: var(--c-apricot-50) !important; }
.spaces-map .leaflet-control-zoom a:focus-visible { outline: 2px solid var(--c-orange); outline-offset: -2px; }
.spaces-map .leaflet-control-zoom a.leaflet-disabled { color: var(--c-gray-200) !important; }
.spaces-map .leaflet-control-attribution {
  margin: 0 !important;
  padding: 2px 8px !important;
  border-radius: var(--r-sm) 0 0 0;
  background: rgba(255,255,255,.85) !important;
  color: var(--c-ink-2);
  font-size: .6875rem;
}
.spaces-map .leaflet-control-attribution a { color: var(--c-orange-text); }

/* Мітки */
.map-marker { background: none; border: 0; }
.map-marker__pin {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--c-white);
  box-shadow: 0 4px 12px rgba(31,26,23,.3);
  transition: transform .25s var(--ease-out), opacity .35s ease;
}
.map-marker--vulyk .map-marker__pin { background: var(--c-honey); }
.map-marker--women .map-marker__pin { background: var(--c-orange); }
.map-marker--other .map-marker__pin { background: var(--c-ink-2); }
.map-marker.is-active .map-marker__pin { transform: scale(1.45); }
.map-marker:hover .map-marker__pin { transform: scale(1.2); }
.map-marker.is-active:hover .map-marker__pin { transform: scale(1.45); }
.map-marker.is-hidden .map-marker__pin { opacity: 0; transform: scale(.4); }
.map-marker.is-hidden { pointer-events: none; }
.map-marker:focus-visible { outline: none; }
.map-marker:focus-visible .map-marker__pin { outline: 3px solid var(--c-ink); outline-offset: 2px; }

.map-cluster { background: none; border: 0; }
.map-cluster__badge {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--c-white);
  background: var(--c-orange);
  box-shadow: 0 0 0 6px rgba(255,127,0,.25), 0 4px 12px rgba(31,26,23,.3);
  color: var(--c-ink);
  font-family: var(--ff-head);
  font-size: .9375rem;
  font-weight: 700;
  transition: transform .25s var(--ease-out);
}
.map-cluster:hover .map-cluster__badge { transform: scale(1.1); }
.map-cluster:focus-visible { outline: none; }
.map-cluster:focus-visible .map-cluster__badge { outline: 3px solid var(--c-ink); outline-offset: 2px; }

/* Спливаюче вікно */
.spaces-map .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: var(--r-md);
  box-shadow: var(--sh-float);
}
.spaces-map .leaflet-popup-content { width: min(280px, 70vw) !important; margin: 20px 22px 22px; line-height: 1.5; }
.spaces-map .leaflet-popup-close-button {
  top: 8px !important; right: 8px !important;
  width: 32px !important; height: 32px !important;
  border-radius: 50%;
  font-size: 22px !important;
  line-height: 30px !important;
  color: var(--c-ink-2) !important;
}
.spaces-map .leaflet-popup-close-button:hover { background: var(--c-gray-100); color: var(--c-ink) !important; }
.map-popup__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-ink-2);
  font-family: var(--ff-head);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.map-popup__title {
  margin: 6px 28px 2px 0;
  font-family: var(--ff-head);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}
.map-popup__city { color: var(--c-ink-2); font-size: var(--fs-sm); margin: 0; }
.map-popup__desc { margin: 10px 0 0; font-size: var(--fs-sm); }
.map-popup__btn { margin-top: 14px; min-height: 44px; padding: .6em 1.4em; font-size: .9375rem; }
.spaces-map .leaflet-popup-content a.btn--primary { color: var(--c-ink); }

/* ---- Перелік списком ---- */
.spaces-map__list {
  margin-top: 20px;
  border-radius: var(--r-lg);
  background: var(--c-white);
  box-shadow: var(--sh-soft);
}
.spaces-map__list-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 24px;
  border-radius: var(--r-lg);
  font-family: var(--ff-head);
  font-size: var(--fs-body);
  font-weight: 600;
  list-style: none;
}
.spaces-map__list-toggle svg { width: 20px; height: 20px; transition: transform .25s var(--ease-out); }
.spaces-map__list[open] .spaces-map__list-toggle svg { transform: rotate(180deg); }
.spaces-map__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 8px;
  padding: 0 16px 16px;
}
.spaces-map__item {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--c-white-brand);
}
.spaces-map__item-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-ink-2);
  font-family: var(--ff-head);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.spaces-map__item-city { font-family: var(--ff-head); font-weight: 700; }
.spaces-map__item-title { color: var(--c-ink-2); font-size: var(--fs-sm); }

/* ---- Адаптив ---- */
@media (max-width: 992px) {
  .spaces-map__filters {
    position: static;
    max-width: none;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: none;
    background: var(--c-white-brand);
  }
  .spaces-map__filters::-webkit-scrollbar { display: none; }
  .map-filter { flex-shrink: 0; }
}
@media (max-width: 768px) {
  .spaces-map__frame { padding: 8px; border-radius: calc(var(--r-lg) + 8px); }
  .spaces-map__canvas { height: clamp(360px, 100vw, 420px); border-radius: var(--r-lg); }
  .spaces-map__hint { inset: 8px; border-radius: var(--r-lg); }
  .spaces-map .leaflet-control-zoom { margin-bottom: 26px !important; }
  .spaces-map .leaflet-control-zoom a { width: 42px !important; height: 42px !important; line-height: 40px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .map-marker__pin, .map-cluster__badge, .spaces-map__hint { transition: none; }
}
/* ===== /BLOCK: spaces-map ===== */
