/* =============================================================================
   XLENT Design System
   Единые токены, типографика и компоненты для каталога и админ-панелей.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- Акцент (подменяется настройками каталога) --- */
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, .12);
  --accent-contrast: #ffffff;
  --accent-hover: #2458d8;
  /* Читаемый вариант акцента для текста/иконок на поверхностях (нижняя навигация
     и т.п.) — в тёмной теме JS осветляет его, если клиентский акцент слишком
     тёмный и сливается с фоном (см. updateAccentReadability в catalog.js). */
  --accent-fg: var(--accent);

  /* --- Поверхности --- */
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e9eef6;
  --overlay: rgba(14, 20, 33, .55);

  /* --- Текст --- */
  --text: #131a28;
  --text-2: #4b586e;
  --text-3: #7b879d;
  --text-inverse: #ffffff;

  /* --- Линии --- */
  --line: #e4e9f2;
  --line-strong: #d2dae7;

  /* --- Статусы --- */
  --success: #12996a;
  --success-soft: rgba(18, 153, 106, .12);
  --warning: #d9891a;
  --warning-soft: rgba(217, 137, 26, .13);
  --danger: #d8453c;
  --danger-soft: rgba(216, 69, 60, .12);
  --info: #6a5bd6;
  --info-soft: rgba(106, 91, 214, .12);
  --whatsapp: #25d366;

  /* --- Радиусы --- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  /* --- Тени --- */
  --sh-xs: 0 1px 2px rgba(17, 25, 42, .06);
  --sh-sm: 0 2px 8px rgba(17, 25, 42, .07);
  --sh-md: 0 8px 24px rgba(17, 25, 42, .09);
  --sh-lg: 0 20px 48px rgba(17, 25, 42, .13);
  --sh-xl: 0 32px 80px rgba(17, 25, 42, .18);

  /* --- Ритм --- */
  --gap: 16px;
  --page-pad: 16px;
  --header-h: 60px;
  --tabbar-h: 62px;

  /* --- Движение --- */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --fast: .16s var(--ease);
  --normal: .26s var(--ease);
  --slow: .4s var(--ease);

  --font: "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-num: "Inter", ui-monospace, "SF Mono", Menlo, monospace;
}

/* --- Тёмная тема --- */
:root[data-theme="dark"],
:root:not([data-theme="light"]) [data-theme-auto="dark"] {
  color-scheme: dark;
  --bg: #0e1320;
  --bg-elevated: #151b2b;
  --surface: #151b2b;
  --surface-2: #1c2436;
  --surface-3: #262f45;
  --overlay: rgba(5, 8, 14, .7);

  --text: #eaeefa;
  --text-2: #a8b3cb;
  --text-3: #75819b;

  --line: #26304a;
  --line-strong: #364160;

  --accent-soft: rgba(90, 143, 255, .18);
  --success-soft: rgba(18, 153, 106, .18);
  --warning-soft: rgba(217, 137, 26, .18);
  --danger-soft: rgba(216, 69, 60, .18);
  --info-soft: rgba(126, 112, 235, .2);

  --sh-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --sh-md: 0 10px 28px rgba(0, 0, 0, .42);
  --sh-lg: 0 22px 54px rgba(0, 0, 0, .5);
  --sh-xl: 0 34px 90px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1320;
    --bg-elevated: #151b2b;
    --surface: #151b2b;
    --surface-2: #1c2436;
    --surface-3: #262f45;
    --overlay: rgba(5, 8, 14, .7);
    --text: #eaeefa;
    --text-2: #a8b3cb;
    --text-3: #75819b;
    --line: #26304a;
    --line-strong: #364160;
    --accent-soft: rgba(90, 143, 255, .18);
    --success-soft: rgba(18, 153, 106, .18);
    --warning-soft: rgba(217, 137, 26, .18);
    --danger-soft: rgba(216, 69, 60, .18);
    --info-soft: rgba(126, 112, 235, .2);
    --sh-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --sh-md: 0 10px 28px rgba(0, 0, 0, .42);
    --sh-lg: 0 22px 54px rgba(0, 0, 0, .5);
    --sh-xl: 0 34px 90px rgba(0, 0, 0, .6);
  }
}

/* =============================================================================
   Сброс
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* scroll-behavior: smooth здесь НЕ ставим. Из-за него любое возвращение
     страницы на прежнее место (закрыли карточку товара, вышли из категории)
     проигрывалось анимацией — со стороны это выглядело как «страница уехала
     вверх и медленно поехала обратно». Плавная прокрутка нужна точечно
     (например, лента миниатюр в карточке товара) и задаётся там явно. */
  scroll-behavior: auto;
  /* Полностью убираем масштабирование на телефоне: пинч и двойной тап по
     тексту/картинке больше не зумят страницу (в паре с viewport-мета
     maximum-scale=1,user-scalable=no — часть браузеров учитывает и то, и то). */
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.22; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Скроллбар — тонкий, в цвете темы */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   Утилиты
   ========================================================================== */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.strong { font-weight: 700; }

/* =============================================================================
   Кнопки
   ========================================================================== */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform var(--fast), background var(--fast), box-shadow var(--fast), opacity var(--fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg, .btn i { flex: none; }

.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-contrast); box-shadow: 0 6px 18px -6px var(--accent); }
.btn-primary:hover { --btn-bg: var(--accent-hover); }

.btn-ghost { --btn-bg: transparent; --btn-bd: var(--line); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }

.btn-soft { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); }

.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn-danger-soft { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; }
.btn-whatsapp { --btn-bg: var(--whatsapp); --btn-fg: #06280f; }

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; min-height: 42px; padding: 0; border-radius: var(--r-sm); }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }

/* =============================================================================
   Формы
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label,
.label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  letter-spacing: .01em;
}
.hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.error-text { font-size: 12px; color: var(--danger); font-weight: 600; }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
  appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.is-error, .select.is-error, .textarea.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b879d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group > .input { padding-left: 40px; }
.input-group > .input-icon {
  position: absolute; left: 13px; display: grid; place-items: center;
  color: var(--text-3); pointer-events: none;
}
.input-suffix {
  position: absolute; right: 12px; font-size: 13px; font-weight: 650; color: var(--text-3);
}

/* Переключатель */
.switch { position: relative; display: inline-flex; flex: none; width: 46px; height: 27px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: var(--r-full);
  background: var(--surface-3); transition: background var(--normal);
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-xs);
  transition: transform var(--normal);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid transparent;
  transition: border-color var(--fast);
}
.switch-row:hover { border-color: var(--line); }
.switch-row-title { font-weight: 640; font-size: 14px; }
.switch-row-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }

/* Чекбокс */
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.checkbox input { appearance: none; width: 19px; height: 19px; flex: none;
  border: 1.6px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  transition: all var(--fast); position: relative; cursor: pointer; }
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Сегментированный переключатель */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.segmented button {
  padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 620;
  color: var(--text-2); transition: all var(--fast); white-space: nowrap;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }

/* =============================================================================
   Карточки и панели
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 11px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 650; white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 750;
}

/* =============================================================================
   Скелетоны — вместо спиннеров: страница сразу выглядит «как настоящая»
   ========================================================================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  animation: skeleton-sweep 1.4s infinite;
}
:root[data-theme="dark"] .skeleton::after,
:root:not([data-theme="light"]) .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes skeleton-sweep { 100% { transform: translateX(100%); } }

.skeleton-text { height: 12px; border-radius: 6px; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }

/* =============================================================================
   Модальные окна
   ========================================================================== */
.modal {
  position: fixed; inset: 0; z-index: 400;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--normal);
}
.modal.is-open { display: flex; }
.modal.is-visible { opacity: 1; }

.modal-panel {
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  overflow: hidden;
  transform: translateY(14px) scale(.985);
  transition: transform var(--normal);
}
.modal.is-visible .modal-panel { transform: none; }
.modal-panel.wide { width: min(940px, 100%); }
.modal-panel.narrow { width: min(460px, 100%); }

.modal-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-subtitle { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.modal-body { padding: 20px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; flex: 1 1 auto; max-width: 100%; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.modal-close {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-3);
  background: var(--surface-2); transition: all var(--fast); flex: none;
}
.modal-close:hover { color: var(--text); background: var(--surface-3); }

/* Нижний лист на телефоне */
@media (max-width: 720px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel {
    width: 100%;
    max-height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    transform: translateY(100%);
    transition: transform var(--slow);
  }
  .modal.is-visible .modal-panel { transform: none; }
  .modal-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

.sheet-grip {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--line-strong); margin: 9px auto 0; flex: none;
  display: none;
}
@media (max-width: 720px) { .sheet-grip { display: block; } }

body.scroll-locked { overflow: hidden; position: fixed; width: 100%; }

/* На телефоне страница под модалкой не «замораживается» (иначе при закрытии
   она прыгает вверх и обратно — см. lockScroll в catalog.js), поэтому
   прокрутку фона отсекаем жестами: тач по затемнению не прокручивает ничего,
   а внутри самой панели прокрутка работает как обычно. */
@media (max-width: 720px) {
  .modal, .cart-drawer { touch-action: none; }
  .modal-panel, .cart-panel { touch-action: auto; }
}

/* =============================================================================
   Всплывающие уведомления
   ========================================================================== */
.toast-host {
  position: fixed; z-index: 600;
  left: 50%; transform: translateX(-50%);
  /* Сверху, а не снизу: внизу уведомления перекрывали нижнюю панель
     (навигацию каталога, закреплённую панель действий админки). */
  top: max(16px, env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  font-size: 14px; font-weight: 550;
  pointer-events: auto;
  animation: toast-in .3s var(--ease);
}
.toast.out { animation: toast-out .22s var(--ease) forwards; }
.toast-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.toast-success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-info .toast-icon { background: var(--accent-soft); color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* =============================================================================
   Пустые состояния
   ========================================================================== */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 52px 20px; text-align: center; color: var(--text-3);
}
.empty-icon {
  width: 58px; height: 58px; border-radius: var(--r-lg);
  display: grid; place-items: center; background: var(--surface-2);
  color: var(--text-3); margin-bottom: 4px;
}
.empty-title { font-size: 16px; font-weight: 650; color: var(--text-2); }
.empty-text { font-size: 13.5px; max-width: 340px; line-height: 1.55; }

/* =============================================================================
   Таблицы
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.table { font-size: 14px; }
.table th {
  text-align: left; padding: 11px 14px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-2); }

/* =============================================================================
   Загрузка
   ========================================================================== */
.spinner {
  width: 20px; height: 20px; flex: none;
  border: 2.2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Крутилка поверх ещё не загрузившейся картинки. Ставится в контейнер рядом
   с <img> — видна, пока у картинки нет класса .loaded. */
.img-wrap { display: contents; }
.img-spinner {
  position: absolute; inset: 0; z-index: 3;   /* поверх самой картинки и заглушки */
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.img-spinner .spinner { width: 22px; height: 22px; border-width: 2.4px; }
:is(.product-media, .category-media, .pv-slide, .cart-item-media, .image-tile, .pv-thumb):has(img:not(.loaded)) .img-spinner {
  display: flex;
}

/* Прогрессивная загрузка: сначала маленькая версия (слегка размыта), потом
   бесшовно подменяется полноразмерной — см. lazyImage() в catalog.js. */
.img-wrap img { transition: opacity var(--normal), filter .45s var(--ease); }
.img-wrap img.is-low { filter: blur(9px); }

.page-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 700;
  background: transparent; pointer-events: none;
}
.page-progress::after {
  content: ""; display: block; height: 100%; width: var(--progress, 0%);
  background: var(--accent); transition: width .2s var(--ease);
  box-shadow: 0 0 8px var(--accent);
}
