/* ВЕРХНИЙ ОТСТУП - ТОТ ЖЕ, ЧТО НА ВСЕХ СТРАНИЦАХ (80px).
   Здесь стояло 120px, и крошки в корзине начинались на 40px ниже, чем на
   карточке товара, в избранном и сравнении. При переходе с каталога в
   корзину шапка «прыгала».
   */
main {
  padding-top: 80px;
  padding-bottom: 40px;
  min-height: calc(100vh - 80px);
}

/* ==========================================================================
   CART PAGE — Modern Design
   ========================================================================== */

/* ── Variables ── */
:root {
  --c-brand:        #01A572;
  --c-brand-dark:   #018055;
  --c-brand-light:  #e6f8f2;
  --c-accent:       #FF7700;
  --c-text:         #0f172a;
  --c-muted:        #64748b;
  --c-border:       #c5cdd9; /* было #e2e8f0 - контраст ~1.15:1, границы не читались */
  --c-bg:           #f8fafc;
  --c-white:        #ffffff;
  --c-danger:       #ef4444;
  --c-danger-light: #fef2f2;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12);
}

/* ══════════════════════════════
   STEP PROGRESS BAR
   ══════════════════════════════ */
/* Компактнее: полоса шагов занимала слишком много места. Кружки/подписи/отступы уменьшены пропорционально, сама
   структура (кружок+подпись+коннектор) не тронута.
   */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 18px auto;
  max-width: 340px;
  padding: 0 16px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  flex-shrink: 0;
}

.step__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--c-border);
  background: var(--c-white);
  color: var(--c-muted);
  /* Свойства поимённо, а не `all` (DESIGN.md, «Движение»): `all` анимирует и
     размеры, заставляя браузер пересчитывать страницу на каждом кадре. Здесь
     между шагами меняются только цвета. */
  transition: background var(--zd-dur) var(--zd-ease),
              border-color var(--zd-dur) var(--zd-ease),
              color var(--zd-dur) var(--zd-ease);
}

/* 11 -> 13px: подписи шагов «Корзина - Доставка - Готово» показывают, где
   человек находится в оформлении. Аудитория 40-65+, мельче 13px не читают.
   Замер.
   */
.step__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
  transition: color .3s;
}

.step--active .step__circle {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
}
.step--active .step__label { color: var(--c-brand); }

.step--done .step__circle {
  background: var(--c-brand-light);
  border-color: var(--c-brand);
  color: var(--c-brand);
}
.step--done .step__label { color: var(--c-brand); }

.step--success .step__circle {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
  animation: successPulse .6s ease;
}
@keyframes successPulse {
  0%   { transform: scale(.8); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1);   opacity: 1; }
}

.step__connector {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  margin: 0 8px;
  margin-bottom: 13px;
  transition: background .3s;
}
.step__connector--done { background: var(--c-brand); }

/* ══════════════════════════════
   CART PAGE LAYOUT
   ══════════════════════════════ */
.cart-page { padding-bottom: 40px; }

.cart-content {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
  /* БЕЗ max-width и ЦЕНТРИРОВАНИЯ. Ограничение 1400px с margin:0 auto
     сдвигало содержимое к центру, а крошки и шапка оставались во всю ширину:
     на широком экране крошки начинались на 25px, а карточки — на 255px. На
     избранном и в сравнении ограничения нет — корзина теперь живёт по тому же
     правилу.
     */
}

/* ── Cart Header ── */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

/* H1 ПО ШКАЛЕ: 28px / 700 / цвет ink.
   Было 26px/800 - веса 800 в шкале проекта нет вовсе (400/500/600/700), а
   размер не совпадал ни с одной ступенью. Замер нашёл семь разных H1 на семи
   страницах: 22/26/26/28/32/36/52 при весах 700-900.
   */
.cart-header h1 {
  font-size: var(--zd-text-2xl, 28px);
  font-weight: var(--zd-fw-bold, 700);
  color: var(--zd-ink, #1F1F1F);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-header h1 i { font-size: 24px; color: var(--c-brand); }
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  background: var(--c-brand);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.cart-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Мобиле: кнопки превращаются в квадратные иконки без текста.
   Подписи скрываются через .visually-hidden-mobile. */
@media (max-width: 560px) {
  .cart-actions {
    gap: 8px;
  }
  .cart-actions .btn-share-cart,
  .cart-actions .btn-clear-cart {
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    justify-content: center;
    flex: 0 0 auto;
  }
  .cart-actions .btn-label {
    display: none; /* на мобиле — только иконка */
  }
}
.btn-share-cart, .btn-clear-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--zd-dur-fast) var(--zd-ease),
              border-color var(--zd-dur-fast) var(--zd-ease),
              color var(--zd-dur-fast) var(--zd-ease);
}
.btn-share-cart {
  background: transparent;
  border: 1.5px solid var(--c-brand);
  color: var(--c-brand);
}
.btn-share-cart:hover { background: var(--c-brand); color: #fff; }

/* WhatsApp-вариант: фирменный зелёный */
.btn-share-cart--wa { border-color: #25D366; color: #25D366; }
.btn-share-cart--wa:hover { background: #25D366; color: #fff; }
.btn-clear-cart {
  background: transparent;
  border: 1.5px solid var(--c-border);
  color: var(--c-muted);
}
.btn-clear-cart:hover { border-color: var(--c-danger); color: var(--c-danger); background: var(--c-danger-light); }

/* Items section */
.cart-items-section {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Cart Item */
.cart-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 20px;
  padding: 20px 0;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
}
.cart-item:last-of-type { border-bottom: none; }
/* НАВЕДЕНИЕ НА СТРОКУ НИЧЕГО НЕ ДЕЛАЕТ.
   Здесь был hover с подсветкой и отрицательными полями (margin: 0 -24px):
   строка под курсором расползалась шире соседних и дёргалась при каждом
   проходе мышью к кнопкам количества. Строка не кликабельна целиком —
   подсвечивать её нечего обещать.
   */

.cart-item-image {
  width: 130px; height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-bg);
  flex-shrink: 0;
}
/* cover - см. решение в css/card.css (.image-track img):
   фото заполняет бокс целиком, обрезка по краям для нетипичных пропорций. */
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { min-width: 0; }
.cart-item-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-name-en {
  font-size: 14px;
  color: var(--c-muted);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
/* Подпись фасовки в строке корзины (js/cart-page.js). Нужна, чтобы две
   фасовки одного товара («500 семян» и «25 кг») не выглядели одинаково -
   у обычного товара без доп. фасовок блок не рендерится вовсе. */
.cart-item-packing {
  font-size: 14px;
  color: var(--c-text);
  margin-bottom: 8px;
}
.cart-item-packing b { font-weight: 700; }

.cart-item-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cart-item-brand-logo { height: 24px; display: flex; align-items: center; }
.cart-item-brand-logo img { height: 100%; width: auto; object-fit: contain; opacity: .8; }

.cart-item-rating { display: inline-flex; align-items: center; gap: 5px; }
.rating-value { font-weight: 700; font-size: 13px; color: var(--c-text); }
.stars-small { display: inline-flex; }
/* Атомы (.cart-item-prices/.cart-item-price/.cart-item-old-price/
   .stars-small/.review-count) вынесены в блок card-base main.css (был
   отдельным файлом card-base.css, слит). Здесь оставлены только overrides
   размеров под корзинный layout.
   */
.cart-item-price { font-size: 20px; }
.cart-item-old-price { font-size: 15px; }
/* Обычная цена под оптовой. Выглядит точно как зачёркнутая старая,
   но класс свой: по .cart-item-old-price считается строка «Скидка» в итогах
   (js/cart.js, updateTotals), а опт скидкой не считается - это отдельный
   прайс за объём.
   */
.cart-item-base-price {
  font-size: 16px;
  text-decoration: line-through;
  color: var(--c-accent);
  font-weight: 600;
  white-space: nowrap;
}

/* ОПТОВАЯ ЦЕНА: две стадии одного состояния.
   --on  - опт уже применён, цена в строке оптовая (зелёный, как остальные
           подтверждения на сайте);
   --hint - опт есть, но количество не набрано: подсказка, сколько осталось.
   Разными цветами, потому что это разные новости: одно - «вы уже платите
   меньше», другое - «можете платить меньше». Одинаковый вид заставлял бы
   вчитываться, чтобы понять, какая цена сейчас в силе. */
.cart-item-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.cart-item-opt--on {
  background: #e8f6ee;
  color: #0f7a44;
  border: 1px solid #bfe5d0;
}
.cart-item-opt--hint {
  background: #fff7ed;
  color: #92400e;
  border: 1px solid #fed7aa;
  font-weight: 600;
}
.cart-item-discount {
  background: var(--c-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
}

/* ПОЗИЦИЯ БОЛЬШЕ НЕДОСТУПНА (js/cart-page.js): товар/фасовку скрыли или
   удалили ПОСЛЕ того, как покупатель положил её в корзину. Строка остаётся
   в списке (не пропадает молча), но приглушена и не даёт оформить заказ,
   пока её не уберут - тот же принцип, что у .fav-status-tag--soldout
   (css/favorites.css), только это пилюля в строке, а не тег на карточке. */
.cart-item--unavailable {
  opacity: 0.6;
}
.cart-item-unavailable-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  background: #f3e8fd;
  color: #6D28D9;
  border: 1px solid #ddc7f7;
}

/* Controls */
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  min-width: 140px;
}
.btn-remove {
  background: transparent;
  border: 1.5px solid var(--c-border);
  color: var(--c-muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--zd-dur-fast) var(--zd-ease),
              border-color var(--zd-dur-fast) var(--zd-ease),
              color var(--zd-dur-fast) var(--zd-ease);
  align-self: flex-end;
}
.btn-remove:hover { border-color: var(--c-danger); color: var(--c-danger); background: var(--c-danger-light); }

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
/* 44x44 - норма попадания пальцем. touch-action: manipulation убирает double-tap-zoom: по этим
   кнопкам жмут сериями, и вторым нажатием iOS зумил страницу вместо
   изменения количества.
   */
.qty-btn {
  width: 44px; height: 44px;
  touch-action: manipulation;
  border: none;
  background: transparent;
  color: var(--c-text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qty-btn:hover { background: var(--c-brand-light); color: var(--c-brand); }
/* .qty-value теперь <input> (можно вписать число). Сбрасываем всё, что
   браузер добавляет полю ввода, чтобы визуально осталась прежняя ячейка
   между «−» и «+»: своя рамка, фон и стрелки-спиннеры тут не нужны. */
input.qty-value {
  width: 48px;
  padding: 0;
  background: transparent;
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}
/* ШРИФТ ПОЛЯ - РОВНО 16px НА ЛЮБОМ ЭКРАНЕ.
   Safari на iPhone при тапе по полю с шрифтом меньше 16px увеличивает всю
   страницу, а обратно сам не возвращает: покупатель набирает количество
   на «уехавшей» странице и потом отзумливает её руками.
   Задано в базовом правиле, а не в медиазапросе: телефоны попадают в разные
   брейкпоинты (576/768), и правило в одном из них оставляло бы зум на части из них. */
input.qty-value { font-size: 16px; }
input.qty-value::-webkit-outer-spin-button,
input.qty-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Поле количества при фокусе НЕ подсвечиваем.
   Зелёная рамка обводила ячейку между «−» и «+» и читалась как ошибка или
   как выделенная кнопка; поле и так очевидно редактируемое - в нём стоит
   курсор. Показываем только сам курсор, ячейка остаётся прежней. */
input.qty-value:focus {
  outline: none;
  background: transparent;
}
.qty-value {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--c-text);
  border-left: 1.5px solid var(--c-border);
  border-right: 1.5px solid var(--c-border);
  line-height: 36px;
}

.cart-item-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  background: var(--c-brand-light);
  border: 1.5px solid rgba(1,165,114,.2);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  white-space: nowrap;
}

/* Скелетон - пока js/cart-page.js ждёт zdCart.getList()/api/products/by-ids.php.
   Grid 1:1 повторяет .cart-item (130px фото | инфо | auto), подменяется
   реальным innerHTML целиком - отдельно убирать не нужно. .skel - общий
   шиммер из css/main.css.
   */
.cart-item--skel {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 20px;
  padding: 20px 0;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
}
.cart-item--skel:last-of-type { border-bottom: none; }
.cart-item--skel .skel-photo { width: 130px; height: 130px; border-radius: var(--radius-md); }
.cart-item--skel .skel-info { display: flex; flex-direction: column; gap: 10px; }
.cart-item--skel .skel-title-1 { height: 18px; width: 85%; }
.cart-item--skel .skel-title-2 { height: 18px; width: 55%; }
.cart-item--skel .skel-price { height: 24px; width: 110px; margin-top: 6px; }
.cart-item--skel .skel-controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; width: 120px; }
.cart-item--skel .skel-qty { height: 36px; width: 100%; border-radius: 8px; }
.cart-item--skel .skel-total { height: 20px; width: 70%; }
@media (max-width: 640px) {
  .cart-item--skel { grid-template-columns: 90px 1fr; min-height: 110px; gap: 14px; }
  .cart-item--skel .skel-photo { width: 90px; height: 90px; }
  .cart-item--skel .skel-controls { display: none; }
}

/* Empty cart */
.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 60px 20px;
}
.cart-empty i { font-size: 56px; color: var(--c-border); margin-bottom: 16px; }
.cart-empty p { color: var(--c-muted); font-size: 17px; margin: 0 0 24px; }
.btn-back-to-shop {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--c-brand); color: #fff;
  padding: 14px 32px; border-radius: var(--radius-md);
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .2s;
}
.btn-back-to-shop:hover { background: var(--c-brand-dark); }

/* ══ SIDEBAR / ORDER SUMMARY ══ */
.cart-sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
}
.cart-summary {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.cart-summary h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 16px;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
}
.summary-row.discount-row { color: var(--c-accent); }
.discount-amount { font-weight: 700; }
.summary-row.total {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  border: none;
  padding: 16px 0 20px;
}
.total-price { color: var(--c-brand); font-size: 22px; }

.btn-checkout {
  width: 100%;
  background: var(--c-brand);
  color: #fff;
  border: none;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background .2s;
}

.btn-checkout-arrow {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-block;
  flex-shrink: 0;
}
.btn-checkout-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.btn-checkout:disabled {
  background: #94d3bc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.cart-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #92400e;
  font-weight: 500;
  line-height: 1.5;
}
.cart-notice svg,
.cart-notice > .icon { flex-shrink: 0; margin-top: 1px; }
/* Восклицательный знак - глиф шрифта zeldomkz (E906), а не inline-SVG:
   правило проекта «иконки только шрифтом». Цвет наследуется от плашки
   (#92400e) - на её фоне #fff7ed он читается заметно лучше прежнего
   ярко-оранжевого #FF7700, которым была нарисована вторая из двух. */
.cart-notice > .icon { font-size: 18px; }

/* Подпись и сумма столбиком: колонка итогов узкая, в строку сумма рвалась
   по разрядам и знак ₸ уезжал вниз отдельно от числа. */
.cart-notice__body { display: flex; flex-direction: column; gap: 2px; }
.cart-notice__sum { font-size: 16px; font-weight: 700; white-space: nowrap; }

/* Плашка гостя: те же цвета, что у общей .cart-notice, плюс ряд действий.
   Кнопки 44px по высоте - минимальная зона нажатия по сайту. */
.cart-notice--guest { margin-top: 0; margin-bottom: 16px; }
.cart-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cart-notice__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #fed7aa;
  background: #fff;
  color: #92400e;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.cart-notice__btn:hover { background: #fffbf5; }
.cart-notice__btn:disabled { opacity: 1; color: #b98a54; cursor: progress; }
/* Вход - главное действие: только он реально сохраняет корзину. */
.cart-notice__btn--main {
  background: var(--zd-brand, #01A572);
  border-color: var(--zd-brand, #01A572);
  color: #fff;
}
.cart-notice__btn--main:hover { background: var(--zd-brand-hover, #018F63); }

/* ОДНА БОЛЬШАЯ КНОПКА ПОД НИЖНИМ МЕНЮ */
  .mobile-checkout-btn {
    display: flex !important;
    position: fixed;
    bottom: calc(65px + var(--zd-nav-lift)); /* Высота нижнего меню - кнопка сразу над ним */
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border: none;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 16px 20px 24px 20px;
    margin: 0 auto;
    z-index: 998;
    box-shadow: 0px 13px 52px 36px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    color: #fff;
    pointer-events: auto;
  }

  /* Контейнер с ценой и текстом */
  .mobile-checkout-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #01A572;
    padding: 16px 32px;
    border-radius: 16px;
    margin: 0 auto;
    width: 100%;
  }

  /* Блок с ценой слева */
  .mobile-checkout-price-block {
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .mobile-checkout-total-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 2px;
  }

  .mobile-checkout-total-price {
    font-size: 24px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
  }

  .mobile-checkout-items-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-top: 2px;
  }

  /* Текст "Продолжить" справа */
  .mobile-checkout-action-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
  }

  .mobile-checkout-action-text i {
    font-size: 20px;
    color: white;
  }

/* Toast */
.toast-notification {
  position: fixed;
  bottom: calc(90px + var(--zd-nav-lift));
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity:0; transform: translateX(-50%) translateY(8px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* Окно подтверждения переехало в css/confirm-modal.css - оно одинаковое у
   корзины, избранного, сравнения и карточки товара. */

/* ====== STEP 2 — CHECKOUT FORM ====== */
.co-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}
.co-delivery-panel {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.co-delivery-title {
  font-size: 17px; font-weight: 700; color: var(--c-text);
  margin: 0 0 20px; padding-bottom: 14px;
  border-bottom: 2px solid var(--c-brand);
}
.co-form-group { margin-bottom: 16px; }
.co-label { display: block; font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
/* Пояснение под подписью поля наследовало уменьшающий <small> и выходило
   10.8px - самый мелкий текст в оформлении заказа. */
.co-label small { font-weight: 400; font-size: 13px; color: #5A6472; display: block; margin-top: 2px; }
.req { color: var(--c-brand); }
.co-select-wrap { position: relative; }
.co-select {
  width: 100%; height: 44px;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 0 36px 0 14px; font-size: 14px; color: var(--c-text);
  background: var(--c-white); appearance: none; cursor: pointer;
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.co-select:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.co-select-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; pointer-events: none; color: var(--c-muted);
}
.co-delivery-card {
  border: 1.5px solid var(--c-brand); border-radius: var(--radius-md);
  overflow: hidden; margin: 18px 0; background: var(--c-brand-light);
}
.co-delivery-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--c-white); border-bottom: 1px solid var(--c-border);
}
.co-toggle { display: flex; align-items: center; cursor: pointer; }
.co-toggle input { display: none; }
.co-toggle-track {
  width: 44px; height: 24px; background: var(--c-border); border-radius: 999px;
  position: relative; transition: background .25s;
}
.co-toggle-track::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; top: 3px; left: 3px;
  transition: transform .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.co-toggle input:checked + .co-toggle-track { background: var(--c-brand); }
.co-toggle input:checked + .co-toggle-track::after { transform: translateX(20px); }
.co-delivery-specs { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
/* Тариф - подпись НАД значением, а не в одну строку с прижатием вправо.
   Значения приходят из справочника (delivery_city_methods) и это живой
   текст менеджера: у Кентау - «Средняя стоимость за 1 кг до 137 тенге, не
   менее 1200 тенге за почтовое отправление». В прежней раскладке
   space-between такая строка переносилась по 2-3 слова с рваным левым
   краем. Ширина панели 380px, короче данные не станут. */
.co-spec-item { display: flex; flex-direction: column; gap: 2px; }
.co-spec-label { font-size: 13px; font-weight: 600; color: var(--c-text); }
.co-spec-val { font-size: 13px; color: var(--c-muted); line-height: 1.45; }
.co-delivery-note { font-size: 12px; color: var(--c-muted); padding: 0 16px 8px; margin: 0; line-height: 1.5; }
/* Было 11px цветом #aaa - контраст 2.3:1, вдвое ниже нормы. Здесь сказано,
   от чего зависят сроки и стоимость доставки: сноска, которую покупатель как
   раз должен прочесть. Замер.
   */
.co-delivery-footnote { font-size: 13px; color: #616161; padding: 8px 2px 0; margin: 0; }

.co-delivery-options { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.co-delivery-option {
  display: block; border: 1.5px solid var(--c-border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--c-white); cursor: pointer; transition: border-color .2s, background .2s;
}
.co-delivery-option input { position: absolute; opacity: 0; pointer-events: none; }

/* ── Скелетон способов доставки ────────────────────────────────────────
   Пока справочник едет по сети, здесь стоял голый текст «Загружаем
   условия доставки…». Заглушка повторяет .co-delivery-option (рамка,
   радиус, отступы заголовка), поэтому блок не прыгает по высоте, когда
   приходят настоящие способы.

   Шиммер — общий .skel из main.css: своей анимации не заводим, он уже
   гасится при prefers-reduced-motion. Курсор снимаем — нажимать нечего. */
.co-delivery-option--skel { cursor: default; pointer-events: none; }
/* 51px — замеренная высота невыбранной карточки способа. Держим её ровно,
   чтобы блок не дёргался, когда заглушки сменяются настоящими способами. */
.co-delivery-option--skel .co-delivery-option-head { padding: 0 16px; min-height: 48px; }
.co-delivery-option--skel .skel-line { height: 12px; border-radius: var(--zd-r-xs, 4px); }
.co-delivery-option--skel .skel-line--title { width: 42%; }
.co-delivery-option.is-selected { border-color: var(--c-brand); background: var(--c-brand-light); }
.co-delivery-option-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.co-delivery-option-title { font-size: 14px; font-weight: 700; color: var(--c-text); }
.co-delivery-option-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-border);
  flex: none; position: relative; transition: border-color .2s;
}
.co-delivery-option.is-selected .co-delivery-option-radio { border-color: var(--c-brand); }
.co-delivery-option.is-selected .co-delivery-option-radio::after {
  content: ''; position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-brand); top: 3px; left: 3px;
}
.co-delivery-option .co-delivery-specs,
.co-delivery-option .co-delivery-note { display: none; }
.co-delivery-option.is-selected .co-delivery-specs { display: flex; padding: 14px 16px; border-top: 1px solid var(--c-border); }
.co-delivery-option.is-selected .co-delivery-note { display: block; font-size: 12px; color: var(--c-muted); padding: 0 16px 14px; line-height: 1.5; }
/* === Выбор способа оплаты ===
   Тот же визуальный язык, что у способов доставки выше (карточка-радио с
   раскрывающимся пояснением) - это соседние блоки одной формы, и разный вид
   у них читался бы как разная механика. Отдельный набор классов, а не
   переиспользование .co-delivery-option: у доставки есть свои части (специфи-
   кации тарифа, логотип Казпочты), которых у оплаты нет и не будет. */
.co-payment-options { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.co-payment-option {
  display: block; border: 1.5px solid var(--c-border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--c-white); cursor: pointer; transition: border-color .2s, background .2s;
}
.co-payment-option input { position: absolute; opacity: 0; pointer-events: none; }
.co-payment-option.is-selected { border-color: var(--c-brand); background: var(--c-brand-light); }
.co-payment-option:hover { border-color: var(--c-brand); }
.co-payment-option-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; gap: 12px; }
.co-payment-option-title { font-size: 14px; font-weight: 700; color: var(--c-text); }
.co-payment-option-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-border);
  flex: none; position: relative; transition: border-color .2s;
}
.co-payment-option.is-selected .co-payment-option-radio { border-color: var(--c-brand); }
.co-payment-option.is-selected .co-payment-option-radio::after {
  content: ''; position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-brand); top: 3px; left: 3px;
}
/* Пояснение показываем только у выбранного - иначе пять абзацев подряд
   превращают выбор в стену текста. */
.co-payment-option .co-payment-option-note { display: none; }
.co-payment-option.is-selected .co-payment-option-note {
  display: block; font-size: 12px; color: var(--c-muted);
  padding: 0 14px 12px; line-height: 1.5;
}
.co-payment-option:focus-within { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.co-btn-other-country {
  display: block; width: 100%; padding: 12px;
  background: transparent; border: 1.5px dashed var(--c-border);
  border-radius: var(--radius-sm); color: var(--c-muted);
  font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px;
  transition: background var(--zd-dur-fast) var(--zd-ease),
              border-color var(--zd-dur-fast) var(--zd-ease),
              color var(--zd-dur-fast) var(--zd-ease);
}
.co-btn-other-country:hover { border-color: var(--c-brand); color: var(--c-brand); background: var(--c-brand-light); }
/* Кнопка «Другая страна доставки» — переключатель, а не ссылка: в нажатом
   состоянии она показывает, что режим включён, и её же нажимают, чтобы
   вернуться к Казахстану. Без этого покупатель, открывший зарубежные поля,
   не видит способа передумать. */
.co-btn-other-country[aria-expanded="true"] {
  border-style: solid; border-color: var(--c-brand);
  color: var(--c-brand); background: var(--c-brand-light);
}
/* Звёздочка обязательного поля — та же роль, что у .required в address.php,
   но в пространстве имён чекаута (co-). */
.co-req { color: var(--c-danger, #d64545); font-weight: 700; }
/* Пояснение про расчёт менеджером под зарубежными полями. */
.co-foreign-note {
  margin: 4px 0 0; padding: 10px 12px;
  background: var(--c-brand-light); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.5; color: #5A6472;
}
.co-form-panel {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm);
}
/* .co-notice удалён вместе с синей плашкой в шапке формы:
   её текст дублировал подсказку под полем «Адрес». Класс больше не
   встречается в разметке - правило убрано, чтобы не отрастить копию.
   */

/* === Выбор сохранённого адреса в корзине === */
.co-saved-picker {
  background: #f7fafb;
  border: 1px solid #e3e6e8;
  border-radius: 12px;
  padding: 16px 16px;
  margin-bottom: 16px;
}
.co-saved-picker-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.co-saved-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.co-saved-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border: 1.5px solid #d8dbde;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
  color: #2a2a2a;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
}
.co-saved-item input { margin-top: 3px; accent-color: #01A572; }
.co-saved-item.is-active {
  border-color: #01A572;
  background: #f3fbf7;
}
.co-saved-picker-manage {
  display: inline-block;
  margin-top: 12px;
  color: #01A572;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.co-saved-picker-manage:hover { text-decoration: underline; }
.co-input {
  width: 100%; height: 44px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 0 14px;
  font-size: 14px; color: var(--c-text); background: var(--c-white);
  transition: border-color .2s, box-shadow .2s; font-family: inherit;
}
.co-input:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.co-input::placeholder { color: #8a8a8a; }
.co-textarea {
  width: 100%; min-height: 80px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; color: var(--c-text); resize: vertical;
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.co-textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.co-textarea::placeholder { color: #8a8a8a; }
.co-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.co-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.co-phone-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.co-phone-wrap:focus-within { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
/* Код страны - селектор (тот же, что на регистрации), а не подпись «+»:
   маска писала в поле собственный плюс, и рядом стояло два. */
.co-phone-country {
  height: 44px; padding: 0 22px 0 10px; font-size: 15px; font-weight: 600;
  color: var(--c-text); background: var(--c-bg);
  border: none; border-right: 1.5px solid var(--c-border); border-radius: 0;
  /* appearance:none - иначе <select> рисует СВОЙ нативный контур со своим
     скруглением поверх border-radius обёртки .co-phone-wrap, и слева от
     номера виден чужой уголок вместо общего с полем номера. Стрелка ниже -
     своя, вместо снятой нативной (поле теперь кликабельно, см. cart.js). */
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 14px;
  flex-shrink: 0; outline: none; cursor: pointer;
  /* Ширина под «🇰🇿 +998» - фиксируем, чтобы поле номера не прыгало
     при смене страны. */
  min-width: 96px;
}
.co-phone-input { border: none !important; border-radius: 0 !important; box-shadow: none !important; }
/* Плашка отказа в оформлении (js/cart.js::showOrderError). */
.co-submit-error {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-sm);
  background: #FEF2F2;
  color: #991B1B;
  font-size: 14px;
  line-height: 1.45;
}
.co-submit-error[hidden] { display: none; }

/* Сумма к оплате над кнопкой подтверждения. Стоит именно здесь, вплотную к
   кнопке: покупатель должен видеть цифру ровно в тот момент, когда решает
   платить, а не вспоминать её с предыдущего шага. */
.co-total-bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--c-border);
}
.co-total-bar__label { font-size: 15px; font-weight: 600; }
.co-total-bar__count { color: var(--c-text-muted, #6b7280); font-weight: 400; }
.co-total-bar__sum {
  font-size: 22px; font-weight: 800; color: var(--c-brand-dark);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* Разделитель уже нарисован строкой итога выше — второй подряд читался бы
   как пустая полоса между суммой и кнопкой. */
.co-total-bar + .co-submit-bar { margin-top: 16px; padding-top: 0; border-top: none; }

.co-submit-bar {
  display: flex; justify-content: flex-end;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--c-border);
}
.co-btn-confirm {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-brand); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 13px 28px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(1,165,114,.3);
}
.co-btn-confirm:hover:not(:disabled) { background: var(--c-brand-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(1,165,114,.4); }
.co-btn-confirm:disabled { background: #94d3bc; box-shadow: none; cursor: not-allowed; transform: none; }

/* ====== STEP 3 — SUCCESS ====== */
.co-success-layout {
  display: flex; flex-direction: column; gap: 28px; align-items: stretch;
  max-width: 640px; margin: 0 auto;
  animation: fadeUp .5s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.co-success-info {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.co-success-info-title { font-size: 16px; font-weight: 700; color: var(--c-text); margin: 0 0 12px; }
.co-success-divider { border: none; border-top: 2px solid var(--c-brand); margin: 0 0 18px; }
.co-info-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: 14px;
}
.co-info-row:last-child { border-bottom: none; }
.co-info-key { color: var(--c-muted); font-weight: 500; flex-shrink: 0; }
.co-info-value { color: var(--c-brand); font-weight: 600; text-align: right; word-break: break-word; }
.co-success-confirm {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 20px; gap: 14px;
}
.success-icon-ring {
  width: 90px; height: 90px; background: var(--c-brand); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; animation: successPulse .6s ease; margin-bottom: 8px;
}
.co-success-title { font-size: 28px; font-weight: 700; color: var(--c-text); margin: 0; }
.co-success-thanks { font-size: 16px; color: var(--c-muted); margin: 0; }
.co-success-msg { font-size: 15px; color: var(--c-muted); margin: 0; }
.co-success-account-note {
  font-size: 14px; color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: 10px; padding: 12px 16px; margin-top: 4px;
}
.co-success-account-note a { color: inherit; font-weight: 700; text-decoration: underline; }
.co-btn-continue {
  display: flex; align-items: center; gap: 8px;
  background: var(--c-brand); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 14px 32px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background-color .2s;
  margin-top: 8px;
}
.co-btn-continue:hover { background-color: var(--c-brand-dark); }

/* ====== RESPONSIVE ====== */
@media screen and (max-width: 1024px) {
  
  .cart-page { padding-bottom: 150px; }
  .cart-content { grid-template-columns: 1fr; max-width: 700px; }
  .cart-sidebar { position: static; order: 1; }
  .btn-checkout { display: none !important; }
  .mobile-checkout-btn { display: flex !important; }
  .co-layout { grid-template-columns: 1fr; gap: 20px; }
  .co-success-layout { grid-template-columns: 1fr; gap: 24px; }
  .co-submit-bar { justify-content: stretch; }
  .co-btn-confirm { width: 100%; min-width: unset; justify-content: center; }
}
@media screen and (min-width: 1025px) {
  .mobile-checkout-btn { display: none !important; }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .mobile-checkout-btn {
    bottom: calc(65px + var(--zd-nav-lift));
    padding: 20px 24px 32px 24px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }
  
  .mobile-checkout-content {
    padding: 20px 32px;
    border-radius: 20px;
  }

  .mobile-checkout-total-price {
    font-size: 28px;
  }

  .mobile-checkout-action-text {
    font-size: 22px;
  }

  .mobile-checkout-action-text i {
    font-size: 22px;
  }
}

@media screen and (max-width: 768px) {
  
  .cart-item {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
    gap: 14px; padding: 16px 0;
  }
  .cart-item-image { width: 100px; height: 100px; }
  .cart-item-controls {
    grid-column: 1 / -1; flex-direction: row; align-items: center;
    justify-content: space-between; padding-top: 10px;
    border-top: 1px solid var(--c-border); min-width: unset;
  }
  .cart-item-total { font-size: 16px; padding: 6px 12px; }
  .mobile-checkout-btn { bottom: calc(65px + var(--zd-nav-lift)); }
  .co-row-3 { grid-template-columns: 1fr; gap: 10px; }
  .co-row-2 { grid-template-columns: 1fr; gap: 10px; }
  .steps-bar { max-width: 280px; margin: 14px auto; }
  /* Была ещё ступень вниз (10px) поверх базовых 13px - на телефоне
     срабатывала именно она, и подписи шагов заказа выходили самым мелким
     текстом воронки. Держим 13px. Замер.
     */
  .step__label { font-size: 13px; }
  .step__circle { width: 24px; height: 24px; font-size: 11px; }
}
@media screen and (max-width: 576px) {
  .mobile-checkout-btn {
    bottom: calc(60px + var(--zd-nav-lift)); /* На маленьких экранах меню 60px */
    padding: 12px 12px 20px 12px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
  
  .mobile-checkout-content {
    padding: 12px 20px;
    border-radius: 12px;
  }

  .mobile-checkout-total-price {
    font-size: 22px;
  }

  .mobile-checkout-total-label {
    font-size: 14px;
  }

  .mobile-checkout-items-count {
    font-size: 12px;
  }

  .mobile-checkout-action-text {
    font-size: 16px;
  }

  .mobile-checkout-action-text i {
    font-size: 18px;
  }
  .cart-items-section { padding: 16px; }
  .cart-item { grid-template-columns: 80px 1fr; gap: 12px; padding: 14px 0; }
  .cart-item-image { width: 80px; height: 80px; }
  .cart-item-title { font-size: 15px; }
  .cart-item-price { font-size: 17px; }
  .cart-item-total { font-size: 14px; }
  /* На телефоне кнопки НЕ уменьшаем: здесь как раз и нужен крупный размер.
     Было 30x30 - вдвое ниже нормы, ровно на том экране, где попадают
     пальцем, а не мышью. */
  .qty-btn { width: 44px; height: 44px; }
  .qty-value { min-width: 44px; font-size: 16px; line-height: 44px; }
  .cart-summary { padding: 18px; }
  .summary-row { font-size: 14px; }
  .summary-row.total { font-size: 16px; }
  .mobile-checkout-btn { bottom: calc(60px + var(--zd-nav-lift)); }
  .co-form-panel { padding: 18px; }
  .co-btn-confirm { padding: 14px 20px; font-size: 14px; }
  .co-success-confirm { padding: 24px 10px; }
  .co-success-title { font-size: 22px; }
  .success-icon-ring { width: 72px; height: 72px; }
}
@media screen and (max-width: 440px) {
  .mobile-checkout-btn {
    bottom: calc(60px + var(--zd-nav-lift));
    padding: 12px 12px 20px 12px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
  }

  .mobile-checkout-content {
    gap: 12px;
    padding: 8px 16px;
    border-radius: 8px;
  }

  .mobile-checkout-total-price {
    font-size: 18px;
  }

  /* «Итого» и «N товаров» - то, что покупатель читает перед оплатой, а не
     служебная подпись. 12px не проходят порог читаемости проекта (14px,
     аудит). Панель горизонтальная, места хватает: рядом только сумма и кнопка.
     */
  .mobile-checkout-total-label {
    font-size: 14px;
  }

  .mobile-checkout-items-count {
    font-size: 14px;
  }

  .mobile-checkout-action-text {
    font-size: 16px;
  }

  .mobile-checkout-action-text i {
    font-size: 16px;
  }
}

/* Скрываем мобильную кнопку на десктопе */
@media screen and (min-width: 1025px) {
  .mobile-checkout-btn {
    display: none !important;
  }
}
/* Back button */
.co-btn-back {
  display: flex; align-items: center; gap: 8px;
  background: transparent; color: var(--c-muted);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md); padding: 12px 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--zd-dur-fast) var(--zd-ease),
              border-color var(--zd-dur-fast) var(--zd-ease),
              color var(--zd-dur-fast) var(--zd-ease);
}
.co-btn-back:hover { border-color: var(--c-brand); color: var(--c-brand); background: var(--c-brand-light); }

/* Submit bar with back+confirm side by side */
.co-submit-bar { justify-content: space-between; }

/* Mobile step 2/3 buttons — enabled by default when visible */
#mobile-confirm-btn,
#mobile-continue-btn { display: none; }
#mobile-confirm-btn { pointer-events: auto; }
#mobile-continue-btn .mobile-checkout-content,
#mobile-confirm-btn .mobile-checkout-content { background: var(--c-brand); }
#mobile-continue-btn.mobile-checkout-btn { opacity: 1 !important; cursor: pointer; }

@media screen and (max-width: 1024px) {
  #mobile-confirm-btn { display: flex !important; }
  #mobile-continue-btn { display: flex !important; }
  .co-submit-bar { display: none; }
  /* Back link replaces submit bar on mobile — show inline in form header */
  .co-back-mobile { display: flex; }
}
@media screen and (min-width: 1025px) {
  .co-submit-bar { display: flex !important; }
  #mobile-confirm-btn,
  #mobile-continue-btn { display: none !important; }
}

/* Back link (always visible above form) */
.co-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none;
  color: var(--c-muted); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 0 0 16px 0; transition: color .2s;
}
.co-back-link:hover { color: var(--c-brand); }

/* ====== Field validation states ====== */
.co-input--error,
select.co-input--error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
  background: #fff8f8;
}
.field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
  animation: errIn .2s ease;
}
@keyframes errIn {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Phone wrap error — border from parent */
.co-phone-wrap.phone-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
}

/* ====== Button: not all fields filled ====== */
.co-btn-confirm.btn--inactive {
  background: #94d3bc;
  box-shadow: none;
  cursor: pointer;
  transform: none;
}
.co-btn-confirm.btn--inactive:hover {
  background: #7ec4af;
  transform: none;
  box-shadow: none;
}

/* Неактивный вид мобильной кнопки.

   Селекторы с id обязательны: выше стоит
   «#mobile-confirm-btn .mobile-checkout-content { background: var(--c-brand) }»,
   и правило по классам (специфичность 30 против 110) молчало - кнопка
   оставалась насыщенно-зелёной при незаполненной форме. Покупатель видел
   готовую к нажатию кнопку, жал, получал тряску и ошибки полей вместо
   отправки. Тот же разбор, что и у :disabled ниже. */
.mobile-checkout-btn.btn--inactive .mobile-checkout-content,
#mobile-confirm-btn.btn--inactive .mobile-checkout-content,
#mobile-continue-btn.btn--inactive .mobile-checkout-content {
  background: #94d3bc;
  box-shadow: none;
}

/* Тот же бледный вид — но по НАТИВНОМУ :disabled, а не по классу.
   js/cart.js (строки 114-116) выключает #mobile-checkout-btn атрибутом
   disabled и НИКОГДА не ставит класс .btn--inactive на него (тот висит
   только на #mobile-confirm-btn, cart.php:531) — правило выше молчало, и
   кнопка при сумме заказа ниже минимума оставалась насыщенно-зелёной, будто
   рабочей. На ширине ≤1024px это ЕДИНСТВЕННАЯ кнопка оформления (десктопная
   .btn-checkout скрыта), а alert из showLowAmountNotice (js/cart.js) тоже
   блокируется атрибутом disabled и не срабатывает никогда — покупатель жал в
   пустоту без единого объяснения почему. Найдено аудитом.
   */
.mobile-checkout-btn:disabled {
  cursor: not-allowed;
}
.mobile-checkout-btn:disabled .mobile-checkout-content {
  background: #94d3bc;
  box-shadow: none;
}

/* ====== Shake on invalid click ====== */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.btn--shake { animation: shake .4s ease; }

/* ==========================================================================
   Хлебные крошки (тот же блок, что в favorites.css/comparison.css, стили из
   info-pages.css) - cart.php была единственной страницей кабинета без крошек
   в разметке, поэтому не имела и своей копии стилей (SEO-аудит).
   ==========================================================================
   */


/* Способы доставки: состояние «пункт ещё не выбран».
   Карточки рисует js/cart-delivery.js по ответу справочника — до выбора
   населённого пункта показывать нечего, и пустая панель без объяснения
   читалась бы как сломанная страница. */
.co-delivery-hint {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed #D8DEE3;
  border-radius: 10px;
  background: #FAFBFC;
  color: #6B7580;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

/* ===== Закреплённый низ формы доставки =====
   «К оплате» + кнопки не уезжают за экран, пока покупатель заполняет длинную
   форму.

   sticky, а не fixed: блок остаётся в потоке и не перекрывает последнее поле
   формы. -1px снизу убирает щель субпиксельного округления при зуме.

   КОМПАКТНАЯ ПЛАШКА, а не разъехавшаяся во всю ширину строка. Раньше сумма
   стояла у левого края, кнопки - у правого, и на широком экране (.container
   тянется до 1900px) между ними была голая пустота от края до края.
   Теперь весь блок - одна карточка (рамка+радиус+тень), сумма и кнопки
   сгруппированы вместе и прижаты вправо, а не растянуты по всей ширине
   контейнера.
   */
.co-checkout-footer {
  position: sticky;
  bottom: -1px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 20px 28px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 8px 20px -10px rgba(16, 24, 40, .18);
  margin-top: 24px;
}

/* Внутри карточки суммы/кнопки больше не свои отдельные "секции" с рамкой
   сверху (та рамка имела смысл, когда блоки стояли друг под другом) - здесь
   один общий контейнер уже отделяет их от формы. */
.co-checkout-footer .co-total-bar,
.co-checkout-footer .co-submit-bar {
  margin: 0;
  padding: 0;
  border-top: none;
}
.co-checkout-footer .co-submit-bar { gap: 12px; }

@media screen and (max-width: 1024px) {
  /* На телефоне ту же роль играет #mobile-confirm-btn, закреплённый внизу
     экрана. Два липких блока друг на друге съели бы пол-экрана, поэтому
     здесь обёртка обычная (не sticky), а дублирующая кнопка подтверждения
     в потоке скрыта - оставлена только "Вернуться в корзину". */
  .co-checkout-footer {
    position: static;
    box-shadow: none;
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
  }
  .co-checkout-footer .co-submit-bar .co-btn-confirm { display: none; }
  .co-checkout-footer .co-submit-bar { justify-content: flex-start; }
}

@media (max-width: 300px) {
  .mobile-checkout-total-price { font-size: 17px; white-space: nowrap; }
  .mobile-checkout-total-label, .mobile-checkout-count { font-size: 12px; }
  .mobile-checkout-action-text { font-size: 13px; }
}

/* Корзина на телефоне: позиции серыми блоками, стрелка назад, пояснение про оплату. */
.zd-cart-back { display: none; }
.co-nocharge { margin: 8px 0 6px; font-size: 13px; line-height: 1.35; color: #4B5563; text-align: center; }
@media (max-width: 768px) {
  .zd-cart-back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 6px 0 0; border: 0; border-radius: 12px; background: #F2F2F2; color: #111827; cursor: pointer; }
  .cart-items-section { padding: 0; border: 0; background: transparent; }
  .cart-items-section .cart-item { background: #F2F2F2; border: 0; border-radius: 16px; padding: 10px; margin: 0 0 8px; }
}

/* Подсказка до минимального заказа и номера блоков оформления. */
.zd-min-hint { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #F6D5AE; border-radius: 12px; background: #FFF3E6; color: #B45309; font-size: 14px; font-weight: 600; line-height: 1.35; }
.zd-min-hint[hidden] { display: none; }
.co-delivery-title, .co-section-title { display: flex; align-items: center; gap: 8px; }
.co-delivery-title::before, .co-section-title::before { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #01A572; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.co-delivery-title::before { content: "1"; }
.co-section-title { margin: 22px 0 12px; font-size: 18px; font-weight: 700; }
.co-section-title::before { content: "2"; }
/* Поля оформления заказа - как на входе и регистрации: 52px, текст 16px, скругление 12px.
   Аудитории 40-65+ мелкое поле труднее заполнить; одинаковый вид на всех формах сайта. */
.co-input, .co-select { height: 52px; font-size: 16px; border-radius: 12px; padding-left: 16px; }
.co-textarea { min-height: 96px; font-size: 16px; border-radius: 12px; padding: 14px 16px; }
.co-phone-wrap { border-radius: 12px; }
/* Внутри обёртки с рамкой 1.5px: 49px + рамка = 52px снаружи, вровень с соседними полями. */
.co-phone-wrap .co-input { height: 49px; border-radius: 0; }
.co-phone-country { height: 49px; font-size: 16px; }
/* Телефон: пустой корзине нечего оформлять - без нижней панели и «Итого»; у полной запас снизу под панель и меню (~185px), чтобы «Итого» докручивалось выше них. */
@media (max-width: 768px) {
  body.is-cart-empty .mobile-checkout-btn, body.is-cart-empty .cart-summary { display: none !important; }
  .cart-page { padding-bottom: 220px; }
}
/* Пустая корзина: плашка гостя («Отложить всё в избранное») не нужна - откладывать нечего. */
body.is-cart-empty .cart-notice { display: none !important; }
@media (max-width: 1024px) { .zd-cart-back { width: 44px; height: 44px; margin-bottom: 14px !important; } }

/* ==== .zi: значки шрифта zd-ui вместо svg (сгенерировано по правилам svg выше) ==== */
.cart-notice .zi { flex-shrink: 0; margin-top: 1px; }
.co-select-arrow.zi { font-size: 16px; }
.co-consent { margin: 0 0 10px; font-size: 13px; line-height: 1.4; color: #4B5563; text-align: center; }
.co-consent a { color: #01A572; text-decoration: underline; }

/* Корзина в кабинете. order.css задаёт меню голым «aside» (260px, отступы, рамка справа, flex) - колонка «Итого» тоже aside и сжималась под него. */
body aside + main.cart-page aside.cart-sidebar { width: auto; display: block; padding: 0; border-right: 0; background: transparent; }
body aside + main.cart-page .cart-summary { margin-bottom: 0; }
@media screen and (min-width: 1025px) {
  body aside + main.cart-page .cart-content { grid-template-columns: minmax(0, 1fr) 320px; }
}
/* Рядом с меню слева на ноутбуке двум колонкам тесно - «Итого» под списком, на ширину списка. */
@media screen and (min-width: 1025px) and (max-width: 1500px) {
  body aside + main.cart-page .cart-content { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  body aside + main.cart-page aside.cart-sidebar { position: static; }
}

/* Скелетон строки корзины - размеры настоящей (замер): ПК 196px; телефон - серая карточка, фото 80, снизу ряд количества. */
.cart-item--skel { min-height: 196px; box-sizing: border-box; }
@media (max-width: 640px) {
  .cart-item--skel {
    grid-template-columns: 80px 1fr; grid-template-rows: auto 46px; gap: 12px; min-height: 195px;
    padding: 10px; margin: 0 0 8px; border: 0; border-radius: 16px; background: #F2F2F2; align-items: start;
  }
  .cart-item--skel .skel-photo { width: 80px; height: 80px; margin-top: 13px; }
  .cart-item--skel .skel-info { gap: 10px; }
  .cart-item--skel .skel-title-1 { height: 16px; width: 80%; }
  .cart-item--skel .skel-title-2 { height: 16px; width: 50%; }
  .cart-item--skel .skel-price { height: 22px; width: 90px; margin-top: 18px; }
  .cart-item--skel .skel-controls { display: flex; grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; width: auto; }
  .cart-item--skel .skel-qty { width: 138px; height: 46px; }
  .cart-item--skel .skel-total { width: 88px; height: 35px; border-radius: 8px; }
  /* Пока грузится - место под кнопки шапки (WhatsApp, Скопировать, Очистить): с ними шапка 57px, и список не съезжает вниз. */
  .cart-items-section:has(.cart-item--skel) .cart-header { min-height: 57px; box-sizing: border-box; }
}
.cart-item--skel .skel-total { border-radius: 8px; }
