/* zhbi77.ru, карточка товара, шаг 1 (#342; вариант А). Перенос согласованного прототипа. Язык — как у нового листинга (catalog-listing.css): палитра сайта, рамки 1px, скругление 5px,
   без градиентов, теней, эмодзи, новых шрифтов. Шрифт не задаётся нигде: наследуется от .page сайта (Helvetica). Переходы 0,15 с. */
.pk { --pk-blue: #2696d9; --pk-blue2: #1a8cd4; --pk-link: #1b78b0; --pk-hfg: #0f5d8c; --pk-hbg: #eaf4fb; --pk-press: #e0eaf3; --pk-focus: #14679b;
  --pk-head: #e2eff5; --pk-text: #252e2e; --pk-muted: #666; --pk-line: #e6e9eb; --pk-border: #bbbbbb; --pk-field: #919191; --pk-r: 5px;
  color: var(--pk-text); text-align: left; container-type: inline-size; }
.pk *, .pk *::before, .pk *::after { box-sizing: border-box; }
.pk a { color: var(--pk-link); }
.pk a:hover { color: var(--pk-hfg); }
.pk a:focus-visible, .pk button:focus-visible, .pk input:focus-visible { outline: 2px solid var(--pk-focus); outline-offset: 2px; }
.pk h1 { margin: 0 0 18px; line-height: 1.15; overflow-wrap: anywhere; }
.pk p { margin: 0 0 10px; }
.pk ul, .pk dl { margin: 0; padding: 0; }
.pk button { font: inherit; }

/* ---------- первый экран ---------- */
.pk-top { display: grid; gap: 22px 26px; margin: 0 0 26px; align-items: start; }
.pk-top--a { grid-template-columns: 300px minmax(0, 1fr); }
.pk-top--b { grid-template-columns: minmax(0, 1fr) 256px; }
.pk-left { min-width: 0; display: grid; gap: 14px; align-content: start; }
.pk-left > * { margin-bottom: 0; }
.pk-top--a .pk-left ul.pk-facts { margin: 0; }
.pk-top--a .pk-dc, .pk-top--a .zd-c { margin: 0; }
.pk-info { min-width: 0; }

/* галерея */
.pk-gal { min-width: 0; }
.pk-main { display: block; position: relative; aspect-ratio: 3 / 2; border: 1px solid var(--pk-line); background: #fff; overflow: hidden; }
.pk-main img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pk-main--none { display: flex; align-items: center; justify-content: center; color: var(--pk-muted); background: #f4f6f7; }
.pk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, 68px); gap: 6px; margin-top: 6px; }
.pk-thumb { display: block; padding: 0; border: 1px solid var(--pk-border); border-radius: 0; background: #fff; cursor: pointer; aspect-ratio: 4 / 3; overflow: hidden; transition: border-color .15s ease; }
.pk-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pk-thumb:hover { border-color: var(--pk-blue2); }
.pk-thumb[aria-current="true"] { border-color: var(--pk-link); outline: 2px solid var(--pk-link); outline-offset: -2px; }

/* ключевые характеристики */
.pk dl.pk-key { border-top: 1px solid var(--pk-line); margin: 0 0 16px; }
.pk-key > div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--pk-line); line-height: 1.3; }
.pk-key dt { flex: 0 0 42%; color: var(--pk-muted); }
.pk-key dd { margin: 0; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pk-top--b dl.pk-key { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; }
.pk-top--b .pk-key > div { display: block; padding: 7px 0 8px; }
.pk-top--b .pk-key .pk-wide { grid-column: span 2; }
.pk-top--b .pk-key dt { font-size: 13px; margin-bottom: 1px; }

/* блок покупки */
.pk-buy { border: 1px solid var(--pk-border); border-radius: var(--pk-r); padding: 14px 16px 12px; margin: 0 0 16px; background: #fff; }
.pk-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 8px; }
.pk-price__v { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--pk-text); }
.pk-price__v--ask { font-size: 22px; }
.pk-price__u { color: var(--pk-muted); }
.pk-std { display: inline-flex; margin: 0 0 6px; }
.pk-std__b { min-height: 36px; min-width: 64px; padding: 4px 14px; border: 1px solid var(--pk-blue); background: #fff; color: var(--pk-link); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pk-std__b:first-child { border-radius: var(--pk-r) 0 0 var(--pk-r); }
.pk-std__b:last-child { border-radius: 0 var(--pk-r) var(--pk-r) 0; border-left: 0; }
.pk-std__b[aria-pressed="true"] { background: var(--pk-link); border-color: var(--pk-link); color: #fff; }
.pk-std__b[aria-pressed="false"]:hover { background: var(--pk-hbg); color: var(--pk-hfg); }
.pk-note { color: var(--pk-muted); font-size: 13px; margin: 0 0 10px !important; }
.pk-row { display: flex; gap: 10px; align-items: stretch; margin: 0 0 8px; }
.pk-qty { display: inline-flex; flex: none; border: 1px solid var(--pk-field); border-radius: var(--pk-r); overflow: hidden; background: #fff; }
.pk-qty__b { width: 40px; min-height: 44px; border: 0; background: #fff; color: var(--pk-link); font-size: 20px; line-height: 1; cursor: pointer; transition: background-color .15s ease; }
.pk-qty__b:hover { background: var(--pk-hbg); color: var(--pk-hfg); }
.pk-qty__b:active { background: var(--pk-press); }
.pk-qty__i { width: 56px; min-height: 44px; border: 0; border-left: 1px solid var(--pk-line); border-right: 1px solid var(--pk-line); border-radius: 0; text-align: center; font: inherit; color: var(--pk-text); -moz-appearance: textfield; appearance: textfield; background: #fff; }
.pk-qty__i::-webkit-outer-spin-button, .pk-qty__i::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pk-order { flex: 1 1 auto; min-height: 44px; padding: 4px 18px; border: 1px solid var(--pk-link); border-radius: var(--pk-r); background: var(--pk-link); color: #fff; font-weight: 700; cursor: pointer; transition: background-color .15s ease; }
.pk-order:hover { background: var(--pk-focus); border-color: var(--pk-focus); }
.pk-order:active { background: #0f5d8c; }
.pk-total { color: var(--pk-muted); margin: 0 0 8px !important; }
.pk-hint { margin: 0 0 8px !important; padding: 6px 8px; border: 1px dashed var(--pk-field); border-radius: var(--pk-r); color: var(--pk-muted); font-size: 13px; }
.pk-mailrow { margin: 10px 0 2px !important; padding-top: 10px; border-top: 1px solid var(--pk-line); display: grid; gap: 2px; }
.pk-mailrow__l { color: var(--pk-muted); font-size: 13px; }
.pk-mail { font-weight: 700; overflow-wrap: anywhere; }
.pk-phonerow { margin: 4px 0 0 !important; }
.pk-phone { font-weight: 700; color: var(--pk-text) !important; text-decoration: none; }
.pk-phone:hover { color: var(--pk-hfg) !important; text-decoration: underline; }

/* компактные документы */
.pk-dc { margin: 0 0 16px; padding-top: 10px; border-top: 1px solid var(--pk-line); }
.pk-dc__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 6px; }
.pk-dc__title { font-weight: 700; }
.pk-dc__all { font-size: 14px; }
.pk-dc__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; padding: 4px 0; line-height: 1.3; }
.pk-dc__code { font-weight: 700; }
.pk-dc__st { color: var(--pk-muted); font-size: 13px; flex: 1 0 100%; }
.pk-pdf { white-space: nowrap; font-size: 14px; }
.pk-pdf .zd-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-pdf__size { color: var(--pk-muted); }

/* факты (дословно из индикаторов сайта) */
.pk ul.pk-facts { list-style: none; margin: 0 0 12px; }
.pk-facts li { position: relative; padding: 3px 0 3px 16px; line-height: 1.35; }
.pk-facts li::before { content: ""; position: absolute; left: 0; top: .7em; width: 7px; height: 7px; background: var(--pk-link); }

/* ---------- вкладки ---------- */
.pk-tabs { margin: 0 0 30px; }
.pk-tablist { display: flex; flex-wrap: wrap; list-style: none; border-bottom: 1px solid var(--pk-border); margin: 0 0 4px; }
.pk-tablist li { margin: 0; }
.pk .pk-tab { display: block; padding: 11px 16px 9px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--pk-text); font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pk .pk-tab:hover { background: var(--pk-hbg); color: var(--pk-hfg); }
.pk .pk-tab[aria-selected="true"] { border-bottom-color: var(--pk-link); color: var(--pk-hfg); }
.pk-panel { padding: 8px 0 0; }
.pk .pk-panel__h { margin: 26px 0 10px; padding-top: 14px; border-top: 1px solid var(--pk-border); font-size: 22px; font-weight: 700; line-height: 1.2; }
.pk-js .pk-panel__h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }
.pk-panel[hidden] { display: none; }

/* таблица характеристик */
.pk-spec { width: 100%; border-collapse: collapse; margin: 6px 0 0; }
.pk-spec th, .pk-spec td { padding: 6px 10px; border: 0; border-bottom: 1px solid var(--pk-line); text-align: left; vertical-align: top; }
.pk-spec tbody th { width: 40%; font-weight: 400; color: var(--pk-muted); background: transparent; }
.pk-spec td { font-weight: 700; }
.pk-spec__g th { background: var(--pk-head); color: var(--pk-text) !important; font-weight: 700 !important; padding: 7px 10px; }

/* документы (раздел сайта) внутри вкладки */
.pk-panel .zd { margin-top: 0; }
.pk-text { line-height: 1.5; }
.pk-text h2, .pk-text h3 { margin: 18px 0 8px; font-size: 20px; font-weight: 700; line-height: 1.25; }
.pk-text h3 { font-size: 17px; }
.pk-text ul, .pk-text ol { margin: 0 0 10px; padding-left: 22px; }
.pk-text--auto { margin-top: 14px; color: var(--pk-muted); font-size: 14px; }
.pk-text--auto p { text-align: left !important; }
.pk .pk-text p { text-align: left; }
.pk-tbl { overflow-x: auto; margin: 6px 0 12px; }
.pk-tbl table { width: 100%; border-collapse: collapse; }
.pk-tbl th, .pk-tbl td { padding: 8px 10px; border: 1px solid var(--pk-line); text-align: left; }
.pk-tbl th { background: var(--pk-head); }
.pk ul.pk-facts--p { margin-bottom: 6px; }
.pk-rev { margin: 6px 0 12px; }

/* похожие */
.pk-rel { margin: 0 0 30px; }
.pk .pk-rel__h { margin: 0 0 12px; font-size: 22px; font-weight: 700; line-height: 1.2; }
.pk-rel__l { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pk-rel__l li { margin: 0; min-width: 0; }
.pk .pk-rel__c { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 64px; padding: 6px 10px 6px 6px; border: 1px solid var(--pk-border); border-radius: var(--pk-r); background: #fff; color: var(--pk-text); text-decoration: none; line-height: 1.3; transition: border-color .15s ease, color .15s ease; }
.pk .pk-rel__c:hover { border-color: var(--pk-blue2); color: var(--pk-hfg); }
.pk-rel__c img { flex: none; width: 72px; height: 54px; object-fit: cover; }
.pk-rel__t { display: grid; gap: 2px; min-width: 0; }
.pk-rel__n { overflow-wrap: anywhere; font-weight: 700; }
.pk-rel__p { color: var(--pk-muted); font-size: 14px; }
.pk-rel__all { margin: 10px 0 0 !important; }

/* ---------- адаптив (по ширине колонки контента) ---------- */
@container (max-width: 620px) {
  .pk-top--a, .pk-top--b { grid-template-columns: minmax(0, 1fr); }
  .pk-top .pk-left, .pk-top--a .pk-info, .pk-top--b .pk-rail { display: contents; }
  .pk-top .pk-gal { order: 1; }
  .pk-top--b .pk-buy { order: 2; }
  .pk-top--a .pk-buy { order: 2; }
  .pk-top--a .pk-key { order: 3; }
  .pk-top--a .pk-dc, .pk-top--a .zd-c { order: 4; }
  .pk-top--a .pk-facts { order: 5; }
  .pk-top--b .pk-key { order: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-top--b .pk-dc { order: 4; }
  .pk-top--b .pk-facts { order: 5; }
  .pk-top dl.pk-key, .pk-top .pk-dc, .pk-top .zd-c, .pk-top ul.pk-facts { margin: 0; }
  .pk-main { max-width: 480px; }
  .pk-thumbs { max-width: 480px; }
  .pk-rail { position: static !important; }
}
@container (min-width: 621px) {
  .pk-top--b .pk-rail { position: sticky; top: 12px; }
  .pk-top--b .pk-row { flex-wrap: wrap; }
  .pk-top--b .pk-order { flex: 1 0 100%; }
  .pk-rel__l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 700px) {
  .pk-rel__l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 515px) {
  .pk h1 { font-size: 26px; margin-bottom: 12px; }
  .pk-main { aspect-ratio: 16 / 9; }
  .pk-thumbs { grid-template-columns: repeat(auto-fill, 56px); }
  .pk-price__v { font-size: 28px; }
  .pk-rel__l { grid-template-columns: minmax(0, 1fr); }
  .pk-spec th, .pk-spec td { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) { .pk * { transition: none !important; } }
@media print { .pk-tablist, .pk-order, .pk-qty, .pk-hint { display: none; } .pk-panel[hidden] { display: block; } }

/* ======== Раунд 2: первый экран карточки ======== */
/* блок покупки: цена и ГОСТ/ТУ в одной строке, остальное на всю ширину блока */
.pk-info > .pk-buy { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; margin: 0 0 14px; }
.pk-buy > .pk-price { grid-column: 1; margin: 0; }
.pk-buy > .pk-std { grid-column: 2; margin: 0; }
.pk-buy > .pk-note, .pk-buy > .pk-row, .pk-buy > .pk-one, .pk-buy > .pk-total, .pk-buy > .pk-avail { grid-column: 1 / -1; }
.pk-buy > .pk-note { margin: 6px 0 10px !important; }
.pk-info > dl.pk-key { margin: 0 0 14px; }
.pk-info > .sh-urgent { margin: 0; }
/* выравнивание низа правой колонки с левой (галерея + документы) */
.pk-info > dl.pk-key { margin: 0 0 12px; }
.pk-info .pk-key > div { padding: 4px 0; }
.pk-info > .pk-buy { padding: 12px 16px 10px; margin-bottom: 12px; }
.pk-buy > .pk-avail { margin: 0 !important; padding-top: 8px; border-top: 1px solid var(--pk-line); }
.pk-buy > .pk-one { margin-bottom: 10px; }
.pk-info > .sh-urgent { padding: 12px 16px; }
.pk-info > .sh-urgent h2 { margin-bottom: 6px; }
.pk-info > .sh-urgent p { margin-bottom: 4px; }
.pk-info > .sh-urgent .sh-urgent__l { margin: 2px 0 0 !important; }
/* реальные строки сайта в блоке покупки (сообщение 300) */
.pk-buy > .pk-avail2 { grid-column: 1 / -1; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--pk-line); }
.pk-buy > .pk-avail2 li { margin: 0 0 2px; padding-top: 0; padding-bottom: 0; line-height: 1.35; }
.pk-info > .pk-buy > .pk-one { margin-bottom: 8px; }
.pk-info .pk-key > div { padding: 3px 0; }

/* ======== Раунд 4: телефон (< 768) — лента табов вместо аккордеона ======== */
@media (max-width: 767px) {
  .pk-tablist { display: none; }
  .pk-js .pk-tablist { display: flex; flex-wrap: nowrap; position: sticky; top: 56px; z-index: 40; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -10px 4px; padding: 0 10px; background: #fff; }
  .pk-tablist::-webkit-scrollbar { display: none; }
  .pk-tablist li { flex: none; }
  .pk .pk-tab { white-space: nowrap; padding: 12px 14px 9px; }
  .pk-js .pk-panel { scroll-margin-top: 108px; }
}

/* ======== шаг 1: добавки ======== */
/* компактный блок документов из getInheritedCertificates &mode=compact: оформление как у .pk-dc прототипа */
.zd-c { margin: 0 0 16px; padding-top: 10px; border-top: 1px solid var(--pk-line); }
.zd-c__gap { display: none; }
.zd-c__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 6px; }
.zd-c__title { font-weight: 700; }
.zd-c__all { font-size: 14px; }
.zd-c__row { padding: 4px 0; line-height: 1.3; }
.zd-c__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.zd-c__code { font-weight: 700; }
.zd-c__pdf { white-space: nowrap; font-size: 14px; }
.zd-c .zd-status { display: block; color: var(--pk-muted); font-size: 13px; }
.zd-c__note { color: var(--pk-muted); font-size: 12px; }
/* полный блок документов в табе: заголовок таба уже есть */
.pk-panel .zd > .introtext-inner-heading { display: none; }
.pk-rev-note { margin: 0 0 8px; }
