/* ============================================================
   iStore — productView.css  (страница товара) — ЭТАП 1
   Зависит от переменных theme.css. Бейджи .badge* — из home.css/общих.
   ============================================================ */

.pv-crumb { width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 24px 0; font-size: 12px; color: var(--muted); }
.pv-crumb a { color: inherit; text-decoration: none; }
.pv-crumb a:hover { color: var(--text); }
.pv-crumb .sep { padding: 0 6px; }
.pv-crumb .cur { color: var(--text); }

.pv-grid {
    width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 24px 8px;
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start;
}

/* ---------- gallery ---------- */
.pv-gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 100px; }
.pv-gallery__main {
    position: relative; aspect-ratio: 1/1; border-radius: 24px; overflow: hidden;
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
}
.pv-gallery__main img { width: 100%; height: 100%; object-fit: contain; }
#pv-main-img[data-lightbox-open] { cursor: zoom-in; }
.pv-gallery__zoom {
    position: absolute; right: 14px; bottom: 14px; z-index: 2;
    width: 38px; height: 38px; border-radius: 50%; cursor: zoom-in;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    color: var(--text); border: 1px solid var(--border);
    backdrop-filter: blur(4px);
}
.pv-gallery__zoom:hover { background: var(--surface); }
.pv-gallery__badges { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 6px; }
.pv-gallery__thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.pv-thumb {
    flex: 0 0 76px; width: 76px; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
    background: var(--surface-alt); border: 2px solid transparent; cursor: pointer; padding: 0;
}
.pv-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pv-thumb.is-active { border-color: var(--accent); }

/* ---------- info ---------- */
.pv-info { display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }
.pv-info__head { display: flex; flex-direction: column; gap: 8px; }
.pv-info__name { margin: 0; font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.pv-info__code { font-size: 12px; color: var(--muted); }

/* ---------- атрибуты-фильтры (только инфо) ---------- */
.pv-attrs {
    display: flex; flex-direction: column; gap: 12px;
    padding: 4px 0;
}
.pv-attr {
    display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
    font-size: 13.5px;
}
.pv-attr__label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; font-size: 12px; }
.pv-attr__values { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; text-align: right; }
.pv-attr__value { color: var(--text); }
.pv-attr__color { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.pv-attr__swatch {
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    flex: none;
}

.pv-prices { display: flex; flex-direction: column; gap: 6px; }
.pv-old { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.pv-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pv-price { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.pv-save { font-size: 13px; font-weight: 600; color: var(--danger); }
.pv-installment {
    align-self: flex-start; font-size: 13px; color: var(--muted);
    background: var(--surface-alt); border-radius: 980px; padding: 6px 12px;
}

.pv-gift {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--surface-alt); border-radius: 14px;
}
.pv-gift__icon { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pv-gift__text { font-size: 13px; color: var(--text); }
.pv-gift__text span { color: var(--muted); }

.pv-actions { display: flex; gap: 12px; padding-top: 8px; }
.pv-buy {
    flex: 1; padding: 16px; border-radius: 980px;
    background: var(--accent); color: var(--accent-text);
    text-align: center; font-weight: 500; font-size: 16px; cursor: pointer; text-decoration: none;
}
.pv-buy:hover { opacity: .85; }
.pv-buy.is-in-cart { background: var(--accent); color: var(--accent-text); } /* Checkout — как Buy; меняй тут */
.pv-fav {
    width: 52px; height: 52px; flex: none; border-radius: 50%;
    background: var(--surface-alt); color: var(--muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer; border: 0;
}
.pv-fav:hover { color: var(--text); }
.pv-fav.is-in-favorite { color: #e0245e; }
.pv-fav.is-in-favorite svg { fill: #e0245e; stroke: #e0245e; }
.pv-fav svg { display: block; transform: translate(0.5px, 0.3px); }

.pv-assure {
    display: flex; flex-direction: column; gap: 14px;
    padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.pv-assure__row { display: flex; gap: 12px; align-items: flex-start; }
.pv-assure__ic { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-alt); }
.pv-assure__row span:last-child { font-size: 13px; color: var(--muted); line-height: 1.5; }

.pv-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .pv-grid { grid-template-columns: 1fr; gap: 28px; }
    .pv-gallery { position: static; }
}
@media (max-width: 560px) {
    .pv-grid { padding: 16px 16px 8px; }
    .pv-thumb { flex-basis: 60px; width: 60px; }
}

/* ---------- tabs (Этап 2) ---------- */
.pv-tabs-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 56px 24px 8px; }
.pv-tabs {
    display: flex; gap: 28px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    margin-bottom: 32px;
}
.pv-tab {
    padding: 14px 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
    color: var(--muted); cursor: pointer;
    background: none; border: 0; border-bottom: 2px solid transparent;
}
.pv-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.pv-pane { display: block; }
.pv-pane[hidden] { display: none; }

.pv-spec-row {
    display: grid; grid-template-columns: 220px 1fr; gap: 24px;
    padding: 16px 0; font-size: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.pv-spec-label { color: var(--muted); }
.pv-spec-value { color: var(--text); }

.pv-desc-full { font-size: 15px; color: var(--text); line-height: 1.7; max-width: 780px; }
.pv-desc-full img { max-width: 100%; height: auto; border-radius: 12px; }

/* картинка-описание (одна длинная, по локали) */
.pv-desc-img { display: flex; justify-content: center; }
.pv-desc-img img { width: 100%; max-width: 900px; height: auto; display: block; border-radius: 16px; }

@media (max-width: 640px) {
    .pv-tabs-wrap { padding: 40px 16px 8px; }
    .pv-spec-row { grid-template-columns: 1fr; gap: 4px; }
    .pv-spec-label { font-weight: 600; color: var(--text); }
}

/* ---------- sticky bar (появляется при скролле) ---------- */
.pv-stickybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface);
    box-shadow: 0 -2px 16px rgba(0,0,0,.12);
    transform: translateY(100%);
    transition: transform .25s ease;
}
.pv-stickybar.is-visible { transform: translateY(0); }
.pv-stickybar__inner {
    width: 100%; max-width: 1280px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 20px;
}
.pv-stickybar__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-stickybar__name { font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-stickybar__code { font-size: 12px; color: var(--muted); }
.pv-stickybar__prices { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.pv-stickybar__old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.pv-stickybar__price-row { display: flex; align-items: baseline; gap: 8px; }
.pv-stickybar__price { font-size: 17px; font-weight: 700; white-space: nowrap; }
.pv-stickybar__save { font-size: 12px; font-weight: 600; color: var(--danger); white-space: nowrap; }
.pv-stickybar__buy { flex: none; padding: 12px 28px; font-size: 14px; }

@media (max-width: 560px) {
    .pv-stickybar__inner { gap: 12px; padding: 12px 16px; }
    .pv-stickybar__code { display: none; }
    .pv-stickybar__buy { padding: 12px 20px; }
}

/* отступ под sticky-бар внутри футера (не на body — иначе под футером видна полоса фона) */
body.has-sticky-bar .rd-footer { padding-bottom: calc(24px + 84px); }

/* ============================================================
   Лайтбокс-галерея
   ============================================================ */
.lb {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lb[hidden] { display: none; }
body.lb-noscroll { overflow: hidden; }

.lb__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.9); }

.lb__close {
    position: absolute; top: 18px; right: 22px; z-index: 3;
    width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.1); color: #fff; font-size: 30px; line-height: 1;
    display: grid; place-items: center; transition: background .15s;
}
.lb__close:hover { background: rgba(255,255,255,.2); }

.lb__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.1); color: #fff; font-size: 34px; line-height: 1;
    display: grid; place-items: center; transition: background .15s;
}
.lb__arrow:hover { background: rgba(255,255,255,.2); }
.lb__arrow--prev { left: 24px; }
.lb__arrow--next { right: 24px; }

.lb__counter {
    position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 3;
    color: rgba(255,255,255,.8); font-size: 14px; letter-spacing: .02em;
}

.lb__stage {
    position: relative; z-index: 1;
    width: 100%; max-width: 1000px; flex: 1 1 auto;
    display: flex; align-items: center; justify-content: center; padding: 72px 24px 16px;
}
.lb__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

.lb__thumbs {
    position: relative; z-index: 2;
    display: flex; gap: 10px; padding: 16px 24px 28px; max-width: 100%;
    overflow-x: auto;
}
.lb__thumb {
    flex: none; width: 64px; height: 64px; padding: 0; cursor: pointer;
    border: 2px solid transparent; border-radius: 10px; overflow: hidden;
    background: rgba(255,255,255,.08);
}
.lb__thumb img { width: 100%; height: 100%; object-fit: contain; }
.lb__thumb.is-active { border-color: #fff; }

@media (max-width: 560px) {
    .lb__arrow { width: 42px; height: 42px; font-size: 28px; }
    .lb__arrow--prev { left: 10px; }
    .lb__arrow--next { right: 10px; }
    .lb__stage { padding: 64px 12px 12px; }
    .lb__thumb { width: 52px; height: 52px; }
}