:root {
  --bg: #faf6f1; --surface: #ffffff; --ink: #2a1f1a; --muted: #85766b; --line: #eee4da;
  --accent: #c8643b; --accent-dark: #a24f2c; --chip: #f1e7dc; --outer: #efe5da;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--outer); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 96px; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 16px 8px; }
.top h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.top p { margin: 0; font-size: .85rem; }
.table { background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: .85rem; white-space: nowrap; }

.search { padding: 8px 16px; }
.search input { width: 100%; font: 1rem var(--font); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.chips { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--bg); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 99px; padding: 8px 16px; background: var(--chip); color: var(--ink); font: 600 .85rem var(--font); cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; }

main { padding: 0 16px; }
.cat-title { font-size: 1.1rem; font-weight: 800; margin: 20px 0 10px; scroll-margin-top: 64px; }
.item { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.thumb { width: 76px; height: 76px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: rgba(255,255,255,.95);
  background: linear-gradient(145deg, hsl(var(--h) 60% 62%), hsl(calc(var(--h) + 20) 55% 40%)); }
.item h3 { margin: 0; font-size: .95rem; }
.item p { margin: 2px 0 4px; font-size: .8rem; color: var(--muted); }
.price { font-weight: 800; }
.tag { display: inline-block; font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #fde7dc; color: var(--accent-dark); margin-left: 4px; vertical-align: middle; }
.add { border: 0; background: var(--accent); color: #fff; font: 700 .85rem var(--font); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: 700 1rem var(--font); cursor: pointer; }
.qty b { min-width: 16px; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.credit { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px; }
.credit a { color: inherit; }

.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 488px;
  display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 16px; padding: 16px 18px;
  background: var(--accent); color: #fff; font: 600 .95rem var(--font); cursor: pointer; box-shadow: 0 10px 30px rgba(162,79,44,.35); z-index: 20; }

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20,12,8,.45); }
.sheet-panel { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 18px 16px max(20px, env(safe-area-inset-bottom)); animation: up .25s ease-out; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.icon-btn { border: 0; background: var(--chip); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line div:first-child { min-width: 0; }
.line h4 { margin: 0; font-size: .9rem; }
.line p { margin: 0; font-size: .8rem; color: var(--muted); }
.field { display: grid; gap: 4px; font-weight: 600; font-size: .85rem; margin-top: 12px; }
.field input, .field textarea { font: 1rem var(--font); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.sum { display: flex; justify-content: space-between; font-size: 1.1rem; margin: 16px 0; }
.btn-order { width: 100%; border: 0; border-radius: 14px; padding: 16px; background: #1fa855; color: #fff; font: 700 1rem var(--font); cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion: items rise in one after another, cart bar slides up, quantity bumps. */
.item { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--n, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.cartbar { animation: slideup .45s cubic-bezier(.2,.8,.2,1); }
@keyframes slideup { from { transform: translate(-50%, 140%); } }
.qty b { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.4); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
