.region-switcher {
  font-family: 'Avenir Next', sans-serif;
}

.header-widget__region-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.region-switcher__label {
  font: inherit;
  white-space: nowrap;
}

.region-switcher--desktop {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.region-switcher__static,
.region-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.region-switcher__trigger {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.region-switcher__trigger:focus-visible,
.region-switcher__option:focus-visible,
.region-switcher__close:focus-visible {
  outline: 2px solid #c59f72;
  outline-offset: 3px;
}

.region-switcher__caret {
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.region-switcher__trigger[aria-expanded='true'] .region-switcher__caret {
  transform: translateY(2px) rotate(225deg);
}

.region-switcher--desktop .region-switcher__static,
.region-switcher--desktop .region-switcher__trigger {
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.13px;
}

.region-switcher__popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: max-content;
  min-width: 210px;
  padding: 8px;
  border: 1px solid rgba(80, 76, 72, 0.14);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(25, 21, 18, 0.16);
  color: #504c48;
}

.region-switcher__options {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.region-switcher__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #504c48;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

a.region-switcher__option:hover {
  background: #f7f4f0;
  color: #504c48;
}

.region-switcher__option--current {
  background: #f2ede7;
  font-weight: 500;
}

.region-switcher__check {
  color: #aa8054;
  font-size: 15px;
}

.region-switcher-mobile-row,
.region-switcher-sheet {
  display: none;
}

.region-switcher__popover[hidden],
.region-switcher-sheet[hidden] {
  display: none !important;
}

body.region-switcher-scroll-locked {
  overflow: hidden;
}

@media screen and (min-width: 1201px) {
  .header-widget__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .header-widget__col--region {
    justify-self: start;
  }

  .header-widget__col--menu {
    justify-self: center;
  }

  .header-widget__col--info {
    justify-self: end;
  }

  .header-widget__info-row {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .header-widget__info-col--time {
    padding-right: 4px;
  }

  .header-widget__info-col--phone {
    padding-left: 4px;
  }
}

@media screen and (max-width: 1200px) {
  .region-switcher--desktop {
    display: none;
  }

  .region-switcher-mobile-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding-top: 8px;
    color: #504c48;
    font-size: 14px;
    font-weight: 500;
  }

  .region-switcher--mobile {
    display: inline-flex;
    align-items: center;
    color: #504c48;
    font-size: 14px;
    font-weight: 500;
  }

  .header--crystal .region-switcher--mobile {
    color: #ffffff;
  }

  .header--crystal .region-switcher-mobile-row {
    color: #ffffff;
  }

  .region-switcher--mobile .region-switcher__static,
  .region-switcher--mobile .region-switcher__trigger {
    min-height: 36px;
  }

  .region-switcher-sheet {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: block;
  }

  .region-switcher__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.48);
  }

  .region-switcher__sheet-dialog {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78vh, 560px);
    overflow-y: auto;
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: #ffffff;
    color: #504c48;
    box-shadow: 0 -12px 32px rgba(25, 21, 18, 0.18);
  }

  .region-switcher__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  .region-switcher__sheet-title {
    margin: 0;
    color: #423e39;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
  }

  .region-switcher__close {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f4f1ed;
    cursor: pointer;
  }

  .region-switcher__close::before,
  .region-switcher__close::after {
    content: '';
    position: absolute;
    top: 19px;
    left: 11px;
    width: 18px;
    height: 1px;
    background: #504c48;
  }

  .region-switcher__close::before {
    transform: rotate(45deg);
  }

  .region-switcher__close::after {
    transform: rotate(-45deg);
  }

  .region-switcher__sheet-dialog .region-switcher__options {
    gap: 4px;
  }

  .region-switcher__sheet-dialog .region-switcher__option {
    min-height: 48px;
    padding: 12px;
    font-size: 16px;
  }
}

@media screen and (max-width: 390px) {
  .region-switcher-mobile-row {
    padding-top: 5px;
  }

  .region-switcher__sheet-dialog {
    padding-right: 16px;
    padding-left: 16px;
  }
}
