.map-locations {
  background: #000;
  padding: 60px 0;
  font-family: "Poppins", sans-serif;
}
@media (max-width: 500px) {
  .map-locations { padding-bottom: 40px; }
}

.map-locations__title {
  margin: 0 auto 24px;
  font-weight: 400;
  font-size: 52px;
  line-height: 130%;
  text-align: center;
  color: #fff;
}
.map-locations__text {
  margin: 0 0 48px;
  font-weight: 400;
  font-size: 18px;
  line-height: 160%;
  text-align: center;
  color: #fff;
}
/* map/стили.txt "новое": title drops to a single flat size below 1440
   (not the old 3-step 40/32/26 taper) and gets a max-width so it wraps
   to 2 lines instead of running edge-to-edge; subtitle stays 18px at
   every breakpoint — no override needed. */
@media (max-width: 1024px) {
  .map-locations__title {
    font-size: 42px;
    max-width: 660px;
  }
}
@media (max-width: 1024px) {
  .map-locations__title { font-size: 42px; }
}
@media (max-width: 768px) {
  .map-locations__title {
    font-size: 32px;
  }
  .map-locations__text { font-size: 16px; }
}

#map-wrap {
  position: relative;
  width: 100%;
  /* 70 dots wide x 35 dots tall, always (map/стили.txt) — lock the box
     to that 2:1 ratio instead of a fixed height so the grid keeps
     exactly 70 columns/35 rows at every container width instead of
     drifting as width steps through secondary-container--1280's
     breakpoints while height stayed fixed. */
  aspect-ratio: 2 / 1;
  background: #000;
  border-radius: 12px;
  /* map/стили.txt "новое" drops overflow:hidden here — the popup card
     is now positioned to intentionally bleed past the box's left/
     bottom edges (see .map-popup below), which overflow:hidden would
     have clipped. The dot grid and markers are already computed to
     stay within the box, so nothing else relied on the clipping. */
}
#map-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* city marker glow — "цветная ивент точка" in map/стили.txt
   (box-shadow 0 0 16.8px var(--Color) translated to an SVG-safe
   drop-shadow; stdDeviation ~= half the box-shadow blur radius) */
.map-marker-core {
  filter: drop-shadow(0 0 8.4px var(--marker-color, transparent));
}

/* city marker pulse — based on the designer's reference animation
   (map/Blue Pulsing Circle.svg: scale 1x -> 2x, opacity 0.6 -> 0,
   linearly, once a second). Per feedback the reference read as too
   subtle on the actual map: travel distance stretched 50% (growth
   1x core-radius -> 1.5x), then another 25% on top of that (-> 1.875x,
   i.e. max scale 2.875), plus the duration nudged up. */
.map-marker-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: map-marker-pulse 1.3s linear infinite;
}
@keyframes map-marker-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.875); opacity: 0; }
}

.map-tooltip {
  position: absolute;
  min-width: 230px;
  min-height: 74px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--tooltip-accent, #c4fd9a);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  pointer-events: none;
  transform: translate(18px, -50%);
  white-space: nowrap;
  display: none;
  box-shadow: 0 0 19.4px color-mix(in srgb, var(--tooltip-accent, #c4fd9a) 70%, transparent);
  z-index: 10;
  /* subtle, quick entry so it doesn't just snap into view — `animation`
     rather than `transition` because it's the display:none -> block
     toggle that shows/hides the tooltip, and transitions don't run
     across a display:none boundary the way animations do. */
  animation: map-tooltip-fade-in 240ms ease-out;
}
@keyframes map-tooltip-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* marker sits close enough to the map's right edge that the default
   placement would run past #map-wrap's overflow:hidden and get
   clipped — flip to the marker's left side instead. */
.map-tooltip--flip-left {
  transform: translate(calc(-100% - 18px), -50%);
}
.map-tooltip strong {
  display: block;
  font-weight: 400;
  font-size: 16px;
  line-height: 130%;
  color: #fff;
  margin-bottom: 4px;
}
.map-tooltip span {
  display: block;
  font-weight: 400;
  font-size: 14px;
  line-height: 130%;
  color: rgba(124, 123, 123, 1);
}
/* < 1024 тултипа нет */
@media (max-width: 1023px) {
  .map-tooltip { display: none !important; }
}

.map-popup {
  position: absolute;
  left: 0px;
  bottom: -12px;
  transform: translateX(-20px);
  /* popup width steps per breakpoint (measured off the actual
     Products(1)_* screenshots, not a single fixed value):
       768 -> 234   1024 -> 305   1280 -> 360
       1440 -> 383  1920 -> 405   2560 -> 405 (capped, same as 1920)
     mirrors the same per-breakpoint-table convention as "размер
     точек простых/ивентов" in map/стили.txt. */
  width: 234px;
  max-width: calc(100% - 40px);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 123, 123, 1);
  border-radius: 24px;
  /* the widths above are total box sizes (Figma-style), not just the
     content box — without border-box they'd render padding/border on
     top of that instead of inside it, wider than the design calls for. */
  box-sizing: border-box;
  padding: 24px 26.5px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}
@media (min-width: 1024px) { .map-popup { width: 305px; } }
@media (min-width: 1280px) { .map-popup { width: 360px; } }
@media (min-width: 1440px) { .map-popup { width: 383px; } }
@media (min-width: 1920px) { .map-popup { width: 405px; } }
.map-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.map-popup .map-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.map-popup .map-popup-close:hover {
  color: #fff;
}
.map-popup h3 {
  margin: 0 0 20px;
  padding-right: 20px;
  font-weight: 400;
  font-size: 32px;
  line-height: 39px;
  color: #fff;
}
.map-popup-meta {
  margin-bottom: 20px;
}
.map-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 130%;
  color: rgba(255, 255, 255, 1);
  margin-bottom: 8px;
}
.map-popup-row:last-child {
  margin-bottom: 0;
}
.map-popup-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: rgba(255, 255, 255, 0.6);
}
.map-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  border: none;
  border-radius: 1000px;
  padding: 15px 24px;
  background: rgba(97, 97, 255, 1);
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 130%;
  text-align: center;
  cursor: pointer;
}
.map-popup-cta:hover {
  text-decoration: none;
  color: #fff;
}
@media (max-width: 850px) {
  .map-locations__title {
    font-size: 42px;
  }
}
/* no hover state, matching the theme's other pill CTAs
   (.blue-bubble/.register-cta) — the button stays visually static */
/* < 768 попапа нет */
@media (max-width: 767px) {
  .map-popup { display: none !important; }
}
@media (max-width: 500px) {
  .map-locations {
    padding: 60px 0 40px;
  }
  .map-locations__title {
    /* avoids a lone last word (eg. "you") wrapping onto its own line */
    text-wrap: balance;
  }
}