:root {
  --bg: #f5f5f3; --surface: #ffffff; --panel: #efefec; --photo: #f1f1ee; --line: #e3e3de; --line-2: #d2d2cc;
  --ink: #121212; --ink-2: #474745; --ink-3: #85857f; --red: #e3242b; --red-2: #c81e24; --good: #1b7a3c; --warn: #a06400;
  --r: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d0d0e; --surface: #17171a; --panel: #212125; --photo: #f1f1ee; --line: #2a2a2f; --line-2: #3a3a40;
    --ink: #f2f2f0; --ink-2: #c5c5c0; --ink-3: #8a8a86; --good: #4cc27a; --warn: #f0b13c; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: transparent; }
.num, .price b, .tot, .sizes-t td { font-variant-numeric: tabular-nums; }

/* шапка */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.logo { background: var(--red); color: #fff; padding: 3px 9px; border-radius: 7px; }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; }
.tabs button[aria-pressed="true"] { background: var(--panel); color: var(--ink); }
.top-search { flex: 1 1 260px; max-width: 420px; }
.top-search input { padding: 9px 14px; border-radius: 99px; background: var(--surface); }
.top-x { font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); padding: 7px 11px; border-radius: 9px; white-space: nowrap; }
.who { display: flex; gap: 10px; align-items: center; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.link { border: 0; background: none; color: var(--ink-2); text-decoration: underline; padding: 0; }
.cartbtn { display: flex; align-items: center; gap: 8px; border: 0; background: var(--red); color: #fff; padding: 9px 15px; border-radius: 11px; font-weight: 700; white-space: nowrap; }
.cartbtn span { background: rgba(255,255,255,.24); border-radius: 99px; padding: 0 8px; font-size: 13px; }
.cartbtn:hover { background: var(--red-2); }

main { max-width: 1440px; margin: 0 auto; padding: 18px 24px 90px; }
.btn { border: 0; background: var(--red); color: #fff; font-weight: 700; padding: 12px 18px; border-radius: 11px; }
.btn:hover { background: var(--red-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--panel); color: var(--ink); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
.muted { color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 48px 10px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* вход */
.login { max-width: 400px; margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: grid; gap: 12px; }
.login h1 { margin: 6px 0 0; font-size: 23px; letter-spacing: -.01em; } .login p { margin: 0 0 6px; color: var(--ink-3); font-size: 14px; }

/* каталог: панель разделов и фильтров */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout > section { min-width: 0; }
.filters { position: sticky; top: 76px; display: grid; gap: 16px; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 4px; }
.fgroup h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.fopts { display: grid; gap: 2px; }
.fopt { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 5px 6px; border-radius: 7px; font-size: 14px; }
.fopt:hover { background: var(--panel); }
.fopt .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; font-size: 11px; }
.fopt[aria-pressed="true"] .box { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fopt small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.fsizes { display: flex; flex-wrap: wrap; gap: 5px; }
.fsize { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 8px; font-size: 13px; min-width: 38px; }
.fsize[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.frange { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.frange input { padding: 7px 9px; font-size: 14px; }
.freset { border: 0; background: none; color: var(--red); font-weight: 600; text-align: left; padding: 0; }

.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 99px; white-space: nowrap; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip small { opacity: .55; margin-left: 4px; font-weight: 500; }
.sort { margin-left: auto; width: auto; padding: 7px 10px; border-radius: 9px; font-size: 14px; }
.meta { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.meta.stale { color: var(--warn); }
.note { background: var(--panel); border-radius: var(--r); padding: 11px 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }

/* сетка карточек */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 14px; }
.card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; border-radius: var(--r); position: relative; }
.card:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.ph { aspect-ratio: 4 / 5; background: var(--photo); border-radius: var(--r); overflow: hidden; position: relative; display: grid; place-items: center; }
.ph img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .35s var(--ease); }
.card:hover .ph img { transform: scale(1.035); }
.ph .noimg { color: #a6a6a0; font-size: 13px; }
.badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.badge.sale { background: #141414; }
.badge.hit { background: #fff; color: #141414; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.incart { position: absolute; right: 10px; bottom: 10px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.dots { display: flex; gap: 4px; align-items: center; min-height: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); }
.dots small { color: var(--ink-3); font-size: 12px; }
.ct { font-weight: 650; line-height: 1.28; font-size: 14.5px; }
.cs { color: var(--ink-3); font-size: 12.5px; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price b { font-size: 18px; letter-spacing: -.01em; }
.price s { color: var(--ink-3); font-size: 13px; }
.price em { font-style: normal; font-size: 12px; color: var(--good); font-weight: 650; }
.strip { display: flex; flex-wrap: wrap; gap: 3px 6px; font-size: 12px; color: var(--ink-2); }
.strip span.low { color: var(--warn); }
.more { display: block; height: 1px; }

/* окно модели */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.mbox { position: relative; background: var(--surface); border-radius: 20px; width: min(1180px, 100%); max-height: calc(100vh - 48px); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.mclose { position: absolute; right: 14px; top: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--panel); font-size: 22px; line-height: 1; }
.gal { background: var(--photo); position: relative; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.track { display: flex; align-items: flex-start; flex: none; width: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; width: 100%; height: auto; scroll-snap-align: center; display: grid; place-items: center; aspect-ratio: 1 / 1; cursor: zoom-in; }
.slide img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.garrow { position: absolute; top: 45%; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #111; font-size: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.garrow.l { left: 12px; } .garrow.r { right: 12px; }
.thumbs { display: flex; gap: 8px; padding: 10px 14px 14px; overflow-x: auto; scrollbar-width: none; }
.thumb { flex: none; width: 60px; height: 60px; border-radius: 10px; border: 2px solid transparent; background: #fff; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb[aria-current="true"] { border-color: var(--red); }
.gdots { display: none; justify-content: center; gap: 6px; padding: 10px; }
.gdots i { width: 6px; height: 6px; border-radius: 50%; background: #c8c8c2; }
.gdots i.on { background: #222; }
.minfo { overflow-y: auto; padding: 26px 28px 24px; display: grid; gap: 14px; align-content: start; }
.minfo h2 { margin: 0; font-size: 23px; letter-spacing: -.015em; line-height: 1.2; padding-right: 40px; }
.mprice { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mprice b { font-size: 28px; letter-spacing: -.02em; }
.mprice s { color: var(--ink-3); }
.kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi { background: var(--panel); border-radius: 10px; padding: 7px 11px; font-size: 13px; }
.kpi b { display: block; font-size: 15px; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.colorb { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 5px 10px 5px 5px; font-size: 13px; }
.colorb img, .colorb .ci { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: var(--photo); }
.colorb[aria-current="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sizes-t { width: 100%; border-collapse: collapse; }
.sizes-t th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 4px 6px; }
.sizes-t td { padding: 6px; border-top: 1px solid var(--line); }
.sizes-t td.sz { font-weight: 700; }
.sizes-t td.st { color: var(--ink-2); font-size: 13px; }
.sizes-t td.st.low { color: var(--warn); font-weight: 600; }
.qty { display: grid; grid-template-columns: 34px 54px 34px; justify-content: end; align-items: center; gap: 4px; }
.qty button { border: 0; background: var(--panel); border-radius: 9px; height: 34px; padding: 0; font-weight: 700; font-size: 17px; }
.qty input { text-align: center; padding: 6px 2px; font-weight: 700; }
.qactions { display: flex; flex-wrap: wrap; gap: 6px; }
.subtot { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border-radius: 12px; padding: 12px 14px; font-weight: 650; }
details.acc { border-top: 1px solid var(--line); padding-top: 10px; }
details.acc summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.acc summary::after { content: "+"; color: var(--ink-3); font-weight: 500; }
details.acc[open] summary::after { content: "–"; }
.descr { white-space: pre-line; color: var(--ink-2); font-size: 14px; margin-top: 8px; }
dl.chars { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
dl.chars dt { color: var(--ink-3); } dl.chars dd { margin: 0; }
.also { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.also .card .ct { font-size: 13px; } .also .price b { font-size: 15px; }

/* полноэкранный просмотр */
.viewer { position: fixed; inset: 0; z-index: 70; background: #fff; display: grid; grid-template-rows: 1fr; }
.viewer .track { height: 100vh; }
.viewer .slide { aspect-ratio: auto; height: 100vh; cursor: zoom-out; touch-action: pinch-zoom; }
.viewer .vclose { position: fixed; right: 16px; top: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 24px; }

/* корзина */
.shade { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 45; transform: translateX(100%); transition: transform .22s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.dhead { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dhead h2 { margin: 0; font-size: 19px; }
.x { border: 0; background: var(--panel); width: 36px; height: 36px; border-radius: 10px; font-size: 22px; line-height: 1; }
.dbody { overflow-y: auto; padding: 14px 20px; display: grid; gap: 12px; align-content: start; flex: 1; }
.dfoot { border-top: 1px solid var(--line); padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; background: var(--surface); }
.progress { display: grid; gap: 6px; font-size: 13px; }
.progress .tr { height: 8px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.progress .tr i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #ff6b6b); border-radius: 99px; transition: width .3s var(--ease); }
.cgroup { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cgroup img, .cgroup .ci { width: 64px; height: 80px; object-fit: contain; background: var(--photo); border-radius: 10px; }
.cgroup .t { font-weight: 650; font-size: 14px; line-height: 1.25; }
.cgroup .s { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.cgroup .r { text-align: right; font-weight: 700; font-size: 14px; }
.cgroup .acts { display: flex; gap: 10px; margin-top: 4px; }
.cgroup .acts button { border: 0; background: none; padding: 0; color: var(--ink-2); font-size: 12.5px; text-decoration: underline; }
.tot { display: grid; gap: 4px; font-size: 14px; }
.tot div { display: flex; justify-content: space-between; }
.tot .big { font-size: 19px; font-weight: 800; }
.suggest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sug { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 6px; background: var(--surface); text-align: left; font-size: 12.5px; line-height: 1.25; }
.sug img, .sug .ci { width: 46px; height: 46px; object-fit: contain; background: var(--photo); border-radius: 8px; }
.sug b { display: block; font-size: 13px; }
.mgr { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.mgr a { text-decoration: none; border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; font-weight: 600; }

/* заказы и условия */
.page { max-width: 860px; }
.page h1 { font-size: 24px; margin: 4px 0 16px; letter-spacing: -.01em; }
.orders { display: grid; gap: 12px; }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 8px; }
.order .h { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; flex-wrap: wrap; }
.order .stt { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--panel); }
.order details { font-size: 13.5px; color: var(--ink-2); }
.terms { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; white-space: pre-line; }
.tiers { display: grid; gap: 6px; margin: 10px 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 17px; border-radius: 12px; z-index: 90; font-size: 14px; max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); }

/* мобильная версия */
.tabbar { display: none; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: fixed; inset: auto 0 0 0; top: auto; z-index: 45; background: var(--surface); max-height: 86vh; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .22s var(--ease); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
  .filters.open { transform: none; }
  .filters .fclose { display: block; }
}
.fclose { display: none; }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .tabs, .who, .top-x { display: none; }
  .top-search { order: 3; flex: 1 1 100%; max-width: none; }
  .cartbtn { margin-left: auto; padding: 8px 12px; }
  main { padding: 12px 12px 96px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .ct { font-size: 13.5px; } .price b { font-size: 16px; }
  .sort { margin-left: 0; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar button { border: 0; background: none; padding: 8px 2px 9px; display: grid; justify-items: center; gap: 1px; font-size: 11px; color: var(--ink-2); position: relative; }
  .tabbar button i { font-style: normal; font-size: 18px; line-height: 1.1; }
  .tabbar button[aria-pressed="true"] { color: var(--red); }
  .tabbar em { position: absolute; top: 3px; left: 56%; background: var(--red); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 0 5px; }
  .tabbar em:empty { display: none; }
  .modal { padding: 0; place-items: end stretch; }
  .mbox { grid-template-columns: 1fr; border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; animation: rise .24s var(--ease); }
  @keyframes rise { from { transform: translateY(40px); opacity: .6; } }
  .gal { overflow: visible; }
  .thumbs, .garrow { display: none; }
  .gdots { display: flex; }
  .minfo { overflow: visible; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .minfo h2 { font-size: 20px; }
  .qty { grid-template-columns: 44px 56px 44px; }
  .qty button { height: 44px; }
  .drawer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
