/* ============================================================
   Дизайн 3.0 «Шоурум»: по умолчанию тёмная тема, светлая — <html data-theme="light">
   Все цвета — переменные; компоненты ниже используют только их.
   ============================================================ */
:root {
  --ink: #e8edf2;            /* основной текст */
  --ink-2: #c3ccd5;
  --strong: #ffffff;
  --brown-900: #e8edf2;      /* старые имена переменных — оставлены для совместимости */
  --brown-800: #c3ccd5;
  --brown-700: #9aa6b2;
  --brown-600: #8b97a3;
  --brown-500: #75818d;
  --brown-400: #5d6b78;
  --brown-300: #2f4052;
  --fur: #7cc6ff;
  --bg: #0a0c0f;
  --surface: #0f1318;        /* карточки */
  --surface-2: #131920;
  --line: #1a2129;
  --line-strong: #2a3540;
  --text: var(--ink);
  --muted: #8b97a3;
  --faint: #5d6b78;
  --accent: #7cc6ff;
  --accent-hover: #b3ddff;
  --accent-soft: rgba(124, 198, 255, .10);
  --ok: #7fd3a3;
  --ok-soft: rgba(127, 211, 163, .12);
  --warn: #c9a86a;
  --warn-soft: rgba(201, 168, 106, .12);
  --err: #f0806f;
  --err-soft: rgba(240, 128, 111, .12);
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: none;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --bars: linear-gradient(90deg, #3f86b8, #7cc6ff);
  --hero: radial-gradient(520px 340px at 28% 55%, #16324a 0%, #0f141a 60%, #0c0f13 100%);
  --btn-bg: #e8edf2;         /* главная кнопка: светлая на тёмном */
  --btn-fg: #0a0c0f;
  --on-ink: #0a0c0f;
  --footer-bg: #07090c;
  --field: #12171d;          /* поля ввода и всплывающие списки */
  --field-line: #1f2731;
  --hover-row: #121820;
  --photo-bg: #131920;
  color-scheme: dark;
  font-size: 15px;
}
:root[data-theme="light"] {
  --ink: #121820;
  --ink-2: #2f3a46;
  --strong: #05080c;
  --brown-900: #121820;
  --brown-800: #2f3a46;
  --brown-700: #4f5b68;
  --brown-600: #5b6774;
  --brown-500: #6b7783;
  --brown-300: #b9c7d6;
  --fur: #1769b3;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --line: #e1e6ec;
  --line-strong: #cfd8e1;
  --muted: #5b6774;
  --faint: #7a8692;
  --accent: #1769b3;
  --accent-hover: #0f4f8a;
  --accent-soft: rgba(23, 105, 179, .08);
  --ok: #1d7f47;
  --ok-soft: #e4f3ea;
  --warn: #9a6510;
  --warn-soft: #f8efdc;
  --err: #c0392b;
  --err-soft: #fbe9e6;
  --shadow: 0 1px 2px rgba(18, 24, 32, .04), 0 6px 20px rgba(18, 24, 32, .05);
  --shadow-lg: 0 18px 50px rgba(18, 24, 32, .16);
  --bars: linear-gradient(90deg, #1769b3, #4fa3e8);
  --hero: radial-gradient(520px 340px at 28% 55%, #d6e8f8 0%, #eef3f8 60%, #f7f9fb 100%);
  --btn-bg: #121820;
  --btn-fg: #ffffff;
  --on-ink: #ffffff;
  --footer-bg: #e9edf2;
  --field: #ffffff;
  --field-line: #d9e0e7;
  --hover-row: #f6f8fb;
  --photo-bg: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 1.75rem; margin: .2rem 0 1.1rem; letter-spacing: -.02em; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .9rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code { background: var(--accent-soft); color: var(--brown-800); padding: 1px 6px; border-radius: 5px; font-size: .88em; word-break: break-all; }
.container { max-width: 1340px; margin: 0 auto; padding: 26px 20px 48px; width: 100%; }
.narrow { max-width: 660px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--err); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
::selection { background: var(--brown-300); color: var(--ink); }

/* ---------- шапка ---------- */
.topbar { background: var(--surface); position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(58, 40, 32, .05); }
.topbar-inner { max-width: 1340px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-mark { display: none; height: 40px; width: 40px; }
.brand-sub { font-size: .72rem; line-height: 1.15; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700;
  border-left: 2px solid var(--line); padding-left: 12px; }
.brand-bars { display: flex; height: 4px; }
.brand-bars i { flex: 1; }
.brand-bars i:nth-child(1) { background: #4e3122; } .brand-bars i:nth-child(2) { background: #5e3b28; }
.brand-bars i:nth-child(3) { background: #6f4832; } .brand-bars i:nth-child(4) { background: #7e553b; }
.brand-bars i:nth-child(5) { background: #8d6750; } .brand-bars i:nth-child(6) { background: #9a775e; }
.brand-bars i:nth-child(7) { background: #a88770; } .brand-bars i:nth-child(8) { background: #b8997f; }
.topsearch { flex: 1; max-width: 520px; position: relative; }
.topsearch input { width: 100%; padding-left: 40px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237a6d63' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; border-radius: 999px; }
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.mainnav > a { color: var(--ink-2); padding: 8px 14px; border-radius: 999px; white-space: nowrap; font-weight: 600; font-size: .95rem; }
.mainnav > a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mainnav > a.active { background: var(--ink); color: var(--on-ink); }
.badge { background: var(--accent); color: var(--on-ink); border-radius: 999px; padding: 1px 8px; font-size: .75rem; font-weight: 800; margin-left: 4px; }
.mainnav > a.active .badge { background: var(--fur); }
.usermenu { position: relative; margin-left: 6px; }
.usermenu summary { list-style: none; cursor: pointer; padding: 7px 12px 7px 7px; border-radius: 999px; max-width: 230px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); }
.usermenu summary::before { content: ""; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--bars); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: "▾"; color: var(--muted); font-size: .8rem; }
.usermenu[open] summary { background: var(--surface-2); }
.usermenu-body { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px; min-width: 240px; display: grid; gap: 2px; }
.usermenu-body > .muted { padding: 4px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-body a, .usermenu-body .linkbtn { padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--ink); display: block; width: 100%; }
.usermenu-body a:hover, .usermenu-body .linkbtn:hover { background: var(--accent-soft); text-decoration: none; }

.footer { background: var(--footer-bg); color: var(--muted); border-top: 1px solid var(--line); margin-top: 30px; font-size: .86rem; }
.footer-inner { max-width: 1340px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.footer-inner span { flex: 1; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent); }

/* ---------- формы ---------- */
input, select, textarea {
  font: inherit; color: inherit; background: var(--field); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; min-height: 40px; max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--brown-300); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138, 90, 59, .16); }
input[type=checkbox] { min-height: 0; width: 17px; height: 17px; accent-color: var(--accent); }
input[type=file] { padding: 7px; background: var(--surface-2); }
textarea { resize: vertical; }
.form { display: grid; gap: 15px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.form label input, .form label select, .form label textarea { font-weight: 400; color: var(--ink); }
.form label.check, label.check { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.form-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
legend { font-weight: 700; padding: 0 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); padding: 9px 18px; border-radius: 10px; min-height: 40px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--brown-300); text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); box-shadow: none; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }
.btn-incart { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn-incart:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 13px; min-height: 34px; font-size: .88rem; border-radius: 9px; }
.btn-lg { padding: 12px 26px; font-size: 1.05rem; min-height: 48px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--accent-hover); }
.linkbtn.danger { color: var(--err); }
.iconbtn { background: none; border: 0; font-size: 1.35rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 3px 9px; border-radius: 8px; }
.iconbtn:hover { background: var(--err-soft); color: var(--err); }

.flash { padding: 12px 16px 12px 44px; border-radius: 12px; margin: 0 0 18px; border: 1px solid transparent; position: relative; }
.flash::before { position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; color: #fff; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-ok::before { content: "✓"; background: var(--ok); }
.flash-error { background: var(--err-soft); border-color: transparent; color: var(--err); }
.flash-error::before { content: "!"; background: var(--err); }
.flash-info { background: var(--accent-soft); border-color: transparent; color: var(--ink-2); }
.flash-info::before { content: "i"; background: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > summary { cursor: pointer; font-weight: 700; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.stack { display: grid; gap: 9px; justify-items: start; }

.pill { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-wait { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }
.tag { display: inline-block; background: var(--accent); color: var(--on-ink); border-radius: 6px; padding: 1px 7px; font-size: .78rem; font-weight: 800; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 18px; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brown-700); font-weight: 800; background: var(--surface-2); white-space: nowrap; }
.grid tbody tr { transition: background .12s; }
.grid tbody tr:hover { background: var(--hover-row); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface-2); }
.grid.compact td { padding: 7px 12px; }
.grid .num { text-align: right; white-space: nowrap; }
.grid .total { font-size: 1.15rem; font-weight: 800; }
.row-changed { background: var(--accent-soft); }
.row-warn { background: var(--warn-soft) !important; }
.col-img { width: 64px; padding-right: 0 !important; }
.col-img img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.img-ph { display: block; width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2) url("/static/mark.png") center / 30px no-repeat; filter: grayscale(1); opacity: .45; }
.pname { color: var(--ink); font-weight: 600; }
.pname:hover { color: var(--accent); }
.price b { font-size: 1.05rem; font-weight: 800; }
.old { color: var(--muted); text-decoration: line-through; font-size: .8rem; }
.stock { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.stock-many { color: var(--ok); }
.stock-few { color: var(--warn); }
.stock-none { color: var(--muted); font-weight: 500; }
.col-buy { width: 220px; }
.buy { display: flex; gap: 6px; align-items: center; }
.buy input { width: 76px; text-align: right; }
.buy-lg input { width: 110px; min-height: 48px; font-size: 1.05rem; }
.buy-lg .btn { min-height: 48px; padding: 0 26px; font-size: 1rem; }
.qty-input { width: 96px; text-align: right; }
.actions-cell form { display: flex; gap: 14px; flex-wrap: wrap; }
form.inline { display: inline; }

/* ---------- каталог ---------- */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
.sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; position: sticky; top: 92px;
  max-height: calc(100vh - 112px); overflow: auto; box-shadow: var(--shadow); }
.side-title { font-weight: 800; margin: 2px 6px 10px; text-transform: uppercase; letter-spacing: .07em; font-size: .76rem; color: var(--brown-700); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 12px; margin-left: 8px; border-left: 1px solid var(--line); }
.tree a { display: flex; justify-content: space-between; gap: 6px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); font-size: .93rem; }
.tree a .muted { font-size: .8rem; }
.tree a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.tree a.active { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.tree a.active .muted { color: var(--on-ink); opacity: .7; }
.side-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.crumbs { color: var(--muted); font-size: .86rem; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.catalog-main { min-width: 0; }
.catalog-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.catalog-head h1 { margin-bottom: .8rem; }
.catalog-head .muted { background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; padding: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.filters input[type=search] { flex: 1; min-width: 200px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 14px 0; }
.pager a, .pager span { padding: 7px 14px; border-radius: 999px; }
.pager a { background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.pager a:hover { border-color: var(--brown-300); text-decoration: none; }
.pager span { color: var(--muted); }
.sync-note { text-align: right; }
.empty { text-align: center; padding: 60px 16px; }
.empty h2 { font-size: 1.35rem; }
.empty-code { font-size: 4rem; font-weight: 900; background: var(--bars); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin-bottom: 10px; }

.toast { position: fixed; right: 22px; bottom: 22px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); padding: 13px 18px 13px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 50; max-width: 380px; border-left: 4px solid var(--accent); font-weight: 500; }
.toast.warn { border-left-color: var(--warn); }

/* ---------- карточка товара ---------- */
.product { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 32px; margin-bottom: 28px; }
.product-media { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); aspect-ratio: 1; display: flex;
  align-items: center; justify-content: center; overflow: hidden; box-shadow: var(--shadow); padding: 16px; }
.product-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product > * { min-width: 0; }
.noimg { color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.noimg::before { content: ""; width: 96px; height: 96px; background: url("/static/mark.png") center / contain no-repeat; opacity: .22; filter: grayscale(1); }
.product-info h1 { font-size: 1.9rem; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0 0 18px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; font-weight: 500; }
.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; display: grid; gap: 16px;
  box-shadow: var(--shadow); margin-bottom: 18px; position: relative; overflow: hidden; }
.buybox::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--bars); }
.big { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; }
.stores { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.description { white-space: pre-line; color: var(--ink-2); }

/* ---------- корзина ---------- */
.cart-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.checkout { max-width: 920px; position: relative; overflow: hidden; }
.checkout::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--bars); }
.checkout-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.total-big { font-size: 1.3rem; }
.total-big b { font-weight: 900; }
.import { max-width: 920px; }
.import summary { font-weight: 700; }
.import form { margin-top: 12px; }

/* ---------- заказы ---------- */
.order-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.order-head h1 { margin-bottom: .6rem; }
.order-meta { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.order-meta .sub { color: var(--ink-2); font-size: .85rem; }
.order-meta .muted { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.order-meta .wide { grid-column: 1 / -1; }
.actions { margin-bottom: 18px; }

/* ---------- фото товаров ---------- */
.product-media { position: relative; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--field); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.gal-nav:hover { border-color: var(--accent); }
.gal-prev { left: 10px; } .gal-next { right: 10px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 68px; height: 68px; padding: 4px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb:hover { border-color: var(--brown-300); }
.thumb.active { border-color: var(--accent); }
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(18, 15, 14, .94); display: flex; align-items: center; justify-content: center; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 56px 72px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: transform .2s ease; background: #fff; border-radius: 6px;
  user-select: none; -webkit-user-drag: none; }
.lightbox.zoomed .lb-stage img { cursor: zoom-out; transition: transform .2s ease, transform-origin .05s linear; }
.lb-btn { position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(20,16,14,.55); color: #fff; backdrop-filter: blur(4px);
  font-size: 2rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: rgba(20,16,14,.8); }
.lb-close { top: 14px; right: 16px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #cbbcaf; font-size: .85rem; pointer-events: none; }
body.lb-open { overflow: hidden; }
@media (max-width: 860px) { .lb-stage { padding: 56px 8px; } .lb-hint { display: none; } }
.product-left { display: grid; gap: 12px; align-content: start; }
.photo-upload { display: grid; gap: 6px; text-align: center; }
.photo-upload label.btn { cursor: pointer; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 34px 20px; text-align: center; background: var(--surface-2);
  display: grid; justify-items: center; gap: 8px; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-icon { width: 64px; height: 64px; background: url("/static/mark.png") center / contain no-repeat; opacity: .85; }
.dz-title { font-weight: 800; font-size: 1.1rem; }
.dz-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.dz-progress { width: 100%; max-width: 420px; display: grid; gap: 6px; margin-top: 8px; }
.dz-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.dz-bar i { display: block; height: 100%; width: 0; background: var(--bars); transition: width .2s; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.spinner { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- админка ---------- */
.subnav, .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 22px; padding: 5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; }
.subnav a, .tabs a { padding: 7px 15px; color: var(--ink-2); border-radius: 999px; font-weight: 600; font-size: .92rem; }
.subnav a:hover, .tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.subnav a.active, .tabs a.active { background: var(--ink); color: var(--on-ink); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 34px; height: 3px; background: var(--fur); border-radius: 3px 3px 0 0; }
.stat-v { font-size: 1.8rem; font-weight: 900; letter-spacing: -.02em; }
.stat-bad .stat-v { color: var(--err); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { padding-left: 32px; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; }
.checklist li.ok::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.checklist li.todo::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.errors { margin: 0; padding-left: 18px; font-size: .9rem; }
.ac-list { border: 1px solid var(--line); border-radius: 10px; background: var(--field); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; }
.ac-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; font: inherit; cursor: pointer; }
.ac-list button:hover, .ac-list button:focus { background: var(--accent-soft); outline: none; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px dashed var(--brown-300);
  padding: 11px 13px; border-radius: 10px; margin: 8px 0; word-break: break-all; font-size: .95rem; letter-spacing: .03em; color: var(--brown-800); }
.selectable { user-select: all; }
.steps { padding-left: 20px; display: grid; gap: 12px; }
.policy { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 280px; overflow: auto; font-size: .92rem; margin-bottom: 14px; }
.manager { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft); border-radius: 10px; border-left: 3px solid var(--fur); }
.narrow-card { max-width: 540px; }

/* ---------- вход ---------- */
body.auth { background: var(--bg); }
.auth-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; color: #c3ccd5; padding: 56px 60px; display: flex; flex-direction: column; gap: 48px;
  background: radial-gradient(900px 520px at 30% 60%, #16324a 0%, #0f141a 55%, #090b0e 100%); border-right: 1px solid #1a2129; }
.auth-logo { width: min(440px, 100%); height: auto; }
.auth-hero-text h2 { font-size: 3rem; line-height: 1.05; font-weight: 200; letter-spacing: -.02em; color: #fff; margin: 0 0 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 460px; font-weight: 300; }
.auth-points li { padding-left: 30px; position: relative; color: #9aa6b2; }
.auth-points li b { color: #e8edf2; font-weight: 600; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 9px; width: 14px; height: 2px; background: #7cc6ff; }
.auth-bars { position: absolute; left: 60px; right: 60px; bottom: 0; height: 120px; display: flex; align-items: flex-end; gap: 10px; opacity: .55; }
.auth-bars i { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, rgba(124,198,255,.55), rgba(124,198,255,.04)); }
.auth-bars i:nth-child(1) { height: 18%; } .auth-bars i:nth-child(2) { height: 28%; } .auth-bars i:nth-child(3) { height: 38%; }
.auth-bars i:nth-child(4) { height: 48%; } .auth-bars i:nth-child(5) { height: 58%; } .auth-bars i:nth-child(6) { height: 70%; }
.auth-bars i:nth-child(7) { height: 84%; } .auth-bars i:nth-child(8) { height: 100%; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px 36px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-card-logo { display: none; width: 220px; height: auto; margin: 0 auto 18px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .9rem; }
.auth-links { margin: 16px 0 6px; text-align: center; }
.auth-brand, .auth-title { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .topsearch { display: none; }
  .brand-sub { display: none; }
}
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card-logo { display: block; }
}
@media (max-width: 860px) {
  .catalog, .product, .cols, .form-row { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: 260px; }
  .filters input[type=search] { min-width: 0; flex-basis: 100%; }
  .container { padding: 16px 12px 32px; }
  .order-meta { grid-template-columns: 1fr 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand-logo { display: none; }
  .brand-mark { display: block; }
  .mainnav { margin-left: auto; flex-wrap: wrap; }
  .mainnav > a { padding: 7px 11px; }
  .topbar-inner { flex-wrap: nowrap; }
  .mainnav { flex-wrap: nowrap; gap: 0; }
  .usermenu summary { font-size: 0; gap: 0; padding: 3px; border: 0; }
  .usermenu summary::after { display: none; }
  .usermenu summary::before { width: 32px; height: 32px; }
  .col-buy { width: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .subnav, .tabs { border-radius: 14px; }
  .footer-inner { flex-wrap: wrap; }
  h1 { font-size: 1.45rem; }
}

/* ---------- кнопки заказа и печать ---------- */
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .footer, .no-print, .subnav, .crumbs, .flash-ok, #order-new, .usermenu, .toast, .lightbox { display: none !important; }
  .container { max-width: none; padding: 0; }
  .print-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #7e553b;
    padding-bottom: 6px; margin-bottom: 12px; color: #7a6d63; font-size: 9pt; }
  .print-head img { height: 44px; width: auto; }
  .card, .table-wrap { box-shadow: none !important; border-color: #ccc; break-inside: avoid; }
  .grid th { background: #f3eee9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid td, .grid th { padding: 6px 8px; }
  .grid tr { break-inside: avoid; }
  .pill { border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 18pt; }
}

/* статусы заказов */
.status-tabs .tab-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: .78rem; line-height: 18px; text-align: center; }
.status-tabs a.active .tab-n { background: rgba(127,127,127,.25); color: var(--on-ink); }
.status-tabs .tabs-label { align-self: center; padding: 0 8px 0 10px; color: var(--ink-2); font-size: .86rem; }
.sort-link { color: inherit; white-space: nowrap; }
.sort-link:hover { text-decoration: none; color: var(--brand, inherit); }
.sort-link.active { color: var(--ink); }

/* управление фото товара */
.pm { margin-top: 14px; padding: 14px; display: grid; gap: 10px; }
.pm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pm-staff { margin-left: auto; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pm-item { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--field); cursor: grab; transition: box-shadow .15s, transform .15s; }
.pm-item img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.pm-item.pm-main { border: 2px solid var(--accent); }
.pm-item.pm-dragging { opacity: .45; transform: scale(.96); }
.pm-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.pm-badge { position: absolute; top: 5px; left: 5px; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(30,28,26,.72); color: #fff; }
.pm-main .pm-badge { background: var(--accent); color: var(--on-ink); }
.pm-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); padding: 14px 3px 3px; opacity: 0; transition: opacity .15s; }
.pm-item:hover .pm-tools, .pm-item:focus-within .pm-tools { opacity: 1; }
@media (hover: none) { .pm-tools { opacity: 1; } }
.pm-tools button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: var(--field); color: var(--ink);
  font-size: .9rem; line-height: 1; cursor: pointer; padding: 0; }
.pm-tools button:disabled { opacity: .35; cursor: default; }
.pm-tools button.pm-del { background: #c0392b; color: #fff; }
.pm-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pm-add label.btn { cursor: pointer; }
.pm-add.pm-locked { opacity: .45; pointer-events: none; }
.pm-url { display: flex; gap: 6px; flex: 1 1 220px; min-width: 0; }
.pm-url input { flex: 1; min-width: 0; }
.pm-status:empty { display: none; }
.pm-status.pm-ok { color: var(--ok); }
.pm-status.pm-err { color: var(--err); }
.pm.pm-busy { opacity: .75; }

/* редактирование цен (сотрудники) */
.price-edit { margin-top: 28px; padding: 18px; }
.pe-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pe-head h2 { margin: 0; }
.pe-table th, .pe-table td { white-space: nowrap; }
.pe-table .pe-name { white-space: normal; min-width: 160px; }
.pe-input { width: 118px; text-align: right; font-variant-numeric: tabular-nums; padding: 6px 8px; }
.pe-extra { background: var(--surface-2); }
.pe-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* плашка «Акция» */
.img-wrap { position: relative; display: inline-block; line-height: 0; }
.img-wrap .img-ph { display: block; }
.promo-badge { position: absolute; z-index: 2; background: linear-gradient(135deg, #d8452f, #b3362c); color: #fff;
  font-weight: 800; letter-spacing: .02em; line-height: 1; box-shadow: 0 2px 6px rgba(179,54,44,.35); pointer-events: none;
  text-transform: uppercase; white-space: nowrap; }
.promo-sm { top: -6px; left: -6px; font-size: .58rem; padding: 3px 5px; border-radius: 6px; }
.promo-lg { top: 14px; left: 14px; font-size: .82rem; padding: 7px 12px; border-radius: 999px; }
.promo-inline { position: static; display: inline-block; margin-left: 6px; vertical-align: middle; box-shadow: none; }
.promo-preview { position: relative; width: 160px; height: 120px; margin-top: 8px; }
.promo-preview .img-ph { width: 160px; height: 120px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.promo-tree .promo-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
.product-media { position: relative; }

/* новости */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.news-list { display: grid; gap: 16px; }
.news-card { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 16px; color: inherit; text-decoration: none;
  transition: box-shadow .15s, transform .15s; }
.news-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(30,28,26,.10); transform: translateY(-1px); }
.news-pinned { border-left: 4px solid var(--accent); }
.news-cover { width: 240px; height: 160px; object-fit: cover; border-radius: 12px; background: var(--surface-2); display: block; }
.news-cover-ph { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.news-text h2 { margin: 6px 0 8px; font-size: 1.25rem; }
.news-text p { margin: 0 0 10px; color: var(--ink-2); }
.news-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-more { color: var(--accent); font-weight: 700; font-size: .92rem; }
.pill-pin { background: var(--accent-soft); color: var(--accent); }
.pill-popup { background: var(--accent-soft); color: var(--accent); }
.news-article { padding: 24px 28px; max-width: 860px; }
.news-article h1 { margin: 8px 0 16px; }
.news-media { margin-bottom: 10px; aspect-ratio: 16 / 10; }
.news-media img { width: 100%; height: 100%; object-fit: contain; }
.news-body { font-size: 1.05rem; line-height: 1.65; margin-top: 16px; }
.news-body p { margin: 0 0 1em; }
.news-cols { grid-template-columns: 2fr 1fr; }
.news-side { display: grid; gap: 10px; position: sticky; top: 16px; }
.news-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.news-photo { border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 4px; background: var(--surface-2); }
.news-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.news-photo .np-del { color: var(--err); }
.news-photos .lbl { font-weight: 600; margin: 6px 0; }
.news-delete { margin-top: 16px; }
@media (max-width: 760px) {
  .news-card { grid-template-columns: 1fr; }
  .news-cover { width: 100%; height: 180px; }
  .news-cols { grid-template-columns: 1fr; }
  .news-article { padding: 16px; }
}

/* всплывающее окно новости */
.news-popup { position: fixed; inset: 0; z-index: 1000; background: rgba(20,17,15,.55); display: flex; align-items: center;
  justify-content: center; padding: 16px; animation: np-fade .2s ease-out; }
.news-popup[hidden] { display: none; }
.np-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface);
  border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: np-up .25s ease-out; }
.np-img { width: 100%; max-height: 300px; object-fit: cover; display: block; border-radius: 20px 20px 0 0; }
.np-body { padding: 22px 24px 24px; }
.np-body h2 { margin: 4px 0 10px; font-size: 1.4rem; }
.np-body p { margin: 0 0 18px; color: var(--ink-2); line-height: 1.55; }
.np-kicker { color: var(--accent); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.np-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.np-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; color: var(--ink);
  background: var(--field); font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
@keyframes np-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes np-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* редактор новостей */
.rte { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); overflow: hidden; margin-bottom: 14px; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 3; }
.rte-group { display: flex; gap: 2px; align-items: center; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.rte-group:last-child { border-right: 0; }
.rte-toolbar button { min-width: 32px; height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: var(--ink); font-size: .92rem; cursor: pointer; line-height: 1; }
.rte-toolbar button:hover { background: var(--field); border-color: var(--line); }
.rte-toolbar button:active { background: var(--accent-soft); }
.rte-toolbar select { height: 32px; padding: 0 6px; font-size: .86rem; border-radius: 7px; width: auto; min-width: 0; }
.rte-color { position: relative; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px;
  cursor: pointer; margin: 0; }
.rte-color:hover { background: var(--field); }
.rte-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.rte-a { font-weight: 800; border-bottom: 3px solid #b3362c; line-height: 1.1; }
.rte-mark { font-weight: 800; background: #fff3a0; padding: 0 4px; border-radius: 3px; }
.rte-area { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; outline: none; font-size: 16px; line-height: 1.6; }
.rte-area:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.rte-area:empty::before, .rte-area > p:only-child > br:only-child { }
.rte-area[data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--muted); }
.news-body h2 { font-size: 1.5rem; margin: 1.1em 0 .5em; }
.news-body h3 { font-size: 1.2rem; margin: 1em 0 .45em; }
.news-body blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.news-body ul, .news-body ol { padding-left: 1.5em; margin: 0 0 1em; }
.news-body hr { border: 0; border-top: 2px solid var(--line); margin: 1.4em 0; }
.news-body a { color: var(--accent); text-decoration: underline; }
.news-side-col { display: grid; gap: 16px; align-content: start; }
.news-side .nm { margin: -4px 0 4px 30px; }
.news-mail { margin-top: 20px; max-width: 900px; }
.news-mail h2 { margin-top: 0; }
.mail-status { margin: 8px 0 14px; }
.lbl { font-weight: 600; margin: 10px 0 6px; }

/* фото в тексте новости */
.rte { position: relative; }
.news-body img { max-width: 100%; height: auto; border-radius: 10px; }
.news-body::after { content: ""; display: block; clear: both; }
.rte-area img { cursor: pointer; }
.rte-area img.rte-img-sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.rte-imgbar { position: absolute; z-index: 5; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 6px 8px;
  background: var(--field); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.rte-imgbar button { height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); cursor: pointer; font-size: .82rem; }
.rte-imgbar button:hover { background: var(--accent-soft); }
.rte-imgbar .rte-del { color: var(--err); }
.rte-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.rte-status { padding: 0 14px 10px; color: var(--muted); }
.rte-status:empty { display: none; }
.rte-status.err { color: var(--err); }
.test-mail { margin: 4px 0 18px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; display: grid; gap: 6px; }
.test-mail label { font-weight: 600; margin: 0; }
.test-mail-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; font-weight: normal; }
.test-mail-row input { flex: 1 1 220px; min-width: 0; }

/* плашки товаров */
.badge-chip { display: inline-block; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.pname + .badge-chip { margin-left: 4px; }
.badge-stack { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.badge-stack .promo-badge { position: static; }
.badge-lg { font-size: .8rem; padding: 6px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.badge-panel { margin-top: 14px; padding: 14px; }
.badge-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.badge-opt { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px 4px 6px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); cursor: pointer; margin: 0; font-weight: normal; }
.badge-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.badge-opt input { margin: 0; }
.badge-new summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; margin: 4px 0; }
.badge-new[open] { display: grid; gap: 8px; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatches label { margin: 0; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatches span { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatches input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.section-title { margin-top: 36px; }
.badge-lib { padding: 0; overflow-x: auto; }
.badge-lib input[type=text], .badge-lib input:not([type]) { max-width: 200px; }
.form .badge-opt { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }

/* под заказ у поставщика */
.stock-order { color: var(--warn); }
.stock-extra { font-size: .78rem; font-weight: 600; color: var(--warn); margin-top: 2px; }

/* поставщики и прайсы */
.tiles-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 20px; }
.tiles-row .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.tiles-row .stat b { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.tiles-row .stat span { font-size: .8rem; color: var(--muted); }
.tiles-row .stat-warn { background: var(--err-soft, #f8e4e1); border-color: transparent; }
.tiles-row .stat-warn b, .tiles-row .stat-warn span { color: var(--err); }
.sup-new { margin-top: 20px; max-width: 640px; }
.sup-new-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sup-new-row input { flex: 1 1 240px; min-width: 0; }
.sup-cols { margin-bottom: 20px; }
.rules .pct { width: 80px; text-align: right; }
.rules select { width: auto; }
.grid.compact td, .grid.compact th { padding: 6px 8px; font-size: .86rem; }
.mt { margin-top: 18px; }
.row-muted td { color: var(--muted); }
.inline-search { display: flex; gap: 6px; }
.inline-search input { width: 220px; max-width: 100%; }
.link-form { display: flex; gap: 4px; margin-top: 4px; }
.link-form input { width: 150px; padding: 4px 8px; font-size: .82rem; }
.linked-note { color: var(--ok); font-weight: 600; }
.sup-items h2 { margin: 0; }
.wiz-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.wiz-steps span { padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.wiz-steps span.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.wiz-steps span.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .map-layout { grid-template-columns: 1fr; } }
.map-side { display: grid; gap: 8px; position: sticky; top: 12px; }
.map-scroll { max-height: 70vh; overflow: auto; }
.pricegrid td, .pricegrid th { font-size: .82rem; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; padding: 6px 8px; }
.pricegrid thead tr:first-child th { position: sticky; top: 0; z-index: 2; }
.pricegrid thead tr.map-row th { position: sticky; top: 30px; z-index: 2; background: var(--surface); }
.pricegrid .rn { color: var(--muted); font-size: .72rem; text-align: right; background: var(--surface-2); width: 34px; }
.pricegrid .colh { text-align: center; color: var(--muted); font-size: .72rem; background: var(--surface-2); }
.pricegrid select { min-width: 140px; font-size: .8rem; font-weight: 700; padding: 5px 6px; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.pricegrid select.set { border-style: solid; }
.pricegrid tr.row-head td:not(.rn) { color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 8px, var(--surface-2) 8px 16px); }
.pricegrid td.f-sku { background: rgba(74,127,224, .16); } .pricegrid select.f-sku { color: #4a7fe0; border-color: #4a7fe0; }
.pricegrid td.f-name { background: rgba(155,95,214, .16); } .pricegrid select.f-name { color: #9b5fd6; border-color: #9b5fd6; }
.pricegrid td.f-description { background: rgba(176,122,82, .16); } .pricegrid select.f-description { color: #b07a52; border-color: #b07a52; }
.pricegrid td.f-brand { background: rgba(42,157,179, .16); } .pricegrid select.f-brand { color: #2a9db3; border-color: #2a9db3; }
.pricegrid td.f-price_buy { background: rgba(217,138,43, .16); } .pricegrid select.f-price_buy { color: #d98a2b; border-color: #d98a2b; }
.pricegrid td.f-rrp { background: rgba(184,150,28, .16); } .pricegrid select.f-rrp { color: #b8961c; border-color: #b8961c; }
.pricegrid td.f-qty { background: rgba(63,162,102, .16); } .pricegrid select.f-qty { color: #3fa266; border-color: #3fa266; }
.delta-up { color: var(--err); font-weight: 700; }
.delta-dn { color: var(--ok); font-weight: 700; }
.apply-bar { margin-top: 20px; display: grid; gap: 10px; }
.apply-bar .btns { display: flex; gap: 10px; flex-wrap: wrap; }

.products .col-name { min-width: 300px; }
.products .col-art { max-width: 170px; white-space: normal; word-break: break-word; font-size: .9rem; }
.pdesc { max-width: 520px; }

.nm0 { margin-top: -4px; }
.rules input { width: 100%; min-width: 120px; }
.err { color: var(--err); }

.indent{display:block;margin-left:26px}

.sim-link{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:6px 0;padding:6px 8px;border-radius:8px;background:var(--accent-soft)}
.sim-card label.check{display:block;margin:2px 0}

/* логотип: в тёмной теме — светлая версия */
.brand-logo-light, .auth-card-logo-light { display: none !important; }
:root[data-theme="light"] .brand-logo-dark, :root[data-theme="light"] .auth-card-logo-dark { display: none !important; }
@media (min-width: 861px) { :root[data-theme="light"] .brand-logo-light { display: block !important; } }
:root[data-theme="light"] .auth-card-logo-light { display: block !important; }
@media (max-width: 860px) { .brand-logo-dark { display: none !important; } }

/* переключатель темы */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); cursor: pointer;
  padding: 0; transition: background .15s, border-color .15s; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }
.theme-toggle-float { position: fixed; top: 14px; right: 14px; z-index: 50; }
@media print {
  :root { --ink: #121820; --ink-2: #2f3a46; --bg: #fff; --surface: #fff; --surface-2: #f3f5f8; --line: #dde3ea;
    --line-strong: #c9d2dc; --muted: #5b6774; --accent: #1769b3; --brown-700: #4f5b68; --brown-800: #2f3a46; --field: #fff; color-scheme: light; }
  .theme-toggle { display: none !important; }
}

/* ============================================================
   Дизайн 3.0 «Шоурум» — компоненты
   ============================================================ */
body { font-family: "Commissioner", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1 { font-weight: 300; font-size: 2.1rem; letter-spacing: -.025em; color: var(--strong); }
h2 { font-weight: 500; font-size: 1.05rem; letter-spacing: 0; color: var(--strong); }
.container { max-width: 1440px; padding: 30px 48px 56px; }

/* шапка */
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: none; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1440px; padding: 12px 48px; gap: 26px; min-height: 72px; }
.brand-logo { height: 46px; }
.mainnav { margin-left: 8px; gap: 22px; }
.mainnav > a { padding: 25px 0 23px; border-radius: 0; color: var(--muted); font-weight: 400; font-size: .95rem; background: none !important; }
.mainnav > a:hover { color: var(--strong); }
.mainnav > a.active { color: var(--strong); box-shadow: inset 0 -1px 0 var(--accent); }
.topsearch { margin-left: auto; flex: 0 1 380px; min-width: 180px; }
.topsearch input { width: 100%; border-radius: 999px; background: var(--field); border: 1px solid var(--field-line); padding: 10px 18px 10px 40px; min-height: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b97a3' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px center; }
.cart-pill { display: inline-flex; align-items: center; gap: 9px; padding: 0 18px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--ink); white-space: nowrap; font-size: .93rem; }
.cart-pill:hover, .cart-pill.active { border-color: var(--accent); color: var(--strong); text-decoration: none; }
.cart-pill .badge { background: var(--accent); color: var(--on-ink); }
:root[data-theme="light"] .cart-pill .badge { color: #fff; }
.cart-sum { color: var(--accent); font-weight: 500; }
.usermenu { margin-left: 0; }
.usermenu summary { padding: 3px; border: 0; background: none; display: flex; align-items: center; gap: 10px; }
.usermenu summary::before { display: none; }
.usermenu summary::after { display: none; }
.um-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 500; border: 1px solid var(--line-strong); }
.um-name { display: none; }
.usermenu-body { border-radius: 16px; background: var(--surface); }

/* базовые блоки */
.card { border-radius: 20px; padding: 24px 26px; box-shadow: none; }
.btn { border-radius: 999px; font-weight: 500; padding: 9px 20px; min-height: 42px; background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }
:root[data-theme="light"] .btn-primary:hover { color: #fff; }
.btn-small { border-radius: 999px; padding: 6px 14px; min-height: 34px; }
.btn-lg { border-radius: 999px; }
input, select, textarea { background: var(--field); border-color: var(--field-line); border-radius: 12px; color: var(--ink); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
table.grid th { color: var(--faint); text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; font-weight: 500; background: none; }
table.grid td { border-color: var(--line); }

/* каталог */
.catalog { grid-template-columns: 240px 1fr; gap: 40px; }
.sidebar { background: none; border: 0; padding: 4px 0; box-shadow: none; }
.side-title { color: var(--faint); font-weight: 500; margin: 0 0 12px 10px; }
.tree a { border-radius: 10px; }
.tree a.active { background: var(--accent-soft); color: var(--strong); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent); }
.tree a.active .muted { color: var(--accent); opacity: 1; }

.showcase { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; border-radius: 26px; overflow: hidden; background: var(--hero);
  border: 1px solid var(--line); margin-bottom: 30px; min-height: 340px; }
.showcase-media { display: flex; align-items: center; justify-content: center; padding: 34px; }
.showcase-media img { max-width: 100%; max-height: 300px; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }
:root[data-theme="light"] .showcase-media img { filter: drop-shadow(0 20px 30px rgba(20, 40, 70, .18)); }
.showcase-ph { width: 240px; height: 200px; border: 1px dashed var(--line-strong); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: .85rem; }
.showcase-info { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.showcase-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; display: flex; align-items: center; gap: 10px; }
.showcase-kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.showcase-title { font-size: 2.3rem; font-weight: 200; line-height: 1.1; letter-spacing: -.02em; color: var(--strong); margin: 0; }
.showcase-title a { color: inherit; }
.showcase-desc { color: var(--muted); margin: 0; max-width: 44ch; }
.showcase-buy { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.showcase-price { font-size: 1.9rem; font-weight: 300; color: var(--strong); }
.showcase-price small { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }

.filters { align-items: center; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.view-toggle button { border: 0; background: none; color: var(--muted); width: 36px; height: 32px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.view-toggle button svg { width: 16px; height: 16px; }
.view-toggle button.active, .view-toggle button[aria-pressed="true"] { background: var(--surface-2); color: var(--strong); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative;
  margin: 0; border: 0; cursor: pointer; transition: background .15s; flex: none; min-height: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 19px; background: var(--on-ink); }
:root[data-theme="light"] .switch input:checked::after { background: #fff; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.pcard-media { position: relative; aspect-ratio: 4 / 3; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; }
.pcard-media.has-img { background: #fff; }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.pcard-media .img-ph { width: 72px; height: 72px; opacity: .35; }
.pcard-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard-body { padding: 16px 18px 6px; display: grid; gap: 6px; flex: 1; align-content: start; }
.pcard-group { color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.pcard .pname { color: var(--strong); font-weight: 400; line-height: 1.3; }
.pcard-desc { color: var(--muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { padding: 12px 18px 18px; display: grid; gap: 12px; }
.pcard-price b { font-size: 1.35rem; font-weight: 300; color: var(--strong); }
.pcard-price .old { color: var(--faint); text-decoration: line-through; margin-left: 8px; font-size: .9rem; }
.pcard-price [data-stock] { display: flex; width: fit-content; font-size: .82rem; font-weight: 500; margin-top: 4px; }
.pcard .buy { display: flex; gap: 8px; }
.pcard .buy input { width: 70px; border-radius: 999px; text-align: center; }
.pcard .buy .btn { flex: 1; }

.pgrid-list { grid-template-columns: 1fr; gap: 10px; }
.pgrid-list .pcard { flex-direction: row; align-items: center; border-radius: 16px; }
.pgrid-list .pcard:hover { transform: none; }
.pgrid-list .pcard-media { width: 110px; flex: none; aspect-ratio: 1; }
.pgrid-list .pcard-media img { padding: 8px; }
.pgrid-list .pcard-badges { display: none; }
.pgrid-list .pcard-body { padding: 12px 18px; }
.pgrid-list .pcard-desc { -webkit-line-clamp: 1; }
.pgrid-list .pcard-foot { grid-template-columns: auto 230px; align-items: center; gap: 24px; padding: 12px 18px; }
.showcase-panel .muted { margin-top: 0; }

/* админка */
.subnav, .tabs { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 24px; width: 100%; flex-wrap: wrap; }
.subnav a, .tabs a { padding: 12px 0; border-radius: 0; color: var(--muted); font-weight: 400; background: none !important; }
.subnav a:hover, .tabs a:hover { color: var(--strong); }
.subnav a.active, .tabs a.active { color: var(--strong); box-shadow: inset 0 -1px 0 var(--accent); }
.stat { border-radius: 18px; }
.stat::after { display: none; }
.stat-v { font-weight: 300; color: var(--strong); }

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { margin: 2px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.seg a { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.seg a:hover { color: var(--strong); text-decoration: none; }
.seg a.active { background: var(--btn-bg); color: var(--btn-fg); }
.dash-hero { display: grid; grid-template-columns: 330px 1fr; gap: 30px; background: var(--hero); border: 1px solid var(--line);
  border-radius: 26px; padding: 30px 32px; margin-bottom: 18px; }
.dash-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; }
.dash-big { font-size: 3rem; font-weight: 200; letter-spacing: -.03em; color: var(--strong); line-height: 1.1; margin: 8px 0 6px; }
.delta { font-size: .85rem; color: var(--muted); }
.delta-1 { color: var(--ok); } .delta--1 { color: var(--err); }
.dash-sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.dash-sub b { display: block; font-size: 1.25rem; font-weight: 300; color: var(--strong); }
.dash-sub span { color: var(--muted); font-size: .8rem; }
.dash-chart { margin: 0; min-width: 0; }
.dash-chart svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--faint); font-size: 11px; font-family: inherit; }
.ch-area { fill: var(--accent); opacity: .12; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.ch-peak { fill: var(--strong); font-size: 12px; font-family: inherit; }
.dash-rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.ring-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.ring-card b { display: block; font-size: 1.5rem; font-weight: 300; color: var(--strong); }
.ring-card span { color: var(--muted); font-size: .83rem; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-val { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-accent { stroke: var(--accent); } .ring-ok { stroke: var(--ok); } .ring-warn { stroke: var(--warn); } .ring-muted { stroke: var(--faint); }
.dash-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.dash-wide-first { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
.dash-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; min-width: 0; }
.dcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dcard-head h2 { margin: 0; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; }
.bar { width: 100%; max-width: 28px; background: var(--line-strong); border-radius: 6px 6px 2px 2px; }
.bar-now { background: var(--accent); }
.bar-v { font-size: .72rem; color: var(--muted); }
.bar-l { font-size: .68rem; color: var(--faint); white-space: nowrap; }
.hbar { margin-bottom: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin-bottom: 6px; }
.hbar-top b { font-weight: 400; color: var(--strong); }
.hbar-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.hbar-track.thin { height: 4px; }
.hbar-track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.health { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.health:last-child { border-bottom: 0; }
.health .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.health-ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.health-warn .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.health-err .dot { background: var(--err); box-shadow: 0 0 0 4px var(--err-soft); }
.h-name { flex: 1; }
.h-state { color: var(--muted); font-size: .84rem; text-align: right; }
.health-err .h-state { color: var(--err); }
.drow { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.drow:last-child { border-bottom: 0; }
.drow > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow b { font-weight: 400; color: var(--strong); white-space: nowrap; }
.drow-2 { grid-template-columns: minmax(0, 1fr) auto; }
.drow-2 > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: .76rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.st-ok { background: var(--ok-soft); color: var(--ok); } .st-warn { background: var(--warn-soft); color: var(--warn); }
.st-err { background: var(--err-soft); color: var(--err); } .st-accent { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-size: .88rem; }
.chip b { color: var(--accent); font-weight: 500; margin-left: 4px; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: .9rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }

/* адаптив 3.0 */
@media (max-width: 1180px) {
  .container, .topbar-inner { padding-left: 24px; padding-right: 24px; }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-rings { grid-template-columns: repeat(2, 1fr); }
  .dash-grid3, .dash-wide-first { grid-template-columns: 1fr 1fr; }
  .mainnav { gap: 16px; }
}
@media (max-width: 860px) {
  .container { padding: 18px 14px 36px; }
  .topbar-inner { padding: 8px 12px; gap: 10px; min-height: 60px; }
  .mainnav { gap: 12px; margin-left: auto; }
  .mainnav > a { padding: 18px 0 16px; font-size: .9rem; }
  .theme-toggle { width: 38px; height: 38px; }
  .cart-pill { padding: 0 12px; min-height: 38px; font-size: 0; gap: 0; }
  .cart-pill::before { content: ""; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M3 4h2l2.4 11h11L21 7H6.2'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M3 4h2l2.4 11h11L21 7H6.2'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat; }
  .cart-pill .badge { font-size: .72rem; margin-left: 4px; }
  .cart-sum { display: none; }
  .um-avatar { width: 34px; height: 34px; font-size: .9rem; }
  .sidebar { overflow: visible; }
  .drow.drow-2 { grid-template-columns: minmax(0, 1fr) auto; }
  h1 { font-size: 1.6rem; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sidebar { max-height: none; }
  .side-title { margin-left: 0; }
  .tree { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .tree ul, .tree li { display: contents; }
  .tree a .muted { margin-left: 6px; }
  .tree a { white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; }
  .side-actions { margin-top: 10px; padding-top: 0; border-top: 0; }
  .showcase { grid-template-columns: 1fr; min-height: 0; }
  .showcase-media { padding: 22px 22px 0; }
  .showcase-media img { max-height: 200px; }
  .showcase-info { padding: 20px 22px 26px; }
  .showcase-title { font-size: 1.6rem; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard-body { padding: 12px 12px 4px; }
  .pcard-foot { padding: 10px 12px 12px; }
  .pcard-desc { display: none; }
  .pcard .buy input { width: 54px; }
  .pgrid-list { grid-template-columns: 1fr; }
  .pgrid-list .pcard { flex-wrap: wrap; }
  .pgrid-list .pcard-media { width: 80px; }
  .pgrid-list .pcard-body { flex: 1; min-width: 0; }
  .pgrid-list .pcard-foot { grid-template-columns: 1fr; width: 100%; }
  .subnav, .tabs { gap: 16px; overflow-x: auto; flex-wrap: nowrap; }
  .subnav a, .tabs a { white-space: nowrap; }
  .dash-hero { padding: 22px; }
  .dash-big { font-size: 2.3rem; }
  .dash-rings, .dash-grid3, .dash-wide-first, .dash-grid2 { grid-template-columns: 1fr; }
  .drow { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .drow .st { display: none; }
}
@media (max-width: 420px) {
  .mainnav > a:nth-child(3) { display: none; }
  .pcard .buy { flex-wrap: wrap; }
  .pcard .buy input { width: 100%; }
}
@media print {
  .topsearch, .cart-pill, .theme-toggle, .view-toggle { display: none !important; }
  body { font-family: "Segoe UI", Arial, sans-serif; }
}
.subnav a.active .badge, .tabs a.active .badge { background: var(--accent); color: var(--on-ink); }
.form label, label { font-weight: 500; }
.checklist b { font-weight: 500; }

/* карточка 3.0, вариант «Описание на фото» */
.pcard-body { padding: 18px 20px 4px; gap: 4px; }
.pcard-group { color: var(--accent); font-size: .7rem; letter-spacing: .16em; }
.pcard .pname { font-size: 1.15rem; font-weight: 300; letter-spacing: -.01em; line-height: 1.3; }
.pcard .pname:hover { color: var(--accent); text-decoration: none; }
.pcard-foot { padding: 12px 20px 20px; gap: 14px; margin-top: auto; }
.pcard-price { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.pcard-price b { font-size: 1.4rem; }
.pcard-price .old { margin-left: -2px; margin-right: auto; }
.pcard-price [data-stock] { margin: 0 0 0 auto; font-size: .8rem; }
.pcard-price .stock-extra { flex-basis: 100%; text-align: right; }
.pcard-over { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 20px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s; pointer-events: none; text-align: left; }
.pcard-over-k { color: var(--accent); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }
.pcard-over-d { color: var(--strong); font-size: 1rem; font-weight: 300; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-over-m { color: var(--muted); font-size: .8rem; }
.pcard-over-l { color: var(--accent); font-size: .85rem; }
@media (hover: hover) {
  .pcard:hover .pcard-over, .pcard-media:focus-visible .pcard-over { opacity: 1; }
}
.pcard:hover { border-color: var(--line-strong); }
.pgrid-list .pcard-over { display: none; }
@media (max-width: 860px) {
  .pcard-over { display: none; }
  .pcard-body { padding: 12px 12px 2px; }
  .pcard .pname { font-size: 1rem; }
  .pcard-price b { font-size: 1.15rem; }
  .pcard-foot { padding: 10px 12px 12px; }
}

/* страница товара 3.0: галерея + панель покупки */
.pp { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 36px; align-items: start; margin-bottom: 30px; }
.pp-main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.pp-photo { aspect-ratio: 4 / 3; border-radius: 24px; background: var(--photo-bg); border: 1px solid var(--line); }
.pp-photo.has-img { background: #fff; }
.pp-photo img { padding: 28px; }
.pp .gallery-thumbs { gap: 10px; }
.pp .thumb { width: 78px; height: 78px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.pp .thumb.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gal-nav { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink); border-color: var(--line-strong); backdrop-filter: blur(6px); }
.pp-block { margin-top: 18px; padding-top: 24px; border-top: 1px solid var(--line); }
.pp-block h2, .pp-staff-title { font-weight: 400; font-size: 1.2rem; margin-bottom: 14px; }
.pp .description { color: var(--ink); line-height: 1.65; font-size: 1rem; max-width: 72ch; }
.spec { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; font-size: .95rem; }
.spec dt, .spec dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.spec dt { color: var(--muted); }
.spec dd { text-align: right; word-break: break-word; }
.pp-staff { margin-top: 18px; padding-top: 24px; border-top: 1px dashed var(--line-strong); display: grid; gap: 14px; }
.pp-staff .card { margin: 0; }
.pp-buy { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.pp-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; display: flex; align-items: center; gap: 10px; }
.pp-kicker::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.pp-buy h1 { font-size: 2rem; font-weight: 200; line-height: 1.12; margin: 10px 0 6px; overflow-wrap: anywhere; }
.pp-parent { display: inline-block; margin-bottom: 6px; font-size: .9rem; }
.pp-buy .buybox { background: none; border: 0; padding: 0; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; gap: 14px; }
.pp-buy .buybox::before { display: none; }
.pp-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pp-buy .big { font-size: 2.4rem; font-weight: 300; letter-spacing: -.02em; color: var(--strong); }
.pp-buy .old { color: var(--faint); text-decoration: line-through; }
.pp-buy .tag { background: var(--accent); color: var(--on-ink); border-radius: 999px; padding: 2px 9px; font-size: .78rem; }
:root[data-theme="light"] .pp-buy .tag { color: #fff; }
.pp-buy .stock { font-weight: 500; }
.pp-buy .stores { list-style: none; padding: 0; margin: 10px 0 0; }
.pp-buy .stores li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pp-buy .stores b { color: var(--ink); font-weight: 400; white-space: nowrap; }
.pp-buy .buy { display: flex; gap: 10px; margin-top: 4px; }
.qty-step { display: flex; align-items: center; border: 1px solid var(--field-line); border-radius: 999px; background: var(--field); flex: none; }
.qty-step button { width: 40px; height: 52px; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.qty-step button:hover { color: var(--strong); }
.qty-step input { width: 52px !important; border: 0 !important; background: none !important; text-align: center !important; min-height: 50px !important; padding: 0; box-shadow: none !important; -moz-appearance: textfield; }
.qty-step input::-webkit-inner-spin-button, .qty-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pp-buy .buy .btn { flex: 1; min-height: 52px; font-size: 1rem; }
.pp-mini { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
@media (max-width: 1080px) { .pp { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; } }
@media (max-width: 860px) {
  .pp { grid-template-columns: minmax(0, 1fr); }
  .pp-buy { position: static; order: -1; padding: 20px; border-radius: 20px; }
  .pp-main { display: contents; }
  .pp-photo { order: -2; }
  .pp .gallery-thumbs { order: -2; }
  .pp-buy h1 { font-size: 1.6rem; }
}

/* корзина и оформление 3.0: по шагам */
.co-steps { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; flex-wrap: wrap; }
.co-st { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; cursor: pointer; }
.co-st i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.co-st:hover { color: var(--strong); }
.co-st.on { color: var(--strong); }
.co-st.on i { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.co-st.done i { color: var(--ok); border-color: var(--ok); font-size: 0; }
.co-st.done i::before { content: "✓"; font-size: .85rem; }
.co-ln { flex: 0 0 56px; height: 1px; background: var(--line-strong); }
.co:not(.co-js) .co-steps { display: none; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 30px; align-items: start; }
.co-main { min-width: 0; display: grid; gap: 18px; }
.co-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.co-head h1 { margin: 0; }
.co-lines { display: grid; gap: 10px; }
.co-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 130px 36px; gap: 18px; align-items: center; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.co-line.row-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.co-ph { aspect-ratio: 1; border-radius: 14px; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.co-ph.has-img { background: #fff; }
.co-ph img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.co-ph .img-ph { width: 40px; height: 40px; opacity: .35; }
.co-info { display: grid; gap: 3px; min-width: 0; }
.co-name { color: var(--strong); font-size: 1.05rem; font-weight: 300; line-height: 1.3; }
.co-name:hover { color: var(--accent); text-decoration: none; }
.co-info .stock { font-size: .82rem; font-weight: 500; }
.co-line .qty-step button { height: 42px; width: 34px; }
.co-line .qty-step input { min-height: 40px !important; width: 50px !important; }
.co-sum-line { text-align: right; }
.co-sum-line b { font-size: 1.2rem; font-weight: 300; color: var(--strong); white-space: nowrap; }
.co-line .iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--faint); font-size: 1.3rem; cursor: pointer; }
.co-line .iconbtn:hover { background: var(--surface-2); color: var(--err); }
.cart-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.co-js .cart-actions [data-recalc] { display: none; }
.co-import { margin-top: 16px; color: var(--muted); }
.co-import summary { cursor: pointer; color: var(--accent); }
.co-import form { margin-top: 12px; }
.co-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.co-form { display: grid; gap: 18px; }
.co-panel.card { padding: 28px 30px; margin: 0; }
.co-panel h2 { font-weight: 400; font-size: 1.3rem; margin-bottom: 18px; }
.co-opts { display: grid; gap: 10px; margin-bottom: 20px; }
.co-opt { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line-strong); border-radius: 16px; padding: 15px 18px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.co-opt:hover { border-color: var(--accent); }
.co-opt input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--field); flex: none; cursor: pointer; }
.co-opt input:checked { border: 5px solid var(--accent); }
.co-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.co-opt b { display: block; font-weight: 500; color: var(--strong); }
.co-opt small { color: var(--muted); font-size: .85rem; }
.co-custom { display: grid; gap: 6px; margin: -2px 0 2px 34px; color: var(--muted); font-size: .88rem; }
.co-review { margin-bottom: 20px; }
.co-review dd { color: var(--strong); max-width: 60%; }
.co-final { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: 20px; background: var(--hero); border: 1px solid var(--line); margin-bottom: 12px; }
.co-big { font-size: 2.4rem; font-weight: 200; color: var(--strong); letter-spacing: -.02em; }
.co-final .btn-lg { min-height: 54px; padding: 0 36px; }
.co-js [data-panel][hidden] { display: none !important; }
.co-aside { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px 26px; }
.co-aside-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.co-aside-head h2 { margin: 0; font-weight: 400; font-size: 1.15rem; }
.co-aside .linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .9rem; padding: 0; }
.co:not(.co-js) .co-aside .linkbtn { display: none; }
.co-mini { max-height: 360px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.co-mi { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; }
.co-mph { width: 48px; height: 48px; border-radius: 12px; background: var(--photo-bg); overflow: hidden; display: block; }
.co-mph.has-img { background: #fff; }
.co-mph img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.co-mn { color: var(--ink); font-size: .9rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.co-mi b { font-weight: 400; white-space: nowrap; font-size: .92rem; }
.co-rows { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.co-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; color: var(--muted); font-size: .92rem; }
.co-rows b { color: var(--ink); font-weight: 400; }
.co-rows .co-tot { color: var(--ink); font-size: 1rem; padding-top: 10px; align-items: baseline; }
.co-rows .co-tot b { font-size: 1.8rem; font-weight: 300; color: var(--strong); white-space: nowrap; }
@media (max-width: 1080px) { .co-grid { grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; } }
@media (max-width: 860px) {
  .co-grid { grid-template-columns: minmax(0, 1fr); }
  .co-aside { position: static; order: 2; }
  .co-ln { flex-basis: 16px; }
  .co-st span { font-size: .85rem; }
  .co-st:not(.on) span { display: none; }
  .co-line { grid-template-columns: 64px minmax(0, 1fr) 36px; grid-template-areas: "ph info x" "qty qty sum"; gap: 10px 12px; }
  .co-ph { grid-area: ph; } .co-info { grid-area: info; } .co-line .iconbtn { grid-area: x; align-self: start; }
  .co-line .qty-step { grid-area: qty; justify-self: start; } .co-sum-line { grid-area: sum; align-self: center; }
  .co-panel.card { padding: 20px; }
  .co-nav .btn { flex: 1; }
  .co-review dd { max-width: none; }
  .co-final .btn-lg { width: 100%; }
}
.form .co-opt, .co-opt { display: flex; flex-direction: row; }
.co-opt > span { display: block; }
.co-review { grid-template-columns: 170px minmax(0, 1fr); }
.co-review dd { text-align: left; max-width: none; }
@media (max-width: 860px) {
  .co-line { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .co-review { grid-template-columns: 1fr; }
  .co-review dt { border-bottom: 0; padding-bottom: 0; }
}

/* фото без белого фона (прозрачные копии): товар стоит прямо на подложке карточки */
:root { --photo-glow: radial-gradient(62% 58% at 50% 50%, #1b2733 0%, var(--photo-bg) 100%); --photo-shadow: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); }
:root[data-theme="light"] { --photo-glow: radial-gradient(62% 58% at 50% 50%, #ffffff 0%, #eef2f6 100%); --photo-shadow: drop-shadow(0 10px 14px rgba(20, 40, 70, .14)); }
.pcard-media, .pcard-media.has-img, .pp-photo, .pp-photo.has-img, .showcase-media { background: var(--photo-glow); }
.showcase-media { background: none; }
.pcard-media { overflow: hidden; }
.pcard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; filter: var(--photo-shadow); }
.pp-photo img { filter: var(--photo-shadow); }
.co-ph.has-img, .co-mph.has-img { background: var(--photo-bg); }
.pp .thumb { background: var(--photo-bg); }
.pgrid-list .pcard-media img { padding: 8px; }

/* меню «Бренды и группы»: подразделы раскрываются по нажатию */
.tree-branch > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: .93rem; cursor: pointer; user-select: none; }
.tree-branch > summary::-webkit-details-marker { display: none; }
.tree-branch > summary:hover { background: var(--surface-2); color: var(--ink); }
.tree-branch > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tree-branch > summary .tree-name { flex: 1; min-width: 0; }
.tree-branch > summary .muted { font-size: .8rem; }
.tree-branch > summary.in-path { color: var(--strong); }
.tree-chev { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 2px 0 4px; }
.tree-branch[open] > summary .tree-chev { transform: rotate(45deg); margin-top: -3px; }
.tree-branch > ul { margin: 2px 0 4px 8px; }
.tree a.tree-all { color: var(--muted); font-size: .88rem; }
.tree a.tree-all.active { color: var(--strong); }
@media (max-width: 860px) {
  .tree { display: block; overflow: visible; padding-bottom: 0; }
  .tree ul { display: block; }
  .tree li { display: list-item; }
  .tree a { white-space: normal; border: 0; border-radius: 10px; padding: 7px 10px; }
  .tree a .muted { margin-left: 0; }
  .sidebar { max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
}

/* витрина главной: карусель новинок */
.showcase-carousel { position: relative; border-radius: 26px; overflow: hidden; background: var(--hero); border: 1px solid var(--line); margin-bottom: 30px; }
.sc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.sc-track::-webkit-scrollbar { display: none; }
.showcase-carousel .showcase { flex: 0 0 100%; scroll-snap-align: start; margin: 0; border: 0; border-radius: 0; background: none; min-height: 360px; }
.showcase-carousel .showcase-media img { max-height: 290px; }
.sc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); z-index: 2; }
.sc-nav:hover { border-color: var(--accent); color: var(--strong); }
.sc-prev { left: 16px; } .sc-next { right: 16px; }
.sc-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.sc-dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; transition: width .25s, background .25s; }
.sc-dots button[aria-selected="true"] { width: 26px; background: var(--accent); }
@media (max-width: 860px) {
  .showcase-carousel { border-radius: 20px; margin-bottom: 18px; }
  .showcase-carousel .showcase { min-height: 0; padding-bottom: 26px; }
  .sc-nav { display: none; }
  .sc-dots { bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sc-track { scroll-behavior: auto; } }
.recon-group { margin: 8px 0; }
.recon-group summary { cursor: pointer; }
.recon-group ul { margin: 8px 0 4px; padding-left: 20px; max-height: 260px; overflow: auto; }
.pp-edit { display: inline-block; margin: 0 0 6px; color: var(--muted); }
.pp-edit:hover { color: var(--accent); }
.text-edit textarea { min-height: 150px; resize: vertical; }
.text-edit:target { box-shadow: 0 0 0 2px var(--accent); }
.content-desc { white-space: pre-line; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: .92rem; max-height: 320px; overflow: auto; }
.content-panel .spec { margin: 6px 0 12px; font-size: .88rem; }
.content-url { display: flex; gap: 8px; margin-top: 12px; }
.content-url input { flex: 1; min-width: 0; }
.content-panel:target { box-shadow: 0 0 0 2px var(--accent); }
.drafts-table td { vertical-align: top; }
.drafts-table .content-desc { max-height: 120px; margin: 4px 0; }
.warn-text { color: var(--warn); }

/* блоки для сотрудников в карточке товара: свернуть / развернуть */
.pp-staff > summary.pp-staff-title { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.pp-staff > summary::-webkit-details-marker { display: none; }
.pp-staff > summary .muted { flex: 1; }
.pp-staff[open] > summary .tree-chev { transform: rotate(45deg); margin-top: -3px; }
.pp-staff:not([open]) { padding-bottom: 4px; }
.sec-toggle { cursor: pointer; user-select: none; position: relative; padding-right: 22px; }
.sec-toggle::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.is-collapsed .sec-toggle::after { transform: rotate(-45deg); margin-top: -4px; }
.sec-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.card.is-collapsed > :not(.pm-head):not(.pe-head) { display: none !important; }
.card.is-collapsed { padding-top: 16px; padding-bottom: 16px; }
.staff-tools { display: none; gap: 8px; margin: -4px 0 4px; }
.staff-tools.on { display: flex; }
.pp-staff { display: block; }
.pp-staff > .card { margin: 0 0 12px; }
.pp-staff > summary { margin-bottom: 12px; }
.pp-staff > .staff-tools { margin: 0 0 12px; }

/* вкладки «Описание / Характеристики» на карточке товара */
.pp-tabbar { display: none; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs-on .pp-tabbar { display: flex; }
.pp-tabbar button { background: none; border: 0; padding: 12px 0; font: inherit; font-size: 1.05rem; color: var(--muted); cursor: pointer; }
.pp-tabbar button:hover { color: var(--strong); }
.pp-tabbar button[aria-selected="true"] { color: var(--strong); box-shadow: inset 0 -2px 0 var(--accent); }
.pp-tabbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tabs-on .pp-panel-title { display: none; }
.pp-info { border-top: 0; padding-top: 6px; }
.pp-panel[hidden] { display: none; }
