/* Оформление мини-приложения. Цвета и шрифт — в brand.css, здесь только раскладка. */
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.35;-webkit-font-smoothing:antialiased}
body{min-height:100vh;padding:0 16px calc(24px + env(safe-area-inset-bottom))}
body.has-tabbar{padding-bottom:calc(86px + env(safe-area-inset-bottom))}
body.has-pbar{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
body.has-tabbar.has-pbar{padding-bottom:calc(150px + env(safe-area-inset-bottom))}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:pointer}
input,textarea{font:inherit;color:var(--ink)}
h1,h2{margin:0;letter-spacing:-.01em}
.ic{width:22px;height:22px;flex:none}
.muted{color:var(--muted);font-size:13px}
.fontwarm{position:absolute;left:-9999px;top:0;opacity:0;font-family:var(--font)}
.fontwarm b{font-weight:700}.fontwarm i{font-weight:500;font-style:normal}.fontwarm strong{font-weight:800}

.boot{display:flex;justify-content:center;padding-top:40vh}
.spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* шапка */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0 12px}
.top .logo{height:46px;width:auto;display:block}
.logo-t{font-weight:800;font-size:22px;letter-spacing:.02em}
.hello{font-size:13px;color:var(--muted);text-align:right;max-width:55%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* поиск */
.searchbar{display:flex;align-items:center;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:0 14px;height:48px;color:var(--muted);margin:2px 0 14px}
.searchbar .ic{width:20px;height:20px}
.searchbar.sm{height:44px;margin-bottom:12px}
.searchbar.live{margin-top:14px;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.searchbar input{flex:1;border:0;outline:0;background:transparent;height:100%;font-size:16px}
.searchbar input::-webkit-search-cancel-button{display:none}

/* промо-карточки форм */
.promo{display:flex;align-items:center;gap:14px;padding:16px;border-radius:var(--radius);margin-bottom:10px;color:var(--on-accent);
  background:linear-gradient(120deg,var(--accent) 0%,var(--accent-2) 100%);box-shadow:0 10px 24px -14px var(--accent)}
.promo-ic{width:46px;height:46px;border-radius:14px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center}
.promo-ic .ic{width:26px;height:26px}
.promo-tx{flex:1;display:flex;flex-direction:column;gap:3px}
.promo-tx b{font-size:16px;font-weight:700}
.promo-tx span{font-size:13px;opacity:.9}
.promo .chev{opacity:.85}
.promo.alt{background:var(--card);color:var(--ink);border:1px solid var(--line);box-shadow:none}
.promo.alt .promo-ic{background:var(--accent-soft);color:var(--accent)}

/* заголовки */
.sec{font-size:18px;font-weight:700;margin:22px 0 12px}
.ptitle{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:16px 0 12px}
.ptitle h1{font-size:22px;font-weight:800}
.ptitle span{color:var(--muted);font-size:13px;white-space:nowrap}

/* разделы каталога */
.ggrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gcard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px;display:flex;flex-direction:column;gap:4px;min-height:112px}
.g-ic{width:40px;height:40px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;margin-bottom:8px}
.gcard b{font-size:15px;font-weight:700}
.gcard span{font-size:12px;color:var(--muted)}
.gcard:active,.pcard:active,.promo:active{transform:scale(.98)}

/* чипы */
.chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -16px 14px;padding:0 16px}
.chips::-webkit-scrollbar{display:none}
.chips a,.chips button{white-space:nowrap;padding:8px 14px;border-radius:20px;background:var(--card);border:1px solid var(--line);font-size:13px;font-weight:600}
.chips .on{background:var(--ink);border-color:var(--ink);color:var(--card)}
.chips.wrap{flex-wrap:wrap;overflow:visible;margin:0;padding:0}

/* карточки товаров */
.pgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hscroll{display:flex;gap:10px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px 4px}
.hscroll::-webkit-scrollbar{display:none}
.hscroll .pcard{flex:0 0 46%}
.hscroll .pgrid{display:contents}
.pcard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
.ph{aspect-ratio:1/1;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.ph img{width:100%;height:100%;object-fit:contain;padding:10px}
.ph-empty{background:linear-gradient(160deg,var(--accent-soft),var(--card));color:var(--accent)}
.ph-empty .ic{width:42px;height:42px;stroke-width:1.2;opacity:.75}
.pc-body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:6px;flex:1}
.pc-title{font-size:13px;font-weight:600;line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:50px}
.pc-meta{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;min-height:16px}
.pc-foot{display:flex;align-items:center;justify-content:space-between;margin-top:auto;gap:6px}
.pc-foot b{font-size:16px;font-weight:800;white-space:nowrap}
.addbtn{width:36px;height:36px;border-radius:12px;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;flex:none}
.addbtn .ic{width:20px;height:20px;stroke-width:2}
.addbtn.in{background:var(--ink);color:var(--card);font-weight:700;font-size:14px}
.vol{font-size:11px;font-weight:700;padding:2px 7px;border-radius:6px;background:var(--bg);color:var(--ink)}
.stock{font-size:11px;font-weight:600;display:inline-flex;align-items:center;gap:4px}
.stock::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.stock.ok{color:var(--ok)}.stock.no{color:var(--muted)}
.art{font-size:12px;color:var(--muted)}
.sk{pointer-events:none}
.sk .ph,.ph.sk{background:linear-gradient(90deg,var(--line),var(--bg),var(--line));background-size:200% 100%;animation:sh 1.2s infinite}
.sk i{display:block;height:10px;border-radius:5px;background:var(--line);margin:4px 0}
@keyframes sh{to{background-position:-200% 0}}
.more{display:block;width:100%;margin:14px 0 0;padding:13px;border-radius:14px;background:var(--card);border:1px solid var(--line);font-weight:600}

/* карточка товара */
.pview{margin:0 -16px}
.pview .ph.big{aspect-ratio:1/1;max-height:62vh;width:100%;border-bottom:1px solid var(--line)}
.pview .ph.big img{padding:24px}
.pview .ph-empty.big .ic{width:84px;height:84px;stroke-width:1}
.pv-body{padding:16px}
.pv-cat{font-size:12px;font-weight:700;color:var(--accent);text-transform:uppercase;letter-spacing:.06em}
.pv-body h1{font-size:20px;font-weight:700;line-height:1.3;margin:6px 0 10px}
.pv-tags{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.pv-tags .vol{font-size:12px;padding:4px 9px}
.pv-buy{display:flex;align-items:center;justify-content:space-between;margin:18px 0 6px;padding:14px 16px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.pv-price{font-size:24px;font-weight:800}
.pv-desc{margin-top:14px;font-size:14px;color:var(--ink);opacity:.85}
.stepper{display:flex;align-items:center;background:var(--bg);border-radius:12px}
.stepper button{width:40px;height:40px;display:flex;align-items:center;justify-content:center}
.stepper span{min-width:28px;text-align:center;font-weight:700}
.stepper.sm button{width:32px;height:32px}.stepper.sm .ic{width:18px;height:18px}
.note{display:flex;gap:10px;margin-top:14px;padding:12px 14px;border-radius:14px;background:var(--accent-soft);font-size:13px}
.note .ic{color:var(--accent);width:20px;height:20px}

/* корзина */
.cart{display:flex;flex-direction:column;gap:10px}
.crow{display:flex;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:10px}
.crow .ph.sm{width:76px;height:76px;border-radius:12px;border:1px solid var(--line)}
.crow .ph.sm img{padding:6px}.crow .ph-empty.sm .ic{width:30px;height:30px}
.cr-body{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}
.cr-title{font-size:13px;font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cr-price{font-size:12px;color:var(--muted)}
.cr-foot{display:flex;align-items:center;justify-content:space-between;margin-top:auto}
.cr-foot b{font-size:15px}
.sum{margin-top:14px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;display:flex;flex-direction:column;gap:8px;font-size:14px}
.sum>div{display:flex;justify-content:space-between;color:var(--muted)}
.sum .tot{color:var(--ink);padding-top:8px;border-top:1px solid var(--line)}
.sum .tot b{font-size:20px;font-weight:800}
.sum p{margin:0;font-size:12px;color:var(--muted)}

/* формы */
.form{display:flex;flex-direction:column;gap:14px}
.fld{display:flex;flex-direction:column;gap:7px}
.fld>span{font-size:13px;font-weight:600;color:var(--muted)}
.fld>span i{color:var(--accent);font-style:normal;margin-left:2px}
.fld input,.fld textarea{width:100%;border:1px solid var(--line);background:var(--card);border-radius:14px;padding:13px 14px;font-size:16px;outline:0;resize:none}
.fld input:focus,.fld textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.fld.err input,.fld.err textarea,.fld.err .drop,.fld.err .seg button,.fld.err .svc button{border-color:#E5484D}
.fld.err>span{color:#E5484D}
.hint{font-size:12px;color:var(--muted)}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.seg button,.svc button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px;border-radius:14px;background:var(--card);border:1.5px solid var(--line);text-align:left}
.seg button .ic{color:var(--muted)}
.seg button b{font-size:14px}.seg button small{font-size:11px;color:var(--muted)}
.seg .on,.svc .on{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.seg .on .ic{color:var(--accent)}
.svc{display:flex;flex-direction:column;gap:8px}
.svc button{flex-direction:row;align-items:center;gap:12px}
.svc-ic{width:40px;height:40px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;flex:none}
.svc-tx{flex:1;display:flex;flex-direction:column;gap:2px}.svc-tx b{font-size:14px}.svc-tx small{font-size:12px;color:var(--muted)}
.radio{width:20px;height:20px;border-radius:50%;border:2px solid var(--line);flex:none}
.svc .on .radio{border:6px solid var(--accent)}
.days{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:2px 16px 4px}
.days::-webkit-scrollbar{display:none}
.days button{flex:0 0 58px;display:flex;flex-direction:column;align-items:center;gap:1px;padding:9px 0;border-radius:14px;background:var(--card);border:1.5px solid var(--line)}
.days button small{font-size:11px;color:var(--muted)}.days button b{font-size:18px}
.days .on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.days .on small{color:var(--on-accent);opacity:.85}
.slots{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.slots button{padding:11px 0;border-radius:12px;background:var(--card);border:1.5px solid var(--line);font-weight:600;font-size:14px}
.slots button:disabled{opacity:.35;text-decoration:line-through}
.slots .on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.slots .muted{grid-column:1/-1}
.drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:132px;border:1.5px dashed var(--line);border-radius:var(--radius);background:var(--card);color:var(--accent);text-align:center;padding:14px;overflow:hidden}
.drop .ic{width:30px;height:30px}
.drop b{font-size:14px;color:var(--ink)}.drop small{font-size:12px;color:var(--muted)}
.drop.has{padding:0;border-style:solid}
.drop img{width:100%;max-height:260px;object-fit:cover;display:block}
.drop-x{position:absolute;top:8px;right:8px;width:32px;height:32px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;display:flex;align-items:center;justify-content:center}
.drop-x .ic{width:18px;height:18px}
.linkbtn{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-weight:600;font-size:13px;margin-top:-6px}
.linkbtn .ic{width:16px;height:16px}

.ftop{display:flex;gap:14px;align-items:flex-start;padding:18px 0 14px}
.ftop-ic{width:52px;height:52px;border-radius:16px;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;flex:none}
.ftop-ic .ic{width:28px;height:28px}
.ftop h1{font-size:21px;font-weight:800}
.ftop p{margin:4px 0 0;font-size:13px;color:var(--muted)}
.steps{list-style:none;counter-reset:s;margin:0 0 16px;padding:0;display:flex;gap:8px}
.steps li{counter-increment:s;flex:1;font-size:11px;color:var(--muted);background:var(--card);border:1px solid var(--line);border-radius:12px;padding:9px 10px;line-height:1.3}
.steps li::before{content:counter(s);display:block;font-size:15px;font-weight:800;color:var(--accent);margin-bottom:2px}

/* готово / пусто */
.done{text-align:center;padding:12vh 8px 0;display:flex;flex-direction:column;align-items:center;gap:8px}
.done-ic{width:84px;height:84px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;margin-bottom:10px;box-shadow:0 14px 30px -14px var(--accent)}
.done-ic .ic{width:44px;height:44px;stroke-width:2.2}
.done h1{font-size:24px;font-weight:800}
.done .num{font-size:15px;font-weight:700;color:var(--accent)}
.done-sum{font-size:20px;font-weight:800}
.done p{color:var(--muted);font-size:14px;max-width:300px;margin:4px 0 14px}
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:48px 20px;color:var(--muted)}
.empty .ic{width:44px;height:44px;stroke-width:1.2;margin-bottom:6px;color:var(--accent)}
.empty b{color:var(--ink);font-size:16px}.empty p{margin:0;font-size:13px}
.ghost{display:block;text-align:center;padding:13px 22px;border-radius:14px;border:1px solid var(--line);background:var(--card);font-weight:600}

.foot{margin-top:22px;display:flex;flex-direction:column;gap:10px;padding:14px 16px;border-radius:var(--radius);background:var(--card);border:1px solid var(--line);font-size:13px}
.foot div{display:flex;gap:10px;align-items:center}.foot .ic{width:18px;height:18px;color:var(--accent)}

/* нижнее меню и кнопка */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;justify-content:space-around;padding:8px 8px calc(8px + env(safe-area-inset-bottom));
  background:color-mix(in srgb,var(--card) 88%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line)}
.tabbar a{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;font-weight:600;color:var(--muted);padding:4px 0}
.tabbar a.on{color:var(--accent)}
.tabbar em{position:absolute;top:0;left:calc(50% + 6px);min-width:18px;height:18px;border-radius:9px;background:var(--accent);color:var(--on-accent);font-style:normal;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 5px}
.tabbar em[hidden]{display:none}
.pbar{position:fixed;left:0;right:0;bottom:0;z-index:50;padding:10px 16px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,var(--bg) 30%)}
.has-tabbar .pbar{bottom:calc(62px + env(safe-area-inset-bottom));padding-bottom:10px}
.pbtn{width:100%;height:52px;border-radius:14px;background:var(--accent);color:var(--on-accent);font-weight:700;font-size:16px;box-shadow:0 10px 24px -12px var(--accent)}
.pbtn.busy{opacity:.6}
.toast{position:fixed;left:50%;top:14px;transform:translate(-50%,-90px);z-index:60;background:var(--ink);color:var(--card);padding:11px 16px;border-radius:12px;font-size:14px;font-weight:600;max-width:90vw;transition:transform .25s;box-shadow:0 10px 30px -10px rgba(0,0,0,.4)}
.toast.on{transform:translate(-50%,0)}

/* тёмная тема Telegram */
.dark .ph{background:#fff}
.dark .chips .on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.dark .addbtn.in{background:var(--card);color:var(--ink);border:1px solid var(--line)}
