/* Страница товара (inc/product-page.php) по макету Figma «Страница товара · вариант»:
 * десктоп 137:2, планшет 140:2, телефон 140:224; без фото — 142:2. Общие токены, кнопки и чипы — catalog-page.css и listing.css. */

.ptvp-head .ptvc-wrap { padding-top: 22px; padding-bottom: 18px; }
.ptvp-back { display: none; color: #b9cfcd; font-size: 13px; font-weight: 600; }

/* первый экран */
.ptvp-card {
  background: #fff; border-radius: 10px; padding: 32px; margin-bottom: 16px;
  display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); grid-template-areas: "gal info" "gal buy"; gap: 20px 48px; align-items: start;
}
.ptvp-gallery { grid-area: gal; display: flex; flex-direction: column; gap: 10px; }
.ptvp-photo { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; }
.ptvp-photo img { width: 100%; height: 100%; object-fit: contain; }
.ptvp-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.ptvp-thumbs button { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; }
.ptvp-thumbs button.is-on { border: 2px solid var(--bg); }
.ptvp-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.ptvp-info { grid-area: info; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ptvp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ptvp-tag { background: var(--chip, #e6eeed); color: var(--bg); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 4px; }
.ptvp-tag--brand { background: #d6cf8b; color: #462e21; }
.ptvp-noph { width: 48px; height: 48px; border-radius: 6px; background: #f2f0eb; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; }
.ptvp-noph img { width: var(--s, 30px); height: var(--s, 30px); object-fit: contain; opacity: .55; mix-blend-mode: multiply; }
.ptvp h1 { color: var(--ink); font-size: 34px; line-height: 1.18; overflow-wrap: anywhere; }
.ptvp-sku { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.ptvp-sku b { color: var(--ink); font-weight: 600; font-size: 15px; }
.ptvp-copy { border: 1px solid #d9d4cb; background: #fff; border-radius: 4px; padding: 2px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.ptvp-copy:hover { border-color: var(--bg); color: var(--bg); }
.ptvp-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; }
.ptvp-params div { padding: 12px 14px; border-left: 1px solid var(--line); margin-left: -1px; }
.ptvp-params dt { font-size: 12px; color: var(--muted); margin: 0 0 3px; }
.ptvp-params dd { margin: 0; font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }

.ptvp-buy { grid-area: buy; background: #f6f5f2; border-radius: 10px; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.ptvp-price { font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 24px; line-height: 1.2; }
.ptvp-buy__d { color: #5c554d; font-size: 15px; line-height: 1.45; }
.ptvp-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.ptvp-contacts { font-weight: 600; font-size: 14px; color: var(--bg); }
.ptvp-contacts a:hover { text-decoration: underline; }
.ptvp-terms { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ptvp-terms li { position: relative; padding-left: 18px; font-size: 14px; color: #3a3631; line-height: 1.4; }
.ptvp-terms li::before { content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--link); }

/* без фото — 142:2: без пустой рамки, блок цены справа */
.ptvp-card--nophoto { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "info buy"; }

/* характеристики */
.ptvp-details { background: #fff; border-radius: 10px; padding: 32px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; }
.ptvp-details--one { grid-template-columns: minmax(0, 1fr); }
.ptvp h2 { font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 24px; line-height: 1.25; color: var(--ink); margin: 0 0 14px; }
.ptvp-details__main h2 + * { margin-bottom: 26px; }
.ptvp-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px; }
.ptvp-table th, .ptvp-table td { text-align: left; vertical-align: top; padding: 11px 16px; line-height: 1.4; }
.ptvp-table tr:nth-child(odd) { background: #f8f7f4; }
.ptvp-table th { width: 38%; font-weight: 400; color: var(--muted); }
.ptvp-table td { font-weight: 600; overflow-wrap: anywhere; }
.ptvp-text { color: #3a3631; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ptvp-text p + p { margin-top: 10px; }
.ptvp-cross { display: flex; flex-direction: column; gap: 14px; }
.ptvp-cross h2 { margin: 0; }
.ptvp-cross p { color: #5c554d; font-size: 14px; line-height: 1.5; }
.ptvp-nums { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ptvp-nums li { border: 1px solid #d9d4cb; border-radius: 6px; padding: 6px 12px; font-weight: 600; font-size: 14px; }
.ptvp-tip { background: var(--tile); border-radius: 8px; padding: 14px 16px; font-size: 13px; line-height: 1.45; color: #5a4a3c; }
.ptvp-tip b { display: block; color: #462e21; font-size: 14px; margin-bottom: 2px; }

/* похожие */
.ptvp-rel { background: #fff; border-radius: 10px; padding: 28px 32px 32px; margin-bottom: 40px; }
.ptvp-rel__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ptvp-rel__h h2 { margin: 0; }
.ptvp-rel__h a { color: var(--link); font-weight: 600; font-size: 14px; white-space: nowrap; }
.ptvp-rel__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ptvp-rc { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.ptvp-rc:hover { border-color: #b9c6c2; box-shadow: 0 4px 14px rgba(32, 69, 71, .10); }
.ptvp-rc__img { aspect-ratio: 16 / 10; border-radius: 6px; background: #f2f0eb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ptvp-rc__img img { width: 100%; height: 100%; object-fit: cover; }
.ptvp-rc__img img[style] { width: var(--s); height: var(--s); object-fit: contain; opacity: .5; mix-blend-mode: multiply; }
.ptvp-rc .ptvl-mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.ptvp-rc .ptvl-mchips span { background: var(--chip, #e6eeed); color: var(--bg); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.ptvp-rc__t { font-weight: 600; font-size: 15px; line-height: 1.4; color: var(--ink); }
.ptvp-rc__s { font-size: 13px; color: var(--muted); }
/* карточка без общей ссылки: ссылка на названии растянута на всю карточку */
.ptvp-rc--flat { position: relative; }
.ptvp-rc--flat .ptvp-rc__t::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.ptvp-rel__list:has(.ptvp-rc:nth-child(5)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 1024px) and (max-width: 1199px) {
  .ptvp-card { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 20px 32px; padding: 26px; }
  .ptvp-details { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
}

/* ---------- планшет ---------- */
@media (max-width: 1023px) {
  .ptvp-card, .ptvp-card--nophoto { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
  .ptvp-gallery { width: 100%; }
  .ptvp-photo { aspect-ratio: 5 / 3; }
  .ptvp h1 { font-size: 30px; }
  .ptvp-details { display: flex; flex-direction: column; gap: 28px; padding: 24px; }
  .ptvp-cross { width: 100%; }
  .ptvp-rel { background: transparent; padding: 8px 0 24px; margin-bottom: 0; }
  .ptvp-rel__h h2 { color: #fff; font-size: 22px; }
  .ptvp-rel__h a { color: #9fd8bf; }
  .ptvp-rel__list { display: flex; overflow-x: auto; gap: 12px; margin: 0 -24px; padding: 0 24px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ptvp-rel__list::-webkit-scrollbar { display: none; }
  .ptvp-rc { flex: 0 0 230px; background: #fff; border: 0; scroll-snap-align: start; }
}

/* ---------- телефон ---------- */
@media (max-width: 639px) {
  .ptvp-head .ptvc-crumbs { display: none; }
  .ptvp-back { display: inline-block; }
  .ptvp-head .ptvc-wrap { padding-top: 14px; padding-bottom: 12px; }
  .ptvp-card, .ptvp-card--nophoto { padding: 16px; gap: 16px; margin: 0 -4px 12px; }
  .ptvp-photo { aspect-ratio: 3 / 2; }
  .ptvp h1 { font-size: 26px; line-height: 1.2; }
  .ptvp-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ptvp-params div:nth-child(3), .ptvp-params div:nth-child(4) { border-top: 1px solid var(--line); }
  .ptvp-params div:nth-child(odd) { border-left: 0; margin-left: 0; }
  .ptvp-params dd { font-size: 17px; }
  .ptvp-buy { padding: 16px; }
  .ptvp-price { font-size: 22px; }
  .ptvp-buy__d { font-size: 14px; }
  .ptvp-btns { flex-direction: column; }
  .ptvp-btns .ptvl-btn { width: 100%; }
  .ptvp-details { padding: 16px; margin: 0 -4px 12px; }
  .ptvp h2 { font-size: 22px; }
  .ptvp-table th { width: 42%; }
  .ptvp-table th, .ptvp-table td { padding: 10px 12px; }
  .ptvp-rel__list { margin: 0 -16px; padding: 0 16px; }
  .ptvp-rc { flex-basis: 200px; }
}
