/* Дизайн-система ХоумЛаб 3D (с 2026-11): база, кнопки, карточки товаров,
   вкладки, частые вопросы, появление. Шрифты, токены, шапка и подвал — в shell.css
   (он подключается партиалом шапки на всех страницах, в том числе старых).
   Общая для всех страниц нового вида; стили отдельных страниц — в своих файлах
   (home.css и т. д.), подключаются ПОСЛЕ этого. Описание — docs/DESIGN.md. */

/* Чат Панды (assistant.css) берёт шрифт из переменных старого сайта — на новых страницах направляем на Onest */
:root { --font-body: var(--text); --font-display: var(--display); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 150px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
a[href^="tel:"] { white-space: nowrap; } /* номер не переносится посреди цифр */
h1, h2, h3 { margin: 0; text-wrap: balance; } /* без висячего короткого слова в последней строке заголовка */
p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border: 0; border-radius: 12px; background: var(--accent-strong); color: #fff; font-weight: 600; font-style: normal;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color 160ms ease, transform 120ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { background: var(--bg-3); color: var(--muted); cursor: default; }
@media (hover: hover) { .btn:not(:disabled):hover { background: #009626; } }
.btn--ghost { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
@media (hover: hover) { .btn--ghost:not(:disabled):hover { background: var(--bg-2); } }
.btn--light { background: #fff; color: var(--ink); }
.btn--block { width: 100%; }
.more { color: var(--accent-strong); font-weight: 600; text-decoration: none; white-space: nowrap; }
.more::after { content: ' →'; }
@media (hover: hover) { .more:hover { text-decoration: underline; } }

/* ===== Преимущества ===== */
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.perk { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--bg-2); border-radius: var(--r); }
.perk svg { width: 36px; height: 36px; flex: none; fill: none; stroke: var(--accent-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.perk b { display: block; font-weight: 600; }
.perk span { color: var(--muted); font-size: 14px; }

/* ===== Блоки ===== */
/* Хлебные крошки — на всех страницах нового вида, кроме главной */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 18px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
@media (hover: hover) { .crumbs a:hover { color: var(--accent-strong); } }
.crumbs [aria-current] { color: var(--ink); }
/* Шапка страницы каталога: крошки, заголовок и описание на серой плашке */
.pband { margin-top: 16px; padding: 18px clamp(18px, 2.4vw, 32px) clamp(20px, 2.4vw, 30px); border-radius: var(--r); background: var(--bg-2); }
.pband .crumbs { padding-top: 0; }
.pband .cat-head { margin-top: 10px; }
.block { margin-top: clamp(48px, 6vw, 80px); }
.block__head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 20px; }
.block__head h2, .duo h2, .showroom h2 { font: 700 clamp(24px, 2.4vw, 32px)/1.15 var(--display); letter-spacing: -0.02em; }
.block__head .more { margin-left: auto; }
.block__sub { color: var(--muted); }

/* ===== Вкладки ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--bg-2); cursor: pointer; font-weight: 500; transition: background-color 160ms ease, color 160ms ease; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
@media (hover: hover) { .tab:not([aria-selected="true"]):hover { background: var(--bg-3); } }

/* ===== Карточки товаров =====
   Семь частей карточки выровнены по строкам сетки (subgrid): цена и кнопка
   у соседних карточек на одной линии, сколько бы опций ни было. */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card {
  position: relative; display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 10px; align-content: start;
  padding: 0 0 16px; border-radius: var(--r); background: var(--bg); overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms var(--ease); min-width: 0;
}
@supports not (grid-template-rows: subgrid) { .card { display: flex; flex-direction: column; } .card [data-p="price"] { margin-top: auto; } }
.card > *:not(.card__img) { margin: 0 16px; }
/* Рамка — отдельным слоем поверх фото, иначе фото на всю ширину её перекрывает */
.card::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; transition: box-shadow 200ms ease; }
@media (hover: hover) { .card:hover { box-shadow: 0 14px 36px rgba(14, 36, 22, 0.1); transform: translateY(-2px); } .card:hover::after { box-shadow: inset 0 0 0 1px #cfd8d1; } }
.card__img { position: relative; display: block; aspect-ratio: 1; background: #f3f4f3; overflow: hidden; margin-bottom: 4px; }
.card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 320ms ease, transform 500ms var(--ease); }
.card__img img.is-incoming { opacity: 0; }
/* Листание фото мышью (ds.js, data-gal): чёрточки внизу фото, видны только при наведении */
.card__gal { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; display: flex; gap: 4px; pointer-events: none; }
.card__gal i { flex: 1; height: 3px; border-radius: 2px; background: rgba(120, 120, 120, .35); box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); transition: background 150ms ease; }
.card__gal i.on { background: #1d1d1f; box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); }
@media (hover: hover) { .card:hover .card__img img { transform: scale(1.03); } }
/* Аксессуары (c:): у фото Bambu широкие белые поля — товар крупнее, квадрат фото заполняет плитку целиком (04.11.2026) */
.card[data-card^="c:"] .card__img { background: #f7f7f7; }
.card[data-card^="c:"] .card__img img { transform: scale(1.28); }
@media (hover: hover) { .card[data-card^="c:"]:hover .card__img img { transform: scale(1.32); } }
.card__badges { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; }
/* у пластика слева на фото значок RFID — бейджи справа */
.card[data-card^="f:"] .card__badges { left: auto; right: 12px; justify-content: flex-end; }
.tag { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; background: var(--ink); color: #fff; }
.tag--sale { background: var(--sale); }
.tag--new { background: var(--accent); }
.tag--hit { background: #ffb800; color: var(--ink); }
.card__name { font-weight: 600; font-size: 17px; line-height: 1.3; text-decoration: none; }
@media (hover: hover) { .card__name:hover { color: var(--accent-strong); } }
.card__desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.card__color { color: var(--ink); font-weight: 500; }
.card__opts { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.card__opts:empty { display: block; }
.card__opts:has(.var) { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.var { min-height: 34px; max-width: 100%; padding: 6px 12px; text-align: left; line-height: 1.25; /* длинное «Full Combo (Laser 10W)» переносится внутри кнопки, а не вылезает */ border: 0; border-radius: 9px; background: var(--bg-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color 160ms ease, box-shadow 160ms ease; }
.var[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (hover: hover) { .var:not([aria-pressed="true"]):hover { background: var(--bg-3); } }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--c, #ccc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); transition: transform 140ms var(--ease), box-shadow 160ms ease; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-strong); }
@media (hover: hover) { .sw:hover { transform: scale(1.15); } }
.sw-more { font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: var(--bg-2); }
.seg__b { min-height: 32px; padding: 5px 6px; line-height: 1.2; border: 0; /* на узкой карточке «На катушке» переносится внутри кнопки */ border-radius: 8px; background: none; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.seg__b[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 36, 22, 0.14); }
.seg__b:disabled { opacity: 0.4; cursor: default; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; align-self: end; }
.price b { font: 700 22px/1 var(--text); white-space: nowrap; }
.price s { color: var(--muted); font-size: 14px; white-space: nowrap; }
.price .off { color: var(--sale); font-size: 13px; font-weight: 600; }
/* Цена со скидкой — зелёная везде, обычная — цветом текста (владелец 04.11.2026).
   Признак скидки — зачёркнутая старая цена рядом (<s>) или класс .is-sale там, где её не показывают. */
:is(.price, .pcard__price, .nz-card__price) b:has(+ s), .picker__price:has(s), .vcard__price.is-sale, .lu__price.is-sale { color: var(--accent-strong); }
.picker__price:has(s) s { color: var(--muted); }
.stock { font-size: 13px; font-weight: 500; color: var(--accent-strong); }
.stock.is-sup { color: #9a6b00; }
.stock.is-out { color: var(--muted); }
.btn.is-done { background: var(--deep); }
.fly { position: fixed; z-index: 100; object-fit: cover; pointer-events: none; border-radius: 12px; box-shadow: 0 12px 30px rgba(14, 36, 22, 0.25); } /* летит в корзину */

/* ===== Вопросы: две независимые колонки — раскрытие одного ответа не сдвигает соседнюю ===== */
.faq__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: start; }
.faq__col { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: var(--r); background: var(--bg-2); transition: background-color 240ms ease; }
.faq details[open]:not(.is-closing) { background: var(--accent-soft); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; position: relative; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ''; position: absolute; right: 22px; top: 50%; width: 14px; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--accent-strong); transition: transform 300ms var(--ease); }
.faq summary::after { transform: rotate(90deg); }
.faq details[open]:not(.is-closing) summary::after { transform: rotate(0deg); }
.faq__a { overflow: hidden; }
.faq__a p { padding: 0 20px 18px; color: var(--muted); }
.faq details a { color: var(--accent-strong); font-weight: 600; }

/* ===== Сообщения и cookie из app.js ===== */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 12px; font-weight: 500; max-width: calc(100vw - 32px); transition: opacity 200ms ease, transform 260ms var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; width: fit-content; z-index: 80; max-width: 420px; display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 18px; background: var(--ink); color: #fff; border-radius: 14px; font-size: 14px; }
.cookie-banner a { color: #7fe39a; }
.cookie-banner button { height: 38px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; flex: none; }

/* ===== Окна app.js: «Купить в 1 клик», предзаказ, «Узнать о поступлении» (.pom-overlay) =====
   Окна создаёт app.js сам; на старых страницах их стили — в index.css, на новых — здесь. */
.pom-overlay { position: fixed; inset: 0; z-index: 95; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(14, 36, 22, 0.45); }
.pom-overlay.is-open { display: flex; }
.pom { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; padding: 28px 24px 24px; border-radius: 20px; background: var(--bg); box-shadow: 0 30px 80px rgba(14, 36, 22, 0.3); }
.pom [hidden] { display: none !important; } /* app.js прячет форму / ошибку / успех атрибутом hidden */
.pom__close { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-2); font-size: 22px; line-height: 1; cursor: pointer; }
.pom__title { font: 700 22px/1.2 var(--display); padding-right: 40px; }
.pom__lead { margin: 12px 0 16px; color: var(--muted); font-size: 15px; }
.pom__form { display: flex; flex-direction: column; gap: 12px; }
.pom__field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.pom__field i { color: var(--sale); font-style: normal; }
.pom__field input, .pom__field textarea { height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; font: 400 16px var(--text); color: var(--ink); background: var(--bg); }
.pom__field input:focus, .pom__field textarea:focus { outline: none; border-color: var(--accent-strong); }
.pom__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.pom__consent input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent-strong); flex: none; }
.pom__consent a { color: var(--accent-strong); }
.pom__hp { position: absolute; left: -9999px; }
.pom__error { padding: 10px 12px; border-radius: 10px; background: #fdecec; color: var(--sale); font-size: 14px; }
.pom__submit { width: 100%; height: 52px; }
.pom__success { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0 0; text-align: center; color: var(--accent-strong); }
.pom__success strong { color: var(--ink); font-size: 20px; }
.pom__success p { color: var(--muted); }
.pom__success a { color: var(--accent-strong); }
.pom .btn--outline { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.qb-product { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 12px; background: var(--bg-2); }
.qb-product__img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.qb-product__info { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.qb-product__name { font-weight: 600; }
.qb-product__badge { color: var(--muted); }
.qb-product__price { font-weight: 700; }

/* ===== Появление ===== */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease), transform 700ms var(--ease); transition-delay: var(--d, 0ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .grid.is-swap .card { animation: rise 420ms var(--ease) backwards; }
  .grid.is-swap .card:nth-child(2) { animation-delay: 40ms; }
  .grid.is-swap .card:nth-child(3) { animation-delay: 80ms; }
  .grid.is-swap .card:nth-child(4) { animation-delay: 120ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ===== Планшет ===== */
@media (max-width: 1180px) {
  .grid, .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* ===== Телефон ===== */
@media (max-width: 900px) {
  .perks { grid-template-columns: 1fr 1fr; }
  .grid, .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .faq__cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .perk { padding: 12px; gap: 10px; }
  .perk svg { width: 28px; height: 28px; }
  .perk span { font-size: 13px; }
  .price b { font-size: 18px; }
  .card { padding: 0 0 12px; }
  .btn { height: 42px; padding: 0 14px; }
  .card > *:not(.card__img) { margin: 0 10px; }
  .card__name { font-size: 15px; }
  .var { padding: 6px 10px; font-size: 13px; }
}

/* ===== Баннер «Гид по пластику» (главная, страницы пластика; guideBanner в scripts/lib/product.js) ===== */
.gban { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px 32px; align-items: center; padding: 22px 28px; border-radius: var(--r); background: var(--bg-2); color: var(--ink); text-decoration: none; }
.gban__mats { display: flex; gap: 6px; }
.gban__m { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.gban__m img { width: 52px; height: 52px; border-radius: 50%; background: var(--bg); transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.gban__m b { font-weight: 700; }
.gban__txt b { display: block; font: 700 20px/1.25 var(--display); letter-spacing: -0.01em; }
.gban__txt span { display: block; margin-top: 4px; color: var(--muted); max-width: 62ch; }
.gban--home { padding: 32px 36px; }
.gban--home .gban__h { font-size: clamp(24px, 2.4vw, 32px); }
.gban--home .gban__m img { width: 64px; height: 64px; }
/* при наведении катушки чуть проворачиваются, по очереди — как будто их достают с полки */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gban:hover .gban__m img { transform: rotate(-24deg) translateY(-4px); }
  .gban:hover .gban__m:nth-child(2) img { transition-delay: 40ms; }
  .gban:hover .gban__m:nth-child(3) img { transition-delay: 80ms; }
  .gban:hover .gban__m:nth-child(4) img { transition-delay: 120ms; }
  .gban:hover .gban__m:nth-child(5) img { transition-delay: 160ms; }
  .gban:hover .gban__m:nth-child(6) img { transition-delay: 200ms; }
}
@media (max-width: 900px) {
  .gban, .gban--home { grid-template-columns: 1fr; padding: 22px 18px; }
  .gban__mats { justify-content: space-between; }
  .gban__m img, .gban--home .gban__m img { width: 44px; height: 44px; }
  .gban__go { justify-self: start; }
}

/* ===== Телефон: товары по одной карточке в ряд (в две не влезали «Узнать о поступлении» и комплектации).
   Пластик остаётся по две — у него карточка короткая и так удобнее листать цвета (владелец 02.11.2026). ===== */
@media (max-width: 600px) {
  body .grid.grid:not(:has(> .card[data-card^="f:"])) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid:not(:has(> .card[data-card^="f:"])) .card { padding-bottom: 16px; }
  .grid:not(:has(> .card[data-card^="f:"])) .card__img { aspect-ratio: 4 / 3; }
  .grid:not(:has(> .card[data-card^="f:"])) .card > *:not(.card__img) { margin: 0 16px; }
  .grid:not(:has(> .card[data-card^="f:"])) .card__name { font-size: 17px; }
  .grid:not(:has(> .card[data-card^="f:"])) .price b { font-size: 22px; }
}

/* ===== Телефон: плитки преимуществ по одной, крупнее зоны нажатия ===== */
@media (max-width: 480px) {
  .perks { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (pointer: coarse) {
  .sw { position: relative; }
  .sw::after { content: ''; position: absolute; inset: -8px; }  /* палец попадает в 40 px вокруг кружка цвета */
  .more { display: inline-flex; align-items: center; min-height: 44px; }
}
