/* РЕМ БОКС — витрина. Акцентный цвет задаётся в админке (--accent). */
:root {
  --accent: #d9480f;
  --ink: #14161a;
  --ink-2: #3a3f47;
  --muted: #6b717b;
  --line: #e2e4e8;
  --bg: #f4f5f7;
  --card: #fff;
  --ok: #1f7a3d; --ok-bg: #e6f4ea;
  --mid: #8a5a00; --mid-bg: #fff3d6;
  --bad: #b42318; --bad-bg: #fde8e6;
  --neutral: #4b5563; --neutral-bg: #eceef1;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .4em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1rem; margin: 0 0 .3em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; min-height: 60vh; }
.muted, .small { color: var(--muted); }
.small { font-size: .875rem; }
.tbd { color: var(--muted); font-style: italic; }

/* Шапка */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--accent); font: 700 15px/1 var(--mono); }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-size: 1rem; letter-spacing: .04em; }
.logo-text small { color: #a8adb6; font-size: .75rem; }
.top-search { flex: 1; display: flex; max-width: 560px; margin-left: auto; }
.top-search input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 8px 0 0 8px; padding: 0 12px; font: 15px var(--sans); }
.top-search button { width: 44px; border: 0; border-radius: 0 8px 8px 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cart-link { position: relative; display: grid; place-items: center; width: 42px; height: 40px; color: #fff; }
.cart-count { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); font: 700 11px/18px var(--sans); text-align: center; padding: 0 4px; }
.nav { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; font-size: .9rem; scrollbar-width: none; }
.nav a { color: #c9cdd4; text-decoration: none; white-space: nowrap; }
.nav a[aria-current] { color: #fff; box-shadow: inset 0 -2px var(--accent); }
@media (max-width: 720px) {
  .top-row { flex-wrap: wrap; }
  .logo-text small { display: none; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  .cart-link { margin-left: auto; }
  .hero ~ * .top-search, body:has(.hero) .top-search { display: none; }
}

/* Кнопки, формы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 600 15px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { background: #b8bcc3; cursor: not-allowed; filter: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { height: 52px; font-size: 17px; width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
input, select, textarea { font: 16px var(--sans); color: var(--ink); }
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .9rem; }
label input:not([type=checkbox]):not([type=radio]), label select, label textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #cfd3d9; border-radius: 8px; background: #fff; font-weight: 400; }
label input:focus, label select:focus, label textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label.check, label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input, label.radio input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent); }
label.radio span { display: flex; flex-direction: column; }
label.radio small { color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; padding: 10px 12px 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.req { color: var(--bad); }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }

/* Поиск */
.search { display: flex; gap: 8px; margin: 12px 0 16px; }
.search input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 8px; font: 17px var(--mono); }
.search input:focus { outline: none; border-color: var(--accent); }
.search .btn { height: 48px; }
.search-big input, .search-big .btn { height: 56px; font-size: 18px; }

/* Главная */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 18px; margin-top: 16px; }
.hero h1 { font-size: 1.75rem; margin-top: 0; }
.hero p { color: var(--ink-2); max-width: 60ch; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 4px 0 0; list-style: none; font-size: .9rem; color: var(--muted); }
.hero-facts li::before { content: "■ "; color: var(--accent); font-size: .7em; vertical-align: 2px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.cat { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-decoration: none; font-weight: 600; }
.cat:hover { border-color: var(--accent); }
.cat small { color: var(--muted); font: 500 13px var(--mono); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; }
.sec-head a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Каталог */
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 14px; }
.crumbs a { color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.chip { flex-shrink: 0; padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .875rem; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip small { opacity: .6; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.filters summary { padding: 12px 14px; font-weight: 600; cursor: pointer; }
.filters form { padding: 0 14px 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.price-range { display: flex; gap: 8px; }
.price-range label { flex: 1; }
.filter-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.count { color: var(--muted); font-size: .9rem; margin: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card.is-out { opacity: .72; }
.card-img { position: relative; display: block; aspect-ratio: 4/3; background: #eef0f3; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }
.demo-tag { position: absolute; top: 8px; left: 8px; background: #6d28d9; color: #fff; font: 700 11px/1 var(--sans); padding: 4px 6px; border-radius: 4px; letter-spacing: .05em; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 600; text-decoration: none; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mark { font: 700 15px/1.3 var(--mono); letter-spacing: .02em; word-break: break-all; }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; line-height: 1.6; }
.badge.ok, .t-ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .t-mid { background: var(--mid-bg); color: var(--mid); }
.badge.sold, .t-bad { background: var(--bad-bg); color: var(--bad); }
.t-neutral { background: var(--neutral-bg); color: var(--neutral); }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 20px 0; }
.empty { background: var(--card); border: 1px dashed #cfd3d9; border-radius: var(--radius); padding: 24px; }
.similar { margin-top: 28px; padding-top: 4px; border-top: 2px dashed var(--line); }
.note { background: var(--mid-bg); color: #5c3d00; padding: 10px 12px; border-radius: 8px; }

/* Карточка товара */
.pp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-top: 10px; }
@media (max-width: 820px) { .pp { grid-template-columns: 1fr; gap: 12px; } }
.gallery .g-main { display: block; background: #eef0f3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery .g-main img { width: 100%; height: auto; }
.g-main.noimg { aspect-ratio: 4/3; }
.g-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.g-thumbs button { flex-shrink: 0; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #eef0f3; cursor: pointer; }
.g-thumbs button[aria-current] { border-color: var(--accent); }
.g-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.pp-info h1 { margin-top: 0; font-size: 1.4rem; }
.pn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mark-lg { font-size: 1.35rem; background: #fff; border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; }
.mark-plain { font-family: var(--mono); font-weight: 600; margin: 0; }
.buy { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.price-lg { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.buy p { margin: 0; }
.state { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.state div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.state dt { font-size: .8rem; color: var(--muted); }
.state dd { margin: 2px 0 0; font-weight: 600; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.block p { margin: .3em 0; }
.block-warn { border-color: #f5c27a; background: #fffaf0; }
.block-info { border-color: #bcd4f5; background: #f2f7ff; }
.specs { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0; }
.specs th, .specs td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.specs th { width: 42%; color: var(--muted); font-weight: 500; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.demo-banner { background: #ede9fe; color: #4c1d95; border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-weight: 600; }

/* Корзина */
.cart-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.cart-row img, .cart-row .noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: #eef0f3; }
.cart-row .qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cart-row .qty button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 18px; cursor: pointer; }
.cart-row .remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; padding: 4px 0; }
.cart-row.gone { opacity: .6; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; padding: 12px 4px; }
.checkout { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 640px; }
.checkout h2 { margin-top: 0; }
.steps { padding-left: 22px; margin: 0 0 18px; }
.steps li { margin-bottom: 6px; }
.done { background: var(--ok-bg); border: 1px solid #b7dfc3; border-radius: var(--radius); padding: 20px; }
.methods { padding-left: 20px; }
.methods li { margin-bottom: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: .95rem; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.toast a { color: #fff; font-weight: 700; margin-left: 8px; }

/* Подвал */
.foot { background: #1c1f24; color: #b9bec6; font-size: .875rem; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot a { color: #e6e8eb; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.foot b { color: #fff; }
.legal { font-size: .8rem; }

/* Контакты и услуги */
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.contact-actions .btn { flex: 1 1 200px; text-align: center; }
.svc { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.svc li { border: 1px solid var(--line, #e3e5e8); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.svc li span { color: var(--muted, #5b6270); font-size: 14px; }

/* Видимый фокус для навигации с клавиатуры */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* На телефоне все пункты меню видны сразу (переносятся на вторую строку), область нажатия выше */
@media (max-width: 640px) { .nav { flex-wrap: wrap; overflow: visible; gap: 2px 16px; } .nav a { padding: 6px 0; } }
