:root{--c:#d62828;--bg:#f5f5f7;--card:#fff;--tx:#1d1d1f;--mut:#6e6e73;--bd:#e5e5ea;--ok:#2a9d4a}
*{box-sizing:border-box;margin:0}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--tx);padding-bottom:90px;-webkit-tap-highlight-color:transparent}
.hidden{display:none!important}
button{font:inherit;cursor:pointer;border:0;border-radius:10px;padding:12px 16px;background:var(--c);color:#fff;font-weight:600}
button.sec{background:#eee;color:var(--tx)}
button.sm{padding:6px 10px;font-size:13px}
button.danger{background:#b00020}
input,select,textarea{font:inherit;width:100%;padding:11px 12px;border:1px solid var(--bd);border-radius:10px;background:#fff;color:var(--tx)}
label{display:block;font-size:13px;color:var(--mut);margin:12px 0 4px}
header{background:#fff;position:sticky;top:0;z-index:10;box-shadow:0 1px 0 var(--bd)}
.hd{display:flex;gap:14px;align-items:center;padding:16px;max-width:900px;margin:auto}
.logo{width:64px;height:64px;border-radius:16px;background:var(--c);color:#fff;font-size:28px;font-weight:800;display:grid;place-items:center;flex:none}
h1{font-size:20px}.sub{color:var(--mut);font-size:14px}
.badges{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.badge{font-size:12px;padding:3px 9px;border-radius:99px;background:#e3f6e8;color:var(--ok);font-weight:600}
.badge.closed{background:#fde4e4;color:#b00020}.badge.gray{background:#eee;color:var(--mut)}
nav{display:flex;gap:8px;overflow-x:auto;padding:0 16px 10px;max-width:900px;margin:auto;scrollbar-width:none}
nav a{white-space:nowrap;padding:7px 14px;border-radius:99px;background:#eee;color:var(--tx);text-decoration:none;font-size:14px;font-weight:600}
nav a.on{background:var(--c);color:#fff}
main{max-width:900px;margin:auto;padding:8px 16px}
h2{margin:22px 0 10px;font-size:18px;scroll-margin-top:130px}
.prod{display:flex;gap:12px;background:var(--card);border-radius:14px;padding:12px;margin-bottom:10px;cursor:pointer;border:1px solid var(--bd)}
.prod img,.prod .noimg{width:92px;height:92px;border-radius:12px;object-fit:cover;flex:none;background:#eee}
.prod .t{font-weight:700}.prod .d{color:var(--mut);font-size:13px;margin:3px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.price{font-weight:700;color:var(--c)}
#cartbar{position:fixed;left:0;right:0;bottom:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,var(--bg) 30%);z-index:20}
#cartbar button{width:100%;max-width:900px;display:flex;justify-content:space-between;margin:auto;padding:15px 18px;font-size:16px;box-shadow:0 6px 20px #0003}
#lastOrder{position:fixed;left:16px;right:16px;bottom:80px;z-index:19;max-width:900px;margin:auto}
#lastOrder button{width:100%;background:#1d1d1f}
.sheet{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet-bg{position:absolute;inset:0;background:#0007}
.sheet-body{position:relative;background:#fff;width:100%;max-width:640px;max-height:92vh;overflow:auto;border-radius:22px 22px 0 0;padding:18px 18px calc(20px + env(safe-area-inset-bottom));animation:up .2s}
@keyframes up{from{transform:translateY(40px);opacity:0}}
@media(min-width:700px){.sheet{align-items:center}.sheet-body{border-radius:22px}}
.sheet h3{margin-bottom:6px}
.grp{margin-top:14px}.grp h4{display:flex;justify-content:space-between;background:#f3f3f5;padding:8px 10px;border-radius:8px;font-size:14px}
.opt{display:flex;justify-content:space-between;align-items:center;padding:11px 4px;border-bottom:1px solid var(--bd)}
.opt input{width:auto}
.row{display:flex;gap:10px;align-items:center}.row>*{flex:1}
.spread{display:flex;justify-content:space-between;align-items:center;gap:10px}
.qty{display:flex;align-items:center;gap:12px}.qty button{width:36px;height:36px;padding:0;border-radius:50%}
.qty b{min-width:20px;text-align:center}
.line{display:flex;justify-content:space-between;padding:6px 0;color:var(--mut)}.line.tot{color:var(--tx);font-weight:800;font-size:18px;border-top:1px solid var(--bd);margin-top:6px;padding-top:10px}
.seg{display:flex;gap:8px}.seg button{flex:1;background:#eee;color:var(--tx)}.seg button.on{background:var(--c);color:#fff}
.ci{padding:10px 0;border-bottom:1px solid var(--bd)}.ci small{color:var(--mut);display:block}
.err{background:#fde4e4;color:#b00020;padding:10px;border-radius:10px;margin-top:12px;font-size:14px}
#toast{position:fixed;left:50%;top:20px;transform:translateX(-50%);background:#1d1d1f;color:#fff;padding:10px 16px;border-radius:10px;z-index:99;opacity:0;pointer-events:none;transition:.25s}
#toast.on{opacity:1}
.steps{display:flex;justify-content:space-between;margin:20px 0}
.step{flex:1;text-align:center;font-size:12px;color:var(--mut);position:relative}
.step i{display:block;width:28px;height:28px;border-radius:50%;background:#ddd;margin:0 auto 6px;line-height:28px;font-style:normal;color:#fff}
.step.on{color:var(--tx);font-weight:700}.step.on i{background:var(--c)}
.big{text-align:center;font-size:42px}

.hidden{display:none!important}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.pcard{background:#fff;border:1px solid var(--bd);border-radius:14px;overflow:hidden}.pcard.off{opacity:.5}
.pimg{height:130px;background:#eee center/cover;display:grid;place-items:center;font-size:34px;position:relative}
.pimg .tag{position:absolute;top:8px;left:8px;background:#fff;border-radius:99px;padding:2px 7px;font-size:12px}
.pbody{padding:10px;display:flex;flex-direction:column;gap:2px}.pbody small{color:var(--mut)}
.drop{border:2px dashed var(--bd);border-radius:14px;min-height:130px;display:grid;place-items:center;text-align:center;color:var(--mut);cursor:pointer;overflow:hidden;background:#fafafa}
.drop.over{border-color:var(--c);background:#fff5f5}.drop img{width:100%;max-height:240px;object-fit:cover;display:block}
.drop.round{width:130px;height:130px;border-radius:50%}.drop.round img{height:100%;max-height:none}
.drop.wide{height:130px}.drop.wide img{height:130px}
.thumbs{display:flex;gap:8px;flex-wrap:wrap}.th{width:70px;height:70px;border-radius:10px;overflow:hidden;position:relative;background:#eee}
.th img{width:100%;height:100%;object-fit:cover}.th button{position:absolute;top:2px;right:2px;padding:0;width:22px;height:22px;border-radius:50%;background:#000a;font-size:12px}
.th.add{display:grid;place-items:center;font-size:26px;color:var(--mut);cursor:pointer;border:2px dashed var(--bd);background:#fafafa}

.pays{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}
.pay{background:#fff;color:var(--tx);border:2px solid var(--bd);padding:12px 6px;font-size:14px;font-weight:600}
.pay span{display:block;font-size:24px}.pay.on{border-color:var(--c);background:color-mix(in srgb,var(--c) 8%,#fff)}

.kpi{display:flex;flex-direction:column;gap:2px}.kpi small{color:var(--mut)}.kpi b{font-size:26px}.kpi span{font-size:13px;color:var(--mut)}
.bars{display:flex;align-items:flex-end;gap:3px;height:170px;overflow-x:auto;padding-top:6px}
.bar{flex:1;min-width:16px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center}
.bar i{display:block;width:100%;background:var(--c);border-radius:4px 4px 0 0;min-height:2px}.bar small{font-size:9px;color:var(--mut);margin-top:3px}
