/* ============================================================
   EDA · дизайн-система (токены, база, компоненты)
   ============================================================ */

/* Фирменный шрифт: Onest (variable, 100–900). Три сабсета — латиница,
   кириллица и кириллица-расширение (в нём знак ₽). font-display: swap —
   текст не прячется, пока шрифт едет. */
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin.3db826ed1c5d.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic.fe2bd26ae82a.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic-ext.11a468877c94.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+20BD, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --brand: #f5a623;
  --brand-ink: #14161a;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 35%, #fff);

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9ecf1;

  --ink: #14161a;
  --ink-2: #45494f;
  --muted: #6b7280;
  --line: #e8eaee;
  --line-2: #dfe2e8;

  --ok: #12b76a;
  --ok-soft: #ecfdf3;
  --warn: #f79009;
  --warn-soft: #fffaeb;
  --danger: #f04438;
  --danger-soft: #fef3f2;
  --info: #3b82f6;
  --info-soft: #eff6ff;
  --violet: #7a5af8;
  --violet-soft: #f4f3ff;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 10px 30px rgba(16, 24, 40, .12);
  --shadow-3: 0 24px 60px rgba(16, 24, 40, .18);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
  --container: 90rem;
  --transition: .18s cubic-bezier(.2, .8, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

/* Видимый фокус для клавиатуры и голосового доступа: курсор мыши его не видит. */
:focus-visible {
  outline: 2.5px solid color-mix(in srgb, var(--brand) 62%, var(--ink));
  outline-offset: 2px;
}

/* Уважаем настройку «уменьшить движение»: анимации и плавные прокрутки гасим. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- тач-экраны ----------
   На телефоне браузер подсвечивает элемент системным прямоугольником при касании
   и оставляет наведённое состояние после тапа — кнопка кажется нажатой, пока не
   коснёшься другого места. Подсветку убираем совсем, наведение оставляем только
   под курсором (правила ниже обёрнуты в @media (hover: hover)), а отклик на
   нажатие даём сами — мягким сжатием. */
a, button, input, select, textarea, label { touch-action: manipulation; }
button, .btn, .chip, .icon-btn, .cart-btn, .add-btn, .nav-toggle, .cat-nav-more, [role="tab"] {
  -webkit-user-select: none; user-select: none;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }

/* Числа в таблицах и ценах — табличные цифры: разряды не «пляшут». */
.table, .price-old, .stepper .qty { font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* --- аккуратные скроллбары ------------------------------------------- */
/* Внутренние прокрутки (корзина, списки, панели) рисуем сами: системный
   ползунок в них выглядит тяжело. Основную прокрутку окна не трогаем. */
/* `overscroll-behavior` не трогаем: с `contain` страница не прокручивается,
   когда курсор стоит над блоком, а сам блок прокручивать нечего. */
.scroll-y, .cart-body, .cart-foot, .checkout-card-body, .checkout-card-foot,
.modal-card, .drawer .cart-body, .panel-nav, .table-wrap, .addr-suggestions {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent;
  scroll-behavior: smooth;
}
.scroll-y::-webkit-scrollbar, .cart-body::-webkit-scrollbar, .cart-foot::-webkit-scrollbar,
.checkout-card-body::-webkit-scrollbar, .checkout-card-foot::-webkit-scrollbar,
.modal-card::-webkit-scrollbar, .panel-nav::-webkit-scrollbar, .table-wrap::-webkit-scrollbar,
.addr-suggestions::-webkit-scrollbar {
  width: 10px; height: 10px; background: transparent;
}
.scroll-y::-webkit-scrollbar-track, .cart-body::-webkit-scrollbar-track, .cart-foot::-webkit-scrollbar-track,
.checkout-card-body::-webkit-scrollbar-track, .checkout-card-foot::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track, .panel-nav::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track,
.addr-suggestions::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb, .cart-body::-webkit-scrollbar-thumb, .cart-foot::-webkit-scrollbar-thumb,
.checkout-card-body::-webkit-scrollbar-thumb, .checkout-card-foot::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb, .panel-nav::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb,
.addr-suggestions::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 20%, transparent);
  border: 3px solid transparent; background-clip: content-box; border-radius: 999px;
}
.scroll-y::-webkit-scrollbar-thumb:hover, .cart-body::-webkit-scrollbar-thumb:hover,
.cart-foot::-webkit-scrollbar-thumb:hover, .modal-card::-webkit-scrollbar-thumb:hover,
.checkout-card-body::-webkit-scrollbar-thumb:hover, .checkout-card-foot::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink) 34%, transparent); background-clip: content-box;
}
.scroll-y::-webkit-scrollbar-corner, .cart-body::-webkit-scrollbar-corner { background: transparent; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--ink);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  user-select: none;
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); }
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent); }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
}


.btn-dark { background: var(--ink); color: #fff; }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn-dark:hover { background: #26292e; }
}


.btn-ghost { background: transparent; border-color: var(--line-2); }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn-ghost:hover { background: var(--surface-2); }
}


.btn-success { background: var(--ok); color: #fff; }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn-success:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
}

.btn-danger { background: var(--danger-soft); color: var(--danger); }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, #fff); }
}


.btn-sm { padding: 8px 12px; font-size: 13.5px; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn .icon { width: 18px; height: 18px; flex: 0 0 auto; }

.icon-btn {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: none; cursor: pointer;
  transition: background var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .icon-btn:hover { background: var(--surface-3); }
}


/* ---------- поля ---------- */
.input, input[type="text"].input, input[type="password"].input, input[type="tel"].input,
input[type="number"].input, input[type="time"].input, input[type="email"].input,
input[type="color"].input, select.input, textarea.input, .input select, .input textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
input.input-color { padding: 4px; height: 46px; cursor: pointer; }
textarea.input { resize: vertical; min-height: 84px; }

/* --- выбор фирменного цвета: палитра и предпросмотр -------------------- */
.color-field { display: flex; flex-direction: column; gap: 10px; }
.color-field input.input-color { width: 100%; max-width: 140px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  position: relative; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 12px; background: var(--swatch, #eee);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--swatch-ink, #14161a); box-shadow: inset 0 0 0 1px rgba(20, 22, 26, .08);
  transition: transform var(--transition), border-color var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .color-swatch:hover { transform: translateY(-1px); }
}

.color-swatch .ic { opacity: 0; transition: opacity var(--transition); width: 16px; height: 16px; }
.color-swatch.is-active { border-color: var(--ink); }
.color-swatch.is-active .ic { opacity: 1; }
.color-swatch.is-custom { background: var(--surface-2); color: var(--muted); overflow: hidden; }
.color-swatch.is-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-preview { display: flex; align-items: center; gap: 10px; }
.color-preview-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--swatch, #eee); color: var(--swatch-ink, #14161a);
  font-weight: 800; font-size: 14px;
}


.field { margin-bottom: 16px; }
.field > label, .field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 13px; color: var(--danger); margin-top: 5px; }
.field.has-error .input { border-color: var(--danger); }

.checkbox, .radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 15px;
}
.checkbox input, .radio input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3);
  transition: background var(--transition); position: relative; flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-1);
  transition: transform var(--transition);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card-flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 750; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }

/* ---------- текст с разметкой (оферта, документы) ---------- */
.rich-text { line-height: 1.65; font-size: 14.5px; color: var(--ink-2); }
.rich-text h2 { font-size: 22px; margin: 28px 0 10px; color: var(--ink); }
.rich-text h2:first-child { margin-top: 0; }
.rich-text h3 { font-size: 17.5px; margin: 22px 0 8px; color: var(--ink); }
.rich-text h4 { font-size: 15.5px; margin: 18px 0 6px; color: var(--ink); }
.rich-text p { margin: 0 0 12px; }
.rich-text ul, .rich-text ol { margin: 0 0 12px; padding-left: 22px; }
.rich-text li { margin: 0 0 6px; }
.rich-text hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.rich-text a { color: var(--brand-ink, var(--brand)); text-decoration: underline; }
.rich-text strong { color: var(--ink); font-weight: 700; }

/* ---------- редактор текста с разметкой ---------- */
.markup-editor .markup-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.markup-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; }

.grid { display: grid; gap: 16px; }
.grid-1 { grid-template-columns: minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- бейджи и чипы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650;
  background: var(--surface-2); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: #067647; }
.badge-warn { background: var(--warn-soft); color: #b54708; }
.badge-danger { background: var(--danger-soft); color: #b42318; }
.badge-info { background: var(--info-soft); color: #175cd3; }
.badge-violet { background: var(--violet-soft); color: #5925dc; }
.badge-brand { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 55%, #000); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer; transition: all var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .chip:hover { border-color: var(--line-2); background: var(--surface-2); }
}

.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- прогресс ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .35s ease; }
.progress.is-ok > i { background: var(--ok); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--surface-2); border-radius: var(--radius); }
.tabs a {
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 650;
  color: var(--ink-2); white-space: nowrap;
}
.tabs a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .table tbody tr:hover { background: var(--surface-2); }
}

.table-wrap { overflow-x: auto; }

/* ---------- модалки и панели ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .5);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
  z-index: 60;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; z-index: 70; inset: 0;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  transform: translateY(12px) scale(.98); transition: transform var(--transition);
}
.modal.is-open .modal-card { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }

.drawer {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  background: var(--surface); box-shadow: var(--shadow-3);
  transform: translateX(102%); transition: transform var(--transition);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }

.toast-wrap { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-2);
  animation: toast-in .25s ease;
}
.toast.is-error { background: var(--danger); }
.toast.is-ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- сообщения ---------- */
.messages { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.message {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  background: var(--info-soft); color: #175cd3; border: 1px solid color-mix(in srgb, var(--info) 20%, #fff);
}
.message.success { background: var(--ok-soft); color: #067647; border-color: color-mix(in srgb, var(--ok) 22%, #fff); }
.message.error { background: var(--danger-soft); color: #b42318; border-color: color-mix(in srgb, var(--danger) 22%, #fff); }
.message.warning { background: var(--warn-soft); color: #b54708; border-color: color-mix(in srgb, var(--warn) 22%, #fff); }

/* ---------- пустые состояния ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .emoji { font-size: 40px; margin-bottom: 10px; }

/* Иконки интерфейса: инлайн-SVG из спрайта partials/icons.html */
.ic {
  width: 18px; height: 18px; display: inline-block; vertical-align: -3px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 24px; height: 24px; }
.empty-ico {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--muted);
}
.empty-ico .ic { width: 26px; height: 26px; }
.row-ico { color: var(--muted); }

/* ---------- прочее ---------- */
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 60%, #000);
  font-weight: 750; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* Логотип на страницах входа (панель, покупатель) */
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.auth-brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
}

.steps { display: flex; gap: 6px; }
.steps > i { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-3); }
.steps > i.is-done { background: var(--ok); }
.steps > i.is-current { background: var(--brand); }

.price-old { color: var(--muted); text-decoration: line-through; font-weight: 600; }

.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface-2); border-radius: 999px; padding: 3px;
}
.stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface); font-size: 17px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-1);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .stepper button:hover { background: var(--surface-3); }
}

.stepper .qty { min-width: 26px; text-align: center; font-weight: 700; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; border-radius: var(--radius-sm); }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh;
  }
  /* нижний лист в стиле мобильного приложения: ручка, «залипающие» шапка и кнопки */
  .modal-card::before {
    content: ""; display: block; width: 42px; height: 4px; border-radius: 999px;
    background: var(--line); margin: 8px auto 0;
  }
  .modal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot {
    position: sticky; bottom: 0; z-index: 3; background: var(--surface);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .input, .input select, select.input, textarea.input { min-height: 44px; }
}

/* --- загрузка фото (dropzone) ---------------------------------------- */
.dropzone { display: grid; gap: 10px; }
.dropzone-frame {
  position: relative; display: grid; place-items: center; min-height: 190px;
  padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2, #fafbfc); overflow: hidden; transition: border-color var(--transition), background var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .dropzone-frame:hover { border-color: var(--brand-line); }
}

.dropzone.is-dragover .dropzone-frame { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-error .dropzone-frame { border-color: var(--danger); background: var(--danger-soft); }
.dropzone-preview { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius-xs); }
.dropzone.is-square .dropzone-preview { width: 132px; height: 132px; max-height: 132px; }
.dropzone.is-wide .dropzone-preview { max-height: 240px; aspect-ratio: 16 / 9; }
.dropzone-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 14px; }
.dropzone-empty .ic { width: 30px; height: 30px; color: var(--brand); }
.dropzone-title { color: var(--ink); font-weight: 600; }
.dropzone-hint { font-size: 13px; }
.dropzone-hint-row { font-size: 13px; color: var(--muted); }
.dropzone-change {
  position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(20, 22, 26, .72); color: #fff; font-size: 13px; font-weight: 600;
  opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .dropzone.has-file .dropzone-frame:hover .dropzone-change { opacity: 1; }
}

.dropzone.will-clear .dropzone-frame { opacity: .55; }
.dropzone-frame input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.dropzone-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dropzone-name { font-size: 13px; color: var(--muted); }
.dropzone-clear { margin-left: auto; }
.dropzone-error {
  padding: 10px 14px; border-radius: var(--radius-xs); background: var(--danger-soft);
  color: var(--danger); font-size: 13.5px; font-weight: 600;
}

/* --- современные dropdown ------------------------------------------- */
.dd { position: relative; display: block; }
.dd select { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd-button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 14px; border: 1px solid var(--line); background: var(--surface); color: inherit;
  border-radius: var(--radius-sm); font: inherit; font-size: 15px; transition: border-color var(--transition), box-shadow var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .dd-button:hover { border-color: var(--brand-line); }
}

.dd.is-open .dd-button { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dd-button.is-empty .dd-label { color: var(--muted); }
.dd-button:disabled { opacity: .6; cursor: not-allowed; }
.dd-caret { color: var(--muted); transition: transform var(--transition); flex: none; }
.dd.is-open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; z-index: 120; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 320px; max-width: min(560px, calc(100vw - 32px));
  max-height: 320px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(20, 22, 26, .16); padding: 6px; display: none;
}
.dd.is-open .dd-menu { display: block; }
.dd-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 12px; border: 0; background: none; color: inherit; font: inherit; font-size: 14.5px;
  border-radius: var(--radius-xs); transition: background var(--transition);
}
/* Ховер — только там, где есть курсор: на тач-экранах он залипает после тапа. */
@media (hover: hover) {
  .dd-option:hover { background: var(--surface-2, #f4f5f7); }
}

.dd-option.is-selected { background: var(--brand-soft); font-weight: 600; }
.dd-option.is-selected::after { content: "✓"; color: var(--brand); }
.dd-group {
  padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}

/* Отклик на касание: элемент «нажимается», но только под пальцем. */
@media (hover: none) {
  .btn:active, .icon-btn:active, .cart-btn:active, .chip:active, .add-btn:active,
  .nav-toggle:active, .cat-nav-more:active, .address-btn:active, .co-pill:active,
  .dish-card:active { transform: scale(.97); }
  .btn:active, .chip:active, .icon-btn:active { transition-duration: .06s; }
}
