/* Каркас прототипа. Цвета, радиусы и шрифты задаёт CSS варианта через переменные. */
:root {
  --bg: #fff; --page: #f2f2f2; --fg: #28201e; --fg2: #5f5652; --muted: #959595; --line: #e4e4e4;
  --accent: #28201e; --accent-fg: #fff; --ph: #fff; --r: 0px; --btn-r: 0px; --sheet-r: 0px;
  --font: "Mulish", system-ui, sans-serif; --display: var(--font);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--page); color: var(--fg); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; background: none; border: 0; text-align: inherit; }
button, [role=button] { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { position: relative; max-width: 430px; height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.hdr { flex: none; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 6px; position: relative; z-index: 6;
  background: var(--hdr-bg, var(--bg)); color: var(--hdr-fg, var(--fg)); border-bottom: 1px solid var(--hdr-line, transparent); }
.hdr-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.logo { height: 32px; width: auto; display: block; }
.hdr-title { font: var(--title-w, 500) 17px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tabs { flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--tab-bg, var(--bg)); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 10px; font-size: 10.5px; color: var(--muted); text-align: center; }
.tab.on { color: var(--fg); }
body[data-screen=product] .hdr, body[data-screen=product] .tabs { display: none; }

.ic { width: 22px; height: 22px; flex: none; display: block; }
.ic.big { width: 44px; height: 44px; stroke-width: .9; }
.ib { flex: none; width: 44px; height: 44px; display: grid; place-items: center; position: relative; border-radius: 50%; }
.cnt { position: absolute; top: 5px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); font: 700 10px/17px var(--font); text-align: center; }

/* кнопки и чипсы */
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--btn-r);
  background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 15px; text-align: center; }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong, var(--fg)); }
.btn.wide { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.chip.on { background: var(--fg); color: var(--bg); box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; min-width: 0; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill .ic { width: 18px; height: 18px; }
.pill.on { box-shadow: inset 0 0 0 1px var(--fg); }

/* обвязка каталога */
.seg { display: flex; margin: 12px 16px 4px; padding: 3px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { flex: 1; padding: 7px 0; font-size: 13px; text-align: center; border-radius: var(--btn-r); color: var(--muted); }
.seg button.on { background: var(--fg); color: var(--bg); }
.ctabs { display: flex; gap: 22px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.ctab { flex: none; padding: 14px 0 12px; font-size: 15px; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; }
.ctab.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--fg); }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 8px 6px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.cat.on span { box-shadow: inset 0 -1px 0 currentColor; }
.fbar { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; background: var(--bg); }
.fbar::-webkit-scrollbar, .ctabs::-webkit-scrollbar, .shelf::-webkit-scrollbar, .brail::-webkit-scrollbar, .colls::-webkit-scrollbar, .gal-track::-webkit-scrollbar { display: none; }
.fbtn { flex: none; padding: 8px 14px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; white-space: nowrap; }
.fbtn.on { box-shadow: inset 0 0 0 1px var(--fg); font-weight: 600; }
.count { padding: 2px 16px 10px; font-size: 12px; color: var(--muted); }

/* плитки товаров */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 12px; padding: 0 16px 8px; }
.card { min-width: 0; }
.ph { position: relative; aspect-ratio: 1; background: var(--ph); border-radius: var(--r); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.ph .fav { position: absolute; top: 0; right: 0; color: #28201e; }
.fav.on .ic { fill: currentColor; }
.fav.on { color: var(--fav-on, #9b2c2c); }
.badge { position: absolute; left: 8px; top: 8px; padding: 3px 7px; font-size: 10.5px; line-height: 1.3; border-radius: var(--badge-r, 0); background: var(--badge-bg, #28201e); color: var(--badge-fg, #fff); }
.badge.b-sold { background: #fff; color: #8a8a8a; }
.sold .ph img { opacity: .4; }
.meta { padding-top: 10px; min-width: 0; }
.c-cond { display: none; }
.c-brand { font-size: 13px; font-weight: 600; line-height: 1.3; }
.c-model { font-size: 13px; color: var(--fg2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-price { margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-price s { margin-left: 6px; font-size: 12px; color: var(--muted); }
.c-spec { font-size: 12px; color: var(--muted); margin-top: 2px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok, #2e7d4f); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-fitting { color: var(--warn, #a86b12); }
.st-sold { color: var(--muted); }

.shelf { display: flex; gap: 12px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mini { flex: 0 0 40%; scroll-snap-align: start; min-width: 0; }
.mini .c-brand { margin-top: 8px; }
.mini .c-model { -webkit-line-clamp: 1; }

.concierge { margin: 24px 16px; padding: 22px 20px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; justify-items: start; }
.concierge h3 { font: var(--title-w, 500) 18px/1.25 var(--display); }
.concierge p { font-size: 14px; color: var(--fg2); }
.concierge .btn { flex: none; margin-top: 4px; }
.empty { padding: 64px 32px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty h3 { font: var(--title-w, 500) 20px/1.2 var(--display); }
.empty p { color: var(--fg2); font-size: 14px; max-width: 30ch; }
.empty .btn { flex: none; margin-top: 8px; }

/* карточка товара */
.pd { min-height: 100%; display: flex; flex-direction: column; }
.gal { position: relative; background: var(--ph); }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shot { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: center; overflow: hidden; display: grid; place-items: center; background: var(--ph); }
.shot img { width: 86%; height: 86%; object-fit: contain; mix-blend-mode: multiply; }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #28201e; opacity: .2; }
.dots i.on { opacity: .8; }
.pager { padding: 16px; }
.pager .btn { width: 100%; }
.gal-back { position: absolute; top: 8px; left: 8px; color: #28201e; background: rgba(255, 255, 255, .85); }
.gal-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.gal-tools .ib { color: #28201e; background: rgba(255, 255, 255, .85); }
.gal-tools .fav.on { color: var(--fav-on, #9b2c2c); }
.gal .badge { top: auto; bottom: 12px; left: 16px; }
.pd-body { flex: 1; padding: 18px 16px 24px; }
.pd-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-cond { font-size: 12px; color: var(--muted); }
.pd-type { margin-top: 16px; font-size: 13px; color: var(--muted); }
.pd-brand { font: var(--title-w, 500) 26px/1.15 var(--display); }
.pd-model { margin-top: 4px; font-size: 16px; color: var(--fg2); }
.pd-ref { display: none; }
.pd-price { margin-top: 14px; font-size: 22px; font-variant-numeric: tabular-nums; }
.pd-price s { font-size: 15px; color: var(--muted); margin-left: 8px; }
.pd-acts { display: flex; gap: 8px; margin-top: 18px; }
.pd-acts .pill { flex: 1; justify-content: center; }
.auth { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.auth summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; font-size: 14px; list-style: none; cursor: pointer; }
.auth summary::-webkit-details-marker { display: none; }
.auth p { padding: 0 0 14px 32px; font-size: 13.5px; color: var(--fg2); }
.pd-h { margin: 26px 0 10px; font: var(--title-w, 500) 17px/1.2 var(--display); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { text-align: right; }
.pd .shelf { margin: 0 -16px; }
.buybar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bar-bg, var(--bg)); border-top: 1px solid var(--line); }
.bb-price { flex: 1; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bb-price s { display: block; margin: 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.bb-note { flex: 1; font-size: 13px; color: var(--fg2); }

/* корзина и кабинет */
.cart, .prof { padding: 8px 16px 32px; }
.citem { display: grid; grid-template-columns: 84px 1fr 44px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.citem .meta { padding: 0; }
.sum { margin-top: 16px; }
.sum div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.sum dt { color: var(--muted); }
.sum .total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.sum .total dt { color: var(--fg); }
.note { margin: 14px 0 18px; font-size: 13px; color: var(--fg2); }
.hello { display: flex; align-items: center; gap: 14px; padding: 12px 0 20px; }
.ava { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--fg); color: var(--bg); font: 500 20px var(--display); }
.hello-n { font: var(--title-w, 500) 20px/1.2 var(--display); }
.muted { color: var(--muted); font-size: 13px; }
.loyal { padding: 18px; border-radius: var(--r); background: var(--card, var(--ph)); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; }
.loyal-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--fg2); }
.loyal-hd b { font: var(--title-w, 500) 22px/1 var(--display); color: var(--fg); }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.loyal p { font-size: 13px; color: var(--fg2); }
.mrow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; text-decoration: none; }
.mrow > span { flex: 1; display: grid; }
.mrow small { font-size: 12.5px; color: var(--muted); }
.tile { margin-top: 12px; padding: 16px; border-bottom: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.order { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order-hd { display: flex; justify-content: space-between; margin-bottom: 4px; }

/* поиск */
.sbar { position: sticky; top: 0; z-index: 4; padding: 10px 16px; background: var(--bg); }
.sfield { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); background: var(--field, transparent); }
.sfield input { flex: 1; min-width: 0; outline: 0; }
.sugg { padding: 0 16px; }

/* шторки */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(28, 20, 17, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 90%; display: flex; flex-direction: column; background: var(--sheet-bg, var(--bg)); color: var(--fg);
  border-radius: var(--sheet-r) var(--sheet-r) 0 0; transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.sheet-open .scrim { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px 20px; min-height: 60px; }
.sheet-hd h3 { font: var(--title-w, 500) 19px/1.2 var(--display); }
.sheet-bd { overflow-y: auto; padding: 4px 20px 20px; }
.sheet-bd h4 { margin: 22px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-bd h4:first-child { margin-top: 4px; }
.sheet-ft { display: flex; gap: 10px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.menu-logo { height: 30px; display: block; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { padding: 13px 0; font-size: 15px; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { padding-bottom: 14px; font-size: 14px; color: var(--fg2); }
.legal { display: flex; gap: 16px; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.lead { font-size: 14px; color: var(--fg2); margin-bottom: 16px; }
.shots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.shots img, .addshot { width: 74px; height: 74px; border-radius: var(--r); object-fit: cover; }
.addshot { display: grid; place-items: center; align-content: center; gap: 4px; font-size: 10.5px; text-align: center; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.fld { display: grid; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.fld input, .fld textarea { padding: 12px 14px; border-radius: var(--btn-r); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; color: var(--fg); outline: 0; resize: none; background: var(--field, transparent); }
.fld input:focus, .fld textarea:focus { box-shadow: inset 0 0 0 1px var(--fg); }

.toast { position: absolute; left: 50%; bottom: 84px; z-index: 30; width: max-content; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: var(--toast-r, var(--btn-r));
  background: var(--fg); color: var(--bg); font-size: 13.5px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body[data-screen=product] .toast { bottom: 92px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
