/* ============ Карточка товара (поверх каталога) ============ */
.pv { position: fixed; inset: 0; z-index: 100; --sheet-w: 760px; }
.pv[hidden] { display: none; }

.pv__backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
}

/* фото: фиксированный блок сверху; подложка при прокрутке наезжает на него */
.pv__media {
  position: fixed; left: 0; top: 0; z-index: 1;
  border-radius: 26px; overflow: hidden; transform-origin: 0 0; will-change: transform;
  background: radial-gradient(70% 60% at 50% 40%, #1d1d21 0%, #111113 70%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
/* 3D-телефон без фото — без подложки-прямоугольника, просто на затемнённом фоне */
.pv__media.is-still { background: transparent; box-shadow: none; }
.pv__media > img, .pv__media .pv__slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pv__media > img.is-photo, .pv__media .pv__slide img.is-photo { object-fit: cover; }
.pv__media .phone { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 13px; }
.pv__gallery { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pv__gallery::-webkit-scrollbar { display: none; }
.pv__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; }
.pv__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.pv__dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .4); transition: width .3s, background .3s; }
.pv__dots i.is-on { width: 18px; background: #fff; }

.pv__close {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 4;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(40, 40, 44, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1); opacity: 0;
}
.pv__close svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.pv__close:hover { background: rgba(60, 60, 66, .85); }

/* прокручиваемый слой с подложкой; верхняя пустая часть пропускает касания к фото (листать фото) */
.pv__scroll {
  position: absolute; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain;
  pointer-events: none; -webkit-overflow-scrolling: touch;
}
.pv__scroll.is-active { pointer-events: auto; }
.pv__spacer { pointer-events: none; }
.pv__sheet {
  position: relative; pointer-events: auto;
  max-width: var(--sheet-w); margin: 0 auto; min-height: 60vh;
  background: #121214; border: 1px solid rgba(255, 255, 255, .07); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 10px 24px calc(120px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .8);
  transform: translateY(100%);
}
.pv__grab { display: block; width: 100%; padding: 6px 0 14px; cursor: grab; touch-action: none; }
.pv__grab::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .22); margin: 0 auto; }

.pv__title { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.pv__sub { color: var(--muted); font-size: 16px; margin-top: 6px; }
.pv__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pv__badges span {
  height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center;
  border: 1px solid rgba(255, 255, 255, .14); color: #fff;
}
.pv__badges .is-accent { color: var(--accent); border-color: rgba(255, 122, 0, .45); }
.pv__badges .is-warn { color: #ffd479; border-color: rgba(255, 212, 121, .35); }

.pv__section { margin-top: 30px; }
.pv__section h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.pv__rows { background: #1a1a1d; border-radius: 18px; padding: 4px 16px; }
.pv__row { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 14px 0; }
.pv__row + .pv__row { border-top: 1px solid rgba(255, 255, 255, .07); }
.pv__ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 122, 0, .12); }
.pv__ico svg { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pv__ico.is-warn { background: rgba(255, 212, 121, .12); }
.pv__ico.is-warn svg { stroke: #ffd479; }
.pv__label { color: var(--muted); font-size: 13px; }
.pv__value { font-size: 16px; font-weight: 500; margin-top: 2px; line-height: 1.4; word-break: break-word; }
.pv__meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); margin-top: 9px; overflow: hidden; }
.pv__meter i { display: block; height: 100%; width: var(--lvl); background: var(--c, #30d158); border-radius: 3px; }
.pv__specs { background: #1a1a1d; border-radius: 18px; padding: 2px 16px; }
.pv__specs div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; font-size: 15px; }
.pv__specs div + div { border-top: 1px solid rgba(255, 255, 255, .07); }
.pv__specs dt { color: var(--muted); }
.pv__specs dd { text-align: right; font-weight: 500; }
.pv__desc { font-size: 16px; line-height: 1.55; color: rgba(245, 245, 247, .88); white-space: pre-line; }

/* нижняя панель: цена и кнопка */
.pv__dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(22, 22, 24, .82); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, .08);
  transform: translateY(110%);
}
.pv__dock-in { max-width: var(--sheet-w); margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.pv__price { margin-right: auto; min-width: 0; }
.pv__price b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; }
.pv__price s { color: var(--muted); font-size: 14px; }
.pv__buy { flex: none; height: 50px; padding: 0 26px; }
.pv__buy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv__buy.is-added { background: #1f1f22; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.pv__buy.is-added:hover { background: #2a2a2e; }
.pv__buy-off { display: none; }
@media (hover: hover) {
  .pv__buy.is-added:hover .pv__buy-on, .pv__buy.is-added:hover svg { display: none; }
  .pv__buy.is-added:hover .pv__buy-off { display: inline; }
}
.pv__buy:disabled { background: #2a2a2e; color: var(--muted); box-shadow: none; cursor: default; transform: none; }

/* карточка в каталоге кликабельна */
.pcard { cursor: pointer; }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 560px) {
  .pv__sheet { padding: 8px 18px calc(110px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .pv__price b { font-size: 19px; }
  .pv__buy { height: 48px; padding: 0 18px; font-size: 15px; }
}
