/* Город доставки body-factory.ru (ADR-0020). Цвета и радиусы — из темы Aspro Premier. */

.bf-city-hint {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 3000;
  max-width: 360px;
  padding: 20px 44px 20px 20px;
  background: var(--card_bg_black, #fff);
  color: var(--white_text_black, #333);
  border: 1px solid var(--stroke_black, #ececec);
  border-radius: var(--theme-button-border-radius, 4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.bf-city-hint__text {
  margin-bottom: 14px;
}

.bf-city-hint__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bf-city-hint__close,
.bf-city-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lite_basic_text_black, #999);
  font-size: 24px;
  line-height: 32px;
  cursor: pointer;
}

.bf-city-hint__close:hover,
.bf-city-dialog__close:hover {
  color: var(--white_text_black, #333);
}

.bf-city-hint button:focus-visible,
.bf-city-dialog button:focus-visible,
.bf-city-notice button:focus-visible,
.js-bf-city-open:focus-visible {
  outline: 2px solid var(--theme-base-color, #72af43);
  outline-offset: 2px;
}

/* окно выбора: на компьютере — диалог по центру */
.bf-city-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.bf-city-overlay[hidden] {
  display: none;
}

html.bf-city-open {
  overflow: hidden;
}

.bf-city-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: min(640px, calc(var(--bf-city-vh, 100vh) - 32px));
  padding: 28px 24px 24px;
  background: var(--card_bg_black, #fff);
  color: var(--white_text_black, #333);
  border-radius: var(--theme-button-border-radius, 4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.bf-city-dialog__head {
  padding-right: 32px;
  margin-bottom: 8px;
}

.bf-city-dialog__current {
  margin-bottom: 12px;
  color: var(--lite_basic_text_black, #777);
}

.bf-city-dialog__warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff8e6;
  color: #6b4e00;
  border-radius: var(--theme-button-border-radius, 4px);
}

.bf-city-dialog__label {
  display: block;
  margin-bottom: 6px;
}

.bf-city-dialog__input {
  width: 100%;
}

/* окно — колонка фиксированной высоты: сжимается только список, иначе длинный статус наезжает на него */
.bf-city-dialog > :not(.bf-city-dialog__list) {
  flex-shrink: 0;
}

.bf-city-dialog__status {
  min-height: 20px;
  margin: 8px 0 4px;
  color: var(--lite_basic_text_black, #777);
}

.bf-city-dialog__status a {
  color: inherit;
  text-decoration: underline;
}

.bf-city-dialog__list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -8px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.bf-city-dialog__option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 8px;
  border-radius: var(--theme-button-border-radius, 4px);
  cursor: pointer;
}

.bf-city-dialog__option::before {
  display: none;
}

.bf-city-dialog__option:hover,
.bf-city-dialog__option.is-active {
  background: var(--darkerblack_bg_black, #f5f5f5);
}

.bf-city-dialog__option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--theme-base-color, #72af43);
}

.bf-city-dialog__name--city,
.bf-city-dialog__option[aria-selected="true"] .bf-city-dialog__name {
  font-weight: 600;
}

.bf-city-dialog__place {
  color: var(--lite_basic_text_black, #999);
}

.bf-city-dialog__actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
}

/* сообщение в оформлении заказа */
.bf-city-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--darkerblack_bg_black, #f5f5f5);
  border-left: 3px solid var(--theme-base-color, #72af43);
  border-radius: var(--theme-button-border-radius, 4px);
}

.bf-city-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* телефон: панель снизу на всю видимую высоту, «Применить» над клавиатурой */
@media (max-width: 767px) {
  .bf-city-hint {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .bf-city-overlay {
    align-items: flex-end;
    padding: 0;
    height: var(--bf-city-vh, 100vh);
    bottom: auto;
  }

  .bf-city-dialog {
    max-width: none;
    height: calc(var(--bf-city-vh, 100vh) - 24px);
    max-height: none;
    padding: 24px 16px 0;
    border-radius: 12px 12px 0 0;
  }

  .bf-city-dialog__input {
    font-size: 16px; /* без автоприближения в iOS */
  }

  .bf-city-dialog__actions {
    position: sticky;
    bottom: 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--card_bg_black, #fff);
  }

  .bf-city-dialog__actions .btn {
    flex: 1 1 0;
  }
}

/* корзина: доставка для всего состава покупки */
.bf-basket-delivery {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke_black, #ececec);
}

.bf-basket-delivery[hidden] {
  display: none;
}

.bf-basket-delivery__title {
  margin-bottom: 8px;
}

.bf-basket-delivery__change {
  margin-left: 4px;
  text-decoration: underline;
  cursor: pointer;
}

.bf-basket-delivery__list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.bf-basket-delivery__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 4px 0;
}

.bf-basket-delivery__item::before {
  display: none;
}

.bf-basket-delivery__name {
  display: flex;
  flex-direction: column;
}

.bf-basket-delivery__period,
.bf-basket-delivery__note {
  color: var(--lite_basic_text_black, #999);
}

.bf-basket-delivery__price {
  white-space: nowrap;
  font-weight: 500;
}

.bf-basket-delivery__note {
  margin-bottom: 8px;
}

.bf-basket-delivery__retry {
  cursor: pointer;
}

.bf-basket-delivery__change,
.bf-basket-delivery__retry {
  display: inline;
  width: auto;
  padding: 0;
  text-decoration: underline;
}

/* подпись города в шапке и мобильном меню: «Город / населённый пункт: Москва» */
.bf-city .regions__chooser,
.bf-city-menu .js-bf-city-open {
  align-items: flex-start;
  text-align: left;
}

.bf-city-label {
  white-space: normal;
}

.bf-city-label__caption {
  color: var(--lite_basic_text_black, #777);
}

/* название — псевдоссылка: открывает окно выбора; длинное переносится на свою строку целиком */
.bf-city-label__name {
  font-weight: 500;
  color: var(--white_text_black, #333);
  text-decoration: underline dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.bf-city .regions__chooser:hover .bf-city-label__name,
.bf-city-menu .js-bf-city-open:hover .bf-city-label__name {
  text-decoration-style: solid;
}

/* мобильное меню: подпись сверху, название ниже; справа место под крестик закрытия меню */
.bf-city-menu {
  padding-right: 40px;
}

.bf-city-label--mobile .bf-city-label__caption {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}
