/* checkout.css — ЯДРОВЫЙ рантайм чекаута: структурные стили интерактивных
   элементов, которые рисует движковый checkout.js (варианты доставки/оплаты,
   переключатель типа, выбор точки с картой и маркерами перевозчиков). Подключается
   ДВИЖКОМ на страницах чекаута — не зависит от темы. Цвета берутся из токенов темы
   (--line/--ink/--primary/--surface/…); тема может переопределить оформление. */

/* Варианты доставки/оплаты */
.co-options { display: flex; flex-direction: column; gap: 10px; }
.co-option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.co-option:hover { border-color: var(--primary); }
.co-option.is-selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.co-option input { accent-color: var(--primary); width: 18px; height: 18px; }
.co-option__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-option__name { font-size: 14px; font-weight: 600; color: var(--ink); }
.co-option__eta { font-size: 12px; color: var(--muted); }
.co-option__price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.co-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* Переключатель типа получения (отделение/поштомат/курьер) */
.co-seg { grid-column: 1 / -1; }
.co-seg__row { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #f8fafc); }
.co-seg__opt { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.co-seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.co-seg__opt:hover { color: var(--ink); }
.co-seg__opt.is-active { background: var(--bg, #fff); color: var(--primary, #4f46e5); box-shadow: 0 1px 3px rgba(15,23,42,.1); }

/* Выбор точки (отделение/поштомат): поиск-автокомплит + карта */
.co-point { position: relative; grid-column: 1 / -1; }
.co-point__list { position: absolute; z-index: 500; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none; max-height: 240px; overflow-y: auto; background: var(--bg, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); }
.co-point__item { padding: 8px 10px; border-radius: 7px; font-size: 14px; color: var(--ink); cursor: pointer; }
.co-point__item:hover { background: var(--surface, #f1f5f9); }
.co-point__empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }
/* isolation — свой контекст наложения: высокие z-index панелей/маркеров Leaflet
   (до ~700) не перекрывают выпадающий список поиска отделений над картой */
.co-point__map { height: 320px; margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); isolation: isolate; }
.co-point__map .leaflet-container { height: 100%; font: inherit; }

/* Фирменный красный пин НП (Leaflet divIcon) — текстовый фолбэк маркера */
.np-marker__pin { position: absolute; left: 4px; top: 0; width: 22px; height: 22px; background: #da291c; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(15, 23, 42, .35); }
.np-marker__logo { position: absolute; left: 0; top: 1px; width: 30px; height: 22px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .3px; }
/* Маркер-бейдж с лого перевозчика (divIcon): белая плашка + треугольный «хвост» */
.carrier-marker__badge { position: absolute; left: 0; top: 0; width: 52px; height: 24px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid rgba(15, 23, 42, .12); border-radius: 7px; box-shadow: 0 3px 8px rgba(15, 23, 42, .3); }
.carrier-marker__logo { width: 44px; height: 16px; background-position: center; background-repeat: no-repeat; background-size: contain; }
.carrier-marker__tip { position: absolute; left: 22px; top: 22px; width: 8px; height: 8px; background: #fff; border-right: 1px solid rgba(15, 23, 42, .12); border-bottom: 1px solid rgba(15, 23, 42, .12); transform: rotate(45deg); box-shadow: 2px 2px 4px rgba(15, 23, 42, .12); }
/* Кластеры точек — в фирменный красный (перебиваем CDN-стиль specificity'ю) */
.co-point__map .marker-cluster-small,
.co-point__map .marker-cluster-medium,
.co-point__map .marker-cluster-large { background: rgba(218, 41, 28, .22); }
.co-point__map .marker-cluster-small div,
.co-point__map .marker-cluster-medium div,
.co-point__map .marker-cluster-large div { background: #da291c; color: #fff; font-weight: 700; }
.co-point__map .leaflet-popup-content { font-size: 13px; }

/* Сохранённые адреса доставки (быстрый выбор) */
.co-saved { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.co-saved__title { font-size: 13px; font-weight: 600; color: #64748b; }
.co-saved__item { display: flex; align-items: stretch; gap: 8px; }
.co-saved__pick { flex: 1; display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; }
.co-saved__pick:hover { border-color: #6455F0; box-shadow: 0 2px 10px rgba(23,23,40,.07); }
.co-saved__pick > i { color: #6455F0; font-size: 18px; }
.co-saved__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-saved__label { font-weight: 600; }
.co-saved__meta { font-size: 12px; color: #64748b; }
.co-saved__del { flex: none; width: 46px; border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff; color: #dc2626; cursor: pointer; }
.co-saved__del:hover { background: #fef2f2; border-color: #fecaca; }
.co-save-addr { margin-top: 12px; }

/* Пересчёт тарифа перевозчика (живой API после выбора точки): подсветка секции
   доставки, чтобы было видно работу. Цены притухают, у выбранного способа — спиннер. */
[data-shipping-options].is-recalc { position: relative; }
[data-shipping-options].is-recalc .co-option__price { opacity: .35; }
[data-shipping-options].is-recalc .co-option.is-selected .co-option__price {
  opacity: 0; position: relative;
}
[data-shipping-options].is-recalc .co-option.is-selected .co-option__price::after {
  content: ""; position: absolute; top: 50%; right: 0; width: 15px; height: 15px;
  margin-top: -8px; opacity: 1; border: 2px solid #cbd5e1; border-top-color: #4A3ADB;
  border-radius: 50%; animation: co-spin .6s linear infinite;
}
@keyframes co-spin { to { transform: rotate(360deg); } }
