:root {
  --bg: #f4f5f7; --card: #fff; --text: #16181d; --muted: #6b7280; --line: #e5e7eb;
  --accent: #6c3cf0; --accent-text: #fff; --sale: #e5484d; --ok: #1a9c5b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #1a1d23; --text: #eef0f4; --muted: #9aa1ad; --line: #2a2e36; --accent: #8b63ff; }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: 84px; }
button, input, textarea, select { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg); }
.top h1 { flex: 1; margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--card); font-size: 20px; cursor: pointer; }

main { padding: 0 16px; }
.loader, .empty { padding: 48px 0; text-align: center; color: var(--muted); }

.search { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none; }
.search:focus { border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--card); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.pic { aspect-ratio: 3/4; background: var(--line); display: grid; place-items: center; font-size: 56px; overflow: hidden; }
.pic { position: relative; }
.pic img { width: 100%; height: 100%; object-fit: contain; position: relative; }
.pic img.bg { position: absolute; inset: 0; object-fit: cover; filter: blur(16px) saturate(1.1); transform: scale(1.2); opacity: .85; }
.card .info { padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price b { font-size: 17px; }
.price s { color: var(--muted); font-size: 13px; }
.price .disc { color: var(--sale); font-size: 13px; font-weight: 600; }
.card .name { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.add { margin-top: auto; padding: 8px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.add.in { background: var(--line); color: var(--text); }

.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.gallery .pic { flex: 0 0 82%; scroll-snap-align: center; border-radius: var(--radius); font-size: 120px; }
.detail h2 { margin: 14px 0 6px; font-size: 19px; }
.detail .price b { font-size: 24px; }
.muted { color: var(--muted); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.size { min-width: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.size.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.desc { white-space: pre-line; font-size: 14px; }
.btn { width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 16px; cursor: pointer; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--card); color: var(--text); }
.sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); display: flex; gap: 8px; z-index: 6; }

.line { display: flex; gap: 10px; background: var(--card); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.line .pic { width: 64px; flex: none; border-radius: 10px; font-size: 30px; }
.line .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.line .t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--line); cursor: pointer; font-size: 17px; }
.total { display: flex; justify-content: space-between; font-size: 18px; padding: 12px 2px; }

.form label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.form input, .form textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none; }
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 11px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.seg button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.err { color: var(--sale); margin-top: 10px; }

.done { text-align: center; padding: 40px 0; }
.done .big { font-size: 64px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--line); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--sale) 18%, transparent); color: var(--sale); }

.cart-bar { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-text); font-size: 16px; cursor: pointer; box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); z-index: 10; font-size: 14px; }

.variants { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.variants span { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.variants span:empty { display: none; }
.size.weight { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.size.weight small { color: var(--muted); font-size: 12px; }
.size.weight.on small { color: var(--accent); }
.card .name { color: var(--text); font-weight: 500; }

/* ---------- оформление в стиле формы Ozon ---------- */
.panel { background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 10px; }
.panel h3 { margin: 0 0 12px; font-size: 18px; }
.fld { position: relative; display: block; width: 100%; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 6px 12px 7px; text-align: left; }
.fld:focus-within { border-color: var(--accent); }
.fld label, .fld .lbl { display: block; font-size: 12px; color: var(--muted); }
.fld input { width: 100%; border: 0; outline: none; padding: 1px 0 0; background: transparent; font-size: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.row4 .fld { padding: 6px 8px 7px; }
.row4 .fld label { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel .seg { margin-bottom: 10px; }
.panel .seg button { font-size: 14px; padding: 12px 6px; }
.pick { cursor: pointer; padding-right: 32px; font: inherit; color: inherit; }
.pick .val { display: block; font-size: 15px; }
.pick .val.ph { color: var(--muted); }
.pick .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); }
.oline { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.oline .pic { width: 44px; height: 58px; flex: none; border-radius: 8px; font-size: 22px; aspect-ratio: auto; }
.oline .t { flex: 1; font-size: 14px; min-width: 0; }
.oline .q { font-size: 14px; white-space: nowrap; }
.calc .kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 15px; }
.calc .kv.total { font-size: 18px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.calc .note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.point { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.point.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.point span { font-size: 14px; }
.line.tap { cursor: pointer; }

/* поиск ПВЗ по адресу */
.dmode { padding: 12px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--accent); box-shadow: inset 0 0 0 1px var(--accent); text-align: center; font-weight: 500; }
.pvz-wrap { position: relative; }
.pvz-wrap .fld { margin-bottom: 0; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8; max-height: 320px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .15); }
.sg { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.sg:last-child { border-bottom: 0; }
.sg:hover { background: var(--bg); }
.sg b { font-weight: 500; font-size: 14px; }
.sg small, .sg-msg { font-size: 12px; color: var(--muted); }
.sg-msg { padding: 12px; }
.pvz-sel { min-height: 18px; margin: 6px 2px 4px; font-size: 13px; color: var(--ok); }
.linkbtn { border: 0; background: none; padding: 4px 2px; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }

/* карточка заказа и отмена */
.line.tap { align-items: center; }
.chev-r { font-size: 22px; color: var(--muted); padding: 0 4px; }
.kvrow { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 0; font-size: 14px; }
.kvrow > span:first-child { color: var(--muted); white-space: nowrap; }
.btn.danger { background: var(--sale); color: #fff; }
.reasons .point { font-size: 15px; }

/* иконки в шапке */
.icon-btn { display: grid; place-items: center; color: var(--text); position: relative; }
.cart-btn { color: var(--accent); }
.cart-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sale); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* нет в наличии */
.card.soldout .pic { filter: grayscale(1); opacity: .55; }
.card.soldout .price b { color: var(--muted); }
.add.off, .add:disabled { background: var(--line); color: var(--muted); cursor: default; }
.variants span.off { text-decoration: line-through; opacity: .6; }
.size.weight.off { opacity: .5; }
.size.weight.off small { color: var(--sale); }
.soldout-note { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--sale) 15%, transparent); color: var(--sale); font-weight: 600; font-size: 14px; }

/* Мелкие юридические ссылки: оферта, оплата и возврат, реквизиты */
.legal{margin:18px 4px 8px;text-align:center;font-size:11px;line-height:1.6;color:#8e8e93}
.legal a{color:inherit;text-decoration:underline}
