/* product.css — уникальные блоки страницы «Товар» */

/* ---------- BREADCRUMBS ---------- */

/* ---------- PRODUCT LAYOUT ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; padding: 24px 0 56px; align-items: start; }

/* ---------- GALLERY ---------- */
/* Стейдж сверху, миниатюры — горизонтальной лентой снизу (переносятся по строкам). */
.gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 104px; }
.thumbs { display: flex; flex-flow: row wrap; gap: 10px; }
.thumb { width: 78px; height: 78px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 7px; cursor: pointer; transition: .15s; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.thumb:hover { border-color: var(--muted); }
.thumb.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stage { position: relative; background: var(--surface); border-radius: var(--radius); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; padding: 48px; overflow: hidden; }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: opacity .25s; }
.stage .badges { position: absolute; top: 18px; left: 18px; display: flex; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 9px; }
.tag.stock { background: var(--green-soft); color: var(--green); }
.tag.hit { background: var(--brand); color: #fff; }
.stage .zoom { position: absolute; bottom: 18px; right: 18px; width: 42px; height: 42px; border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.stage .zoom svg { width: 20px; height: 20px; }

/* ---------- PRODUCT INFO ---------- */
.pinfo { display: flex; flex-direction: column; }
.brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.brand-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 9px; padding: 7px 13px; font-size: 13px; font-weight: 700; color: var(--ink); }
.brand-badge .d { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.rating { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.stars { display: flex; gap: 2px; color: var(--brand); }
.stars svg { width: 15px; height: 15px; }
.pinfo h1 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; margin-bottom: 16px; }
.art { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.art b { color: var(--ink-2); font-weight: 600; }

/* ---------- QUICK SPECS ---------- */
.quickspecs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.qs { display: flex; align-items: center; gap: 11px; padding: 13px 15px; background: var(--surface); border-radius: 12px; }
.qs .ic { flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--brand-ink); }
.qs .ic svg { width: 18px; height: 18px; }
.qs .t { line-height: 1.2; }
.qs .t small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.qs .t b { font-size: 14.5px; font-weight: 700; }

/* ---------- BUY BOX ---------- */
.buybox { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.price-row { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 6px; }
.price-now { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.price-now small { font-size: 18px; color: var(--muted); font-weight: 700; }
.price-old { font-size: 19px; color: var(--muted); text-decoration: line-through; font-weight: 600; margin-bottom: 4px; }
.price-save { display: inline-flex; align-items: center; background: var(--green-soft); color: var(--green); font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 8px; margin-bottom: 4px; }
.price-unit { font-size: 13.5px; color: var(--ink-2); margin-bottom: 20px; }
.price-unit b { color: var(--ink); font-weight: 700; }

.stock-line { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 20px; }
.stock-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.buy-actions { display: flex; align-items: stretch; gap: 12px; margin-bottom: 14px; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; flex-shrink: 0; height: 54px; }
.qty button { width: 46px; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 20px; transition: .15s; }
.qty button:hover { background: var(--surface); color: var(--ink); }
.qty input { width: 52px; height: 100%; border: none; outline: none; text-align: center; font-size: 16px; font-weight: 700; color: var(--ink); }
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-cart { flex: 1; height: 54px; }
.add-cart.added { background: var(--green); }
.buy-now { width: 100%; height: 52px; margin-bottom: 18px; }

/* ---------- ВАРИАЦИИ (WC-форма + свотчи WPLB) ---------- */
/* WC отдаёт <table class="variations"> с рамками — превращаем в чистый стек */
.buybox .variations,
.buybox .variations tbody,
.buybox .variations tr,
.buybox .variations td { display: block; width: auto; border: 0; padding: 0; background: none; }
.buybox .variations { margin: 2px 0 18px; }
.buybox .variations tr + tr { margin-top: 16px; }
.buybox .variations td.label { margin-bottom: 9px; }
.buybox .variations td.label label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
/* свотчи-пилюли под наш дизайн (перебиваем плагин wplb) */
.buybox .wplb-variation-swatches__wrapper { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.buybox .wplb-variation-swatches--button .wplb-variation-swatches__item {
  width: auto !important; height: auto; line-height: 1.25; margin: 0;
  padding: 9px 14px !important; border-radius: 10px !important;
  border: 1.5px solid var(--line); background: #fff; box-shadow: none;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: .15s; }
.buybox .wplb-variation-swatches__item:hover,
.buybox .wplb-variation-swatches__item:focus { box-shadow: none; border-color: var(--muted); color: var(--ink); outline: none; }
/* выбранный свотч — бренд. !important: merchant перебивает selected инлайн-CSS кастомайзера */
.buybox .wplb-variation-swatches--button .wplb-variation-swatches__item.selected {
  border-color: var(--brand) !important; background: var(--brand-soft) !important; color: var(--brand-ink) !important; box-shadow: inset 0 0 0 1px var(--brand) !important; }
.buybox .wplb-variation-swatches__item.disabled { opacity: .35; text-decoration: line-through; }
.buybox .wplb-variation-swatches__name { text-indent: 0; }
/* сброс выбора — справа, с подписью (а не сиротливый крестик слева) */
.buybox .reset_variations { display: block; text-align: right; margin: 8px 2px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.buybox .reset_variations::after { content: "Сбросить выбор"; margin-left: 3px; }
.buybox .reset_variations .merchant-svg-icon { display: inline-flex; vertical-align: -3px; }
.buybox .reset_variations svg { width: 14px; height: 14px; }
.buybox .reset_variations:hover { color: var(--brand-ink); }

/* «В корзину» — наш primary (бренд), вместо тёмной кнопки родителя. !important: merchant
   красит .single_add_to_cart_button своим (тёмным) стилем с высокой специфичностью. */
.buybox .single_add_to_cart_button {
  background: var(--brand) !important; color: #fff !important; border: 0 !important;
  border-radius: 12px !important; font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 20px -10px rgba(240,140,30,.8); transition: .18s var(--ease); }
.buybox .single_add_to_cart_button:hover { background: var(--brand-ink) !important; transform: translateY(-1px); }
.buybox .single_add_to_cart_button.disabled,
.buybox .single_add_to_cart_button:disabled { opacity: .5; box-shadow: none; transform: none; cursor: not-allowed; }
.buybox .single_add_to_cart_button .icon-cart svg { width: 20px; height: 20px; }
/* цена/наличие выбранной вариации */
.buybox .woocommerce-variation.single_variation { margin-bottom: 14px; }
.buybox .woocommerce-variation .price { font-size: 24px; font-weight: 800; color: var(--ink); }
.buybox .woocommerce-variation .stock { font-size: 13.5px; font-weight: 600; color: var(--green); margin-top: 4px; }

.buy-secondary { display: flex; gap: 10px; }
.ghost-act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .15s; }
.ghost-act:hover { border-color: var(--brand); color: var(--brand-ink); }
.ghost-act svg { width: 17px; height: 17px; }
.ghost-act.on { color: var(--brand-ink); border-color: var(--brand); }

.delivery-note { display: flex; gap: 12px; margin-top: 20px; padding: 16px; background: var(--surface); border-radius: 12px; }
.delivery-note .ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.delivery-note .ic svg { width: 20px; height: 20px; }
.delivery-note b { font-size: 14px; }
.delivery-note span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }

/* ---------- SHARE ---------- */
.share { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.share .soc { display: flex; gap: 8px; }
.share .soc a { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--ink-2); transition: .15s; }
.share .soc a:hover { background: var(--brand); color: #fff; }
.share .soc svg { width: 16px; height: 16px; }

/* ---------- DETAILS / TABS ---------- */
.details { padding: 8px 0 20px; }
.tabbar { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tabbar button { padding: 14px 22px; font-size: 16px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: .15s; }
.tabbar button.on { color: var(--ink); border-color: var(--brand); }
.tabbar button:hover:not(.on) { color: var(--ink-2); }
.tabpane { display: none; }
.tabpane.on { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- SPEC GRID ---------- */
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; max-width: 920px; }
.spec-grid .row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.spec-grid .row .k { color: var(--ink-2); }
.spec-grid .row .v { font-weight: 700; text-align: right; }

/* ---------- DESCRIPTION ---------- */
.desc { max-width: 840px; }
.desc p { color: var(--ink-2); font-size: 15.5px; line-height: 1.7; margin-bottom: 16px; }
.desc h3 { font-size: 19px; margin: 26px 0 12px; }
.desc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.desc li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.desc li svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--green); margin-top: 1px; }

/* ---------- SIMILAR PRODUCTS ---------- */
/* Карточку .pc целиком стилизует components.css (единый источник). Локальные дубли удалены —
   из-за них related-карточки расходились с каталогом (старый .pc-add 48×48 рисовал
   оранжевый квадрат за текстом «Подробнее»). */
.similar { padding: 20px 0 60px; }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--graphite); color: #fff; padding: 15px 22px; border-radius: 14px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; z-index: 200; transition: transform .35s var(--ease); max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .tk { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; }
.toast .tk svg { width: 15px; height: 15px; color: #fff; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .product { grid-template-columns: 1fr; gap: 32px; }
  .gallery { position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .thumb { width: 70px; height: 70px; }
  .quickspecs, .spec-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .buy-actions { flex-wrap: wrap; }
  .add-cart { flex: 1 1 100%; }
}
