/* Мини-приложение: телефон 390 px. Цена не красная; кнопка действия зелёная.
   Цвета — из макета: чёрный #131313, белый #fff, зелёный действия #2FA84F,
   оранжевый ярлык снижения цены #FF6A13 (тот же, что на обложке). */

:root {
  --ink: #131313;
  --bg: #f4f4f4;
  --card: #fff;
  --line: #e6e6e6;
  --muted: #6b6b6b;
  --green: #2fa84f;
  --green-d: #268a41;
  --sale: #ff6a13;
  --yellow: #ffd60a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/v/fonts/manrope.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/v/fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.35; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

.app { min-height: 100vh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 8px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.top .logo { width: 168px; height: 26px; }
.cartbtn { background: #fff; color: #111; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.cartbtn span { display: inline-block; min-width: 18px; }

.tabs { display: flex; gap: 6px; padding: 8px 12px; background: var(--ink); position: sticky; top: 56px; z-index: 19; overflow-x: auto; }
.tabs button { flex: none; padding: 8px 14px; border-radius: 999px; color: rgba(255,255,255,.72); font-weight: 700; font-size: 14px; background: rgba(255,255,255,.1); }
.tabs button.on { background: #fff; color: #111; }
.tabs i { font-style: normal; }

.view { padding: 12px 12px 20px; }
.chead h1 { font-size: 21px; line-height: 1.15; margin: 4px 0 4px; letter-spacing: -.02em; }
.chead p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.what { background: #fff8e1; border: 1px solid #f2e3a8; color: #4a3f16; border-radius: 12px;
  padding: 9px 12px; font-size: 13px; margin: 0 0 12px; }
.wh { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

.searchrow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 14px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.icon { width: 42px; height: 42px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 18px; }
.icon.on { background: var(--ink); color: #fff; }
.vo { display: flex; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.vo button { width: 36px; height: 42px; color: var(--muted); font-size: 16px; }
.vo button.on { background: var(--ink); color: #fff; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; }

.filters { background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.filters .sw, .f .sw, .mfoot .sw { margin: 6px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.seg button { padding: 7px 11px; border-radius: 10px; background: #f1f1f1; font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--ink); color: #fff; }
.stockseg button.on { background: var(--green); }

.grid { display: grid; gap: 10px; }
.grid.grid { grid-template-columns: 1fr 1fr; }
.grid.list { grid-template-columns: 1fr; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.card.out { opacity: .82; }
.card .ph { position: relative; aspect-ratio: 3 / 4; background: #ddd; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--yellow); color: #111; font-size: 11.5px; font-weight: 800;
  padding: 4px 8px; border-radius: 8px; max-width: calc(100% - 16px); }
.badge.sale { background: var(--sale); color: #fff; }
.badge.low { background: #fff; border: 1.5px solid #111; }
.badge.out { background: #6b6b6b; color: #fff; }
.st { position: absolute; right: 8px; top: 8px; background: rgba(17,17,17,.78); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.card .tx { padding: 9px 10px 10px; }
.card .nm { font-weight: 800; font-size: 14px; line-height: 1.2; }
.card .mk { color: var(--muted); font-size: 11.5px; margin-top: 2px; min-height: 15px; }
.card .pr { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.price small { color: var(--muted); font-size: 11px; font-weight: 600; }
.price b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.price.small { color: var(--muted); font-size: 12px; }
.pout { font-weight: 800; font-size: 14px; color: #6b6b6b; }
.in { margin-left: auto; font-size: 11px; color: var(--green-d); font-weight: 700; }
.act { margin-top: 8px; width: 100%; padding: 9px 10px; border-radius: 11px; background: var(--green); color: #fff; font-weight: 800; font-size: 13px; }
.act:active { background: var(--green-d); }
.act.wait { background: #fff; color: #111; border: 1.5px solid #111; }

.grid.list .card { display: grid; grid-template-columns: 96px 1fr; }
.grid.list .card .ph { aspect-ratio: 1; height: 100%; }
.grid.list .card .tx { padding: 8px 10px; }
.grid.list .card .act { width: auto; padding: 7px 12px; display: inline-block; }

.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.err { background: #fff0f0; border: 1px solid #f0c0c0; border-radius: 12px; padding: 12px; color: #7a1f1f; }

/* карточка товара */
.back { display: inline-block; margin: 0 0 8px; color: var(--muted); font-weight: 700; font-size: 14px; padding: 4px 0; }
.pcard { background: #fff; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.gallery { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 78%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; scroll-snap-align: start; background: #eee; }
.pcard h1 { font-size: 20px; line-height: 1.18; margin: 6px 0 4px; letter-spacing: -.02em; }
.pcard .sub { color: var(--muted); font-size: 13px; }
.pcard .tags { display: inline-block; margin-top: 8px; background: var(--sale); color: #fff; font-weight: 800; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
.tiers { margin: 12px 0 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tr { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; font-size: 14px; border-top: 1px solid var(--line); }
.tr:first-child { border-top: 0; }
.tr i { flex: 1; border-bottom: 1.5px dotted #ccc; transform: translateY(-4px); }
.tr b { font-weight: 800; white-space: nowrap; }
.tr.best { background: #f2fbf4; }
.tr.best b { color: var(--green-d); }
.tr.deal b { font-weight: 600; color: var(--muted); }
.note { color: var(--muted); font-size: 12px; }
.addrow { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; background: #f1f1f1; border-radius: 12px; }
.qty button { width: 38px; height: 42px; font-size: 20px; font-weight: 700; }
.qty input { width: 54px; height: 42px; border: 0; background: transparent; text-align: center; font-weight: 800; font-size: 16px; }
.unit { display: flex; background: #f1f1f1; border-radius: 12px; overflow: hidden; }
.unit button { padding: 0 12px; height: 42px; font-weight: 700; font-size: 13px; color: var(--muted); }
.unit button.on { background: var(--ink); color: #fff; }
.main { background: var(--green); color: #fff; font-weight: 800; border-radius: 12px; padding: 11px 16px; font-size: 15px; }
.main:active { background: var(--green-d); }
.main.wide { width: 100%; margin: 8px 0; }
.ghost { background: #fff; color: #111; border: 1.5px solid #111; font-weight: 800; border-radius: 12px; padding: 10px 16px; font-size: 14px; }
.hintline { margin-top: 12px; background: #f6f6f6; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #444; }

/* корзина */
.cartlist { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: 34px 56px 1fr auto; gap: 10px; align-items: center;
  background: #fff; border-radius: 14px; padding: 10px 10px 10px 6px; box-shadow: var(--shadow); transition: opacity .2s; }
.crow.taken { opacity: .5; }
.crow.taken .cnm { text-decoration: line-through; }
.crow.isout { background: #f7f7f7; }
.chk input { display: none; }
.chk i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 2px solid #bbb; color: transparent; font-style: normal; font-weight: 900; }
.chk input:checked + i { background: var(--green); border-color: var(--green); color: #fff; }
.cph img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eee; }
.ctx .cnm { font-weight: 800; font-size: 14px; }
.ctx .csub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ctx .csum { font-weight: 800; margin-top: 3px; }
.outnote { color: #9a2a2a; font-size: 12px; font-weight: 700; margin-top: 2px; }
.cq { display: grid; gap: 4px; }
.cq button { width: 32px; height: 28px; border-radius: 8px; background: #f1f1f1; font-weight: 800; font-size: 16px; }
.totals { margin: 12px 0 4px; background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.totals b { font-size: 18px; }
.totals .warn { color: #9a2a2a; font-size: 12.5px; display: block; }
.cartbtns { display: flex; gap: 8px; margin-top: 10px; }
.cartbtns .main { flex: 1; }

/* подписки */
.subs { margin-top: 18px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.subs h2 { font-size: 16px; margin: 0 0 4px; }
.subs p { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.subrow { display: flex; gap: 6px; margin-bottom: 6px; }
.subrow input, .subrow select { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; min-width: 0; }
.sublist { margin-top: 8px; display: grid; gap: 6px; }
.sub { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #f6f6f6; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.sub button { color: #9a2a2a; font-weight: 700; font-size: 12px; }

/* менеджер */
.mlist { display: grid; gap: 8px; margin-top: 12px; }
.mrow { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 9px; box-shadow: var(--shadow); }
.mrow .cph img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; }
.mbtns button { border: 1.5px solid #111; border-radius: 10px; padding: 7px 12px; font-weight: 800; font-size: 13px; }
.f { display: block; margin: 8px 0; }
.f > span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.f input, .f select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 15px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grp { background: #fff; border-radius: 14px; padding: 10px 12px; margin: 8px 0; box-shadow: var(--shadow); }
.gh { font-weight: 800; font-size: 14px; }
.gh small { font-weight: 500; color: var(--muted); font-size: 12px; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 14px; font-weight: 600; }
.sw input { display: none; }
.sw i { width: 44px; height: 26px; border-radius: 999px; background: #ccc; position: relative; flex: none; transition: background .2s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; }
.sw input:checked + i { background: var(--green); }
.sw input:checked + i::after { left: 21px; }
.phgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.phgrid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: #eee; }
.addphoto { display: inline-block; margin: 6px 0 4px; padding: 8px 12px; border: 1.5px dashed #bbb; border-radius: 10px; font-weight: 700; font-size: 13px; }
.phnote { color: var(--muted); font-size: 12px; }
.mfoot { display: grid; gap: 8px; margin-top: 12px; }
.sched { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sched input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.rowbtns { margin-top: 6px; }

/* нижняя панель */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; }
.tabbar button span { font-size: 20px; line-height: 1; }
.tabbar button.on { color: var(--ink); }
.tabbar i { font-style: normal; position: absolute; top: -2px; right: 22%; background: var(--sale); color: #fff; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 5px; }
.tabbar i:empty { display: none; }

/* лист предпросмотра */
.sheetwrap { position: fixed; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: #fff;
  border-radius: 18px 18px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 8px; }
.sheet-h button { font-size: 24px; line-height: 1; }
.previmg img { width: 62%; margin: 0 auto 10px; border-radius: 10px; }
.prevcapt { font-size: 13.5px; line-height: 1.45; background: #f7f7f7; border-radius: 12px; padding: 10px 12px; white-space: normal; }
.prevlen { color: var(--muted); font-size: 12px; margin: 8px 0; }
.prevlen.bad { color: #9a2a2a; font-weight: 700; }

/* подсказка */
.hint { display: flex; gap: 8px; align-items: flex-start; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; font-size: 13px; }
.hint b { display: block; font-size: 13.5px; }
.hint span { color: #444; }
.hint button { margin-left: auto; font-size: 20px; line-height: 1; color: var(--muted); }

/* шаги при первом входе */
.steps { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: end center; }
.steps-card { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
.steps-num { color: var(--muted); font-size: 12px; font-weight: 700; }
.steps-text { font-size: 16px; font-weight: 600; margin: 6px 0 14px; line-height: 1.4; }
.steps-btns { display: flex; gap: 8px; }
.steps-btns .ghost { flex: 1; }
.steps-btns .main { flex: 1; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); background: rgba(19,19,19,.94);
  color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; z-index: 70; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

@media (min-width: 520px) {
  .grid.grid { grid-template-columns: repeat(3, 1fr); }
}