/* Страница товара: галерея, блок покупки, разделы описания. Дополняет style.css */

/* ---------- Хлебные крошки ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 20px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
/* Разделитель стоит после пункта: перенесённая строка не начинается с косой черты */
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; }
.crumbs a:hover { color: var(--navy); }
.crumbs [aria-current] { color: var(--navy); }

/* ---------- Верх: галерея и покупка ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; align-items: start; margin-top: 20px; }

/* Большая панель галереи: пропорция как у крупных планов (1162x980), чтобы кадр закрывал панель на любой ширине */
.pd-stage { position: relative; aspect-ratio: 1162 / 980; overflow: hidden; border-radius: var(--r-l); background: #dcf0f2; }
.pd-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 84%;
  width: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 24px 24px rgba(22, 41, 84, 0.22));
}
/* Крупный план: запас 5% прячет прозрачные поля по бокам файла, надписи этикетки остаются в кадре */
.pd-stage.is-zoom img { height: 105%; filter: none; }

/* Миниатюры */
.pd-thumbs { display: flex; gap: 12px; margin-top: 14px; }
/* Пропорция миниатюры та же, что у панели: крупный план виден целиком, без срезанных букв.
   Ширина до 104px, в узкой колонке четыре миниатюры делят её поровну и не вылезают за панель */
.pd-thumb { position: relative; flex: 1 1 0; max-width: 104px; aspect-ratio: 1162 / 980; overflow: hidden; border-radius: var(--r-s); background: #dcf0f2; transition: background-color 0.2s var(--ease); }
.pd-thumb img { position: absolute; left: 50%; top: 50%; height: 82%; width: auto; max-width: none; transform: translate(-50%, -50%); }
.pd-thumb.is-zoom img { height: 105%; }
.pd-thumb:hover { background: #c9e7ea; }
.pd-thumb[aria-pressed="true"] { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Блок покупки */
.pd-title { font-size: clamp(30px, 3vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.pd-buy .lead { margin-top: 12px; }
.pd-buy .spec { margin-top: 24px; }
.spec-plain dd { font-weight: 400; }
.pd-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 28px; }
.pd-price { font-size: 34px; line-height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-price span { font-size: 18px; font-weight: 500; }
/* Наличие: прижато к правому краю строки цены */
.pd-stock { margin-left: auto; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--green-ink); }
.pd-total { font-size: 15px; line-height: 22px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pd-actions { display: flex; gap: 12px; margin-top: 18px; }
.pd-actions .btn-green { flex: 1; }

/* Счётчик количества */
.qty { display: flex; align-items: center; height: 48px; border-radius: var(--r-s); background: var(--paper); }
.qty button { display: grid; place-items: center; width: 44px; height: 48px; border-radius: var(--r-s); transition: background-color 0.2s var(--ease); }
.qty button:hover { background: var(--mint); }
.qty button:disabled { color: #9aa3b8; cursor: default; background: none; }
.qty .icon { width: 18px; height: 18px; }
.qty output { min-width: 32px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }

.pd-uzum { display: inline-block; margin-top: 18px; font-size: 15px; }
.pd-buy .spec + .pd-note { margin-top: 16px; }
.pd-note { font-size: 13px; line-height: 18px; color: var(--ink-2); }

/* ---------- Навигация по разделам ---------- */
/* Прилипает под шапку: её высоту в --head-h выставляет общий скрипт, на телефоне там 0.
   Минус 1px: верхняя линейка навигации уходит под нижнюю линейку шапки, двойной линии нет */
.pd-nav { position: sticky; top: calc(var(--head-h, 0px) - 1px); z-index: 5; margin-top: 72px; background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pd-nav ul { display: flex; align-items: center; gap: 28px; height: 52px; overflow-x: auto; scrollbar-width: none; }
.pd-nav ul::-webkit-scrollbar { display: none; }
.pd-nav a { font-size: 15px; white-space: nowrap; padding: 15px 0; border-bottom: 2px solid transparent; transition: border-color 0.2s var(--ease); }
.pd-nav a:hover { border-color: var(--green); }

/* ---------- Разделы описания ---------- */
/* Отступ якоря: видимая высота прилипшей навигации 53px минус 16px запаса из общего scroll-padding-top.
   Верх раздела встаёт ровно под навигацию, заголовок ниже на внутренний отступ раздела */
.pd-sec { display: grid; grid-template-columns: 280px minmax(0, 760px); gap: 56px; padding: 48px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 37px; }
.pd-sec h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.01em; }
.pd-sec p { max-width: 68ch; }
.pd-sec p + p { margin-top: 12px; }
.pd-sec .spec { margin-top: 0; }

/* Таблица состава */
.pd-table { width: 100%; border-collapse: collapse; }
.pd-table th, .pd-table td { padding: 13px 0; text-align: left; border-bottom: 1px solid var(--line); }
.pd-table th { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--ink-2); }
.pd-table td:first-child { font-weight: 500; }
.pd-table th:last-child, .pd-table td:last-child { text-align: right; }
.pd-table + p { margin-top: 16px; color: var(--ink-2); }

/* Вопросы и ответы */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; font-size: 18px; line-height: 24px; font-weight: 500; cursor: pointer; list-style: none; transition: color 0.2s var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--green-ink); }
.faq-mark { position: relative; flex: none; width: 18px; height: 18px; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; left: 0; top: 8px; width: 18px; height: 2px; background: currentColor; transition: transform 0.3s var(--ease); }
.faq-mark::after { transform: rotate(90deg); }
.faq details[open] .faq-mark::after { transform: rotate(0deg); }
.faq details p { padding-bottom: 20px; color: var(--ink-2); max-width: 64ch; }

/* ---------- Липкая панель покупки (только телефон) ---------- */
.pd-bar { display: none; }

/* ---------- Планшет ---------- */
@media (max-width: 1100px) {
  .pd { gap: 32px; }
  /* Строка цены в узкой колонке: цена и наличие в первом ряду, подпись или сумма под ценой */
  .pd-price-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; }
  .pd-total { grid-column: 1 / -1; grid-row: 2; }
  .pd-sec { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
}

/* ---------- Телефон ---------- */
@media (max-width: 720px) {
  body { padding-bottom: 72px; }
  .crumbs { margin-top: 14px; }
  .pd { grid-template-columns: 1fr; gap: 24px; margin-top: 14px; }
  .pd-thumbs { gap: 10px; }
  .pd-buy .spec div, .pd-sec .spec div { grid-template-columns: 124px 1fr; }
  .pd-price { font-size: 28px; line-height: 34px; }
  .pd-nav { margin-top: 48px; }
  .pd-nav ul { gap: 22px; }
  .pd-sec { grid-template-columns: 1fr; gap: 16px; padding: 32px 0; }
  .pd-sec h2 { font-size: 24px; line-height: 30px; }
  .faq summary { font-size: 16px; line-height: 22px; }
  .pd-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--line);
  }
  .pd-bar .pd-bar-name { display: block; font-size: 13px; line-height: 18px; color: var(--ink-2); }
  .pd-bar .price { font-size: 18px; line-height: 22px; }
  .pd-bar .btn { flex: none; min-width: 148px; }
}

/* Карточки в подборке: строка с ценой и кнопкой прижата к низу, чтобы кнопки стояли на одной линии */
.grid-4 .card-buy { margin-top: auto; padding-top: 14px; }
