/* ==========================================================================
   Страница товара
   ========================================================================== */
.pd { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: clamp(24px, 4vw, 64px); margin-top: 22px; align-items: start; }

/* ---------- фото с лупой ---------- */
.viewer { border-radius: 34px; padding: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
/* Размытая копия фото заполняет поля по бокам узких и широких снимков. */
.viewer__canvas { position: relative; display: grid; place-items: center; border-radius: 27px; overflow: hidden; isolation: isolate; background: var(--bg-2); }
.viewer__canvas::before { content: ''; position: absolute; inset: -60px; z-index: -1; background: var(--bg) center / cover no-repeat; filter: blur(42px) saturate(1.25); opacity: 0.55; transform: scale(1.1); }
.viewer__stage {
  --maxh: min(76vh, 820px);
  position: relative; width: min(100%, calc(var(--maxh) * var(--r))); aspect-ratio: var(--r); margin-inline: auto;
  border-radius: 22px; overflow: hidden; background: var(--bg-2); cursor: zoom-in; touch-action: pan-y; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}
.viewer__stage > img { width: 100%; height: 100%; object-fit: cover; }
.viewer__stage::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(19, 19, 18, 0.06); pointer-events: none; }
.loupe {
  position: absolute; left: 0; top: 0; z-index: 1; width: 210px; height: 210px; margin: -105px 0 0 -105px; border-radius: 50%; pointer-events: none;
  background-repeat: no-repeat; background-color: var(--bg-2);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px rgba(19, 19, 18, 0.15), 0 30px 60px -12px rgba(0, 0, 0, 0.55);
  opacity: 0; transition: opacity 0.25s var(--ease); will-change: transform;
}
.viewer.is-zooming .loupe { opacity: 1; }
.viewer.no-loupe .viewer__stage { cursor: default; }
.viewer__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 10px 6px 12px; font-size: 14px; color: var(--ink-3); }
.viewer__bar p { display: flex; align-items: center; gap: 10px; }
.viewer__bar .dot { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2.5px var(--ink); }
.loupe-toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.loupe-toggle .switch { width: 42px; height: 24px; }
.loupe-toggle .switch::after { width: 18px; height: 18px; }
.loupe-toggle .switch:checked::after { transform: translateX(18px); }

/* ---------- список дефектов ---------- */
.defects { margin-top: clamp(28px, 3vw, 40px); }
.defects__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.defects__head a { font-size: 14.5px; font-weight: 650; color: var(--ink-2); border-bottom: 1.5px solid var(--line-2); }
.defects__list { display: grid; gap: 10px; list-style: none; padding: 0; }
.dcard {
  display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 18px; align-items: center; width: 100%; padding: 8px 18px 8px 8px; text-align: left;
  border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s var(--ease), transform 0.4s var(--ease), background-color 0.3s;
}
.dcard:hover { box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-1); }
.dcard.is-active { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface-2); }
.dcard__zoom { position: relative; width: 108px; height: 108px; border-radius: 17px; background-color: var(--bg-2); background-repeat: no-repeat; overflow: hidden; }
.dcard__zoom::after { content: ''; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; box-shadow: 0 0 0 2px var(--yellow), 0 0 0 4px rgba(19, 19, 18, 0.55); transition: transform 0.5s var(--ease-spring); }
.dcard:hover .dcard__zoom::after, .dcard.is-active .dcard__zoom::after { transform: scale(1.25); }
.dcard__num { position: absolute; left: 7px; top: 7px; z-index: 1; min-width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: var(--yellow); font: 800 13px/24px var(--f-body); text-align: center; }
.dcard b { display: block; font-weight: 750; font-size: 16.5px; line-height: 1.25; }
.dcard small { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }

/* ---------- инфо-колонка ---------- */
.pd__info { position: sticky; top: calc(var(--nav-h) + 30px); }
.pd__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14.5px; font-weight: 650; color: var(--ink-3); }
.pd__meta a { color: var(--ink); border-bottom: 1.5px solid var(--yellow); }
.pd__title { margin-top: 14px; font: 900 clamp(2.5rem, 4.2vw, 4.1rem)/0.9 var(--f-display); text-transform: uppercase; letter-spacing: -0.005em; text-wrap: balance; }
.pd__variant { margin-top: 12px; color: var(--ink-2); font-size: 16.5px; }
.pd__grade { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pd__grade .grade { font-size: 15px; padding: 9px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pd__grade .grade small { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.pd__grade a { font-size: 14px; font-weight: 600; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.pd__grade a:hover { color: var(--ink); }

.pricebox { position: relative; margin-top: 26px; padding: 6px; border-radius: 30px; background: rgba(19, 19, 18, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.pricebox__core { position: relative; padding: 22px 22px 20px; border-radius: 25px; background: var(--surface); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-1); }
.pricebox__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; min-height: 150px; }
.pricebox__label { font-size: 13px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.pricebox__price { margin-top: 6px; font: 900 clamp(3rem, 4.6vw, 4.2rem)/0.9 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: 0.005em; }
.pricebox__old { margin-top: 10px; font-size: 15px; color: var(--ink-3); }
.pricebox__old s { text-decoration-thickness: 1.5px; }
.save { margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--yellow-soft); font-size: 15px; }
.save__chip { padding: 6px 10px 5px; border-radius: 999px; background: var(--ink); color: var(--yellow); font: 800 17px/1 var(--f-display); letter-spacing: 0.02em; }
.save b { font-weight: 800; font-variant-numeric: tabular-nums; }
.pricebox__hang { position: relative; width: 150px; height: 150px; margin: -44px -6px 0 0; }
.pricebox__hang .hang-wrap { position: absolute; left: 50%; top: 0; margin-left: -75px; width: 150px; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 7px; will-change: transform; }
.pricebox__hang .hang__string { height: 30px; }
.pd-tag { --w: 150px; margin-top: -19px; transform-origin: 50% 19px; }
.pd-tag .tag__paper { padding: 34px 14px 16px; }
.pd-tag__g { display: block; font: 900 2.6rem/0.8 var(--f-display); }
.pd-tag .tag__note { margin-top: 8px; font-size: 1.22rem; }

.compare { margin-top: 20px; display: grid; gap: 10px; }
.compare__row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); }
.compare__row i { display: block; height: 10px; border-radius: 10px; background: #cfcdc5; width: var(--w); transform-origin: left; }
.compare__row--us i { background: var(--yellow); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08); }
.compare__row b { text-align: right; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
html.js .compare i { transform: scaleX(0); transition: transform 1.4s var(--ease) 0.2s; }
html.js .compare__row--us i { transition-delay: 0.45s; }
html.js .compare.is-in i { transform: none; }

.pd__actions { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 8px; }
.pd__fav { width: 56px; height: 56px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.pd__fav .i-on { display: none; }
.pd__fav[aria-pressed='true'] { background: var(--yellow); box-shadow: none; }
.pd__fav[aria-pressed='true'] .i-on { display: block; }
.pd__fav[aria-pressed='true'] .i-off { display: none; }
.pd__add[aria-pressed='true'] { background: var(--ink); color: var(--bg); box-shadow: none; }
.pd__add[aria-pressed='true'] .btn__ico { background: var(--yellow); color: var(--ink); }
.pd__second { margin-top: 8px; }
.pd__one { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-3); line-height: 1.4; }
.pd__one .i { color: var(--ink-2); width: 18px; height: 18px; margin-top: 1px; }

.pd__facts { margin-top: 22px; display: grid; gap: 2px; list-style: none; padding: 0; }
.pd__facts li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; padding: 10px 0; }
.pd__facts .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pd__facts .ico .i { width: 20px; height: 20px; }
.pd__facts b { display: block; font-weight: 700; font-size: 15.5px; }
.pd__facts small { display: block; color: var(--ink-3); font-size: 14px; line-height: 1.35; }
.pd__facts a { text-decoration: underline; text-underline-offset: 3px; }

.sound { --wave-on: var(--yellow); --wave-off: rgba(242, 241, 237, 0.24); margin-top: 18px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 14px; align-items: center; padding: 14px 18px 14px 14px; border-radius: 24px; background: var(--dark); color: var(--on-dark); }
.sound__label { grid-column: 2 / 4; font-size: 12.5px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-2); }
.sound__btn { grid-row: 1 / 3; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); transition: transform 0.4s var(--ease-spring); }
.sound__btn:hover { transform: scale(1.06); }
.sound__btn:active { transform: scale(0.94); }
.sound__btn .i { width: 24px; height: 24px; }
.sound__btn .i-pause { display: none; }
.sound.is-playing .sound__btn .i-pause { display: block; }
.sound.is-playing .sound__btn .i-play { display: none; }
.sound canvas { width: 100%; height: 40px; cursor: pointer; }
.sound__time { font-size: 13px; color: var(--on-dark-2); font-variant-numeric: tabular-nums; }

/* ---------- ниже: состояние, характеристики ---------- */
.pd-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(40px, 5vw, 72px); align-items: start; }
.pd-card { padding: clamp(22px, 3vw, 34px); border-radius: 30px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pd-card .h3 { margin-bottom: 18px; }
.pd-card__lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink-2); }
.pd-kit { margin-top: 22px; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--bg); }
.pd-kit b { display: block; font-weight: 700; }
.pd-kit span { color: var(--ink-2); font-size: 15px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.spec { padding: 14px 16px; border-radius: 18px; background: var(--bg); }
.spec dt { font-size: 12.5px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { margin: 6px 0 0; font-weight: 650; line-height: 1.3; }
.spec--wide { grid-column: 1 / -1; }

.similar { margin-top: clamp(52px, 6vw, 92px); }
.similar .sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }

/* плавающая панель покупки на телефоне */
.buybar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50;
  display: none; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-radius: 999px;
  background: rgba(19, 19, 18, 0.94); color: var(--on-dark); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.6); transform: translateY(160%); transition: transform 0.55s var(--ease-2);
}
.buybar.is-shown { transform: none; }
.buybar__price { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.buybar__price b { font: 900 1.6rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.buybar__price s { font-size: 12.5px; color: var(--on-dark-2); }
.buybar .btn { margin-left: auto; }

.notfound { margin-top: 40px; }

@media (max-width: 1100px) {
  .pd { grid-template-columns: minmax(0, 1fr); }
  /* На узком экране: фото, потом цена и покупка, потом список дефектов. */
  .pd__gallery { display: contents; }
  .viewer { order: 1; }
  .pd__info { order: 2; position: static; }
  .defects { order: 3; margin-top: 8px; }
  .viewer__stage { --maxh: 70vh; }
  .pd-more { grid-template-columns: 1fr; }
  .buybar { display: flex; }
}
@media (max-width: 600px) {
  .viewer { padding: 5px; border-radius: 26px; }
  .viewer__stage { border-radius: 18px; --maxh: 64vh; }
  .viewer__canvas { border-radius: 21px; }
  .viewer__bar { padding: 10px 6px 4px; font-size: 13px; }
  .loupe-toggle { display: none; }
  .dcard { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding-right: 12px; border-radius: 20px; }
  .dcard__zoom { width: 84px; height: 84px; border-radius: 14px; }
  .dcard b { font-size: 15.5px; }
  .dcard small { font-size: 13.5px; }
  .pricebox__core { padding: 18px 16px; }
  .pricebox__top { min-height: 0; }
  .pricebox__hang { width: 112px; height: 136px; margin-top: -40px; }
  .pricebox__hang .hang-wrap { width: 112px; margin-left: -56px; }
  .pd-tag { --w: 112px; }
  .pd-tag .tag__paper { padding: 32px 10px 12px; }
  .pd-tag__g { font-size: 2.1rem; }
  .pd-tag .tag__note { font-size: 1.02rem; }
  .compare__row { grid-template-columns: 96px minmax(0, 1fr) 84px; font-size: 13px; gap: 8px; }
  .specs { grid-template-columns: 1fr; }
  .sound { grid-template-columns: 52px minmax(0, 1fr); }
  .sound__btn { width: 52px; height: 52px; }
  .sound__time { grid-column: 2; }
  .sound__label { grid-column: 2; }
  .buybar { padding-left: 16px; }
}
