/* public/css/product.css: страница товара /catalog/{slug}
   Подключается вместе с catalog.css (оттуда берутся кружки цветов .pcard-dot и карточки сопутствующих товаров). */

/* страница светлая независимо от темы сайта (хедер на ней тёмный, см. Site::headerTone) */
.pp {
    --c-bg: #fff; --c-text: #111; --c-muted: rgba(17, 17, 17, .62); --c-line: rgba(17, 17, 17, .18);
    background: #fff; color: #111;
    padding: 112px clamp(16px, 2.8vw, 40px) 120px;
}
.pp [hidden] { display: none !important; }
.pp-wrap { max-width: 1760px; margin: 0 auto; }

/* ---- «Вернуться назад» ---- */
.pp-back {
    display: inline-flex; align-items: center; gap: 14px; margin-bottom: 44px;
    font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
    color: var(--accent, #94a0bb); transition: color .2s;
}
.pp-back svg { width: 26px; height: 14px; flex: none; }
.pp-back:hover { color: #111; }

/* ---- Две колонки: галерея и информация ---- */
.pp-main { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }

/* ---- Галерея ---- */
.pp-stage { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f5f5f5; }
.pp-img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; touch-action: pan-y; cursor: zoom-in; }
.pp-arrow {
    position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
    color: #111; background: rgba(255, 255, 255, .88); border: 0; border-radius: 50%; cursor: pointer;
    transform: translateY(-50%); transition: background .2s;
}
.pp-arrow svg { width: 16px; height: 16px; }
.pp-arrow:hover { background: #fff; }
.pp-arrow--prev { left: 16px; }
.pp-arrow--next { right: 16px; }

.pp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, 60px); gap: 4px; margin-top: 8px; }
.pp-thumb {
    display: block; width: 60px; height: 60px; padding: 0; overflow: hidden; background: #f1f1f1;
    border: 2px solid transparent; cursor: pointer; opacity: .85; transition: opacity .2s, border-color .2s;
}
.pp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-thumb:hover { opacity: 1; }
.pp-thumb.is-active { opacity: 1; border-color: #c9c9c9; }

/* плавная смена фото: следующее фото проявляется поверх текущего (см. swapImage в product.js) */
.pp-stage .pp-img.is-ghost { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.pp-stage .pp-img.is-ghost.is-in { opacity: 1; }

/* ---- Информация ---- */
.pp-name { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.2; text-transform: uppercase; }
.pp-sku { margin: 8px 0 0; font-size: 16px; font-weight: 300; line-height: 1.3; }
.pp-price { margin: 28px 0 0; font-size: 22px; font-weight: 300; line-height: 1.2; color: var(--c-additional, #94a0bb); }

.pp-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.pp-colors .pcard-dot { width: 36px; height: 36px; padding: 4px; }   /* сам круг 28px */

.pp-var { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pp-opt {
    height: 40px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 300; line-height: 1;   /* как у .pp-status */
    color: #9aa0ab; background: transparent; border: 1px solid #e3e5ea; cursor: pointer;
    transition: color .2s, border-color .2s;
}
.pp-opt:hover { color: #111; border-color: #b8bcc6; }
.pp-opt.is-active { color: #111; border-color: #111; }

.pp-status {
    display: inline-flex; align-items: center; height: 40px; margin: 32px 0 0; padding: 0 16px;
    font-size: 14px; line-height: 1; border: 1px solid #111;
}
.pp-status.is-order { color: #555; border-color: #b5b5b5; }

.pp-actions { display: flex; align-items: center; gap: 10px; margin-top: 32px; }
.pp-add {
    min-width: 200px; height: 45px; padding: 0 32px; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .02em;
    text-transform: uppercase; color: #111; background: transparent; border: 1px solid var(--accent, #94a0bb); border-radius: 999px;
    cursor: pointer; transition: background .2s, color .2s;
}
.pp-add:hover:not(:disabled) { background: var(--accent, #94a0bb); color: #fff; }
.pp-add:disabled { opacity: .55; cursor: default; }
.pp-heart {
    display: grid; place-items: center; flex: none; width: 45px; height: 45px; padding: 0;
    color: var(--accent, #94a0bb); background: transparent; border: 1px solid var(--accent, #94a0bb); border-radius: 50%;
    cursor: pointer; transition: background .2s;
}
.pp-heart svg { width: 22px; height: 22px; transition: fill .2s; }
.pp-heart:hover { background: rgba(148, 160, 187, .14); }
.pp-heart[aria-pressed="true"] svg { fill: currentColor; }
.pp-heart:disabled { opacity: .55; cursor: default; }

.pp-block { margin-top: 40px; }
.pp-params { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 300; line-height: 1.3; }
.pp-params th, .pp-params td { padding: 6px 10px; text-align: left; font-weight: 300; vertical-align: top; border: 1px solid #e3e5ea; }
.pp-params th { width: 54%; }

.pp-files { margin: 0; padding: 0; list-style: none; }
.pp-files li { margin: 0 0 4px; font-size: 14px; font-weight: 300; line-height: 1.35; }
.pp-files a { color: var(--accent, #94a0bb); text-decoration: none; transition: color .2s; }
.pp-files a:hover { color: #111; text-decoration: underline; text-underline-offset: 3px; }

/* форматированный текст описаний */
.pp-rich { font-size: 14px; font-weight: 300; line-height: 1.5; }
.pp-rich > :first-child { margin-top: 0; }
.pp-rich > :last-child { margin-bottom: 0; }
.pp-rich p { margin: 0 0 .9em; }
.pp-rich h2, .pp-rich h3, .pp-rich h4 { margin: 1.2em 0 .5em; font-weight: 500; line-height: 1.25; }
.pp-rich ul, .pp-rich ol { margin: 0 0 .9em; padding-left: 1.4em; }
.pp-rich blockquote { margin: 0 0 .9em; padding-left: 1em; border-left: 2px solid #d9d9d9; }
.pp-rich a { color: var(--accent, #94a0bb); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Аккордеон «Все о товаре и покупке» ---- */
.pp-about { margin-top: 110px; }
.pp-h2 { margin: 0 0 40px; font-size: 16px; font-weight: 300; line-height: 1.2; text-transform: uppercase; }
.pp-acc { border-top: 1px solid #e6e6e6; }
.pp-acc-item { border-bottom: 1px solid #e6e6e6; }
.pp-acc-head { margin: 0; }
.pp-acc-btn {
    display: flex; align-items: center; gap: 20px; width: 100%; min-height: 68px; padding: 16px 0;
    font: inherit; font-size: 14px; font-weight: 400; line-height: 1.3; text-align: left; color: #111;
    background: none; border: 0; cursor: pointer;
}
.pp-acc-icon { flex: none; width: 14px; height: 14px; color: var(--accent, #94a0bb); }
.pp-acc-icon svg { display: block; width: 100%; height: 100%; }
.pp-acc-title { flex: 1; min-width: 0; }
/* плюс справа; весь кружок 20px (при наведении синий с белым плюсом), у открытого пункта плюс повёрнут в крестик */
.pp-acc-toggle {
    flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    color: #111; transition: background .2s, color .2s;
}
.pp-acc-toggle svg { width: 12px; height: 12px; transition: transform .25s; }
.pp-acc-btn:hover .pp-acc-toggle, .pp-acc-btn:focus-visible .pp-acc-toggle { background: #2f5bff; color: #fff; }
.pp-acc-btn:focus-visible { outline: 2px solid #2f5bff; outline-offset: 2px; }
.pp-acc-item.is-open .pp-acc-toggle svg { transform: rotate(45deg); }

.pp-acc-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .3s ease, visibility 0s .3s; }
.pp-acc-item.is-open .pp-acc-panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .3s ease; }
.pp-acc-inner { min-height: 0; overflow: hidden; }
.pp-acc-body { padding: 8px 0 56px; }

/* ---- Сопутствующие товары ---- */
.pp-related { margin-top: 120px; }
.pp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 100px 20px; }

/* ---- Планшет и мобильная версия ---- */
@media (max-width: 1024px) {
    .pp { padding-top: 84px; }
    .pp-back { margin-bottom: 24px; }
    .pp-main { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 900px) {
    .pp { padding-bottom: 80px; }
    .pp-price { margin-top: 18px; font-size: 18px; }
    .pp-colors { margin-top: 22px; }
    .pp-colors .pcard-dot { width: 34px; height: 34px; padding: 4px; }   /* круг 26px */
    .pp-var { margin-top: 18px; }
    .pp-status { margin-top: 22px; }
    .pp-actions { margin-top: 22px; }
    .pp-add { flex: 1; min-width: 0; padding: 0 16px; }
    .pp-block { margin-top: 28px; }

    .pp-about { margin-top: 64px; }
    .pp-h2 { margin-bottom: 28px; }
    .pp-acc-btn { gap: 14px; min-height: 60px; }
    .pp-acc-body { padding-bottom: 32px; }

    .pp-related { margin-top: 72px; }
    .pp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .pp-acc-panel, .pp-acc-toggle svg, .pp-thumb, .pp-heart svg { transition: none; }
}

/* ---- Просмотр фото на весь экран (лупа) ---- */
.pp-lb {
    --lb-bg: #fff;
    position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
    background: var(--lb-bg); overflow: hidden;
    opacity: 0; transition: opacity .3s ease;   /* плавное открытие и закрытие (LB_FADE_MS в product.js) */
}
.pp-lb.is-open { opacity: 1; }
.pp-lb[hidden] { display: none !important; }
.pp-lb-img {
    display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in;
    user-select: none; -webkit-user-drag: none; touch-action: none; transition: transform .25s ease, opacity .3s ease;
}
.pp-lb-img.is-zoomed { transform: scale(2.5); cursor: zoom-out; }
/* листание в лупе: следующее фото проявляется поверх текущего (swapImage в product.js) */
.pp-lb-img.is-ghost { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.pp-lb-img.is-ghost.is-in { opacity: 1; }
.pp-lb-close, .pp-lb-arrow {
    position: absolute; z-index: 2; display: grid; place-items: center; padding: 0; color: #111;
    background: rgba(0, 0, 0, .06); border: 0; border-radius: 50%; cursor: pointer; transition: background .2s;
}
.pp-lb-close:hover, .pp-lb-arrow:hover { background: rgba(0, 0, 0, .14); }
.pp-lb-close { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 44px; height: 44px; }
.pp-lb-close svg { width: 20px; height: 20px; }
.pp-lb-arrow { top: 50%; width: 40px; height: 40px; transform: translateY(-50%); }
.pp-lb-arrow svg { width: 20px; height: 20px; }
.pp-lb-arrow[hidden] { display: none !important; }
.pp-lb-arrow--prev { left: 16px; }
.pp-lb-arrow--next { right: 16px; }
@media (prefers-reduced-motion: reduce) { .pp-lb, .pp-lb-img { transition: none; } }