.contacts {
  margin-top: 100px;
}

.contacts_grid {
  display: grid;
  grid-template-columns: minmax(280px, 535px) minmax(0, 1fr);
  column-gap: 87px;
  align-items: start;
}

@media (max-width: 900px) {
  .contacts_grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
  }
}

.contacts .title {
  margin-bottom: 30px;
}

.city_picker {
  position: relative;
  margin-bottom: 30px;
}

.place {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 30px;
  border: 1px solid #e2fc04;
  border-radius: 15px;
  background: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 500;
  min-width: 410px;
  min-height: 60px;
  justify-content: space-between;
  transition: border-radius 0.15s ease;
}

.city_picker.is_open .place {
  border-radius: 15px 15px 0 0;
}

.city_picker.is_open .triangle_down {
  rotate: 180deg;
}

.city_list {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #16181a;
  border: 1px solid #e2fc04;
  border-top: none;
  border-radius: 0 0 15px 15px;
}

.city_list[hidden] {
  display: none;
}

.city_list button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}

.city_list button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.city_list button.is_on {
  color: #e2fc04;
}

@media (max-width: 460px) {
  .place {
    min-width: 0;
    width: 100%;
  }
}

.place_city {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.map_icon {
  width: 14px;
  height: 17px;
}

.triangle_down {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #e2fc04;
}

.contact_list {
  display: flex;
  flex-direction: column;
}

.contact {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid #8c8c8c;
}

.contact:first-child {
  padding-top: 0;
}

.contact:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact_icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #8c8c8c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: #16181a;
}

.contact strong {
  display: block;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
}

.contact div span {
  display: block;
  margin-top: 5px;
  color: #8c8c8c;
  font-size: 16px;
  line-height: 1.4;
}

.map_wrapper {
  position: relative;
  width: 100%;
  margin-top: 45px;
}

.map {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1020 / 508;
  overflow: hidden;
  border: 1px solid #8c8c8c;
  border-radius: 20px;
  background: #1c1d1e;
}

/* запасная картинка, пока грузится карта */
.map_fallback {
  position: absolute;
  inset: 0;
}

.map_fallback > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map_link {
  position: absolute;
  top: 45.47%;
  left: 46.76%;
  width: 38px;
  height: 47px;
  z-index: 1;
}

/* Тёмная карта: слой с плитками инвертируется, метка и подписи интерфейса остаются как есть */
.map [class*="-ground-pane"] {
  filter: invert(1) hue-rotate(180deg) grayscale(0.85) contrast(0.8) brightness(1.15);
}

/* рекламные ссылки Яндекса («Как добраться», «Доехать на такси», «Создать свою карту») скрыты, авторские права остаются */
.map [class*="-map-copyrights-promo"] {
  display: none;
}

.map [class*="-copyrights-pane"] {
  opacity: 0.7;
}

@media (max-width: 900px) {
  .map_wrapper {
    margin-top: 0;
  }
}

/* мобильная версия: контакты в один столбец, карта ниже */
@media (max-width: 767px) {
  .contacts {
    margin-top: 40.4px;
  }

  .contacts_grid {
    display: block;
  }

  .contacts .title {
    margin-bottom: 18.6px;
  }

  /* рамка 1px снаружи: блок выступает на 1px с каждой стороны */
  .city_picker {
    margin: 0 -1px -1px;
  }

  .place {
    gap: 10px;
    min-width: 0;
    min-height: 0;
    height: 47px;
    padding: 0 48.5px 0 22px;
    border-radius: 10px;
    font-size: 14px;
  }

  .city_picker.is_open .place {
    border-radius: 10px 10px 0 0;
  }

  .city_list {
    border-radius: 0 0 10px 10px;
  }

  .map_icon {
    width: 10.5px;
    height: 12.8px;
  }

  .triangle_down {
    border-left-width: 4.75px;
    border-right-width: 4.75px;
    border-top-width: 6px;
  }

  .contact {
    gap: 10px;
    padding: 15px 0;
  }

  .contact:first-child {
    padding-top: 15px;
  }

  .contact:last-child {
    padding-bottom: 0;
  }

  .contact_icon {
    width: 35px;
    height: 35px;
  }

  .contact_icon img {
    width: 17px;
    height: 17px;
  }

  .contact:first-child .contact_icon img {
    width: 15.5px;
    height: 18.6px;
  }

  .contact strong {
    font-size: 16px;
    line-height: 22px;
  }

  .contact div span {
    font-size: 14px;
    line-height: 19.6px;
  }

  .map_wrapper {
    margin: 19.5px -1px 0;
    width: auto;
  }

  .map {
    aspect-ratio: 322 / 205;
    border-radius: 15px;
  }
}
