/* =====================================================================
   TOPLOFT · карточка товара (обычный товар и комбо-набор — один шаблон)
   Каркас: галерея слева на всю высоту экрана и прилипает; справа прокручивается информация.
   Токены --tl-* — из tl-chrome.css (лейаут). Наведение меняет только цвет.
   ===================================================================== */

.tl-pc {
  --pc-top: 16px;                                           /* где прилипает галерея (шапка не липкая) */
  --pc-media-h: calc(100dvh - 32px);                        /* высота галереи = экран минус поля сверху и снизу */
  --pc-rail: 64px;                                          /* ширина ленты миниатюр */
  --pc-gap: 40px;
  --pc-radius: 20px;
  --pc-line: #ececec;
  --pc-muted: #767676;
  --pc-soft: #f4f4f5;

  box-sizing: border-box;
  max-width: var(--tl-container);
  margin-inline: auto;
  padding: 24px var(--tl-gutter) 64px;                     /* 24 сверху: крошки теперь внизу, карточка идёт сразу под шапкой */
  font-family: var(--tl-font);
  font-weight: var(--tl-fw);
  color: var(--tl-c-text);
}
.tl-pc *, .tl-pc *::before, .tl-pc *::after { box-sizing: border-box; }
.tl-pc :where(h1, h2, p, dl, dd, figure) { margin: 0; }
.tl-pc :where(a) { color: inherit; text-decoration: none; }
.tl-pc :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tl-pc :where(img) { display: block; max-width: 100%; }
.tl-pc :where(a, button):focus { outline: none; }
.tl-pc :where(a, button):focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }

/* ---------- раскладка: две колонки от 1024 ---------- */
@media (min-width: 1024px) {
  .tl-pc {
    display: grid;
    grid-template-columns: minmax(0, min(calc(var(--pc-media-h) + var(--pc-rail) + 12px), 62%)) minmax(340px, 1fr);
    gap: var(--pc-gap);
    align-items: start;
  }
  .tl-pc__media {
    position: sticky;
    top: var(--pc-top);
    height: var(--pc-media-h);
    min-height: 420px;
  }
}
@media (min-width: 1440px) { .tl-pc { --pc-rail: 80px; --pc-gap: 48px; } }

/* =========================== ГАЛЕРЕЯ =========================== */
.tl-gal { display: flex; gap: 12px; height: 100%; }
.tl-gal__rail {
  display: flex;
  flex: 0 0 var(--pc-rail);
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.tl-gal__rail::-webkit-scrollbar { display: none; }
.tl-gal__thumb {
  flex: 0 0 auto;
  width: var(--pc-rail);
  height: var(--pc-rail);
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--pc-soft);
  transition: border-color .2s;
}
.tl-gal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-gal__thumb:hover { border-color: #c9c9c9; }
.tl-gal__thumb.is-active { border-color: #111; }

.tl-gal__stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--pc-radius);
  background: var(--pc-soft);
  isolation: isolate;
}
.tl-gal__track { position: relative; height: 100%; }
.tl-gal__slide { position: absolute; inset: 0; display: none; cursor: zoom-in; }
.tl-gal__slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
/* кадр грузится: на его месте — миниатюра (уже скачана), поверх — индикатор; чёткий кадр проявляется, когда придёт */
.tl-gal__slide { background: var(--pc-soft) center / cover no-repeat; }
.tl-gal__slide img { transition: opacity .25s ease; }
.tl-gal__slide.is-loading img { opacity: 0; }
.tl-gal__slide.is-loading::after,
.tl-lb.is-loading .tl-lb__stage::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid rgb(255 255 255 / 30%);
  border-top-color: #fff;
  border-radius: 50%;
  background: rgb(0 0 0 / 32%);          /* тёмная подложка — кольцо видно и на белом фото */
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
  animation: tl-spin .8s linear infinite, tl-appear .2s ease .15s both;   /* быстрые загрузки — без мелькания */
}
@keyframes tl-spin { to { transform: rotate(360deg); } }
@keyframes tl-appear { from { opacity: 0; } to { opacity: 1; } }
.tl-gal__slide:first-child { display: block; }                 /* без скрипта виден первый кадр */
.tl-gal.is-ready .tl-gal__slide { display: none; opacity: 0; transition: opacity .35s ease; }
.tl-gal.is-ready .tl-gal__slide.is-near { display: block; }  /* текущий и соседи — чтобы не грузить весь набор */
.tl-gal.is-ready .tl-gal__slide.is-active { opacity: 1; z-index: 1; }

.tl-gal__btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #222;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color .2s;
}
.tl-gal__btn:hover { background: #fff; }
.tl-gal__zoom { top: 14px; right: 14px; }
.tl-gal__arrow { top: 50%; margin-top: -20px; }
.tl-gal__arrow--prev { left: 14px; }
.tl-gal__arrow--next { right: 14px; }
.tl-gal--single .tl-gal__arrow, .tl-gal--single .tl-gal__dots, .tl-gal--single .tl-gal__rail { display: none; }

.tl-gal__dots { position: absolute; inset: auto 0 12px; z-index: 2; display: none; justify-content: center; gap: 6px; }
.tl-gal__dot { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / 60%); box-shadow: 0 0 0 1px rgb(0 0 0 / 8%); transition: background-color .2s, width .2s; }
.tl-gal__dot.is-active { width: 18px; border-radius: 4px; background: #fff; }

/* ---------- тач и узкие экраны: лента кадров листается пальцем ---------- */
@media (max-width: 1023.98px), (hover: none) and (pointer: coarse) {
  .tl-gal__track {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .tl-gal__track::-webkit-scrollbar { display: none; }
  .tl-gal .tl-gal__slide,
  .tl-gal.is-ready .tl-gal__slide { position: relative; display: block; flex: 0 0 100%; opacity: 1; scroll-snap-align: center; }
  .tl-gal__dots { display: flex; }
  .tl-gal__arrow { display: none; }
}

/* ---------- до 1024: галерея сверху, миниатюры под кадром ---------- */
@media (max-width: 1023.98px) {
  .tl-pc__media { margin-bottom: 20px; }
  .tl-gal { flex-direction: column-reverse; height: auto; }
  .tl-gal__stage { aspect-ratio: 1; max-height: 78dvh; }
  .tl-gal__rail { flex: 0 0 auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .tl-gal__thumb { --pc-rail: 64px; }
}
@media (max-width: 767.98px) {
  .tl-pc { padding: 0 var(--tl-gutter-m) 48px; }
  .tl-pc__media { margin-inline: calc(-1 * var(--tl-gutter-m)); }   /* фото в край экрана */
  .tl-gal__stage { border-radius: 0; max-height: none; }
  .tl-gal__rail { padding-inline: var(--tl-gutter-m); gap: 8px; }
  .tl-gal__thumb { --pc-rail: 52px; border-radius: 10px; }
  .tl-gal__zoom { top: 12px; right: 12px; width: 36px; height: 36px; }
}

/* =========================== ИНФОРМАЦИЯ =========================== */
.tl-pc__info { min-width: 0; padding-top: 4px; }
.tl-pc__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tl-pc__badges:empty { display: none; }
.tl-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--tl-fw-bold);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.tl-badge--sale { background: var(--tl-c-accent); color: #111; }
.tl-badge--set { background: #111; color: #fff; }
.tl-pc__sku { font-size: 13px; color: var(--pc-muted); }
.tl-pc__title { margin-top: 6px; font-size: clamp(22px, 1.1rem + 1vw, 32px); font-weight: var(--tl-fw-bold); line-height: 1.2; }

/* варианты: чанк платформы (vz-variants) — оформляем от своего контейнера */
.tl-pc__variants:empty { display: none; }
.tl-pc__variants { margin-top: 18px; }
.tl-pc__variants .vz-axis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tl-pc__variants .vz-axis:has(.vz-opt--swatch) { gap: 10px; }
.tl-pc__variants .vz-axis__name { flex: 0 0 100%; font-size: 13px; font-weight: var(--tl-fw-mid); color: var(--pc-muted); }
.tl-pc__variants .vz-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  font-size: 14px;
  font-weight: var(--tl-fw-mid);
  line-height: 1.2;
  color: #111;
  background: #fff;
  transition: border-color .2s;
}
.tl-pc__variants .vz-opt--text { min-width: 64px; }
/* чип с фото: картинка отстоит от края одинаково сверху, снизу и слева, подпись — 16 справа */
.tl-pc__variants .vz-opt--photo { padding: 5px 16px 5px 5px; border-radius: 14px; }
.tl-pc__variants .vz-opt--photo .vz-opt__swatch { width: 42px; height: 42px; border-radius: 9px; }
/* цвет — крупный квадрат текстуры без подписи (владелец: «только картинка, крупно, 128×128»).
   Название остаётся только для экранных чтецов (aria-label ставит tl-gallery.js). Выбранный — рамка вокруг. */
.tl-pc__variants .vz-opt.vz-opt--swatch {
  position: relative;
  width: min(128px, calc((100% - 3 * 10px) / 4));   /* до 128; четыре цвета всегда в один ряд */
  height: auto;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.tl-pc__variants .vz-opt.vz-opt--swatch .vz-opt__swatch { position: absolute; inset: 0; width: auto; height: auto; border-radius: inherit; }
.tl-pc__variants .vz-opt.vz-opt--swatch .vz-opt__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tl-pc__variants .vz-opt.vz-opt--swatch:hover { box-shadow: 0 0 0 1px #9a9a9a; }
.tl-pc__variants .vz-opt.vz-opt--swatch[vz-state="active"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }

.tl-pc__variants .vz-opt:hover { border-color: #9a9a9a; }
.tl-pc__variants .vz-opt[vz-state="active"] { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
.tl-pc__variants .vz-opt[vz-state="unavailable"] { color: #aaa; border-style: dashed; }
.tl-pc__variants .vz-opt__swatch { display: block; flex: 0 0 auto; background-image: var(--vz-swatch-hd, var(--vz-swatch)); background-size: cover; background-position: center; }   /* hd — ступень 320 */

.tl-pc__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 18px; }
.tl-pc__now { font-size: clamp(28px, 1.4rem + 1vw, 38px); font-weight: 800; line-height: 1.1; }
.tl-pc__old { font-size: 18px; color: #9a9a9a; }

.tl-pc__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; background: var(--pc-soft); }
.tl-chip--hot { background: #fff4e5; color: #a24b00; font-weight: var(--tl-fw-mid); }

/* ---------- покупка ---------- */
.tl-pc__buy { display: flex; gap: 10px; margin-top: 22px; }
.tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: var(--tl-fw-mid);
  transition: background-color .2s, border-color .2s, color .2s;
}
/* кнопка всегда тёмная (как у стандартной карточки): что товар уже в корзине — говорит строка под ней */
.tl-btn--buy { flex: 1 1 auto; min-width: 0; color: #fff; background: #111; }
.tl-btn--buy:hover { background: #2e2e2e; }
.tl-btn--buy[vz-state="adding"], .tl-pc__buy.is-busy .tl-btn--buy { opacity: .7; pointer-events: none; }

/* количество «− 1 +» */
.tl-qty { display: flex; flex: 0 0 auto; align-items: center; height: 52px; border: 1px solid #dcdcdc; border-radius: 14px; background: #fff; }
.tl-qty__btn { display: grid; place-items: center; width: 40px; height: 100%; color: #111; transition: color .2s; }
@media (hover: hover) { .tl-qty__btn:not(:disabled):hover { color: #6b6b6b; } }
.tl-qty__btn:disabled { color: #c8c8c8; cursor: default; }
.tl-qty__input {
  width: 32px;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 16px;          /* 16 — чтобы iPhone не увеличивал страницу при вводе */
  font-weight: var(--tl-fw-mid);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #111;
  background: none;
}

.tl-pc__incart { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; font-size: 13px; color: var(--pc-muted); }
.tl-pc__incart:has([vz-cart-count]:empty) { display: none; }
.tl-pc__incart svg { flex: 0 0 auto; color: #111; }
.tl-pc__incart > span { color: #111; font-weight: var(--tl-fw-mid); }
.tl-pc__incart a { text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.tl-pc__incart a:hover { color: #111; }
.tl-btn--fav, .tl-btn--square { flex: 0 0 52px; width: 52px; padding: 0; border: 1px solid #dcdcdc; background: #fff; }
.tl-btn--fav:hover, .tl-btn--square:hover { border-color: #9a9a9a; }
.tl-fav-on { display: none; }
.tl-btn--fav[vz-state="active"] .tl-fav-off, .tl-btn--fav[vz-state="in"] .tl-fav-off { display: none; }
.tl-btn--fav[vz-state="active"] .tl-fav-on, .tl-btn--fav[vz-state="in"] .tl-fav-on { display: block; }

.tl-pc__consult { display: flex; gap: 10px; margin-top: 10px; }
.tl-btn--ghost { flex: 1 1 auto; border: 1px solid #dcdcdc; background: #fff; }
.tl-btn--ghost:hover { border-color: #9a9a9a; }
.tl-btn--call { background: var(--tl-c-accent); border-color: transparent; }
.tl-btn--call img { width: 24px; height: 24px; }
.tl-btn--call:hover { border-color: #111; }

.tl-pc__promo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(135deg, #2e2e2e, #151515);
}
.tl-pc__promo b { color: var(--tl-c-accent); font-weight: var(--tl-fw-bold); }
.tl-pc__promo-mark {
  display: grid;
  flex: 0 0 52px;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  color: #111;
  background: var(--tl-c-accent);
}

/* ---------- блоки ниже ---------- */
.tl-pc__block { margin-top: 32px; }
.tl-pc__h2 { margin-bottom: 14px; font-size: 20px; font-weight: var(--tl-fw-bold); }

.tl-set__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--pc-line);
  border-radius: 16px;
  transition: border-color .2s;
}
.tl-set__item + .tl-set__item { margin-top: 8px; }
.tl-set__item:hover { border-color: #bdbdbd; }
.tl-set__item img { grid-row: 1 / 3; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--pc-soft); }
.tl-set__name { align-self: end; font-size: 14px; font-weight: var(--tl-fw-mid); line-height: 1.3; }
.tl-set__price { align-self: start; font-size: 14px; }
.tl-set__price b { font-weight: var(--tl-fw-bold); }
.tl-set__price s { margin-left: 6px; color: #9a9a9a; }

.tl-incombo { padding: 16px; border: 2px solid #ff9a1f; border-radius: 20px; background: #fff8ef; }
.tl-incombo__title { color: #b85600; }
.tl-incombo__card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  transition: box-shadow .2s;
}
.tl-incombo__card + .tl-incombo__card { margin-top: 8px; }
.tl-incombo__card:hover { box-shadow: 0 0 0 1px #ffb866; }
.tl-incombo__img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--pc-soft); }
.tl-incombo__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-incombo__name { font-size: 14px; font-weight: var(--tl-fw-mid); line-height: 1.3; }
.tl-incombo__line { font-size: 13px; color: #555; }
.tl-incombo__line b { color: #111; }
.tl-incombo__sum { font-size: 14px; }
.tl-incombo__sum b { font-size: 17px; font-weight: 800; }
.tl-incombo__sum s { margin-left: 4px; color: #9a9a9a; }
.tl-incombo__sum em { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-style: normal; font-weight: var(--tl-fw-mid); color: #a24b00; background: #ffe7c7; }
.tl-incombo__go { margin-top: 2px; font-size: 13px; font-weight: var(--tl-fw-mid); color: #b85600; }

.tl-specs { border-top: 1px solid var(--pc-line); }
.tl-specs__row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--pc-line); font-size: 14px; }
.tl-specs__row dt { color: var(--pc-muted); }
.tl-specs__row dd { font-weight: var(--tl-fw-mid); text-align: right; }

.tl-pc__desc { font-size: 15px; line-height: 1.6; white-space: pre-line; color: #333; }
.tl-pc__desc.is-clamped { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.tl-more { margin-top: 8px; font-size: 14px; font-weight: var(--tl-fw-mid); text-decoration: underline; text-underline-offset: 3px; }
.tl-more[hidden] { display: none; }

.tl-pc__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tl-tag { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #555; background: var(--pc-soft); }

/* =========================== ПРОСМОТРЩИК (на весь экран) =========================== */
.tl-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-columns: auto 1fr;
  font-family: var(--tl-font);
  color: #fff;
  background: #000;
  animation: tl-lb-in .18s ease;
  touch-action: none;
}
@keyframes tl-lb-in { from { opacity: 0; } to { opacity: 1; } }
.tl-lb__rail { display: flex; flex-direction: column; gap: 10px; width: 112px; padding: 72px 16px 16px; overflow-y: auto; scrollbar-width: none; }
.tl-lb__rail::-webkit-scrollbar { display: none; }
.tl-lb__thumb { flex: 0 0 80px; width: 80px; height: 80px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; opacity: .6; transition: opacity .2s, border-color .2s; }
.tl-lb__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-lb__thumb:hover { opacity: .9; }
.tl-lb__thumb.is-active { border-color: #fff; opacity: 1; }
.tl-lb__stage { position: relative; overflow: hidden; cursor: zoom-in; background: center / contain no-repeat; }   /* фон — миниатюра, пока кадр грузится */
.tl-lb__stage.is-zoomed { cursor: grab; }
.tl-lb__stage.is-dragging { cursor: grabbing; }
.tl-lb__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
  will-change: transform;
}
.tl-lb__img.is-anim { transition: transform .2s ease; }
.tl-lb__bar { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 999px; background: rgb(0 0 0 / 55%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }   /* тёмная подложка: счётчик читается и на белом фото */
.tl-lb :where(button):focus { outline: none; }   /* без обводки фокуса — решение владельца; клавиатуре — подсветка фона */
.tl-lb__btn:focus-visible { background: rgb(255 255 255 / 28%); }
.tl-lb__count { min-width: 56px; font-size: 14px; font-variant-numeric: tabular-nums; }
.tl-lb__btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: rgb(255 255 255 / 10%); transition: background-color .2s; }
.tl-lb__btn:hover { background: rgb(255 255 255 / 22%); }
.tl-lb__btn:disabled { opacity: .3; cursor: default; }
.tl-lb__close, .tl-lb__close:focus-visible { background: #fff; color: #111; }
.tl-lb__close:hover { background: #e6e6e6; }
.tl-lb__nav { position: absolute; top: 50%; z-index: 3; margin-top: -24px; width: 48px; height: 48px; }
.tl-lb__nav--prev { left: 128px; }   /* правее рейки миниатюр (112) */
.tl-lb--single .tl-lb__nav--prev { left: 16px; }
.tl-lb__nav--next { right: 16px; }
.tl-lb--single .tl-lb__nav, .tl-lb--single .tl-lb__rail { display: none; }
@media (max-width: 767.98px) {
  .tl-lb { grid-template-columns: 1fr; }
  .tl-lb__nav--prev { left: 16px; }
  .tl-lb__rail { display: none; }
  .tl-lb__nav { display: none; }
  .tl-lb__bar { top: 10px; right: 10px; }
}

