.city-switcher {
  --city-ink: #0647d9;
  position: relative;
  flex: none;
  color: var(--city-ink);
}

.city-switcher[open] { z-index: 5; }

.city-switcher__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  min-block-size: 44px;
  padding-inline: .5em;
  border-radius: 10px;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 650;
  line-height: 1.25;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}

.city-switcher__toggle::-webkit-details-marker { display: none; }

.city-switcher__toggle::after {
  content: "";
  inline-size: .45em;
  block-size: .45em;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-.12em) rotate(45deg);
}

.city-switcher[open] > .city-switcher__toggle::after {
  transform: translateY(.12em) rotate(225deg);
}

.city-switcher__toggle:hover,
.city-switcher__toggle:focus-visible,
.city-switcher__link:hover,
.city-switcher__link:focus-visible {
  background: #eef3ff;
}

.city-switcher__toggle:focus-visible,
.city-switcher__link:focus-visible {
  outline: 2px solid var(--city-ink);
  outline-offset: 2px;
}

.city-switcher__list {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline-start: 0;
  inline-size: max-content;
  min-inline-size: 175px;
  padding: 6px;
  margin: 0;
  list-style: none;
  border: 1px solid #dce5ff;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px #0a102927;
}

.city-switcher__link,
.city-switcher__current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75em;
  min-block-size: 44px;
  padding-inline: 10px;
  border-radius: 7px;
  color: var(--city-ink);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

.city-switcher__current { font-weight: 700; }

.city-office {
  display: grid;
  gap: .3em;
  margin-block-start: .65em;
  font-size: .9em;
  line-height: 1.4;
}

.city-office a { text-decoration: underline; }

@media (max-width: 560px) {
  .header__bar > .city-switcher { position: static; }
  .city-switcher__list {
    inset-block-start: calc(100% + 4px);
    inset-inline: auto 6px;
  }
}

@media not (min-width: 1400px) {
  /* R035 originally put the phone on a separate row. Keep it with the other
     contact shortcuts, using the same icon treatment as the current header. */
  body.spb-page[data-spb-page] .header[data-initialized] .header__bar:has(> .city-switcher) {
    display: flex;
  }

  body.spb-page[data-spb-page] .header[data-initialized] .header__actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }

  body.spb-page[data-spb-page] .header[data-initialized] .header__phone {
    inline-size: 34px;
    min-block-size: 36px;
    padding: 0;
    border-radius: 10px;
    background: #f6f6fa;
  }

  body.spb-page[data-spb-page] .header[data-initialized] .header__phone .icon { display: block; }
  body.spb-page[data-spb-page] .header[data-initialized] .header__phone-label { display: none; }

  body.spb-page[data-spb-page] .header[data-initialized] .header__body {
    inset-block-start: 73px;
    max-block-size: calc(100dvh - 85px);
  }

  body.spb-page[data-spb-page]:has(.city-switcher) .page-shell > section { scroll-margin-top: 80px; }
}

@media (max-width: 440px) {
  .header[data-header] .header__bar:has(> .city-switcher) {
    column-gap: 4px;
    padding-inline: 5px;
  }

  .header[data-header] .header__bar:has(> .city-switcher) > .brand { column-gap: 4px; }
  .header[data-header] .header__bar:has(> .city-switcher) .brand__mark {
    inline-size: 30px;
    block-size: 28px;
  }
  .header[data-header] .header__bar:has(> .city-switcher) .brand__name { font-size: 12px; }
}

@media (max-width: 374px) {
  .header__bar:has(> .city-switcher) > .brand .brand__copy { display: none; }
}
