:root {
  --navy: #0f2544;
  --navy-dark: #0a1a30;
  --accent: #ff6a00;
  --accent-dark: #e35c00;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c2b3a;
  --muted: #6b7c93;
  --border: #e3e8ee;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* [hidden] должен побеждать любые display:flex/grid на том же элементе */
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a { text-decoration: none; color: inherit; }

/* Topbar */
.topbar {
  background: var(--navy-dark);
  color: #cfd9e6;
  font-size: 13px;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  padding: 6px 20px;
}
.topbar__phone { font-weight: 600; color: #fff; }

/* Плашка "собираете заказ для клиента" (сотрудник оформляет заказ от имени
   клиента, выбранного заранее в разделе Клиенты админки) */
.staff-order-banner {
  background: var(--accent);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.staff-order-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-size: 14px;
}
.staff-order-banner__cancel {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.staff-order-banner__cancel:hover { background: rgba(255, 255, 255, .3); }

/* Header */
.header {
  background: var(--navy);
  color: #fff;
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo img { display: block; height: 26px; width: auto; }

.search {
  position: relative;
  flex: 1;
  display: flex;
  max-width: 600px;
}
.search__suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(10,20,35,.15);
  overflow: hidden;
  /* Выше .staff-order-banner (z-index: 50) — иначе оранжевая плашка
     "Собираете заказ для..." перекрывает подсказки поиска, когда она
     показана (сотрудник оформляет заказ от имени клиента). */
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
}
.search__suggestion {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.search__suggestion:last-child { border-bottom: none; }
.search__suggestion:hover { background: var(--bg); }
.search__suggestion-brand { font-weight: 700; color: var(--navy); white-space: nowrap; }
.search__suggestion-article { color: var(--accent); font-weight: 600; white-space: nowrap; }
.search__suggestion-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.search__suggestions.is-loading {
  padding: 22px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.search__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: search-spin .7s linear infinite;
}
@keyframes search-spin { to { transform: rotate(360deg); } }
.search__mode {
  position: relative;
  flex-shrink: 0;
}
/* Специфичность выше, чем у ".search button" (общий стиль кнопки "Найти")
   — иначе тот перебивает фон/цвет кнопки-переключателя. */
.search .search__mode-toggle {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  border-radius: var(--radius) 0 0 var(--radius);
  white-space: nowrap;
  transition: background .15s;
}
.search .search__mode-toggle:hover { background: rgba(255,255,255,.2); }
.search__mode-arrow { font-size: 10px; color: #cfd9e6; }
.search__mode-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(10,20,35,.15);
  overflow: hidden;
  z-index: 61;
}
/* Специфичность выше, чем у ".search button" (общий стиль кнопки "Найти")
   — иначе тот перебивает фон/паддинги у пунктов списка. */
.search .search__mode-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  background: none;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.search .search__mode-option:hover { background: var(--bg); }
.search .search__mode-option.is-active { color: var(--accent); font-weight: 600; }

.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  outline: none;
}
.search button {
  padding: 10px 20px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background .15s;
}
.search button:hover { background: var(--accent-dark); }

.header__actions { display: flex; gap: 8px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.16); }
.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  padding: 1px 6px;
  margin-left: 4px;
}

.nav { background: var(--navy-dark); }
.nav__inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 20px;
}
.nav__inner a, .nav__inner button {
  background: none;
  border: none;
  color: #cfd9e6;
  font-size: 14px;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.nav__inner a:hover, .nav__inner button:hover { color: #fff; }

/* Hero */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, #1a3a63 100%);
  color: #fff;
  padding: 60px 0;
}
.hero__inner { max-width: 640px; }
.hero h1 { font-size: 34px; margin-bottom: 14px; line-height: 1.25; }
.hero p { color: #cfd9e6; margin-bottom: 24px; font-size: 16px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 15px;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn--outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn--outline:hover { background: var(--bg); }
.btn--full { width: 100%; text-align: center; }

.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Sections */
.section { padding: 44px 0; }
.section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.section__title { font-size: 24px; margin-bottom: 20px; }
.section__header .section__title { margin-bottom: 0; }

/* Categories */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

/* Подбор запчастей по автомобилю (ilcats.ru) */
.ilcats-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.ilcats-tab {
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.ilcats-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ilcats-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.ilcats-vin-form { display: flex; gap: 10px; margin-bottom: 6px; }
.ilcats-vin-form input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.ilcats-hint { font-size: 12px; color: var(--muted); }
.ilcats-error { font-size: 13px; color: #c0392b; min-height: 1em; }
.ilcats-warning {
  font-size: 13px;
  color: #8a5a00;
  background: #fdf3dc;
  border: 1px solid #f0d99a;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ilcats-muted { color: var(--muted); font-size: 13px; }
.ilcats-stage-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.ilcats-breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 4px; }
.ilcats-crumb--link { color: var(--accent); cursor: pointer; }
.ilcats-crumb--link:hover { text-decoration: underline; }
.ilcats-crumb-sep { margin: 0 4px; }
.ilcats-vin-inline { display: flex; gap: 10px; margin-bottom: 16px; }
.ilcats-vin-inline__input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.ilcats-block { margin-bottom: 16px; }
.ilcats-nav-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
}
.ilcats-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.ilcats-tile {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.ilcats-tile:hover { background: #1a3a63; }
.ilcats-tile svg { flex-shrink: 0; }
.ilcats-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ilcats-card:hover { border-color: var(--accent); }
.ilcats-card--wide { text-align: left; margin-bottom: 8px; }
.ilcats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ilcats-table th, .ilcats-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ilcats-table th { color: var(--muted); font-weight: 600; }
.ilcats-table__row--link { cursor: pointer; }
.ilcats-table__row--link:hover { background: var(--bg); }
.ilcats-table__row--link td:first-child { color: var(--accent); font-weight: 600; }
.ilcats-table__article { color: var(--accent); font-weight: 600; text-decoration: none; }
.ilcats-table__article:hover { text-decoration: underline; }
.ilcats-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ilcats-form-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 150px; }
.ilcats-form-field select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15,37,68,.08);
  border-color: var(--accent);
}
.category-card__icon { font-size: 32px; margin-bottom: 10px; }
.category-card__name { font-weight: 600; font-size: 14px; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Products */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.product-card:hover { box-shadow: 0 10px 24px rgba(15,37,68,.1); }
.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.product-card__supplier {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.supplier-offers__status {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}
.supplier-offers__status:empty { display: none; }
.supplier-offers__status--error {
  color: #a4231a;
  background: #fdecea;
  border-color: #f5c2c0;
}
.supplier-offers__status--loading { color: var(--muted); }

/* Индикатор постепенной загрузки результатов поиска (см. search.js:
   runSearch, /api/supplier-cross-search/stream) — счётчик источников
   показываем только сотруднику (см. progress-card__count:empty ниже:
   для покупателя span остаётся пустым, поэтому и не рендерится вовсе;
   ему незачем знать про внутреннюю кухню поиска), сама полоска и текст
   "Ищем ещё предложения…" — общие для всех. */
.progress-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  transition: opacity .4s ease, margin .4s ease, padding .4s ease, max-height .4s ease;
  max-height: 200px;
  overflow: hidden;
}
.progress-card.is-done { opacity: 0; margin: 0; padding: 0; max-height: 0; border-width: 0; pointer-events: none; }
.progress-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.progress-card__label { color: var(--text); font-weight: 600; }
.progress-card__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-card__count:empty { display: none; }
.progress-track { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }
@media (prefers-reduced-motion: reduce) {
  .progress-card, .progress-fill { transition: none; }
}
.product-card__img {
  font-size: 48px;
  text-align: center;
  padding: 20px 0;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.product-card__img--photo {
  padding: 0;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card__img--photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* Кнопка-обёртка вокруг настоящего фото (см. product-card__img-btn в
   productCardHtml, common.js) — открывает то же увеличенное фото, что и
   у запрашиваемого товара в поиске (target-summary__photo). Заполняет
   родителя целиком, без своего фона/рамки — иначе кнопка визуально
   отделялась бы от карточки. */
.product-card__img-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: zoom-in;
}
.product-card__brand { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.product-card__name { font-weight: 600; font-size: 14px; margin: 4px 0 6px; min-height: 38px; }
.product-card__art { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.product-card__rating { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.product-card__rating strong { color: var(--text); }
.product-card__prices { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.price { font-size: 18px; font-weight: 800; }
.price--old { font-size: 13px; color: var(--muted); text-decoration: line-through; font-weight: 400; }
.product-card__add {
  margin-top: auto;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s;
}
.product-card__add:hover { background: var(--accent); }
.product-card__add.added { background: #1c9d5b; }
.product-card__add.update { background: var(--accent); }

/* Advantages */
.advantages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.advantage { text-align: center; padding: 20px; }
.advantage__icon { font-size: 34px; margin-bottom: 10px; }
.advantage h3 { font-size: 16px; margin-bottom: 6px; }
.advantage p { font-size: 13px; color: var(--muted); }

/* Cart panel */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,35,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 40;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 380px;
  max-width: 90vw;
  background: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,.15);
}
.cart-panel.open { transform: translateX(0); }
.cart-panel__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-panel__header .icon-btn { background: var(--bg); color: var(--text); }
.cart-panel__clear {
  display: block; margin: 10px 20px 0; padding: 0;
  background: none; border: none; color: var(--muted);
  font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; align-self: flex-start;
}
.cart-panel__clear:hover { color: var(--accent); }
.cart-panel__items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 40px; }

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item__checkbox {
  width: 18px; height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.cart-item--unchecked { opacity: .5; }
.cart-item__img {
  font-size: 26px;
  background: var(--bg);
  border-radius: 8px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item__img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 13px; font-weight: 600; }
.cart-item__meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cart-item__price { font-size: 13px; color: var(--muted); }
.cart-item__qty {
  display: flex; align-items: center; gap: 6px;
}
.cart-item__qty button {
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.cart-item__remove {
  background: none; border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}
.cart-item__remove:hover { color: #d33; }

.cart-panel__footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}
.cart-total {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 16px;
  margin-bottom: 12px;
}
.cart-total span { color: var(--accent); }

/* Модалка оформления заказа */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,35,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 60;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  z-index: 61;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal--wide { width: 760px; }
.modal__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__header .icon-btn { background: var(--bg); color: var(--text); }
.modal__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.checkout-account-note {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius);
}
#checkoutStaffFields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#checkoutNameField { position: relative; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field select {
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7c93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
}

.modal__error {
  color: #d33;
  font-size: 13px;
  min-height: 0;
}
.modal__error:empty { display: none; }

.modal__success {
  padding: 40px 24px;
  text-align: center;
}
.modal__success-icon { font-size: 40px; margin-bottom: 12px; }
.modal__success h3 { margin-bottom: 8px; }
.modal__success p { color: var(--muted); margin-bottom: 20px; }

/* Footer */
.footer { background: var(--navy-dark); color: #cfd9e6; margin-top: 40px; }
.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 40px 20px;
}
.footer__col p { margin: 6px 0; font-size: 14px; color: #a9b7c8; }
.footer__col h4 { color: #fff; margin-bottom: 10px; font-size: 15px; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 0;
  font-size: 12px;
  color: #7d8ea3;
  text-align: center;
}
.footer__bottom-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer__admin-link {
  color: #7d8ea3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__admin-link:hover { color: #cfd9e6; }

@media (max-width: 720px) {
  .header__inner { flex-wrap: wrap; }
  .search { order: 3; max-width: 100%; }
  .hero h1 { font-size: 26px; }
  .footer__inner { grid-template-columns: 1fr; }
  .ilcats-vin-form, .ilcats-vin-inline { flex-direction: column; }
  .ilcats-vin-form button, .ilcats-vin-inline__btn { width: 100%; }
  .ilcats-tiles { grid-template-columns: 1fr; }
}

/* Страница результатов поиска */
.breadcrumb {
  margin: 24px 0 8px;
  font-size: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }

.search-title {
  font-size: 22px;
  margin-bottom: 24px;
}

.results-sortbar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.sort-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.sort-btn:hover { color: var(--text); }
.sort-btn--active { color: var(--accent); font-weight: 700; }

/* Группа: один товар (бренд+артикул+название один раз), ниже — строки
   предложений от разных поставщиков/складов, как на exist.ru, вместо
   повтора названия в каждой строке (это и было причиной горизонтальной
   прокрутки у старой табличной вёрстки). */
#targetGrid, .brand-group__body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.brand-group__body { border-radius: 0; border: none; border-top: 1px solid var(--border); }

.product-group { border-top: 1px solid var(--border); }
.product-group:first-of-type { border-top: none; }
.product-group__header { padding: 12px 20px 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.product-group__brand { font-weight: 700; color: var(--navy); font-size: 13px; }
.product-group__article { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.product-group__name { font-size: 13px; color: var(--muted); }

.offer-row { display: flex; align-items: center; gap: 10px; padding: 8px 20px; }
.offer-row:hover { background: var(--bg); }
.offer-row__stock { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 4px; white-space: nowrap; width: 72px; text-align: center; flex-shrink: 0; }
.offer-row__stock--in { background: #e6f7ee; color: #1c9d5b; }
.offer-row__stock--order { background: #fdecea; color: #a4231a; }
.offer-row__delivery { font-size: 13px; color: var(--muted); width: 68px; flex-shrink: 0; }
.offer-row__supplier { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.offer-row__spacer { flex: 1; }
.offer-row__price-cost { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-row__price { text-align: right; white-space: nowrap; }
.offer-row__price-old { display: block; font-size: 11px; color: var(--muted); text-decoration: line-through; }
.offer-row__price-now { font-size: 15px; font-weight: 700; }

.offer-row__stepper { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.offer-row__step { width: 24px; border: none; background: var(--bg); color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.offer-row__step:hover { background: var(--border); }
.offer-row__qty {
  width: 32px;
  padding: 5px 2px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  /* Свои кнопки +/- уже стоят по бокам (.offer-row__step) — родные
     стрелки number-поля тут лишние, сужают цифру и сдвигают её от центра. */
  -moz-appearance: textfield;
}
.offer-row__qty::-webkit-outer-spin-button,
.offer-row__qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Как у обычной кнопки "В корзину" в карточках товара (.product-card__add) —
   тёмно-синяя, при наведении акцентный оранжевый, после добавления зелёная —
   но компактная иконка вместо текста, чтобы строка предложения помещалась
   в одну линию даже на мобильном. */
.offer-row__cart {
  width: 34px; height: 34px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 8px;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}

/* Карточка запрашиваемого товара — фото + бренд/артикул/название один раз
   над списком предложений (не в каждой строке), по размеру содержимого,
   а не на всю ширину. */
.target-summary {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.target-summary__photo {
  width: 84px; height: 84px; flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  overflow: hidden;
  padding: 0;
}
button.target-summary__photo { cursor: zoom-in; }
.target-summary__photo img { width: 100%; height: 100%; object-fit: contain; }
.target-summary__info { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.target-summary__brand { font-weight: 700; color: var(--navy); font-size: 15px; }
.target-summary__article { color: var(--accent); font-weight: 600; font-size: 13px; }
.target-summary__name { color: var(--muted); font-size: 13px; }
.target-summary__meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Увеличенное фото — простой лайтбокс поверх страницы */
.photo-lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,35,.7);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 70;
}
.photo-lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.photo-lightbox {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  max-width: 90vw; max-height: 85vh;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 71;
}
.photo-lightbox.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.photo-lightbox img {
  display: block;
  max-width: 90vw; max-height: 85vh;
  border-radius: var(--radius);
  background: #fff;
}
.photo-lightbox__close {
  position: absolute;
  top: -14px; right: -14px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-lightbox__close:hover { background: var(--accent); }

.store-stock-offer {
  background: #e6f7ee;
  border-radius: var(--radius);
  padding: 8px 0 4px;
  margin-bottom: 14px;
}
.store-stock-offer__label {
  font-weight: 600;
  font-size: 13px;
  color: #1c9d5b;
  padding: 0 20px 8px;
}
.store-stock-offer .product-group { border-top: none; }

.group-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 20px;
}
.group-toggle:hover { color: var(--accent); }

/* Аналоги — список брендов по алфавиту, каждый сворачивается/разворачивается */
.brand-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.brand-group__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.brand-group__header:hover { background: var(--bg); }
.brand-group__name { font-weight: 700; color: var(--navy); font-size: 15px; }
.brand-group__meta { color: var(--muted); font-size: 13px; margin-left: auto; }
.brand-group__chevron { color: var(--muted); transition: transform .15s; flex-shrink: 0; }
.brand-group.expanded .brand-group__chevron { transform: rotate(180deg); }

@media (max-width: 640px) {
  .offer-row { padding: 8px 14px; gap: 6px; }
  .product-group__header { padding: 12px 14px 8px; }
  .offer-row__stock { width: auto; }
  .offer-row__delivery { width: auto; }
  .offer-row__supplier { display: none; }
  .results-sortbar { padding: 8px 14px; }
  .group-toggle { padding: 8px 14px; }
}

/* Страница выбора бренда — один и тот же артикул нашёлся сразу у
   нескольких брендов, отдаём выбор пользователю, а не гадаем сами. */
.brand-pick-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.brand-pick-item {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.brand-pick-item:first-child { border-top: none; }
.brand-pick-item:hover { background: var(--bg); }
.brand-pick-item__brand { font-weight: 700; color: var(--navy); font-size: 15px; white-space: nowrap; }
.brand-pick-item__name { color: var(--muted); font-size: 13px; flex: 1; }
.brand-pick-item__arrow { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.brand-pick-fallback { margin-top: 16px; font-size: 13px; color: var(--muted); }
.brand-pick-fallback a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.brand-pick-fallback a:hover { color: var(--accent); }

/* Общие компоненты: статус позиции заказа, таблица позиций заказа —
   используются и в личном кабинете, и в админке. */
.muted { color: var(--muted); font-size: 14px; }

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-new { background: #fff3e0; color: #e65100; }
.status-confirmed { background: #e3f2fd; color: #1565c0; }
.status-sent_to_supplier { background: #ede7f6; color: #5e35b1; }
.status-awaiting_delivery { background: #e1f5fe; color: #0277bd; }
.status-ready { background: #e0f2f1; color: #00796b; }
.status-issued { background: #e8f5e9; color: #2e7d32; }
.status-cancelled { background: #ffebee; color: #c62828; }

.order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}
.order-items-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.order-items-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.order-items-table th:first-child, .order-items-table td:first-child { padding-left: 0; }
.order-items-table th:last-child, .order-items-table td:last-child { padding-right: 0; }
/* Число и "₽" не должны переноситься на разные строки — некрасиво рвёт
   цену/сумму пополам на узкой колонке. Наименование, наоборот, должно
   переноситься (длинные названия товаров) — исключение через .name-col. */
.order-items-table th, .order-items-table td { white-space: nowrap; }
.order-items-table .name-col { white-space: normal; }
/* article-col — не :first-child: при чекбоксе возврата (см. account.js,
   hasIssued) он оказывается в начале строки, и :first-child задел бы его,
   а не столбец "Артикул". */
.order-items-table .article-col { color: var(--accent); font-weight: 600; }
.order-items-table td:last-child, .order-items-table th:last-child { text-align: right; }
.order-items-table .sum-col { font-weight: 600; }
.order-items-table__profit-total td { border-bottom: none; padding-top: 10px; font-weight: 600; }
.order-items-table__profit-total td:nth-last-child(2) { color: #1c9d5b; }
