/* ==========================================================================
   Product Single — «Тёплый минимал» (единый стиль с каталогом)
   Токены --c-* задаёт catalog-redesign.css (ШАГ1, скоуп включает
   body.single-product) — здесь только алиас базовых переменных на них
   + собственная геометрия карточки товара.
   Откат: переименовать single-product-v1.php → single-product.php,
          удалить этот файл и убрать его enqueue из functions.php.
   ========================================================================== */

/* Алиас базовых токенов (--bg/--ink/--line/--accent…) на тёплую палитру
   каталога — так все общие компоненты страницы (variant-table, диалог
   исполнения, .eyebrow/.muted, product-next-panel и т.д. из main.css)
   подхватывают её без дублирования правил. */
body.single-product {
    --bg: var(--c-bg-soft);
    --surface: var(--c-bg);
    --surface-warm: var(--c-bg-soft);
    --ink: var(--c-ink);
    --muted: var(--c-muted);
    --line: var(--c-line);
    --accent: var(--c-yellow);
    --accent-dark: var(--c-yellow-strong);
    --accent-fg: var(--c-ink);
}

html:has(.psp-page) {
    scroll-padding-top: calc(76px + 52px);
}

/* Кнопки — полная скруглённость, как в каталоге (перебивает плоский
   старый жёлтый .button из redesign.css). */
body.single-product .button {
    border-radius: 999px;
    font-weight: 600;
    box-shadow: none;
}
body.single-product .button:hover {
    box-shadow: 0 10px 28px rgba(245, 165, 36, .35);
}
body.single-product .button-secondary {
    background: transparent;
    color: var(--c-ink);
    border-color: var(--c-line-strong);
}
body.single-product .button-secondary:hover {
    background: var(--c-bg-soft);
    border-color: var(--c-yellow);
    color: var(--c-ink);
    box-shadow: none;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.psp-hero {
    padding: 28px 0 56px;
}

.psp-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

/* Gallery */
.psp-hero__gallery {
    position: relative;
    min-width: 0;
}

.psp-hero__gallery .product-gallery-main {
    width: 100%;
    aspect-ratio: 4/3;
    border: 1px solid var(--c-line);
    border-radius: var(--c-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    /* Чисто белый, а не тёплый --c-bg: на большом hero-фото тёплый оттенок
       через mix-blend-mode: multiply читается как жёлтая подложка под
       товаром — на маленьких карточках каталога того же приёма это
       незаметно, здесь заметно. */
    background: #fff;
    position: relative;
}

.psp-hero__gallery .product-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.2s;
    mix-blend-mode: multiply;
}

.psp-hero__gallery .gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid var(--c-yellow);
    color: var(--c-ink);
    font-size: 1.6rem;
    line-height: 1;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    box-shadow: var(--c-shadow-soft);
    transition: opacity 0.2s, box-shadow 0.15s, background 0.15s, color 0.15s;
    z-index: 2;
}
.psp-hero__gallery .gallery-arrow-prev { left: 12px; }
.psp-hero__gallery .gallery-arrow-next { right: 12px; }
.psp-hero__gallery .product-gallery-main:hover .gallery-arrow { opacity: 1; }
.psp-hero__gallery .gallery-arrow:hover {
    background: var(--c-yellow);
    border-color: var(--c-yellow);
    color: var(--c-ink);
    box-shadow: var(--c-shadow-lift);
}

.psp-hero__gallery .product-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.psp-hero__gallery .product-gallery-thumbs::-webkit-scrollbar { display: none; }

.psp-hero__gallery .product-gallery-thumb {
    width: 72px;
    height: 54px;
    border: 2px solid var(--c-line);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    background: #fff;
    transition: border-color 0.2s;
}
.psp-hero__gallery .product-gallery-thumb.is-active,
.psp-hero__gallery .product-gallery-thumb:hover {
    border-color: var(--c-yellow);
}
.psp-hero__gallery .product-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    mix-blend-mode: multiply;
}

/* No-image placeholder */
.psp-hero__gallery .psp-no-image {
    width: 100%;
    aspect-ratio: 4/3;
    border: 1px solid var(--c-line);
    border-radius: var(--c-radius-lg);
    background: var(--c-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--c-line-strong);
    font-family: var(--c-display);
}

/* Info column */
.psp-hero__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Chips: brand + category — как бейджи каталога, пилюли на тёплом фоне */
.psp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.psp-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    font-family: var(--c-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--c-ink-soft);
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line-strong);
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.psp-chip:hover {
    background: var(--c-yellow-soft);
    color: var(--c-ink);
    border-color: var(--c-yellow);
}

/* Title */
.psp-hero__title {
    font-family: var(--c-display);
    font-size: clamp(1.55rem, 2.3vw, 2.1rem);
    font-weight: 800;
    color: var(--c-ink);
    margin: 0 0 24px;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

/* Stat tiles 2×2 */
.psp-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.psp-stat {
    padding: 14px 16px;
    border: 1px solid var(--c-line);
    border-radius: var(--c-radius);
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--c-bg);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.psp-stat:hover {
    border-color: var(--c-yellow);
    transform: translateY(-2px);
    box-shadow: var(--c-shadow-soft);
}
.psp-stat__label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.psp-stat__label svg {
    stroke: var(--c-yellow);
    flex-shrink: 0;
}
.psp-stat__value {
    font-family: var(--c-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-ink);
    line-height: 1.25;
    word-break: break-word;
}

/* CTA */
.psp-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.psp-cta .button {
    flex: 1 1 auto;
    min-width: 150px;
    justify-content: center;
}

/* Trust strip */
.psp-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--c-muted);
}
.psp-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.psp-trust-item svg {
    stroke: var(--c-yellow);
    flex-shrink: 0;
}

/* ── Sticky tabs ──────────────────────────────────────────────────────────── */
.psp-tabs {
    position: sticky;
    top: 76px;
    z-index: 20;
    background: var(--c-bg);
    border-top: 1px solid var(--c-line);
    border-bottom: 1px solid var(--c-line);
    margin-bottom: 48px;
}
.psp-tabs__inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}
.psp-tabs__inner::-webkit-scrollbar { display: none; }

.psp-tabs__link {
    position: relative;
    padding: 16px 4px;
    margin-right: 28px;
    color: var(--c-muted);
    font-family: var(--c-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.psp-tabs__link:last-child { margin-right: 0; }
.psp-tabs__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--c-yellow);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s;
}
.psp-tabs__link:hover,
.psp-tabs__link.is-active { color: var(--c-ink); }
.psp-tabs__link:hover::after,
.psp-tabs__link.is-active::after { transform: scaleX(1); }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.psp-section {
    margin-bottom: 56px;
    scroll-margin-top: calc(76px + 56px);
}

.psp-section__head {
    position: relative;
    padding-left: 16px;
    margin-bottom: 24px;
}
.psp-section__head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 2px;
    background: var(--c-yellow);
}
.psp-section__kicker {
    display: block;
    font-family: var(--c-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-yellow);
    margin-bottom: 4px;
}
.psp-section__title {
    font-family: var(--c-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--c-ink);
    margin: 0;
    line-height: 1.2;
}

/* Description — full-width, светлая контрастная полоса на тёплом фоне страницы */
.psp-description-full {
    background: var(--c-bg);
    padding: 48px 0;
    border-top: 1px solid var(--c-line);
    border-bottom: 1px solid var(--c-line);
}

/* Единый размер шрифта для всего блока описания (main.css/UA-стили давали
   разнобой: .lead — 20px, <h2> из редактора — ~24px Inter полужирный,
   абзацы/списки — 16px). Здесь один размер и line-height на весь текст,
   иерархия — через вес и цвет, как в таблице характеристик выше. */
.psp-desc-body {
    color: var(--c-ink);
    font-size: 1rem;
    line-height: 1.75;
}
.psp-desc-body.entry-content {
    max-width: none;
}
.psp-desc-body :is(h1, h2, h3, h4) {
    font-family: var(--c-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--c-ink);
    margin: 28px 0 12px;
}
.psp-desc-body :is(h1, h2, h3, h4):first-child {
    margin-top: 0;
}
.psp-desc-body .lead {
    max-width: none;
    font-size: inherit;
    font-weight: 500;
    color: var(--c-muted);
}
.psp-desc-body p,
.psp-desc-body li {
    font-size: inherit;
}
.psp-desc-body strong {
    font-weight: 700;
    color: var(--c-ink);
}
.psp-desc-body p { margin: 0 0 12px; }
.psp-desc-body p:last-child { margin-bottom: 0; }
.psp-desc-body ul,
.psp-desc-body ol {
    margin: 0 0 12px;
    padding-left: 22px;
}
.psp-desc-body ul:last-child,
.psp-desc-body ol:last-child {
    margin-bottom: 0;
}
.psp-desc-body li {
    margin-bottom: 6px;
}
.psp-desc-body li:last-child {
    margin-bottom: 0;
}

/* Specs table — список строк с иконками вместо сетки 2×N. Лейбл и значение —
   элементы ОДНОЙ сетки на весь блок (.psp-specs__row не создаёт свою сетку,
   а "растворяется" через display:contents), поэтому колонка подписи везде
   одинаковой ширины и подстраивается под самый длинный лейбл — короткие
   подписи не переносятся на вторую строку, пока помещаются. Значения — по
   правому краю; составные (КСС, крепление) разбиты на пилюли и выровнены
   тем же flex-end, поэтому перенос строк не ломает читаемость, как это
   было при переносе обычного текста через запятую. */
.psp-specs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 20px;
    max-width: 720px;
    border: 1px solid var(--c-line);
    border-radius: var(--c-radius);
    overflow: hidden;
    background: var(--c-bg);
    /* Один размер шрифта на весь блок (как в .variant-dialog__specs) —
       иерархия лейбл/значение держится только на толщине начертания. */
    font-size: .92rem;
    line-height: 1.4;
}
.psp-specs__row {
    display: contents;
}
.psp-specs__row:nth-child(even) :is(.psp-specs__label, .psp-specs__value) {
    background: var(--c-bg-soft);
}
.psp-specs__row:last-child :is(.psp-specs__label, .psp-specs__value) {
    border-bottom: 0;
}
.psp-specs__label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 0 13px 20px;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-muted);
    font-weight: 400;
    white-space: nowrap;
}
.psp-specs__label svg {
    stroke: var(--c-yellow);
    flex-shrink: 0;
}
.psp-specs__value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 13px 20px 13px 0;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-ink);
    font-weight: 600;
    text-align: right;
}

/* Составные значения (КСС, крепление…) — пилюли вместо строки через запятую */
.psp-specs__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.psp-specs__tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line-strong);
    color: var(--c-ink-soft);
    font-size: inherit;
    font-weight: 600;
    line-height: 1.4;
}
.psp-specs__row:nth-child(even) .psp-specs__tag {
    background: var(--c-bg);
}

/* Цветовая температура — кружки (кельвины + цвета свечения) */
.psp-cct-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    justify-content: flex-end;
}
.psp-cct-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: inherit;
    font-weight: 600;
    color: var(--c-ink);
    white-space: nowrap;
}
.psp-cct-dot,
.psp-cct-swatch {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset;
}
.psp-cct-swatch.is-white {
    box-shadow: 0 0 0 1px var(--c-line) inset;
}

@media (max-width: 767px) {
    /* На мобильном лейбл и значение больше не помещаются рядом — сетка
       схлопывается в одну колонку, и .psp-specs__label/.psp-specs__value
       (прямые элементы благодаря display:contents на .psp-specs__row)
       просто идут друг за другом, лейбл над значением. */
    .psp-specs {
        grid-template-columns: 1fr;
    }
    .psp-specs__label {
        padding: 12px 16px 4px;
        border-bottom: 0;
        white-space: normal;
    }
    .psp-specs__value {
        padding: 0 16px 12px;
    }
    /* На мобильном лейбл уже стоит над значением, а не рядом — выравнивать
       по правому краю больше не относительно чего, поэтому едет к левому. */
    .psp-specs__value,
    .psp-specs__tags,
    .psp-cct-chips {
        text-align: left;
        justify-content: flex-start;
    }
}

/* ── Модификации / документы / next — карточки в духе каталога ─────────────── */
.psp-page .variant-tools,
.psp-page .variant-table-wrap,
.psp-page .product-next-panel {
    border-radius: var(--c-radius);
    border-color: var(--c-line);
    box-shadow: var(--c-shadow-soft);
}
.psp-page .variant-table th {
    background: var(--c-bg-soft);
}
.psp-page .variant-tools input,
.psp-page .variant-tools select {
    border-radius: 10px;
    border-color: var(--c-line-strong);
    background: var(--c-bg);
}
.psp-page .variant-tools input:focus-visible,
.psp-page .variant-tools select:focus-visible {
    outline: none;
    border-color: var(--c-yellow);
}
.psp-page .product-next-panel {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.psp-page .product-next-panel:hover {
    transform: translateY(-3px);
    box-shadow: var(--c-shadow-lift);
    border-color: var(--c-line-strong);
}
.psp-page .document-note {
    border-radius: var(--c-radius);
    border-color: var(--c-line);
}

/* Disclaimer */
.psp-disclaimer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--c-line);
    color: var(--c-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ── Mobile sticky CTA ────────────────────────────────────────────────────── */
.psp-mobile-cta {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 50;
    padding: 10px 12px;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: var(--c-radius);
    box-shadow: var(--c-shadow-lift);
    align-items: center;
    gap: 12px;
}
.psp-mobile-cta__title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.psp-mobile-cta .button {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.875rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .psp-hero__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .psp-hero { padding-bottom: 40px; }
}

@media (max-width: 767px) {
    .psp-page { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

    .psp-hero { padding: 16px 0 32px; }
    .psp-hero__title { font-size: 1.4rem; }

    .psp-hero__gallery .product-gallery-main {
        aspect-ratio: 1/1;
        padding: 16px;
    }

    .psp-stats { gap: 8px; margin-bottom: 16px; }
    .psp-stat { padding: 10px 12px; }
    .psp-stat__value { font-size: 1rem; }

    .psp-cta .button { width: 100%; flex-basis: 100%; }

    .psp-tabs { top: 76px; margin-bottom: 32px; }
    .psp-tabs__link {
        padding: 12px 2px;
        margin-right: 0;
        font-size: clamp(0.6rem, 3vw, 0.85rem);
    }
    .psp-tabs__inner { justify-content: space-between; }

    .psp-section { margin-bottom: 40px; }
    .psp-section__title { font-size: 1.2rem; }

    .psp-mobile-cta { display: flex; }

    .fixed-corner-stack { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
