.villages-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: calc(100% - 40px);
  height: 653.297px;
  margin-inline: 20px;
  color: var(--color-light);
  background: var(--color-dark);
  border: 1px solid rgba(244, 246, 244, 0.1);
}

.villages-map__sidebar {
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: 380px;
  height: 100%;
}

.villages-map__title {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--color-light);
  font-size: 40px;
  font-weight: 600;
  line-height: 42.4px;
  letter-spacing: -0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.villages-map__title span:last-child {
  color: rgba(244, 246, 245, 0.6);
  font-weight: 400;
}

.villages-map__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 379px;
  padding-top: 26px;
}

.villages-map__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 380px;
  padding: 15px 14px;
  color: var(--color-light);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 260ms ease, border-color 260ms ease;
}

.villages-map__item.is-active {
  background: rgba(244, 246, 245, 0.08);
  border-color: rgba(244, 246, 245, 0.16);
}

.villages-map__item-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: rgba(244, 246, 245, 0.28);
  border-radius: 50%;
  transition: background-color 260ms ease, box-shadow 260ms ease;
}

.villages-map__item.is-active .villages-map__item-dot {
  background: var(--color-yellow);
  box-shadow: 0 0 0 4px rgba(200, 240, 49, 0.08);
}

.villages-map__item-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.villages-map__item-copy strong {
  color: var(--color-light);
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.16px;
  white-space: nowrap;
}

.villages-map__item-copy small {
  padding-top: 4px;
  color: rgba(244, 246, 245, 0.45);
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

.villages-map__time {
  color: rgba(244, 246, 245, 0.4);
  font-size: 12px;
  font-weight: 600;
  line-height: normal;
  white-space: nowrap;
}

.villages-map__item.is-active .villages-map__time {
  color: var(--color-yellow);
}

.villages-map__item:focus,
.villages-map__marker:focus,
.villages-map__zoom button:focus {
  outline: none;
}

.villages-map__office {
  width: 100%;
  margin-top: 24px;
  padding: 24px;
  color: var(--color-dark);
  background: var(--color-yellow);
  border-radius: 14px;
}

.villages-map__office p,
.villages-map__office address {
  margin: 0;
}

.villages-map__office p {
  font-size: 11px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: 1.98px;
  text-transform: uppercase;
}

.villages-map__office address {
  height: 60px;
  padding-top: 12px;
  font-size: 15px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
}

.villages-map__office a {
  display: inline-block;
  margin-top: 14px;
  color: var(--color-dark);
  font-size: 23px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.23px;
  white-space: nowrap;
}

.villages-map__canvas {
  position: relative;
  width: 100%;
  min-height: 540px;
  height: 100%;
  overflow: hidden;
  background: #161b18;
  border-radius: 16px;
}

.villages-map__stage {
  --map-scale: 1;
  position: absolute;
  inset: 0;
  transform: scale(var(--map-scale));
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.villages-map__image,
.villages-map__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.villages-map__image {
  object-fit: cover;
}

.villages-map__overlay {
  background: linear-gradient(to bottom, rgba(8, 12, 11, 0.2), rgba(8, 12, 11, 0.5));
}

.villages-map__marker {
  position: absolute;
  top: var(--marker-y);
  left: var(--marker-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--color-light);
  background: transparent;
  border: 0;
  cursor: pointer;
  transform: translateX(-50%);
}

.villages-map__marker-dot {
  width: 16px;
  height: 16px;
  background: var(--color-light);
  border: 2px solid rgba(8, 12, 11, 0.4);
  border-radius: 50%;
  transition: width 260ms ease, height 260ms ease, background-color 260ms ease, border-color 260ms ease;
}

.villages-map__marker-label {
  padding: 3px 8px;
  color: var(--color-light);
  background: rgba(20, 26, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: 0.44px;
  white-space: nowrap;
}

.villages-map__marker.is-active .villages-map__marker-dot {
  width: 18px;
  height: 18px;
  background: var(--color-yellow);
  border-color: transparent;
}

.villages-map__marker.is-active .villages-map__marker-label {
  display: none;
}

.villages-map__popup {
  position: absolute;
  top: 28.945%;
  right: 20px;
  z-index: 2;
  width: 280px;
  margin: 0;
  padding: 22px;
  color: var(--color-light);
  background: linear-gradient(161deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  box-shadow: 0 26px 64px rgba(5, 10, 9, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(26px);
}

.villages-map__popup.is-updating {
  animation: villages-map-popup 380ms ease;
}

.villages-map__popup p,
.villages-map__popup h3 {
  margin: 0;
}

.villages-map__popup-time {
  color: var(--color-yellow);
  font-size: 11px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: 1.76px;
  text-transform: uppercase;
  white-space: nowrap;
}

.villages-map__popup h3 {
  height: 37px;
  padding-top: 10px;
  font-size: 24px;
  font-weight: 600;
  line-height: 26.4px;
  letter-spacing: -0.36px;
  white-space: nowrap;
}

.villages-map__popup-location {
  height: 29px;
  padding-top: 8px;
  color: rgba(244, 246, 245, 0.7);
  font-size: 13px;
  font-weight: 400;
  line-height: 20.15px;
  white-space: nowrap;
}

.villages-map__popup a {
  display: inline-flex;
  align-items: center;
  margin-top: 15px;
  padding-bottom: 4px;
  color: var(--color-light);
  border-bottom: 2px solid var(--color-yellow);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  white-space: nowrap;
}

.villages-map__zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.villages-map__zoom button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--color-light);
  background: rgba(20, 26, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(16px);
  font-size: 17px;
  cursor: pointer;
}

@keyframes villages-map-popup {
  0% { opacity: 0.55; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 950px) {
  .villages-map {
    grid-template-columns: 1fr;
    height: auto;
  }

  .villages-map__sidebar {
    width: min(100%, 380px);
  }

  .villages-map__canvas {
    height: 620px;
  }
}

@media (max-width: 520px) {
  .villages-map__title {
    font-size: 34px;
    line-height: 37px;
  }

  .villages-map__item {
    width: 100%;
  }

  .villages-map__canvas {
    height: 520px;
  }

  .villages-map__popup {
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .villages-map__stage,
  .villages-map__item,
  .villages-map__item-dot,
  .villages-map__marker-dot {
    transition-duration: 1ms;
  }
}
