/* Тёмная карта доставки, выплывающая из верхней полосы при наведении на
   «Доставка по всей России». Палитра и композиция — артборд MapFull
   (design/artboards/body/MapFull.body.html): тёмно-зелёное полотно, страна
   целиком, карточка города в углу карты, чипы городов снизу.
   Логика — assets/js/topbar-map.js. */

/* Затемнение НЕ ловит мышь: иначе оно накрывает саму пилюлю, браузер шлёт ей
   mouseleave, панель закрывается и тут же открывается снова — карта мигала.
   Клик мимо панели ловит обработчик на документе (topbar-map.js). */
.aztm-back {
  position: fixed; inset: 0; z-index: 1190; pointer-events: none;
  background: rgba(24, 38, 28, .34);
  opacity: 0; transition: opacity .22s ease;
}
.aztm-back.is-on { opacity: 1; }

.aztm-pop {
  position: fixed; z-index: 1200; left: 50%;
  width: min(1120px, calc(100vw - 32px));
  transform: translate(-50%, -10px);
  opacity: 0; transition: opacity .22s ease, transform .22s ease;
  background: #22392C; color: #FFFDF9;
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(16, 31, 23, .42), 0 2px 0 rgba(255, 253, 249, .06) inset;
  padding: 22px 26px 18px;
  font-family: 'Manrope', system-ui, sans-serif;
  overflow: auto; overscroll-behavior: contain;
}
.aztm-pop.is-on { opacity: 1; transform: translate(-50%, 0); }
/* Мягкий свет на полотне — как на артборде, чтобы карта не была плоской */
.aztm-pop::before {
  content: ""; position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  background: radial-gradient(1100px 520px at 58% 55%, rgba(122, 148, 113, .26), transparent 72%);
}

/* Крестик: крупный и всегда на виду — панель закрывают им, а не уводом мыши */
.aztm-x {
  position: absolute; right: 14px; top: 14px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 253, 249, .26); background: rgba(16, 31, 23, .5);
  color: #FFFDF9; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s ease, border-color .16s ease;
}
.aztm-x:hover { background: #FFFDF9; color: #22392C; border-color: #FFFDF9; }
.aztm-x svg { width: 16px; height: 16px; }

.aztm-head {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px; margin: 0 0 10px; padding-right: 54px;
}
.aztm-kicker {
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  font-weight: 800; color: #A9C29D;
}
.aztm-h {
  font-size: 27px; line-height: 1.12; letter-spacing: -.025em;
  margin: 6px 0 0; font-weight: 800; color: #FFFDF9;
}
.aztm-h em { font-style: normal; color: #B7D2A9; }
.aztm-nums { display: flex; gap: 22px; flex: none; }
.aztm-num { text-align: right; }
.aztm-num b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.aztm-num small {
  display: block; font-size: 11px; font-weight: 600; color: #A9C29D;
  margin: 5px 0 0 auto; line-height: 1.3; max-width: 132px;
}

.aztm-mapbox { position: relative; margin: 0 -6px; }
.aztm-map { display: block; width: 100%; height: clamp(290px, 49vh, 510px); }
.aztm-map .aztm-city { cursor: pointer; }
.aztm-map .aztm-city:hover circle { fill: #FFFDF9; }
.aztm-map .aztm-city:hover text { opacity: 1; }

/* Пунктир маршрута и пульс пина — как на артборде */
@keyframes aztmDash { to { stroke-dashoffset: -300; } }
@keyframes aztmPing { 0% { r: 5; opacity: .75 } 70% { r: 16; opacity: 0 } 100% { opacity: 0 } }
.aztm-route { stroke-dasharray: 4 6; animation: aztmDash 9s linear infinite; }
.aztm-ping { animation: aztmPing 2.6s ease-out infinite; }

.aztm-card {
  position: absolute; right: 4px; top: 6px; width: 258px;
  background: rgba(16, 31, 23, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 253, 249, .22); border-radius: 16px; padding: 13px 15px;
}
.aztm-card .cap { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 800; color: #A9C29D; }
.aztm-card .city { display: flex; align-items: baseline; gap: 8px; margin: 5px 0 9px; }
.aztm-card .city b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.aztm-card .row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; padding: 5px 0; border-top: 1px solid rgba(255, 253, 249, .13);
}
.aztm-card .row:first-of-type { border-top: 0; }
.aztm-card .row b { font-weight: 700; }
.aztm-card .fin { font-size: 11px; color: #A9C29D; margin-top: 8px; line-height: 1.35; }
.aztm-chg {
  font: inherit; font-size: 12px; color: #B7D2A9; margin-left: auto;
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.aztm-chg:hover { color: #FFFDF9; }

/* Поле «сменить город» — подсказки те же, что в корзине (/api/city-autocomplete) */
.aztm-ask { margin: 6px 0 2px; position: relative; }
.aztm-ask input {
  width: 100%; height: 34px; border-radius: 10px; padding: 0 11px;
  border: 1px solid rgba(255, 253, 249, .28); background: rgba(255, 253, 249, .08);
  color: #FFFDF9; font: 600 13px 'Manrope', sans-serif; outline: none;
}
.aztm-ask input::placeholder { color: rgba(255, 253, 249, .55); }
.aztm-ask input:focus { border-color: #B7D2A9; }
.aztm-ask .aztm-list {
  position: absolute; left: 0; right: 0; top: 38px; z-index: 4;
  background: #1A2E22; border: 1px solid rgba(255, 253, 249, .2);
  border-radius: 12px; overflow: hidden; max-height: 210px; overflow-y: auto;
}
.aztm-ask .aztm-list button {
  display: flex; width: 100%; gap: 8px; align-items: baseline; text-align: left;
  background: none; border: 0; color: #FFFDF9; cursor: pointer;
  font: 600 13px 'Manrope', sans-serif; padding: 8px 11px;
}
.aztm-ask .aztm-list button:hover { background: rgba(255, 253, 249, .12); }
.aztm-ask .aztm-list span { font-weight: 600; font-size: 11px; color: #A9C29D; margin-left: auto; }

.aztm-legend {
  position: absolute; right: 6px; bottom: 4px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 11px; color: #A9C29D;
  background: rgba(16, 31, 23, .7); border-radius: 999px; padding: 6px 13px;
}
.aztm-legend i { display: inline-block; width: 20px; height: 8px; border-radius: 2px; }

.aztm-foot {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 12px; padding-top: 13px;
  border-top: 1px solid rgba(255, 253, 249, .13); flex-wrap: nowrap;
}
.aztm-wh { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #D7E3D0; flex: 1 1 auto; min-width: 0; }
.aztm-wh i { width: 7px; height: 7px; border-radius: 999px; background: #FFFDF9; flex: none; box-shadow: 0 0 0 3px rgba(255, 253, 249, .16); }
.aztm-wh b { font-weight: 700; color: #FFFDF9; }
.aztm-chips { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; flex: 0 1 auto; }
.aztm-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(255, 253, 249, .26);
  background: none; color: #FFFDF9; cursor: pointer; white-space: nowrap;
  font: 600 11.5px 'Manrope', sans-serif; transition: background .16s ease, color .16s ease;
}
.aztm-chip i { width: 5px; height: 5px; border-radius: 999px; background: #B7D2A9; }
.aztm-chip:hover { background: rgba(255, 253, 249, .14); }
.aztm-chip.is-on { background: #FFFDF9; color: #22392C; border-color: #FFFDF9; }
.aztm-chip.is-on i { background: #22392C; }
.aztm-more {
  display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
  border-radius: 999px; background: #FFFDF9; color: #22392C; flex: 0 0 auto; white-space: nowrap;
  font: 700 11.5px 'Manrope', sans-serif; text-decoration: none;
}
.aztm-more:hover { background: #EFF4EA; }

/* Пока грузится карта страны (173 КБ данных тянем только по наведению) */
.aztm-map.is-wait { opacity: .35; }

@media (prefers-reduced-motion: reduce) {
  .aztm-back, .aztm-pop { transition: none; }
  .aztm-route, .aztm-ping { animation: none; }
}

/* Узкие окна: панель прячем совсем — на телефоне у полосы нет наведения,
   пилюля просто ведёт на /delivery (topbar-map.js там не поднимается). */
@media (max-width: 980px) {
  .aztm-back, .aztm-pop { display: none !important; }
}
