/* NEVER — минималистичный светлый интерфейс: белый фон, чёрные элементы управления,
   тёплые песочные и графитовые акценты */
:root {
  --sand: #efe8dc;
  --sand-2: #e4d9c7;
  --sand-ink: #6b5a45;
  --graphite: #1d1c1a;
  --gold: #b08a5a;
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --muted: #8b8b8b;
  --line: #ebebeb;
  --soft: #f4f4f2;
  --soft-2: #ecebe8;
  --sale: #c4161c;
  --ok: #1f7a3d;
  --radius: 14px;
  --radius-s: 10px;
  --gutter: 16px;
  --topbar-h: 54px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* overflow-x: hidden на body в WebView iOS/Telegram иногда ломает прокрутку — обрезаем только вид */
.view { overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: grid; grid-template-columns: 92px 1fr 92px; align-items: center;
  padding: 0 6px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.tb-left { display: flex; }
.tb-right { display: flex; justify-content: flex-end; }
.wordmark {
  grid-column: 2; justify-self: center;
  font-weight: 800; font-size: 19px; letter-spacing: .42em; text-transform: uppercase;
  padding-left: .42em; white-space: nowrap;
}
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; position: relative; border-radius: 50%;
}
.icon-btn:active { background: var(--soft); }
.badge {
  position: absolute; top: 6px; right: 4px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--ink); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center; line-height: 1;
}

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; letter-spacing: .02em;
}
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { stroke-width: 2; }
.tabbar .badge { top: 5px; right: calc(50% - 22px); }
body.no-tabbar .tabbar { display: none; }

/* ---------- контент ---------- */
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); min-height: calc(100vh - var(--topbar-h)); }
body.no-tabbar .view { padding-bottom: calc(96px + var(--safe-b)); }
.view.enter { animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pad { padding: 0 var(--gutter); }

.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 14px var(--gutter) 4px; }
.page-sub { color: var(--muted); margin: 0 var(--gutter) 14px; font-size: 14px; }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.section-head a { font-size: 13px; color: var(--muted); }

/* hero */
.hero {
  position: relative; margin: 6px var(--gutter) 0; border-radius: 18px; overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--soft); display: block;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55)); }
.hero .hero-text { position: absolute; left: 20px; right: 20px; bottom: 22px; z-index: 1; color: #fff; }
.hero .eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; opacity: .85; }
.hero h1 { margin: 8px 0 14px; font-size: 30px; line-height: 1.05; letter-spacing: -.02em; font-weight: 700; }
.hero.plain { aspect-ratio: auto; background: var(--ink); color: #fff; padding: 40px 22px 26px; }
.hero.plain::after { display: none; }
.hero.plain .hero-text { position: static; }
.hero.plain h1 { font-size: 34px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px;
}

/* чипсы */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gutter) 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; font-size: 14px; white-space: nowrap; background: #fff;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* плитки категорий */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 var(--gutter); }
.cat-tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--soft); aspect-ratio: 1 / 1; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .cat-name {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600;
  display: flex; justify-content: space-between; gap: 6px;
}
.cat-tile .cat-name em { font-style: normal; color: var(--muted); font-weight: 400; }
.cat-tile.noimg { display: grid; place-items: center; }
.cat-tile.noimg .big { font-size: 34px; }

/* карточки товаров */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 10px; padding: 0 var(--gutter); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 10px; overflow-x: auto; padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }
.card { position: relative; min-width: 0; }
.card .media { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.card .tags { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; }
.tag { height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; display: inline-flex; align-items: center; background: #fff; color: var(--ink); }
.tag.dark { background: var(--ink); color: #fff; }
.tag.sale { background: var(--sale); color: #fff; }
.fav-btn {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.88);
}
.fav-btn svg { width: 19px; height: 19px; }
.fav-btn.on svg { fill: var(--ink); }
.card .info { padding: 9px 2px 0; }
.card .name { font-size: 13.5px; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.price.sale { color: var(--sale); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 13px; white-space: nowrap; }
.card.soldout .media img { opacity: .45; }
.soldout-label { position: absolute; left: 8px; bottom: 8px; font-size: 11px; background: #fff; padding: 3px 8px; border-radius: 6px; }

.noimg-ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b9b8b4; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; background: linear-gradient(135deg, var(--soft), var(--soft-2)); }

/* поиск и фильтры */
.searchbar { position: relative; margin: 10px var(--gutter) 12px; }
.searchbar input {
  width: 100%; height: 44px; border-radius: 12px; border: 0; background: var(--soft);
  padding: 0 40px 0 42px; font-size: 15px; outline: none;
}
.searchbar input:focus { box-shadow: 0 0 0 1.5px var(--ink) inset; background: #fff; }
.searchbar > svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.searchbar .clear { position: absolute; right: 6px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter) 14px; gap: 10px; }
.toolbar .count { color: var(--muted); font-size: 13px; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  height: 34px; padding: 0 30px 0 14px; font-size: 13px;
}
.select-wrap::after { content: ""; position: absolute; right: 13px; top: 13px; width: 6px; height: 6px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); pointer-events: none; }

/* карточка товара */
.gallery { position: relative; background: var(--soft); }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 5; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .slide { flex: 0 0 100%; scroll-snap-align: center; }
.gallery .slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery .dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.gallery .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.25); transition: width .2s, background .2s; }
.gallery .dots i.on { width: 18px; background: var(--ink); }
.gallery .fav-btn { top: 12px; right: 12px; width: 42px; height: 42px; }
.gallery .tags { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; }
.pd { padding: 18px var(--gutter) 0; }
.pd .crumbs { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.pd h1 { margin: 6px 0 8px; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.pd .price-row .price { font-size: 22px; }
.pd .price-row .old-price { font-size: 15px; }
.opt { margin-top: 22px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.opt-head b { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.opt-head span { font-size: 13px; color: var(--muted); }
.opt-head .link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn {
  min-width: 52px; height: 44px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; background: #fff; position: relative;
}
.opt-btn.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; font-weight: 600; }
.opt-btn.off { color: #bdbdbd; background: repeating-linear-gradient(135deg, #fff 0 6px, #f6f6f6 6px 7px); }
.stock-hint { margin-top: 10px; font-size: 13px; color: var(--sale); min-height: 18px; }
.desc { margin-top: 24px; border-top: 1px solid var(--line); }
.desc details { border-bottom: 1px solid var(--line); }
.desc summary { list-style: none; padding: 16px 0; display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; cursor: pointer; }
.desc summary::-webkit-details-marker { display: none; }
.desc summary::after { content: "+"; font-weight: 300; font-size: 20px; line-height: 12px; }
.desc details[open] summary::after { content: "–"; }
.desc .body { padding: 0 0 16px; color: var(--ink-2); white-space: pre-line; font-size: 14.5px; }

/* нижняя панель действия */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px var(--gutter) calc(10px + var(--safe-b));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
}
.btn {
  height: 52px; border-radius: 14px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 15.5px; background: var(--ink); color: #fff; width: 100%; transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.btn.light { background: var(--soft); color: var(--ink); }
.btn.small { height: 40px; font-size: 14px; border-radius: 12px; width: auto; }
.btn .sep { opacity: .5; }
.square-btn { flex: none; width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; }
.square-btn.on svg { fill: var(--ink); }

/* корзина */
.cart-item { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 16px var(--gutter); border-bottom: 1px solid var(--line); }
.cart-item .thumb { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--soft); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .row1 { display: flex; justify-content: space-between; gap: 10px; }
.cart-item .t { font-size: 14.5px; line-height: 1.3; }
.cart-item .v { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cart-item .warn { color: var(--sale); font-size: 12.5px; margin-top: 4px; }
.cart-item .row2 { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.remove-btn { color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; margin: -6px -6px 0 0; }
.remove-btn svg { width: 18px; height: 18px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 36px; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; font-size: 18px; }
.stepper button[disabled] { opacity: .3; }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; font-size: 14px; }
.summary { padding: 18px var(--gutter); }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--ink-2); }
.sum-row.total { color: var(--ink); font-weight: 700; font-size: 18px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.sum-row .minus { color: var(--sale); }
.promo { display: flex; gap: 8px; padding: 6px var(--gutter) 0; }
.promo input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; text-transform: uppercase; outline: none; }
.promo input:focus { border-color: var(--ink); }
.promo-ok { margin: 8px var(--gutter) 0; font-size: 13px; color: var(--ok); display: flex; justify-content: space-between; }
.promo-ok button { color: var(--muted); text-decoration: underline; font-size: 13px; }

/* формы */
.form { padding: 4px var(--gutter) 0; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; height: 48px; padding: 0 14px; font-size: 16px; outline: none; background: #fff;
}
.field textarea { height: 84px; padding: 12px 14px; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field.err input, .field.err textarea { border-color: var(--sale); }
.field .err-text { color: var(--sale); font-size: 12.5px; margin-top: 6px; }
.seg { display: grid; gap: 8px; }
.seg button { height: 48px; border-radius: 12px; border: 1px solid var(--line); text-align: left; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.seg button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; font-weight: 600; }
.seg button.on::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.note { margin: 16px var(--gutter) 0; padding: 14px; border-radius: 12px; background: var(--soft); font-size: 13.5px; color: var(--ink-2); }

/* списки */
.list { margin: 6px 0 0; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--gutter); border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.list-item .l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.list-item .l svg { color: var(--ink-2); flex: none; }
.list-item .title { font-size: 15px; }
.list-item .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-item .chev { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); flex: none; }
.status { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.status.new, .status.awaiting_payment { background: #111; color: #fff; }
.status.cancelled { background: #fbe9ea; color: var(--sale); }
.status.delivered { background: #e8f3ec; color: var(--ok); }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 14px var(--gutter) 6px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; }
.profile-head .n { font-size: 19px; font-weight: 600; }
.profile-head .u { color: var(--muted); font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px var(--gutter); }
.stat { background: var(--soft); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 17px; }
.stat span { color: var(--muted); font-size: 12px; }

/* пустые состояния и загрузка */
.empty { text-align: center; padding: 70px 30px 30px; }
.empty .ico { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; margin: 0 auto 18px; }
.empty .ico svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 22px; color: var(--muted); }
.empty .btn { width: auto; display: inline-flex; padding: 0 26px; }
.skel { background: linear-gradient(90deg, var(--soft) 0, #fafaf9 50%, var(--soft) 100%); background-size: 200% 100%; animation: sk 1.1s infinite linear; border-radius: var(--radius); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card .s1 { aspect-ratio: 3 / 4; }
.skel-card .s2 { height: 12px; margin-top: 10px; width: 80%; border-radius: 6px; }
.skel-card .s3 { height: 12px; margin-top: 6px; width: 40%; border-radius: 6px; }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 20px 20px 0 0;
  max-height: 86vh; overflow-y: auto; padding: 8px var(--gutter) calc(20px + var(--safe-b)); animation: up .25s ease-out;
}
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.sheet pre { white-space: pre-wrap; font-family: var(--font); font-size: 14px; background: var(--soft); padding: 14px; border-radius: 12px; overflow-x: auto; }
.sheet img { border-radius: 12px; margin-bottom: 12px; width: 100%; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: up .2s ease-out;
}
body.no-tabbar .toast { bottom: calc(86px + var(--safe-b)); }

/* успех */
.success { text-align: center; padding: 56px 26px 10px; }
.success .check { width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin: 0 auto 20px; }
.success .check svg { width: 34px; height: 34px; stroke-width: 2.2; }
.success h1 { font-size: 24px; margin: 0 0 8px; }
.success p { color: var(--muted); margin: 0 0 6px; }

/* админка */
.admin-tabs { display: flex; gap: 8px; padding: 6px var(--gutter) 10px; }
.admin-card { margin: 0 var(--gutter) 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.admin-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.admin-card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.admin-card .items { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.admin-card select { width: 100%; margin-top: 12px; height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; background: #fff; }
.admin-prod { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.admin-prod .thumb { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--soft); }
.admin-prod .thumb img { width: 100%; height: 100%; object-fit: cover; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flags .chip { height: 30px; font-size: 12.5px; padding: 0 12px; }
.var-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.var-row:first-child { border-top: 0; }
.var-row input { width: 74px; height: 36px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.var-wrap { margin-top: 10px; }
.price-edit { display: flex; gap: 8px; margin-top: 10px; }
.price-edit input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }

.gate { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 30px; }
.gate .wordmark-big { font-weight: 700; letter-spacing: .34em; font-size: 22px; margin-bottom: 30px; }
.gate p { color: var(--muted); margin: 0 0 24px; }
.gate .btn { margin-top: 10px; }

/* ---------- карусель баннеров ---------- */
.carousel { position: relative; margin: 6px var(--gutter) 0; border-radius: 20px; overflow: hidden; }
.carousel .c-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel .c-track::-webkit-scrollbar { display: none; }
.banner { position: relative; flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; overflow: hidden; display: block; background: var(--sand); }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.0) 40%, rgba(0,0,0,.5)); }
.banner.top::after { background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0) 45%, rgba(0,0,0,.25)); }
.banner .b-text { position: absolute; left: 20px; right: 20px; bottom: 26px; z-index: 1; color: #fff; }
.banner.top .b-text { top: 26px; bottom: auto; }
.banner.light::after { background: linear-gradient(180deg, rgba(239,232,220,.0) 45%, rgba(239,232,220,.85)); }
.banner.light .b-text { color: var(--graphite); }
.banner.light .pill-btn { background: var(--graphite); color: #fff; }
.banner .eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; opacity: .9; }
.banner h2 { margin: 8px 0 14px; font-size: 30px; line-height: 1.04; letter-spacing: -.02em; font-weight: 800; }
.c-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.c-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); transition: width .25s, background .25s; }
.c-dots i.on { width: 20px; background: #fff; }

/* ---------- блоки главной ---------- */
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 var(--gutter); margin-top: 14px; }
.perk { background: var(--sand); border-radius: 14px; padding: 12px 10px; font-size: 11.5px; line-height: 1.3; color: var(--sand-ink); }
.perk b { display: block; color: var(--graphite); font-size: 12.5px; margin-bottom: 2px; }
.sizefinder { margin: 30px var(--gutter) 0; background: var(--sand); border-radius: 20px; padding: 20px; position: relative; overflow: hidden; }
.sizefinder h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.sizefinder p { margin: 0 0 14px; color: var(--sand-ink); font-size: 13.5px; }
.sf-row { display: flex; gap: 8px; }
.sf-row input { flex: 1; min-width: 0; height: 48px; border-radius: 12px; border: 0; padding: 0 14px; font-size: 16px; background: #fff; outline: none; }
.sf-row .btn { width: auto; padding: 0 18px; height: 48px; }
.sf-result { margin-top: 12px; font-size: 15px; min-height: 22px; }
.sf-result b { font-size: 22px; }
.sf-link { margin-top: 6px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--sand-ink); }
.wheel-strip { margin: 30px var(--gutter) 0; background: var(--graphite); color: #fff; border-radius: 20px; padding: 20px; display: flex; align-items: center; gap: 16px; }
.wheel-strip .mini-wheel { flex: none; width: 74px; height: 74px; }
.wheel-strip .mini-wheel svg, .wheel-wrap svg.wheel { width: 100%; height: 100%; stroke: none; }
.wheel-strip h3 { margin: 0 0 4px; font-size: 18px; }
.wheel-strip p { margin: 0 0 10px; color: rgba(255,255,255,.65); font-size: 13px; }
.wheel-strip .pill-btn { height: 34px; font-size: 13px; padding: 0 14px; }

/* ---------- звёзды и отзывы ---------- */
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.stars .off { color: #d9d4cb; }
.rating-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.card .rating-line { font-size: 12px; margin-top: 3px; }
.rv-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 10px; overflow-x: auto; padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scroll-snap-type: x mandatory; scrollbar-width: none; }
.rv-rail::-webkit-scrollbar { display: none; }
.review { background: var(--soft); border-radius: 16px; padding: 14px; scroll-snap-align: start; }
.rv-list .review { margin: 0 var(--gutter) 10px; }
.review .rv-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.review .rv-name { font-weight: 600; font-size: 14px; }
.review .rv-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.review .rv-text { margin-top: 8px; font-size: 14px; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.rv-list .review .rv-text { -webkit-line-clamp: unset; display: block; }
.review .rv-photo { margin-top: 10px; width: 88px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.review .rv-photo img { width: 100%; height: 100%; object-fit: cover; }
.rv-summary { display: flex; align-items: baseline; gap: 10px; padding: 0 var(--gutter); margin-bottom: 12px; }
.rv-summary b { font-size: 34px; letter-spacing: -.02em; }
.star-input { display: flex; gap: 6px; margin: 8px 0 16px; }
.star-input button { font-size: 34px; line-height: 1; color: #d9d4cb; }
.star-input button.on { color: var(--gold); }
.file-pick { display: flex; align-items: center; gap: 10px; height: 48px; border: 1px dashed #cfc8bb; border-radius: 12px; padding: 0 14px; color: var(--sand-ink); font-size: 14px; cursor: pointer; margin-top: 10px; }
.file-pick input { display: none; }
.pending-note { margin-top: 12px; padding: 12px 14px; background: var(--sand); border-radius: 12px; font-size: 13.5px; color: var(--sand-ink); }

/* ---------- размерная сетка ---------- */
.size-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; margin: 8px 0 6px; }
.size-table th, .size-table td { text-align: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.size-table th { font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.size-table td:first-child, .size-table th:first-child { text-align: left; padding-left: 0; color: var(--ink-2); }
.size-table td:first-child b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--graphite); color: #fff; font-size: 11px; margin-right: 6px; }
.size-table .hl { background: var(--sand); font-weight: 700; }
.size-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.size-hint { font-size: 12.5px; color: var(--muted); }
.size-scheme { background: #fff; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; margin-top: 14px; }
.size-scheme img { width: 100%; }

/* ---------- колесо удачи ---------- */
.wheel-wrap { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 18px auto 0; }
.wheel-wrap svg.wheel { width: 100%; height: 100%; transition: transform 4.6s cubic-bezier(.12,.8,.12,1); }
.wheel-wrap .pointer { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--graphite); z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.wheel-wrap .hub { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--graphite); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px; letter-spacing: .2em; padding-left: .2em; box-shadow: 0 0 0 6px #fff; }
.wheel-info { text-align: center; padding: 18px var(--gutter) 0; }
.wheel-info h1 { margin: 0 0 6px; font-size: 24px; }
.wheel-info p { margin: 0; color: var(--muted); }
.promo-card { margin: 0 var(--gutter) 10px; border-radius: 16px; padding: 16px; background: var(--sand); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.promo-card.dim { background: var(--soft); color: var(--muted); }
.promo-card .pc-label { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.promo-card .pc-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; margin-top: 2px; letter-spacing: .06em; }
.promo-card .pc-meta { font-size: 12px; color: var(--sand-ink); margin-top: 4px; }
.promo-card.dim .pc-meta { color: var(--muted); }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 var(--gutter); }
.kpi { border-radius: 14px; padding: 14px; background: var(--soft); }
.kpi.dark { background: var(--graphite); color: #fff; }
.kpi.sand { background: var(--sand); }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.dark span { color: rgba(255,255,255,.6); }
.kpi b { display: block; font-size: 22px; letter-spacing: -.02em; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 0 var(--gutter); }
.bars i { flex: 1; background: var(--graphite); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars i.zero { background: var(--line); }
.bars-axis { display: flex; justify-content: space-between; padding: 6px var(--gutter) 0; font-size: 11px; color: var(--muted); }
.st-list { padding: 0 var(--gutter); }
.st-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.st-row .meter { grid-column: 1 / -1; height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.st-row .meter i { display: block; height: 100%; background: var(--gold); }
.st-row .muted { color: var(--muted); }
.funnel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 var(--gutter); }
.funnel div { background: var(--soft); border-radius: 12px; padding: 12px; text-align: center; }
.funnel b { display: block; font-size: 20px; }
.funnel span { font-size: 11.5px; color: var(--muted); }
.upload-box { margin: 0 var(--gutter); padding: 18px; border-radius: 16px; background: var(--sand); }
.upload-box p { margin: 0 0 12px; font-size: 13.5px; color: var(--sand-ink); }
.upload-box .btn { margin-top: 8px; }
.result-pre { white-space: pre-wrap; font-size: 13px; background: var(--soft); border-radius: 12px; padding: 12px; margin: 12px var(--gutter) 0; }

/* ---------- анимации: появление при прокрутке, 3D-наклон, пружинистые нажатия ---------- */
.reveal { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
/* в горизонтальных лентах — только проявление, без сдвига (сдвиг давал вертикальную прокрутку ленты) */
.rail .reveal, .rv-rail .reveal, .c-track .reveal { transform: none; }
/* горизонтальные ленты листаются только вбок: вертикальный свайп всегда прокручивает страницу */
.c-track, .rail, .rv-rail, .chips, .gallery .track { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.tilt.pressing { transition-duration: .12s; }
.card .media { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.card:active .media { transform: scale(.97); }
.btn, .chip, .opt-btn, .icon-btn, .pill-btn, .square-btn { transition: transform .18s cubic-bezier(.3,1.6,.5,1), background .2s, color .2s, opacity .2s; }
.chip:active, .opt-btn:active, .icon-btn:active, .pill-btn:active, .square-btn:active { transform: scale(.93); }
.sheet { animation: sheetUp .42s cubic-bezier(.2,1.25,.35,1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.view.enter { animation: viewIn .32s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast { animation: toastIn .35s cubic-bezier(.2,1.3,.4,1); display: flex; gap: 10px; align-items: center; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
.gallery .track img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.badge.bump { animation: bump .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- коды товаров ---------- */
.code-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--soft); color: var(--ink-2); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.card .code-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92); }
.pd .code-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pd .code-row .code-tag { height: 26px; font-size: 12.5px; cursor: pointer; }
.pd .code-row .copy-hint { font-size: 12px; color: var(--muted); }
.code-hit { margin: 0 var(--gutter) 14px; padding: 14px; border-radius: 16px; background: var(--graphite); color: #fff; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.code-hit .th { aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: #333; }
.code-hit .th img { width: 100%; height: 100%; object-fit: cover; }
.code-hit .meta { font-size: 12px; color: rgba(255,255,255,.6); }
.code-hit .pill-btn { height: 36px; font-size: 13px; }
.search-tip { padding: 0 var(--gutter); margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- бестселлеры с номерами ---------- */
.rank { position: absolute; left: 8px; bottom: 6px; font-size: 44px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.35); letter-spacing: -.04em; pointer-events: none; }
.rail.ranked .code-tag { left: auto; right: 8px; }

/* ---------- фильтры ---------- */
.filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; background: #fff; }
.filter-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-btn svg { width: 16px; height: 16px; }
.sheet .opts { margin-bottom: 18px; }

/* ---------- NEVER VPN ---------- */
.vpn { margin: 30px var(--gutter) 0; border-radius: 22px; padding: 22px 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #3b3a37 0%, #1d1c1a 55%, #0f0f0e 100%); display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.vpn::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 30px rgba(255,255,255,.03), 0 0 0 60px rgba(255,255,255,.02); }
.vpn .eyebrow { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.vpn h3 { margin: 6px 0 6px; font-size: 22px; letter-spacing: .04em; }
.vpn p { margin: 0 0 14px; color: rgba(255,255,255,.7); font-size: 13.5px; }
.vpn .logo { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.08); display: grid; place-items: center; position: relative; }
.vpn .logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- статус заказа ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px var(--gutter) 4px; }
.timeline .st { text-align: center; font-size: 11px; color: var(--muted); }
.timeline .st i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 8px; transition: background .4s; }
.timeline .st.done { color: var(--ink); }
.timeline .st.done i { background: var(--ink); }
.timeline .st.now { font-weight: 700; color: var(--ink); }

/* ---------- размерная сетка (фото) ---------- */
.size-photo { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.size-photo img { width: 100%; }

/* ---------- админка: колесо и VPN ---------- */
.prize-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr .7fr 28px; gap: 6px; align-items: center; margin-bottom: 8px; }
.prize-row input, .prize-row select { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 13px; background: #fff; }
.prize-head { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr .7fr 28px; gap: 6px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--soft); margin-bottom: 12px; font-size: 14px; }
.switch input { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; background: #d8d6d1; border-radius: 13px; position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- просмотр фото на весь экран с увеличением ---------- */
.zoom { position: fixed; inset: 0; z-index: 80; background: #0b0b0b; display: flex; flex-direction: column; animation: fade .2s; }
.zoom .z-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.zoom .z-track::-webkit-scrollbar { display: none; }
.zoom.zoomed .z-track { overflow-x: hidden; }
.zoom .z-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; overflow: hidden; touch-action: pan-x; }
.zoom .z-slide img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; }
.zoom .z-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; color: #fff; z-index: 2; background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,0)); }
.zoom .z-top button { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.zoom .z-count { font-size: 13px; letter-spacing: .12em; }
.zoom .z-hint { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.55); font-size: 12px; pointer-events: none; transition: opacity .4s; }
.zoom.zoomed .z-hint { opacity: 0; }
.gallery .slide img { cursor: zoom-in; }
.gallery .zoom-badge { position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; pointer-events: none; }
.gallery .zoom-badge svg { width: 18px; height: 18px; }
.size-inline { padding-bottom: 16px; }
.size-inline img { width: 100%; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .rail { grid-auto-columns: 30%; }
  .view, .topbar, .tabbar, .actionbar { max-width: 760px; margin-left: auto; margin-right: auto; }
  .tabbar, .actionbar { left: 50%; transform: translateX(-50%); width: 100%; }
  .hero { aspect-ratio: 16 / 10; }
}
