/* Страница товара: галерея, характеристики, связь, просмотр на весь экран */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); font-size: var(--fs-sm); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 32px; }

.pdp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.pdp > * { min-width: 0; }
@media (min-width: 900px) { .pdp { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-7); } .pdp__gallery { position: sticky; top: calc(var(--header-h) + 64px); } }

/* ---------- Галерея ---------- */
.viewer { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.viewer__track {
  display: flex; height: 100%; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.viewer__track::-webkit-scrollbar { display: none; }
.viewer__track:focus-visible { outline-offset: -3px; }
.viewer__slide {
  position: relative; flex: 0 0 100%; min-width: 0; height: 100%; padding: 0; border: 0; background: none;
  scroll-snap-align: start; scroll-snap-stop: always; cursor: zoom-in; display: block;
}
.viewer__slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer__slide:focus-visible { outline-offset: -4px; }
.viewer__count {
  position: absolute; left: var(--s-3); bottom: var(--s-3); padding: 3px 11px; border-radius: var(--r-pill);
  background: rgb(15 22 29 / .78); color: #fff; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none;
}
.viewer__hint {
  position: absolute; right: var(--s-3); bottom: var(--s-3); display: none; align-items: center; gap: 6px; padding: 3px 11px;
  border-radius: var(--r-pill); background: rgb(15 22 29 / .78); color: #fff; font-size: var(--fs-xs); pointer-events: none;
}
@media (hover: hover) { .viewer__hint { display: inline-flex; } }
.viewer__nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: none; place-items: center;
  border: 0; border-radius: 50%; background: rgb(255 255 255 / .94); color: var(--steel-900); cursor: pointer; box-shadow: var(--sh-2);
}
.viewer__nav--prev { left: var(--s-3); }
.viewer__nav--next { right: var(--s-3); }
@media (hover: hover) { .viewer__nav { display: grid; } }
.viewer__empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: var(--s-2); color: var(--ink-3); }

.thumbs { list-style: none; margin: var(--s-3) 0 0; padding: 0 0 var(--s-1); display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: thin; }
.thumbs li { flex: none; }
.thumbs__btn { display: block; width: 76px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: var(--r-ctl); overflow: hidden; background: var(--surface-3); cursor: pointer; opacity: .75; transition: opacity .15s, border-color .15s; }
.thumbs__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs__btn:hover { opacity: 1; }
.thumbs__btn.is-active { border-color: var(--accent); opacity: 1; }
@media (min-width: 900px) { .thumbs__btn { width: 88px; } }

/* ---------- Информация ---------- */
.pdp__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); line-height: 1.08; text-wrap: balance; }

.specs { margin: var(--s-4) 0 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.specs > div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.specs > div + div { border-top: 1px solid var(--line); }
.specs dt { color: var(--ink-2); font-size: var(--fs-sm); }
.specs dd { margin: 0; font-weight: 600; }

.pdp__desc { margin-top: var(--s-5); }
.pdp__desc .h4 { margin-bottom: var(--s-2); }
.pdp__desc p { margin: 0; max-width: 62ch; color: var(--ink); }

.pdp__cta { margin-top: var(--s-5); border-left: 4px solid var(--accent); }
.pdp__cta-title { margin: 0 0 var(--s-2); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); line-height: 1.15; }
.pdp__admin { margin-top: var(--s-4); }
.stats-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-3); }
.stats-2 > div { background: var(--surface-2); border-radius: var(--r-ctl); padding: var(--s-3); text-align: center; }
.stats-2 b { display: block; font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1; }
.stats-2 span { color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Похожие ---------- */
.similar { margin-top: var(--s-8); }
.similar .h2 { margin-bottom: var(--s-4); }
@media (max-width: 699px) {
  .similar__row { display: flex; gap: var(--s-3); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: var(--s-3); margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .similar__row::-webkit-scrollbar { display: none; }
  .similar__row .pcard { flex: 0 0 78%; scroll-snap-align: start; }
}

/* ---------- Закреплённая панель на телефоне ---------- */
.buybar { display: none; }
@media (max-width: 899px) {
  .buybar {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    padding: var(--s-2) 16px calc(var(--s-2) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgb(15 22 29 / .12);
  }
  .buybar .btn { width: 100%; }
  .main { padding-bottom: calc(var(--s-8) + 64px); }
}

/* ---------- Просмотр на весь экран ---------- */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0A0F14; color: #fff; overflow: hidden;
}
.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: #0A0F14; }
.lightbox__stage { position: absolute; inset: 0; touch-action: none; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; }
.lightbox__stage.is-zoomed { cursor: grab; }
.lightbox__stage.is-dragging { cursor: grabbing; }
.lightbox__img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none;
  transform-origin: center center; will-change: transform;
}
.lightbox__bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: max(var(--s-3), env(safe-area-inset-top)) max(var(--s-3), env(safe-area-inset-right)) var(--s-3) max(var(--s-4), env(safe-area-inset-left));
  background: linear-gradient(#0A0F14cc, transparent); pointer-events: none;
}
.lightbox__bar > * { pointer-events: auto; }
.lightbox__count { font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--fs-sm); }
.lightbox__tools { display: flex; gap: var(--s-2); }
.lb-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgb(255 255 255 / .14); color: #fff; backdrop-filter: blur(6px);
}
.lb-btn:hover { background: rgb(255 255 255 / .26); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; }
.lb-nav--prev { left: var(--s-3); }
.lb-nav--next { right: var(--s-3); }
@media (hover: none) { .lb-nav { display: none; } }
.lightbox.is-single .lb-nav { display: none; }
