/* MatchaUchi customer menu. Brand CI: Matcha green, Forest Tea, Hojicha clay, warm paper. */
:root {
  --cream: #F5EFE4; --paper: #FFFCF6; --sage: #A3B5A0; --sage-soft: #DDE6D8; --sage-mist: #EDF2EA;
  --green: #4E754A; --forest: #2F4A2E; --clay: #C9773F; --ink: #2B3529; --muted: #758070; --line: #E6DDCC;
  --red: #A5402E; --red-bg: #F7DED6; --amber: #8A5E12; --amber-bg: #F8EBCB; --ok: #3D6A38; --ok-bg: #DDE9D3;
  --shadow: 0 1px 2px rgba(47, 74, 46, .06), 0 6px 18px rgba(47, 74, 46, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Noto Sans Thai', system-ui, sans-serif; background: var(--cream); color: var(--ink); font-size: 16px; line-height: 1.5;
       padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px;
       height: 62px; padding: 0 16px; background: rgba(245, 239, 228, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
       border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--forest); text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: var(--paper); padding: 4px; box-shadow: var(--shadow); object-fit: contain; }
.brand b { display: block; font-size: 18px; line-height: 1.1; }
.brand small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.chip { min-height: 38px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--forest); font-weight: 600; font-size: 14px; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
h1 { font-size: 24px; color: var(--forest); margin: 4px 0 12px; }
h2 { font-size: 19px; color: var(--forest); margin: 26px 0 10px; scroll-margin-top: 124px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.banner { border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.banner.closed { background: var(--amber-bg); color: var(--amber); }
.banner.open { background: var(--ok-bg); color: var(--ok); }
.banner.info { background: var(--paper); border: 1px solid var(--line); }
.banner a { color: inherit; font-weight: 700; }

.cats { position: sticky; top: 62px; z-index: 9; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; margin: 0 -16px;
        background: rgba(245, 239, 228, .96); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { white-space: nowrap; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
          color: var(--forest); text-decoration: none; font-size: 14px; font-weight: 500; }
.cats a.on { background: var(--green); border-color: var(--green); color: #fff; }

.items { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left; padding: 10px; border-radius: var(--radius);
        border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); cursor: pointer; }
.item img, .item .ph { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; background: var(--sage-soft); flex: none; }
.item .txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.item b { color: var(--forest); font-size: 16px; line-height: 1.3; }
.item .desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .price { margin-top: auto; font-weight: 700; color: var(--forest); }
.item.out { opacity: .55; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--red-bg); color: var(--red); }

.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; max-width: 560px; margin: 0 auto; }
.cartbar[hidden] { display: none; }
.btn { min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--forest);
       font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(78, 117, 74, .3); }
.btn.clay { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.cartbar .btn { width: 100%; justify-content: space-between; min-height: 56px; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; }
.sheet-wrap[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(43, 53, 41, .4); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--cream);
         border-radius: 24px 24px 0 0; padding: 0 16px; max-width: 640px; margin: 0 auto;
         box-shadow: 0 -10px 30px rgba(0, 0, 0, .15); }
.sheet .hero { width: calc(100% + 32px); margin: 0 -16px 12px; height: 240px; object-fit: cover; border-radius: 24px 24px 0 0; background: var(--sage-soft); }
.sheet .x { position: sticky; top: 10px; float: right; margin: 10px -4px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 0;
            background: rgba(255, 252, 246, .95); box-shadow: var(--shadow); font-size: 20px; cursor: pointer; z-index: 2; }
.sheet h3 { font-size: 20px; color: var(--forest); margin: 4px 0 4px; }
.sheet .foot { position: sticky; bottom: 0; z-index: 2; background: var(--cream); margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
               display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(47, 74, 46, .06); }
.group { margin: 16px 0; }
.group > .lbl { font-weight: 600; color: var(--forest); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.opts { display: grid; gap: 8px; }
.opts.row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 14px;
       border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; text-align: left; }
.opt.on { border-color: var(--green); background: var(--sage-mist); box-shadow: inset 0 0 0 1px var(--green); }
.opt:disabled { opacity: .45; cursor: default; }
.opt small { color: var(--muted); display: block; font-size: 12px; }
.opt .pr { font-weight: 700; color: var(--forest); white-space: nowrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--forest); }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }
input.custom { width: 90px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); padding: 4px 8px; text-align: right; background: #fff; }

/* cart / checkout */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .grow { flex: 1; min-width: 0; }
.line .sub { font-size: 13px; color: var(--muted); }
.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; color: var(--forest); padding-top: 10px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input[type=text], input[type=tel], textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.err { color: var(--red); font-size: 14px; margin: 6px 0 0; }

/* order status */
.big-no { text-align: center; margin: 6px 0 4px; }
.big-no .n { font-size: clamp(34px, 11vw, 52px); letter-spacing: .02em; font-weight: 700; color: var(--forest); line-height: 1; }
.steps { display: grid; gap: 0; margin: 8px 0; }
.step { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--muted); }
.step .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); flex: none;
             display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--green); border-color: var(--green); }
.step.now { color: var(--forest); font-weight: 700; }
.step.now .dot { border-color: var(--green); box-shadow: 0 0 0 5px var(--sage-soft); }
.qr { text-align: center; }
.qr img { width: min(280px, 80vw); height: auto; margin: 8px auto; image-rendering: pixelated; border-radius: 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.wait { background: var(--amber-bg); color: var(--amber); } .pill.bad { background: var(--red-bg); color: var(--red); }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
         background: var(--forest); color: #fff; padding: 10px 18px; border-radius: 14px; max-width: calc(100% - 32px); font-size: 14px; }
.toast.err { background: var(--red); }
.toast[hidden] { display: none; }

/* order complete */
.done-pop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px;
            background: rgba(43, 53, 41, .35); animation: fadeIn .25s ease; }
.done-card { background: var(--paper); border-radius: 26px; padding: 28px 24px 20px; width: min(340px, 100%); text-align: center;
             box-shadow: 0 20px 50px rgba(0, 0, 0, .25); animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1); }
.done-card h3 { font-size: 24px; color: var(--forest); margin: 12px 0 4px; }
.done-card p { font-size: 18px; margin: 0 0 18px; color: var(--ink); }
.done-tick { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--green); color: #fff; font-size: 42px;
             display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px var(--sage-soft); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 60; pointer-events: none; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .done-pop, .done-card { animation: none; } }

/* delivery map */
.map { height: 260px; margin-top: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--sage-soft); position: relative; z-index: 0; overflow: hidden; }
.pin span { display: block; width: 30px; height: 30px; margin-top: 2px; border-radius: 50% 50% 50% 0; background: var(--clay);
            border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transform: rotate(-45deg); }
.btn.clay { box-shadow: 0 6px 18px rgba(201, 119, 63, .3); }
