/* Vibetrans - интерактивная карта России (плоская 2D) */

.geo-map-section {
  --z-arctic: #2a8fa8;
  --z-east: #6b3fa8;
  --z-sib: #4a3d9a;
  --z-ural: #3d4d9a;
  --z-south: #9a3d6b;
  --z-center: #1f7a5a;
  --z-nw: #2a6a9a;
  --z-empty: #3a4258;
  --h-arctic: #3ecfe8;
  --h-east: #a855f7;
  --h-sib: #7c5cff;
  --h-ural: #6366f1;
  --h-south: #ec4899;
  --h-center: #34d399;
  --h-nw: #38bdf8;
  margin: 36px 0 44px;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(46, 120, 200, 0.1), transparent 55%),
    var(--card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.geo-map-section__head {
  margin-bottom: 20px;
}

.geo-map-section__head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.geo-map-section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 62ch;
}

.geo-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.geo-map-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238b95a8' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='M12 12l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

.geo-map-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 120, 200, 0.15);
}

.geo-map-toolbar__hint {
  font-size: 12px;
  color: var(--muted);
}

.geo-map-mount {
  position: relative;
  min-height: 300px;
}

.geo-map-loading,
.geo-map-error {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.geo-map-error a {
  color: var(--accent);
}

/* ── Map ── */
.geo-map,
.geo-map * {
  box-sizing: border-box;
}

.geo-map {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.geo-map svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.geo-map path[data-code] {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 1.25;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.geo-map [data-code].is-clickable {
  transform-box: fill-box;
  transform-origin: 50% 68%;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.32s ease,
    fill 0.2s ease,
    opacity 0.28s ease,
    stroke 0.2s ease;
  will-change: transform, filter;
}

html[data-theme="light"] .geo-map path[data-code] {
  stroke: rgba(13, 18, 32, 0.38);
}

/* Zone base colors */
.geo-map .zone-arctic { fill: var(--z-arctic); }
.geo-map .zone-east   { fill: var(--z-east); }
.geo-map .zone-sib    { fill: var(--z-sib); }
.geo-map .zone-ural   { fill: var(--z-ural); }
.geo-map .zone-south  { fill: var(--z-south); }
.geo-map .zone-center { fill: var(--z-center); }
.geo-map .zone-nw     { fill: var(--z-nw); }
.geo-map .zone-empty,
.geo-map .is-empty    { fill: var(--z-empty) !important; opacity: 0.35; pointer-events: none; }

.geo-map [data-code].is-clickable {
  cursor: pointer;
}

.geo-map:not(.open):has([data-code].is-raised) [data-code]:not(.is-raised):not(.is-empty) {
  opacity: 0.42;
  filter: brightness(0.82) saturate(0.9);
}

.geo-map [data-code].is-raised {
  transform: translateY(-10px) scale(1.04);
  filter:
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.42))
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28))
    brightness(1.1)
    saturate(1.08);
}

html[data-theme="light"] .geo-map [data-code].is-raised {
  filter:
    drop-shadow(0 14px 22px rgba(13, 18, 32, 0.28))
    drop-shadow(0 5px 9px rgba(13, 18, 32, 0.16))
    brightness(1.06)
    saturate(1.05);
}

.geo-map .zone-arctic.is-clickable.is-raised { fill: var(--h-arctic); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-east.is-clickable.is-raised   { fill: var(--h-east); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-sib.is-clickable.is-raised    { fill: var(--h-sib); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-ural.is-clickable.is-raised   { fill: var(--h-ural); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-south.is-clickable.is-raised  { fill: var(--h-south); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-center.is-clickable.is-raised { fill: var(--h-center); stroke: #fff; stroke-width: 1.45; }
.geo-map .zone-nw.is-clickable.is-raised     { fill: var(--h-nw); stroke: #fff; stroke-width: 1.45; }

html[data-theme="light"] .geo-map [data-code].is-clickable.is-raised,
html[data-theme="light"] .geo-map [data-code].is-active {
  stroke: rgba(13, 18, 32, 0.55);
}

.geo-map [data-code].is-dimmed {
  opacity: 0.35;
  filter: none;
  transform: none;
}

.geo-map .zone-arctic.is-active { fill: var(--h-arctic); }
.geo-map .zone-east.is-active   { fill: var(--h-east); }
.geo-map .zone-sib.is-active    { fill: var(--h-sib); }
.geo-map .zone-ural.is-active   { fill: var(--h-ural); }
.geo-map .zone-south.is-active  { fill: var(--h-south); }
.geo-map .zone-center.is-active { fill: var(--h-center); }
.geo-map .zone-nw.is-active     { fill: var(--h-nw); }

.geo-map [data-code].is-active {
  stroke: #fff;
  stroke-width: 1.4;
  transform: translateY(-8px) scale(1.03);
  filter:
    drop-shadow(0 14px 20px rgba(0, 0, 0, 0.38))
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.22))
    brightness(1.08);
}

/* ── Region label ── */
.geo-map__district {
  display: none;
  position: absolute;
  z-index: 8;
  top: 10px;
  left: 10px;
  right: 10px;
  pointer-events: none;
}

.geo-map__district b {
  display: none;
}

.geo-map__district span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 18, 30, 0.9);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.geo-map__district span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.geo-map.open .geo-map__district span {
  font-size: clamp(14px, 2vw, 18px);
  padding: 10px 16px;
}

/* ── Overlay ── */
.geo-map.open::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.9);
}

.geo-map .geo-map__close {
  opacity: 0;
  z-index: 10;
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 26px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s;
}

.geo-map.open .geo-map__close {
  opacity: 1;
  pointer-events: initial;
}

.geo-map .geo-map__close:hover {
  background: var(--accent);
}

.geo-map .geo-map__panel {
  display: none;
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  color: #eef1f7;
  pointer-events: none;
}

.geo-map.open .geo-map__panel.is-visible {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 64px 20px 20px;
  overflow: auto;
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.geo-map__link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.geo-map__link:hover {
  background: rgba(46, 120, 200, 0.2);
  border-color: rgba(110, 200, 255, 0.4);
  transform: translateY(-1px);
}

.geo-map__link.is-hidden {
  display: none !important;
}

/* ── Region chips ── */
.geo-map__index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-height: 140px;
  overflow: auto;
}

.geo-map__index-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.geo-map__index-btn:hover,
.geo-map__index-btn:focus-visible {
  color: var(--fg);
  border-color: var(--accent);
  background: rgba(46, 120, 200, 0.08);
  outline: none;
}

.geo-map__index-btn.is-hidden {
  display: none;
}

@media (min-width: 768px) {
  .geo-map.open .geo-map__panel.is-visible {
    padding: 72px 28px 24px;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 10px;
  }

  .geo-map__index {
    max-height: 110px;
  }
}

@media (max-width: 767px) {
  .geo-map-section {
    padding: 18px 14px;
    margin: 24px -4px;
  }

  .geo-map.open .geo-map__panel.is-visible {
    grid-template-columns: 1fr 1fr;
    padding-top: 56px;
  }
}