:root {
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #1d1f22;
  --ink-2: #5b6068;
  --line: #e4e2dc;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee5;
  --ok: #2f8a4c;
  --warn: #b26a00;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 4px 14px rgba(20, 20, 20, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 15px; line-height: 1.45; }
a { color: inherit; }
img { max-width: 100%; }
h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 16px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 28px 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; width: 100%; padding-top: 18px; padding-bottom: 48px; }
[hidden] { display: none !important; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; align-items: center; gap: 14px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.logo-text { font-weight: 750; font-size: 17px; line-height: 1.05; display: flex; flex-direction: column; }
.logo-text small { font-weight: 500; font-size: 12px; color: var(--ink-2); }
.logo.big { justify-content: center; margin-bottom: 14px; }
.cat-btn { display: flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; height: 42px; padding: 0 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.search { flex: 1; display: flex; height: 42px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; position: relative; }
.search input { border-radius: 10px 0 0 10px; }
.search > button { border-radius: 0 10px 10px 0; }
.search input { flex: 1; border: 0; padding: 0 14px; font: inherit; outline: none; min-width: 0; }
.search button { border: 0; background: #fff; padding: 0 14px; cursor: pointer; color: var(--ink); }
.icons { display: flex; gap: 4px; align-items: center; }
.icon-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--ink-2); text-decoration: none; padding: 4px 8px; cursor: pointer; list-style: none; }
.icon-link::-webkit-details-marker { display: none; }
.icon-link:hover { color: var(--ink); }
.badge { position: absolute; top: -2px; right: 6px; background: var(--accent); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.me { position: relative; }
.me-menu { position: absolute; right: 0; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; z-index: 30; }
.me-menu a, .me-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; text-decoration: none; border: 0; background: none; font: inherit; cursor: pointer; }
.me-menu a:hover, .me-menu button:hover { background: var(--bg); }
/* category bar */
.catbar { border-top: 1px solid var(--line); }
.catbar-wrap { display: flex; align-items: center; gap: 8px; }
/* что не влезло в строку — уходит вниз и прячется; всё доступно по «Все разделы» */
.catbar-row { flex: 1; display: flex; flex-wrap: wrap; gap: 0 2px; height: 46px; overflow: hidden; align-items: center; }
.catbar a { white-space: nowrap; text-decoration: none; padding: 0 9px; line-height: 34px; margin: 6px 0; border-radius: 8px; font-size: 14.5px; font-weight: 500; }
.catbar a:hover, .catbar a.on { background: var(--accent-soft); color: var(--accent); }
.catbar-all { flex-shrink: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--accent); cursor: pointer; padding: 8px 4px 8px 10px; }

/* mega menu */
.mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; }
.mega-backdrop { position: absolute; left: 0; right: 0; top: 0; height: 100vh; background: rgba(20, 20, 20, .35); }
.mega-box { position: relative; }
.mega-box { display: grid; grid-template-columns: 270px 1fr; background: #fff; border-radius: 0 0 16px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.18); padding: 0; max-height: calc(100vh - 140px); overflow: hidden; }
.mega-head-mobile { display: none; }
.mega-left { list-style: none; margin: 0; padding: 12px 8px; border-right: 1px solid var(--line); overflow-y: auto; background: #fbfaf8; }
.mega-left a { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 9px; text-decoration: none; font-weight: 550; font-size: 15px; }
.mega-left a svg { color: var(--ink-2); opacity: .5; }
.mega-left a.on { background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.mega-left a.on svg { color: var(--accent); opacity: 1; }
.mega-right { overflow-y: auto; padding: 20px 28px 28px; }
.mega-back { display: none; }
.mega-title { display: block; font-size: 22px; font-weight: 750; text-decoration: none; margin-bottom: 16px; }
.mega-title small { font-size: 14px; font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.mega-title:hover { color: var(--accent); }
.mega-cols { column-count: 3; column-gap: 28px; }
.mega-group { break-inside: avoid; margin-bottom: 18px; display: flex; flex-direction: column; gap: 5px; }
.mega-g { font-weight: 650; text-decoration: none; font-size: 15px; }
.mega-s { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.mega-more { border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--accent); font-size: 13px; }
.mega-more:hover { text-decoration: underline; }
.mega-rest { display: flex; flex-direction: column; gap: 5px; }
.mega-rest[hidden] { display: none; }
.mega a.mega-g:hover, .mega a.mega-s:hover { color: var(--accent); }
.top { position: sticky; }
.cat-btn.open { background: var(--accent); }
body.menu-open { overflow: hidden; }
@media (max-width: 1100px) { .mega-cols { column-count: 2; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #cfccc4; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #d24f08; border-color: #d24f08; }
.wide { width: 100%; }

/* home */
.hero { background: var(--ink); color: #fff; border-radius: 16px; padding: 28px 30px; margin-bottom: 10px; }
.hero h1 { margin: 0 0 6px; }
.hero p { margin: 0; color: #cfd2d6; font-size: 16px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s; }
.cat:hover { border-color: var(--accent); transform: translateY(-1px); }
.cat span { font-weight: 650; }
.cat small { color: var(--ink-2); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { position: relative; background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 12px; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { color: var(--ink-2); font-size: 13px; }
.tag { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.tag-hit { background: var(--accent); color: #fff; }
.tag-new { background: var(--ink); color: #fff; }
.fav { position: absolute; right: 8px; top: 8px; border: 0; background: rgba(255, 255, 255, .9); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.fav svg { fill: none; }
.fav.on { color: var(--accent); }
.fav.on svg { fill: var(--accent); }
.fav-inline { position: static; border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 10px; }
.card-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 19px; font-weight: 750; }
.price.big { font-size: 32px; }
.old { color: var(--ink-2); font-size: 14px; }
.save { font-size: 12px; color: var(--ink-2); }
.card-name { text-decoration: none; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 60px; }
.card-name:hover { color: var(--accent); }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); gap: 6px; }
.instock { color: var(--ok); }
.nostock { color: var(--warn); }
/* «В корзину» — яркая: бледная заливка выглядела как уже нажатая. Бледной она становится после добавления */
.btn-cart { margin-top: auto; height: 38px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-cart:hover { background: #d24f08; border-color: #d24f08; }
.btn-cart.in, .btn-cart.in:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-cart:disabled, .btn-cart:disabled:hover { background: #eeece7; color: #6b6862; border-color: #eeece7; }
/* нет в наличии — приглушаем */
.card-out .card-img img { opacity: .45; filter: grayscale(1); }
.card-out .price, .card-out .card-name { color: var(--ink-2); }
.btn-notify { background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.btn-notify:hover { border-color: var(--ink); background: #fff; color: var(--ink); }
.btn-notify.on { background: #e5f3ea; color: var(--ok); border-color: #e5f3ea; }
.btn-primary.btn-notify { height: 46px; font-size: 15px; }
.card-out:hover .card-img img { opacity: .8; filter: grayscale(.3); }

/* list */
.crumbs { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
h1 small { font-size: 15px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { background: #fff; border: 1px solid var(--line); padding: 7px 12px; border-radius: 20px; text-decoration: none; font-size: 14px; }
.chip:hover { border-color: var(--accent); }
.chip small { color: var(--ink-2); }
.list-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.f-title { font-weight: 650; margin-bottom: 8px; font-size: 14px; }
.filters select, .filters input[type=text], .f-price input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
.f-price { display: flex; gap: 8px; }
.f-check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; padding: 3px 0; }
.f-check small { color: var(--ink-2); margin-left: auto; }
.f-brands { max-height: 260px; overflow: auto; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 26px; }
.pager a { background: #fff; border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--ink-2); }

/* product page */
.pd { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; margin-top: 8px; }
.gallery { position: sticky; top: 84px; align-self: start; }
.g-main { background: #fff; border-radius: 16px; border: 1px solid var(--line); aspect-ratio: 1; display: grid; place-items: center; padding: 24px; }
.g-main img { width: 100%; height: 100%; object-fit: contain; }
.g-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.g-thumbs button { flex: 0 0 68px; height: 68px; border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; cursor: pointer; }
.g-thumbs button.on { border-color: var(--accent); }
.g-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd-info h1 { font-size: 24px; margin-bottom: 6px; }
.buybox { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 18px 0; }
.stock-line { margin: 6px 0 16px; font-size: 14px; }
.buy-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.buy-actions .btn-primary { flex: 1; min-width: 160px; height: 46px; font-size: 16px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 42px; background: #fff; }
.qty button { width: 36px; border: 0; background: #fff; font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--bg); }
.qty input { width: 46px; border: 0; text-align: center; font: inherit; font-weight: 600; outline: none; }
.attrs { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.attrs div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.attrs div:last-child { border-bottom: 0; }
.attrs dt { color: var(--ink-2); }
.attrs dd { margin: 0; }
.desc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 14px; margin-top: 22px; max-width: 900px; }
.desc h2 { font-size: 17px; }

/* cart */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.cart-lines { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cline { display: grid; grid-template-columns: 72px 1fr auto 110px 32px; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.cline:last-child { border-bottom: 0; }
.cline-off { opacity: .55; }
.cline-img { width: 72px; height: 72px; display: grid; place-items: center; }
.cline-img img { max-height: 72px; object-fit: contain; }
.cline-name a { text-decoration: none; font-weight: 550; }
.cline-sum { text-align: right; }
.cline-del { border: 0; background: none; font-size: 24px; color: var(--ink-2); cursor: pointer; }
.cline-del:hover { color: var(--accent); }
.checkout { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.total-row b { font-size: 26px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 550; }
label input, label textarea { font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
label input:focus, label textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.f-check input, .f-check { font-weight: 400; flex-direction: row; }

/* orders */
.orow { display: grid; grid-template-columns: 70px 110px 80px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; margin-bottom: 8px; }
.orow:hover { border-color: var(--accent); }
.st { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 6px; background: var(--bg); justify-self: start; }
.st-new { background: var(--accent-soft); color: var(--accent); }
.st-done { background: #e5f3ea; color: var(--ok); }
.st-cancelled { color: var(--ink-2); }
.otable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.otable th, .otable td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.otable th { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.otable a { text-decoration: none; }
.done-box { background: #e5f3ea; border-radius: 16px; padding: 22px 26px; margin-bottom: 18px; }
.done-box h1 { margin: 0 0 6px; }
.done-box p { margin: 0; }

/* auth */
body.auth { background: var(--ink); }
body.auth .main { display: grid; place-items: center; }
body.auth .logo { text-decoration: none; }
.auth-box { background: #fff; border-radius: 18px; padding: 32px 28px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-box h1 { margin: 0; }
.err { color: #c2341a; font-size: 13px; font-weight: 500; }

/* misc */
.flash > div { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); }
.flash-success { background: #e5f3ea !important; }
.flash-error { background: #fbe9e5 !important; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 50; font-size: 14px; box-shadow: var(--shadow); }
.foot { color: var(--ink-2); font-size: 13px; padding: 26px 0 32px; border-top: 1px solid var(--line); background: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; }
.foot-grid b { color: var(--ink); font-size: 15px; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--accent); }
.trusted-dot { position: absolute; top: 2px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }
.me-note { font-size: 12px; color: var(--ok); padding: 8px 12px 4px; }
.hero-badge { display: inline-block; margin-top: 12px !important; background: var(--accent); color: #fff !important; padding: 6px 12px; border-radius: 8px; font-size: 14px !important; }
.delivery { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.consent { align-items: flex-start; font-size: 13px; }
.consent input { margin-top: 3px; }
.page { max-width: 860px; }
.page h1 { margin-top: 16px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .list-layout, .pd, .cart-layout { grid-template-columns: 1fr; }
  .filters, .gallery, .checkout { position: static; max-height: none; }
  .filters { order: 0; }
}
@media (max-width: 720px) {
  .catbar-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .catbar-row::-webkit-scrollbar { display: none; }
  .catbar-all { display: none; }
  .catbar a { font-size: 14px; }
  .mega { position: fixed; inset: 0; top: 0; }
  .mega-box { display: block; position: absolute; inset: 0; max-height: none; border-radius: 0; padding: 0; overflow: hidden; }
  .mega-head-mobile { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 18px; }
  .mega-head-mobile button { border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; }
  .mega-left { border: 0; background: #fff; height: calc(100% - 58px); }
  .mega-left a.on { background: none; box-shadow: none; color: inherit; }
  .mega-left a.on svg { color: var(--ink-2); opacity: .5; }
  .mega-right { position: absolute; inset: 58px 0 0 0; background: #fff; padding: 12px 16px 30px; display: none; }
  .mega.drill .mega-right { display: block; }
  .mega.drill .mega-left { display: none; }
  .mega-back { display: block; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; padding: 6px 0 12px; cursor: pointer; }
  .mega-cols { column-count: 1; }
  .wrap { padding: 0 12px; }
  .top-row { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .logo-text small, .icon-link span, .cat-btn span { display: none; }
  .search { order: 5; flex-basis: 100%; }
  .icons { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding: 4px 10px 10px; }
  .price { font-size: 17px; }
  .cline { grid-template-columns: 56px 1fr 32px; }
  .cline-img { width: 56px; height: 56px; }
  .cline .qty { grid-column: 2; }
  .cline-sum { grid-column: 2; text-align: left; }
  .cline-del { grid-row: 1; grid-column: 3; }
  .orow { grid-template-columns: 1fr auto; }
  h1 { font-size: 22px; }
  .hero { padding: 20px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat { padding: 12px; }
}
@media (max-width: 400px) {
  .logo-text { display: none; }
  .icon-link { padding: 4px 5px; }
}

/* мои подписки */
.alerts { display: grid; gap: 8px; margin-bottom: 26px; }
.arow { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.arow img { width: 56px; height: 56px; object-fit: contain; }
.arow a { text-decoration: none; }
.arow-back { border-color: var(--ok); }
@media (max-width: 720px) { .arow { grid-template-columns: 56px 1fr; } }

/* листинг */
.list-h1 { margin-bottom: 18px; }
.list-h1 small { font-size: 16px; font-weight: 400; margin-left: 4px; }
.list-layout { grid-template-columns: 260px 1fr; gap: 32px; }
.side { position: sticky; top: 150px; max-height: calc(100vh - 160px); overflow: auto; padding-right: 4px; }
.side-found { font-weight: 700; font-size: 17px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-block { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.side-cats { display: flex; flex-direction: column; gap: 2px; }
.side-cats a, .side-cur { text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.side-cats a:hover { background: #fff; color: var(--accent); }
.side-up { color: var(--ink); }
.side-up svg { flex-shrink: 0; color: var(--ink-2); }
.side-cur { background: #fff; font-weight: 600; border: 1px solid var(--line); }
.side-sub { padding-left: 22px !important; color: var(--ink-2); }
.side-cats small { color: var(--ink-2); font-size: 12px; margin-left: auto; }
.side-filters { display: flex; flex-direction: column; gap: 0; }
.side-switch { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; cursor: pointer; }
.side-switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.side .f-price input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
.sortbar { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; margin-bottom: 16px; font-size: 15px; }
.sortbar a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.sortbar a:hover { color: var(--accent); }
.sortbar a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.viewsw { margin-left: auto; display: flex; gap: 6px; }
.viewsw button { border: 0; background: none; padding: 2px; cursor: pointer; color: #c9c6be; }
.viewsw button.on { color: var(--accent); }
/* вид списком */
.grid.as-list { grid-template-columns: 1fr; }
.grid.as-list .card { flex-direction: row; }
.grid.as-list .card-img { width: 180px; flex-shrink: 0; aspect-ratio: auto; height: 170px; }
.grid.as-list .card-body { display: grid; grid-template-columns: 1fr 200px; grid-template-rows: auto auto 1fr; gap: 6px 24px; padding: 16px 56px 16px 8px; }
.grid.as-list .price-row { grid-column: 2; grid-row: 1; }
.grid.as-list .card-name { grid-column: 1; grid-row: 1 / span 2; font-size: 16px; min-height: 0; -webkit-line-clamp: 3; }
.grid.as-list .card-meta { grid-column: 1; grid-row: 3; align-self: end; justify-content: flex-start; gap: 16px; }
.grid.as-list .card-body > .btn-cart, .grid.as-list .card-buy { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
@media (max-width: 900px) {
  .side { position: static; max-height: none; }
  .grid.as-list .card-img { width: 110px; height: 120px; }
  .grid.as-list .card-body { grid-template-columns: 1fr; padding-right: 48px; }
  .grid.as-list .price-row, .grid.as-list .card-name, .grid.as-list .card-meta, .grid.as-list .card-body > .btn-cart, .grid.as-list .card-buy { grid-column: 1; grid-row: auto; }
}

.card-art { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.card-art:hover { color: var(--accent); }
.grid.as-list .card-art { grid-column: 1; grid-row: auto; }

/* подсказки поиска */
.suggest { position: absolute; left: -2px; right: -2px; top: calc(100% + 6px); background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); border: 1px solid var(--line); z-index: 60; overflow: hidden; max-height: calc(100vh - 120px); overflow-y: auto; }
.sg-sec { padding: 8px 0; }
.sg-sec + .sg-sec { border-top: 1px solid var(--line); }
.sg-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 6px 16px; font-weight: 600; }
.sg-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-decoration: none; }
.sg-item.on, .sg-item:hover { background: var(--accent-soft); }
.sg-cat-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex-shrink: 0; }
.sg-cat b { font-weight: 600; }
.sg-cat small, .sg-prod small { display: block; color: var(--ink-2); font-size: 12px; }
.sg-n { margin-left: auto; color: var(--ink-2); font-size: 13px; }
.sg-prod img, .sg-noimg { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; background: #fff; }
.sg-prod .sg-name { flex: 1; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-price { font-weight: 700; white-space: nowrap; }
.sg-out { opacity: .55; }
.sg-all { display: block; text-align: center; padding: 12px; font-weight: 600; color: var(--accent); text-decoration: none; border-top: 1px solid var(--line); }
.sg-all.on, .sg-all:hover { background: var(--accent-soft); }
.sg-empty { padding: 18px 16px; color: var(--ink-2); }
mark { background: none; color: var(--accent); font-weight: 700; }

/* видео */
.g-video { flex: 0 0 68px; height: 68px; border: 2px solid var(--line); border-radius: 10px; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 11px; }
.g-video:hover { background: var(--accent); border-color: var(--accent); }
.videos { display: flex; flex-direction: column; gap: 14px; }
.video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-box video, .video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }

/* видео в галерее */
.g-main { position: relative; overflow: hidden; }
.g-player { position: absolute; inset: 0; background: #000; }
.g-player video, .g-player iframe { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
.g-vthumb { position: relative; padding: 0 !important; overflow: hidden; }
.g-vthumb img { opacity: .55; }
.g-play { position: absolute; inset: 0; display: grid; place-items: center; }
.g-play svg { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.g-hasvideo { margin-top: 8px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.g-hasvideo svg { color: var(--accent); }

/* карточка: основные характеристики, вкладки, описание + характеристики рядом */
.keyspecs h2 { margin-top: 4px; }
.attrs-short div { padding: 7px 14px; }
.more-link { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 600; text-decoration: none; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.more-link:hover { text-decoration: underline; }
.pd-tabs { display: flex; gap: 24px; margin: 34px 0 0; border-bottom: 1px solid var(--line); position: sticky; top: 112px; background: var(--bg); z-index: 5; }
.pd-tabs a { padding: 12px 0; text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; }
.pd-tabs a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pd-bottom { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pd-bottom .desc { max-width: none; scroll-margin-top: 170px; }
.specs { scroll-margin-top: 170px; }
.specs h3 { font-size: 15px; margin: 18px 0 8px; color: var(--ink-2); }
.pack { margin-top: 14px; }
.pack summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 6px 0; }
.desc-body.clamped { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
@media (max-width: 900px) { .pd-bottom { grid-template-columns: 1fr; } .pd-tabs { top: 0; position: static; overflow-x: auto; } }

/* карточка: секции во всю ширину */
.pd-sec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 24px 20px; margin-top: 18px; scroll-margin-top: 170px; }
.pd-sec h2 { font-size: 19px; }
.attrs-2col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; border: 0; border-radius: 0; }
.attrs-2col div { border-bottom: 1px solid var(--line); padding: 9px 0; }
.docs { display: flex; flex-wrap: wrap; gap: 10px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 550; font-size: 14px; background: #fff; }
.doc:hover { border-color: var(--accent); color: var(--accent); }
.doc svg { color: var(--accent); flex-shrink: 0; }
.doc-registry svg { color: var(--ok); }
@media (max-width: 720px) { .attrs-2col { grid-template-columns: 1fr; } .pd-sec { padding: 4px 16px 16px; } }

.kit { margin: 0; padding-left: 20px; columns: 2; column-gap: 40px; }
.kit li { padding: 4px 0; break-inside: avoid; }
@media (max-width: 720px) { .kit { columns: 1; } }

/* избранное: дерево категорий и поиск */
.fav-tree summary { font-weight: 700; font-size: 15px; margin-bottom: 10px; cursor: pointer; list-style: none; }
.fav-tree summary::-webkit-details-marker { display: none; }
.side-cats .ft { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 1px solid transparent; background: none; font: inherit; font-size: 14.5px; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.side-cats .ft:hover { background: #fff; color: var(--accent); }
.side-cats .ft.on { background: #fff; border-color: var(--line); color: var(--accent); font-weight: 600; }
.ft-all { font-weight: 700; }
.ft-top { font-weight: 600; margin-top: 8px; }
.side-cats .ft-sub { padding-left: 22px; color: var(--ink-2); }
.fav-bar { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.fav-bar input[type=search] { flex: 1; min-width: 220px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font: inherit; background: #fff; }
.fav-bar input[type=search]:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fav-bar .side-switch { border: 0; margin: 0; padding: 0; }
@media (max-width: 900px) { .fav-tree summary::after { content: " ▾"; color: var(--ink-2); } .fav-tree { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 4px; } }

/* телефон и узкий экран: одна колонка (правило должно идти после стилей листинга) */
@media (max-width: 900px) { .list-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; } .list-layout > * { min-width: 0; } }

.sortbar button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 4px 0; font: inherit; cursor: pointer; color: var(--ink); }
.sortbar button:hover { color: var(--accent); }
.sortbar button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.sortbar button i { font-style: normal; }

/* выбор покупателя и оплаты */
.buyer-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; }
.buyer-switch label { display: block; cursor: pointer; }
.buyer-switch input { position: absolute; opacity: 0; pointer-events: none; }
.buyer-switch span { display: block; text-align: center; padding: 8px 6px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.buyer-switch input:checked + span { background: #fff; box-shadow: var(--shadow); color: var(--accent); }
.buyer-switch input:focus-visible + span { outline: 2px solid var(--accent); }
.pay { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pay legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.pay p { margin: 0; }
.pay-opt { flex-direction: row !important; align-items: flex-start; gap: 10px !important; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-opt input { margin-top: 3px; accent-color: var(--accent); }
.pay-opt b { display: block; font-size: 14px; }
.pay-opt small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.order-pay { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
/* с реквизитами форма выше экрана — не «прилипает», чтобы кнопка не пряталась */
.checkout:has(fieldset.company:not([hidden])) { position: static; }

/* промокод */
#promo-form { display: none; }
.promo-row { display: flex; gap: 8px; }
.promo-row input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; font: inherit; text-transform: uppercase; }
.promo-row input::placeholder { text-transform: none; }
.promo-row input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.promo-row .btn { height: 40px; }
.promo-on { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #e5f3ea; color: var(--ok); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.promo-on button { border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; text-decoration: underline; }
.discount-row { display: flex; justify-content: space-between; color: var(--ok); font-size: 14px; }

/* предварительный расчёт доставки СДЭК в корзине */
.cdek { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cdek summary { cursor: pointer; font-weight: 600; }
.cdek input { width: 100%; height: 40px; margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; font: inherit; }
.cdek input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.cdek ul { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.cdek li button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.cdek li button:hover, .cdek li button:focus-visible { background: var(--bg); }
.cdek-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cdek-opt b { white-space: nowrap; }
.cdek-test { margin: 8px 0 0; font-size: 13px; color: var(--accent); }

.profile-box { max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.profile-box form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 12px 0; }
.profile-box label { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.profile-box input { height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; font: inherit; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.over { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: #b42318; }
.over .btn { margin-left: 6px; padding: 4px 10px; font-size: 13px; }
.checkout .btn:disabled { opacity: .5; cursor: not-allowed; }
.need-email { background: var(--bg); border-radius: 10px; padding: 12px; }

/* выбор доставки */
.delivery[hidden], .cdek[hidden], .sum-row[hidden], .total-row[hidden], .pay-opt[hidden], #cdek-where [hidden] { display: none; }
.cdek label.cdek-opt { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; cursor: pointer; }
.cdek-opt span { flex: 1; }
.cdek-opt input, .cdek-point input { width: auto; height: auto; margin: 0; flex: none; }
#cdek-points { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.cdek label.cdek-point { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
#cdek-doorbox:not([hidden]) { display: block; margin-top: 10px; }
.sum-row { display: flex; justify-content: space-between; }
.pay-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.closed-note { margin: 8px 0; font-weight: 600; color: #b42318; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* фильтры по характеристикам */
.facet summary { cursor: pointer; }
.facet:not([open]) summary { margin-bottom: 0; }
.facet-more > summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 14px; }
.facet-reset { margin: 0 0 14px; font-size: 14px; }

/* на телефоне фильтры спрятаны за кнопкой */
.filters-toggle { display: none; }
.filters-n { display: inline-block; min-width: 20px; margin-left: 8px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; line-height: 20px; }
.filters-n[hidden] { display: none; }
@media (max-width: 900px) {
  .side.collapsible .filters-toggle { display: flex; justify-content: center; align-items: center; margin-bottom: 14px; }
  .side.collapsible .side-filters { display: none; }
  .side.collapsible.open .side-filters { display: flex; }
  .side.collapsible .side-found, .side.collapsible .side-nosub { display: none; }
  .side.collapsible.open .filters-apply { position: sticky; bottom: 10px; z-index: 5; background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
}
.list-main.loading { opacity: .5; transition: opacity .15s .15s; }
.facet[open] > summary { margin-bottom: 10px; }

/* «− число +» в карточке вместо кнопки «В корзину» */
.card-buy { margin-top: auto; display: flex; flex-direction: column; }
.card-qty { display: flex; align-items: center; justify-content: space-between; height: 38px; background: #eeeff1; border-radius: 10px; overflow: hidden; }
.card-buy [hidden] { display: none; }
.card-qty button { width: 52px; height: 100%; flex-shrink: 0; border: 0; background: none; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); touch-action: manipulation; }
.card-qty button:hover { background: #e2e4e7; }
.card-qty input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: none; padding: 0; text-align: center; font: inherit; font-weight: 700; color: var(--ink); }
