/* ============================================================================
   Общие токены и компоненты витрины ТехноМост (DNS/shop.kz-стиль).
   Подключается на index.html и product.html; admin.html использует только токены.
   ========================================================================== */
:root {
  --bg: #f4f5f7;
  --panel: #fff;
  --line: #e6e8ec;
  --txt: #15171b;
  --muted: #697077;
  --accent: #ff6a00;
  --accent-h: #e55f00;
  --ok: #17a34a;
  --wb: #8b5cf6;
  --bad: #dc2626;
  --hdr: #101317;
  --hdr-bar: #101317;                   /* капсула шапки: тёмная в обеих темах */
  --r: 14px;
  --shadow: 0 1px 3px rgba(16, 22, 26, .08);
  /* тематизируемые токены (light) */
  --photo: #fff;                       /* подложка фото товаров — ВСЕГДА белая */
  --input-bg: #fff;
  --hover-accent: rgba(255, 106, 0, .06);
  --pill-act-bg: #fff;                 /* активная пилюля в тёмной шапке */
  --pill-act-tx: var(--hdr);
  --skel-a: #e9ebef;                   /* skeleton-градиенты */
  --skel-b: #f6f7f9;
  /* Производные оттенки панелей: тонкая линия внутри панели, утопленная
     подложка вложенного блока и две ступени текста между --txt и --muted. */
  --line-soft: #eff1f4;
  --sub-wash: #fafbfc;
  --txt-strong: #000;
  --txt-soft: #3d434a;
}

/* ── Тёмная тема (OLED, чистый чёрный). Переключение: I18N.setTheme() ────── */
:root[data-theme="oled"] {
  --bg: #000;
  --panel: #0c0d0f;
  --line: #26292e;
  --txt: #ececef;
  --muted: #8f979f;
  --hdr: #000;
  --hdr-bar: #16181d;                   /* в OLED приподнимаем над чёрным, иначе капсула сольётся с фоном */
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  --photo: #fff;                       /* фото товаров на белом — в обеих темах */
  --input-bg: #131418;
  --hover-accent: rgba(255, 106, 0, .12);
  --pill-act-bg: var(--panel);
  --pill-act-tx: var(--txt);
  --skel-a: #17181b;
  --skel-b: #222327;
  --line-soft: #1c1f23;
  --sub-wash: #08090b;
  --txt-strong: #fff;
  --txt-soft: #c9ced4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ── Шапка: плавающая скруглённая капсула (в стиле сегментированного
   переключателя языка). Полоса под капсулой = фон страницы, поэтому при
   скролле капсула «плывёт» над контентом. ─────────────────────────────── */
.tm-header {
  background: var(--bg);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  padding: 10px 12px;                    /* воздух вокруг капсулы */
}
.tm-header .tm-wrap {
  max-width: 1360px; margin: 0 auto; padding: 0 12px 0 18px;
  display: flex; align-items: center; gap: 14px; height: 54px;
  background: var(--hdr-bar);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .20);
}
.tm-logo { font-size: 20px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.tm-logo b { color: var(--accent); }
/* ── Поиск в шапке: поле + саджест ──────────────────────────────────────── */
.tm-search {
  flex: 1; min-width: 0; display: flex; align-items: stretch; position: relative; max-width: 1000px;
  background: var(--input-bg); border: 1.5px solid transparent; border-radius: 12px;
  transition: border-color var(--dur-base, .15s) ease, box-shadow var(--dur-base, .15s) ease;
}
/* Без overflow:hidden — иначе обрезался бы абсолютный саджест под полем.
   Скругление держат крайние дети: слева фон поля, справа кнопка «Найти». */
.tm-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .35); }
.tm-search-ic {
  display: flex; align-items: center; padding-left: 14px; color: var(--muted); flex: 0 0 auto;
}
.tm-search-ic svg { width: 17px; height: 17px; display: block; }
.tm-search input {
  flex: 1; min-width: 0; height: 42px; border: none; border-radius: 0;
  padding: 0 12px; font-size: 15px; outline: none;
  background: transparent; color: var(--txt);
}
.tm-search-x {
  width: 38px; border: none; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; flex: 0 0 auto; padding: 0;
}
.tm-search-x:hover { color: var(--accent); }
/* Пустое поле — крестика нет (без JS-синхронизации значения) */
.tm-search input:placeholder-shown ~ .tm-search-x { display: none; }
.tm-search button[type="submit"] {
  height: auto; padding: 0 26px; border: none; border-radius: 0 10px 10px 0;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; flex: 0 0 auto;
}
.tm-search button[type="submit"]:hover { background: var(--accent-h); }
.tm-search button[type="submit"]:active { transform: scale(.97); }

/* Затемнение страницы, пока открыт саджест (фокус на поиске) */
.tm-sugg-veil {
  position: fixed; inset: 0; z-index: 45; background: var(--bg);
  opacity: .65; pointer-events: none; animation: tmVeilIn .18s ease both;
}
/* Своя кейфрейма (не tmFadeIn): нужен финал .65, а не 1 — иначе с fill-mode
   both затемнение схлопывало бы страницу в сплошной фон. */
@keyframes tmVeilIn { from { opacity: 0; } to { opacity: .65; } }
/* Панель подсказок: слева список, справа товары по запросу */
.tm-sugg {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-pop, 0 18px 50px rgba(0, 0, 0, .3));
  display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  animation: tmDropIn .18s ease both; text-align: left;
}
/* minmax(0,…), а не 1fr: иначе трек не сжимается ниже min-content длинных
   подсказок и панель вылезает за экран на мобиле. */
.tm-sugg.with-recs { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); }
.tm-sugg .sg-list { padding: 12px 0 14px; min-width: 0; max-height: 60vh; overflow-y: auto; }
.tm-sugg.with-recs .sg-list { border-right: 1px solid var(--line); }
.sg-all {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px 12px;
  color: var(--accent); font-size: 14.5px; font-weight: 700;
}
.sg-all:hover { background: var(--hover-accent); color: var(--accent); }
.sg-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 4px 18px 8px;
}
.sg-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px;
  color: var(--txt); background: transparent;
}
.sg-row.act { background: var(--hover-accent); }
.sg-ic {
  width: 22px; flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
}
.sg-ic svg { width: 15px; height: 15px; display: block; }
.sg-thumb {
  width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--photo);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sg-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sg-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-lbl {
  font-size: 15px; line-height: 1.3; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-lbl b { font-weight: 700; color: var(--txt-strong, var(--txt)); }
.sg-lbl .sg-hit { font-weight: 400; color: var(--muted); }   /* то, что уже набрано */
.sg-sub { font-size: 12.5px; color: var(--accent); }
/* Правая колонка: товары по запросу */
.sg-recs { padding: 16px 18px 18px; min-width: 0; background: var(--sub-wash); }
.sg-recs-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.sg-recs-h {
  font-size: 15px; font-weight: 800; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-recs-top a { font-size: 13px; font-weight: 600; color: var(--accent); flex: 0 0 auto; }
.sg-recs-top a:hover { color: var(--accent-h); }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.sg-p {
  display: flex; flex-direction: column; gap: 6px; color: var(--txt); min-width: 0;
  border: 1px solid transparent; border-radius: 12px; padding: 8px;
}
.sg-p:hover { border-color: var(--line); background: var(--panel); }
.sg-p-photo {
  background: var(--photo); border-radius: 8px; height: 104px; padding: 8px;
  display: flex; align-items: center; justify-content: center;
}
.sg-p-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sg-p-price { font-size: 15px; font-weight: 800; color: var(--txt); }
.sg-p-alt { font-size: 12px; color: var(--muted); }
.sg-p-name {
  font-size: 12.5px; line-height: 1.35; color: var(--txt);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sg-p-rate { font-size: 12px; color: var(--muted); }
.sg-p-rate .st { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .tm-sugg, .tm-sugg-veil { animation: none; }
  .tm-search { transition: none; }
}
.tm-cur { display: flex; background: rgba(255,255,255,.1); border-radius: 10px; padding: 3px; }
.tm-cur button {
  border: none; background: transparent; color: #cbd2d9;
  padding: 5px 12px; border-radius: 8px; font-weight: 700;
}
.tm-cur button.act { background: var(--pill-act-bg); color: var(--pill-act-tx); }
.tm-cart-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); color: #fff; border: none;
  padding: 9px 16px; border-radius: 10px; font-weight: 600;
}
.tm-cart-btn:hover { background: rgba(255,255,255,.18); }
/* Тумблер темы: круглая компакт-кнопка в тёмной шапке (🌙 в light / ☀️ в oled) */
.tm-theme-btn {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1); color: #fff; font-size: 17px; line-height: 1;
  transition: background .15s, transform .1s ease;
}
.tm-theme-btn:hover { background: rgba(255,255,255,.18); }
.tm-theme-btn:active { transform: scale(.94); }
/* Волна переключения темы: гасим дефолтный кроссфейд View Transitions, оставляем
   только круговой reveal (clip-path новой темы анимируется в shop.js). */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 0; }
::view-transition-new(root) { z-index: 1; }
.tm-cart-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; padding: 0 5px;
}

/* ── Контейнер ─────────────────────────────────────────────────────────── */
.tm-page { max-width: 1360px; margin: 0 auto; padding: 20px; }

/* ── Панели/карточки ───────────────────────────────────────────────────── */
.tm-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}

/* ── Бейджи наличия ────────────────────────────────────────────────────── */
.tm-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 3px 9px;
}
.tm-badge.ok  { color: var(--ok);   background: rgba(23,163,74,.1); }
.tm-badge.wb  { color: var(--wb);   background: rgba(139,92,246,.12); }
.tm-badge.pre { color: var(--muted); background: rgba(105,112,119,.12); }

/* ── Кнопки ────────────────────────────────────────────────────────────── */
.tm-btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-weight: 700; transition: background .15s;
}
.tm-btn.primary { background: var(--accent); color: #fff; }
.tm-btn.primary:hover { background: var(--accent-h); }
.tm-btn.ghost {
  background: transparent; border: 1.5px solid var(--line); color: var(--txt);
}
.tm-btn.ghost:hover { border-color: var(--muted); }
.tm-btn:disabled { opacity: .5; cursor: default; }

/* ── Инпуты ────────────────────────────────────────────────────────────── */
.tm-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; outline: none;
  background: var(--input-bg); color: var(--txt);
}
.tm-input:focus { border-color: var(--accent); }
label.tm-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }

/* ── Корзина (drawer) ──────────────────────────────────────────────────── */
.tm-drawer-veil {
  position: fixed; inset: 0; background: rgba(16,19,23,.45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tm-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 95vw;
  height: 100vh; background: var(--panel); z-index: 91; display: flex;
  flex-direction: column; transition: right .25s; box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
body.tm-drawer-open .tm-drawer { right: 0; }
body.tm-drawer-open .tm-drawer-veil { opacity: 1; pointer-events: auto; }
.tm-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 17px;
}
.tm-drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.tm-drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.tm-x { border: none; background: none; font-size: 22px; color: var(--muted); }
.tm-cart-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tm-cart-row img { width: 56px; height: 56px; object-fit: contain; background: var(--photo); border: 1px solid var(--line); border-radius: 8px; }
.tm-cart-row .nm { font-size: 13.5px; font-weight: 600; }
.tm-cart-row .pr { font-weight: 800; margin-top: 4px; }
.tm-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; }
/* color обязателен: <button> НЕ наследует цвет текста — без него UA-дефолт
   (чёрный) сливается с фоном в OLED-теме */
.tm-qty button {
  border: none; background: none; width: 28px; height: 28px; font-size: 16px;
  color: var(--txt); font-weight: 700; cursor: pointer; border-radius: 6px;
}
.tm-qty button:hover { color: var(--accent); background: rgba(255, 106, 0, .08); }
.tm-qty span { min-width: 26px; text-align: center; font-weight: 700; }

/* ── Модалка чекаута ───────────────────────────────────────────────────── */
.tm-modal-veil {
  position: fixed; inset: 0; background: rgba(16,19,23,.5); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
body.tm-modal-open .tm-modal-veil { display: flex; }
.tm-modal {
  background: var(--panel); border-radius: 16px; width: 440px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 24px;
}
.tm-modal h3 { margin: 0 0 6px; font-size: 19px; }

/* ── Утилиты ───────────────────────────────────────────────────────────── */
.tm-muted { color: var(--muted); }
.tm-price { font-weight: 800; }
.tm-price-old { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: .85em; margin-left: 8px; }
.tm-empty { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 760px) {
  .tm-header .tm-wrap { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 10px; }
  .tm-search { order: 3; flex-basis: 100%; }
}

/* ════════════════════════════════════════════════════════════════════════
   FX-ядро: техно-галочки и «расплыв» от точки нажатия (ripple)
   Применение: чекбокс — разметка .tm-check (см. shop.js TM.checkHTML);
   расплыв — класс .fx на любом кликабельном (кнопки, карточки, плитки).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Техно-чекбокс: прорисовка галочки + пульс-свечение ─────────────────── */
.tm-check {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; font-size: 14px;
}
.tm-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.tm-check .box {
  width: 19px; height: 19px; flex: 0 0 auto;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--input-bg);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.tm-check:hover .box { border-color: var(--accent); }
.tm-check input:focus-visible + .box {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.tm-check .box svg { width: 12px; height: 12px; display: block; }
.tm-check .box .tick {
  fill: none; stroke: #fff; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 20; stroke-dashoffset: 20;
}
.tm-check input:checked + .box {
  background: var(--accent); border-color: var(--accent);
  animation: tmCheckPulse .45s ease;
}
.tm-check input:checked + .box .tick {
  animation: tmTickDraw .28s ease .05s forwards;
}
@keyframes tmTickDraw { to { stroke-dashoffset: 0; } }
@keyframes tmCheckPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 106, 0, .35); }
  100% { box-shadow: 0 0 0 9px rgba(255, 106, 0, 0); }
}
.tm-check .n { color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* ── Переключатель (iOS-style) — модификатор .tm-switch поверх .tm-check ──
   Та же разметка/семантика чекбокса, просто другой визуал: подпись слева,
   тумблер справа (для булевых фильтров вроде «В наличии», как на ВБ). */
.tm-check.tm-switch { flex-direction: row-reverse; justify-content: space-between; width: 100%; }
.tm-check.tm-switch .box {
  width: 40px; height: 24px; border-radius: 999px; flex: 0 0 auto;
  border: none; background: var(--line); position: relative;
  transition: background .18s ease;
}
.tm-check.tm-switch .box svg { display: none; } /* галочка не нужна — это тумблер */
.tm-check.tm-switch .box::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.tm-check.tm-switch input:checked + .box { background: var(--accent); animation: none; }
.tm-check.tm-switch input:checked + .box::after { transform: translateX(16px); }

/* Утилита: заблокировать скролл фона под полноэкранным оверлеем (мобильные фильтры и т.п.) */
.tm-noscroll { overflow: hidden; }

/* ── Расплыв от точки нажатия (ripple) ──────────────────────────────────── */
.fx { position: relative; overflow: hidden; }
.fx-r {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle,
    rgba(255, 106, 0, .28) 0%, rgba(255, 106, 0, .16) 45%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: tmRipple .55s ease-out forwards;
  z-index: 1;
}
.fx-r.light {
  background: radial-gradient(circle,
    rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .2) 45%, transparent 70%);
}
@keyframes tmRipple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
/* лёгкое «нажатие» плитки */
.fx:active { transform: scale(.988); }
.fx, .fx:active { transition: transform .12s ease; }

@media (prefers-reduced-motion: reduce) {
  .tm-check .box, .tm-check input:checked + .box { animation: none; transition: none; }
  .tm-check input:checked + .box .tick { animation: none; stroke-dashoffset: 0; }
  .fx-r { animation: none; display: none; }
  .fx:active { transform: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   Дизайн-ядро v2: анимации, скелетоны, тосты, вход по коду, меню юзера
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes tmFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tmShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes tmPop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes tmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tmModalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes tmDropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── Появление блоков при скролле: .reveal → .reveal.in (JS: TM.revealInit) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── Скелетоны загрузки ────────────────────────────────────────────────── */
.skel {
  border-radius: 8px; color: transparent !important; pointer-events: none;
  background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 45%, var(--skel-a) 65%);
  background-size: 200% 100%;
  animation: tmShimmer 1.3s linear infinite;
}
.skel-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px; min-height: 330px;
}
.skel-card::before {
  content: ""; display: block; height: 170px; border-radius: 8px;
  background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 45%, var(--skel-a) 65%);
  background-size: 200% 100%;
  animation: tmShimmer 1.3s linear infinite;
}
.skel-card::after {
  content: ""; display: block; margin-top: 14px; height: 100px; border-radius: 6px;
  background:
    linear-gradient(var(--skel-a), var(--skel-a)) 0 0    / 92% 13px no-repeat,
    linear-gradient(var(--skel-a), var(--skel-a)) 0 22px / 65% 13px no-repeat,
    linear-gradient(var(--skel-a), var(--skel-a)) 0 52px / 40% 19px no-repeat,
    linear-gradient(var(--skel-a), var(--skel-a)) 0 84px / 100% 16px no-repeat;
}

/* ── Тост ──────────────────────────────────────────────────────────────── */
.tm-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 300;
  transform: translate(-50%, 14px);
  background: #1d2126; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; max-width: min(90vw, 480px); text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.tm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Модалка: появление (scale .96→1 + fade) ───────────────────────────── */
body.tm-modal-open .tm-modal-veil { animation: tmFadeIn .18s ease both; }
body.tm-modal-open .tm-modal { animation: tmModalIn .22s ease both; }

/* ── Кнопки: нажатие + focus-кольцо акцента ────────────────────────────── */
.tm-btn { transition: background .15s, transform .1s ease, box-shadow .15s; }
.tm-cart-btn, .tm-user-btn { transition: background .15s, transform .1s ease; }
.tm-btn:active:not(:disabled), .tm-cart-btn:active, .tm-user-btn:active { transform: scale(.97); }
button:focus-visible, .tm-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, .35);
}

/* ── Кнопка юзера в шапке + выпадашка ──────────────────────────────────── */
.tm-user-wrap { position: relative; }
.tm-user-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .1); color: #fff; border: none;
  padding: 9px 14px; border-radius: 10px; font-weight: 600; white-space: nowrap;
}
.tm-user-btn:hover { background: rgba(255, 255, 255, .18); }
.tm-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tm-user-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px;
  background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(16, 22, 26, .2); padding: 6px; z-index: 95;
}
.tm-user-menu.open { display: block; animation: tmDropIn .16s ease both; }
.tm-user-menu a, .tm-user-menu button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--txt);
}
.tm-user-menu a:hover, .tm-user-menu button:hover { background: var(--hover-accent); color: var(--accent); }

/* ── Модалка входа: телефон + 4 ячейки кода + таймер повтора ───────────── */
.tm-auth-tabs { display: flex; gap: 6px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 2px 0 14px; }
.tm-auth-tab {
  flex: 1; border: none; background: none; cursor: pointer; border-radius: 9px;
  padding: 9px 8px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s;
}
.tm-auth-tab.active { background: var(--panel); color: var(--txt); box-shadow: 0 1px 4px rgba(16, 22, 26, .12); }
.tm-auth-sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 6px; }
/* Крутилка «отправляем» на кнопке — цвет наследует текст кнопки (белый на primary,
   тёмный на ghost). */
.tm-spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .85;
  border-radius: 50%; animation: tmSpin .7s linear infinite;
}
@keyframes tmSpin { to { transform: rotate(360deg); } }
/* Секундомер-кольцо у «Отправить ещё раз» — плавно стекает за время кулдауна
   (transition на stroke-dashoffset, длительность = секундам ожидания). */
.tm-stopwatch { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.tm-stopwatch svg { transform: rotate(-90deg); }
.tm-stopwatch .sw-bg { fill: none; stroke: var(--line); stroke-width: 3; }
.tm-stopwatch .sw-fg {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 97.4; stroke-dashoffset: 0;
}
.tm-auth-phone { font-size: 19px; font-weight: 700; letter-spacing: .3px; padding: 13px 14px; }
.code-cells { display: flex; gap: 10px; justify-content: center; margin: 16px 0 4px; }
.code-cells input {
  width: 58px; height: 66px; text-align: center;
  font-size: 28px; font-weight: 700;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  background: var(--input-bg); color: var(--txt);
  transition: border-color .15s, box-shadow .15s;
}
.code-cells input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .18); }
.code-cells input:disabled { opacity: .55; }
.tm-auth-err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
.tm-auth-dev { color: var(--muted); font-size: 12px; margin-top: 6px; }
.tm-auth-bot { margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px; background: rgba(38, 160, 218, .1); border: 1px solid rgba(38, 160, 218, .3); }
.tm-auth-bot-txt { font-size: 13px; color: var(--txt); line-height: 1.45; }
.tm-auth-botlink {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 13.5px; font-weight: 600; color: #26a0da; text-decoration: none;
}
.tm-auth-botlink:hover { text-decoration: underline; }

/* ── Футер (плитка снизу) ─────────────────────────────────────────────────── */
.tm-footer { margin-top: 48px; background: var(--panel); border-top: 1px solid var(--line); }
.tm-foot-wrap { max-width: 1360px; margin: 0 auto; padding: 40px 20px 20px; }
.tm-foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.tm-foot-col h4 { margin: 0 0 16px; font-size: 16px; font-weight: 800; color: var(--txt); }
.tm-foot-col a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 5px 0; line-height: 1.35; }
.tm-foot-col a:hover { color: var(--accent); }
.tm-foot-sub { margin-top: 16px; }
.tm-foot-sub-t { font-size: 13.5px; font-weight: 700; color: var(--txt); margin-bottom: 8px; }
.tm-foot-subf { display: flex; gap: 8px; }
.tm-foot-subf input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--input-bg, var(--bg)); color: var(--txt); font-size: 13.5px;
}
.tm-foot-subf .tm-btn { flex: 0 0 auto; padding: 9px 16px; }
.tm-foot-sub-msg { font-size: 12.5px; color: var(--muted); min-height: 16px; margin-top: 6px; }
.tm-foot-soc { display: flex; gap: 10px; margin-top: 16px; }
.tm-foot-soc a {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--txt); text-decoration: none; font-weight: 700; font-size: 15px;
}
.tm-foot-soc a:hover { border-color: var(--accent); color: var(--accent); }
.tm-foot-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.tm-foot-bl a { color: var(--muted); text-decoration: none; }
.tm-foot-bl a:hover { color: var(--accent); }
@media (max-width: 860px) { .tm-foot-cols { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (max-width: 480px) { .tm-foot-cols { grid-template-columns: 1fr; } .tm-foot-bottom { flex-direction: column; align-items: flex-start; } }
.tm-auth-resend {
  border: none; background: none; color: var(--accent); font-weight: 700; font-size: 14px;
  padding: 4px 8px; border-radius: 8px;
}
.tm-auth-resend:hover:not(:disabled) { text-decoration: underline; }
.tm-auth-resend:disabled { color: var(--muted); cursor: default; font-weight: 600; }

/* ── «Улетающая точка» в корзину + пульс бейджа ────────────────────────── */
.tm-fly-dot {
  position: fixed; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 106, 0, .25);
  z-index: 310; pointer-events: none;
  transition: transform .55s cubic-bezier(.5, .05, .7, 1), opacity .55s ease;
}
.tm-cart-badge.pop { animation: tmPop .35s ease; }

/* ── prefers-reduced-motion: отключаем/упрощаем движение ───────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .skel, .skel-card::before { animation: none; }
  body.tm-modal-open .tm-modal, body.tm-modal-open .tm-modal-veil { animation: none; }
  .tm-user-menu.open { animation: none; }
  .tm-cart-badge.pop { animation: none; }
  .tm-toast { transition: opacity .01s linear; transform: translate(-50%, 0); }
  .tm-fly-dot { display: none; }
  .tm-drawer, .tm-drawer-veil { transition: none; }
  .tm-btn, .tm-cart-btn, .tm-user-btn, .code-cells input { transition: none; }
  .tm-btn:active:not(:disabled), .tm-cart-btn:active, .tm-user-btn:active { transform: none; }
  .tm-check.tm-switch .box, .tm-check.tm-switch .box::after { transition: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   ❤ Желаемое / ⚖ Сравнение: компактные кнопки (карточки + buy-box) и
   плавающий бар сравнения снизу. Всё на тема-токенах → живёт в light и OLED.
   Разметка — TM.heartHTML / TM.cmpBtnHTML; бар — TM.renderCmpBar (shop.js).
   ═══════════════════════════════════════════════════════════════════════ */
.tm-heart, .tm-cmp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 10px; padding: 7px 11px; font-weight: 700; font-size: 12.5px;
  line-height: 1; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s, transform .1s ease;
}
.tm-heart:hover, .tm-cmp-btn:hover { border-color: var(--accent); color: var(--accent); }
.tm-heart:active, .tm-cmp-btn:active { transform: scale(.96); }
.tm-heart svg, .tm-cmp-btn svg { width: 16px; height: 16px; flex: 0 0 auto; display: block; }
.tm-heart .hs, .tm-cmp-btn .cs {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round;
  transition: fill .15s ease;
}
/* Активно (в желаемом / в сравнении) — акцент + мягкая заливка иконки */
.tm-heart.is-on, .tm-cmp-btn.is-on {
  color: var(--accent); border-color: var(--accent); background: var(--hover-accent);
}
.tm-heart.is-on .hs, .tm-cmp-btn.is-on .cs { fill: currentColor; }

/* ── Иконочный вариант ❤ (только значок, без подписи «В желаемое») ───────── */
.tm-heart--icon { padding: 8px; width: 38px; height: 38px; gap: 0; flex: 0 0 auto; }
.tm-heart--icon svg { width: 18px; height: 18px; }

/* ── Плавающий бар сравнения ────────────────────────────────────────────── */
.tm-cmp-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(16, 22, 26, .16);
  transform: translateY(105%); transition: transform .28s ease;
}
.tm-cmp-bar.show { transform: none; }
.tm-cmp-in {
  max-width: 1360px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
}
.tm-cmp-thumbs {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  overflow-x: auto; padding: 3px 2px; scrollbar-width: thin;
}
.tm-cmp-thumb {
  position: relative; width: 48px; height: 48px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--photo);
  display: flex; align-items: center; justify-content: center;
}
.tm-cmp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tm-cmp-ph { font-size: 22px; line-height: 1; }
.tm-cmp-thumb .x {
  position: absolute; top: 1px; right: 1px; width: 16px; height: 16px;
  border: none; border-radius: 50%; background: rgba(16, 19, 23, .62); color: #fff;
  font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.tm-cmp-thumb .x:hover { background: var(--bad); }
.tm-cmp-bar .tm-btn { flex: 0 0 auto; }
/* Тост не должен прятаться под баром сравнения */
body.tm-cmpbar-open .tm-toast { bottom: 92px; }

@media (max-width: 600px) {
  .tm-cmp-in { padding: 8px 12px; gap: 10px; }
  .tm-cmp-thumb { width: 40px; height: 40px; }
  .tm-cmp-bar .tm-btn { padding: 9px 12px; font-size: 13px; }
  .tm-heart .tm-ib-lbl, .tm-cmp-btn .tm-ib-lbl { display: none; } /* на узких — иконки без подписи */
  .tm-heart, .tm-cmp-btn { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-cmp-bar { transition: none; }
  .tm-heart, .tm-cmp-btn { transition: none; }
  .tm-heart:active, .tm-cmp-btn:active { transform: none; }
  .tm-heart .hs, .tm-cmp-btn .cs, .tm-cmp-thumb .x { transition: none; }
}

/* ── Плавающие иконки контактов (Telegram/WhatsApp/Avito/Kaspi/YouTube) ──── */
.tm-float-contacts {
  position: fixed; right: 20px; bottom: 24px; z-index: 70;
  display: flex; flex-direction: column; gap: 10px;
}
.tm-fc-btn {
  width: 50px; height: 50px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--fc-c, var(--accent)); color: #fff;
  box-shadow: 0 4px 14px rgba(16, 22, 26, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tm-fc-btn svg { width: 24px; height: 24px; flex: 0 0 auto; display: block; }
/* Логотип-картинка (Avito) — крупнее svg-глифов: у app-icon PNG есть свой
   встроенный отступ (safe zone), иначе марка выглядит мельче остальных. */
.tm-fc-btn img { width: 30px; height: 30px; flex: 0 0 auto; display: block; object-fit: contain; border-radius: 6px; }
.tm-fc-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(16, 22, 26, .34); }
.tm-fc-btn:active { transform: scale(.96); }
/* Заглушка (ссылка ещё не заполнена в настройках) — та же иконка, полупрозрачно приглушена */
.tm-fc-btn[data-stub="1"] { opacity: .55; cursor: pointer; }
.tm-fc-btn[data-stub="1"]:hover { opacity: .85; }

@media (max-width: 600px) {
  .tm-float-contacts { right: 12px; bottom: 16px; gap: 8px; }
  .tm-fc-btn { width: 44px; height: 44px; }
  .tm-fc-btn svg { width: 21px; height: 21px; }
  .tm-fc-btn img { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-fc-btn { transition: none; }
  .tm-fc-btn:hover, .tm-fc-btn:active { transform: none; }
}
