:root {
  --bg: #FFF8EE;
  --card: #FFFFFF;
  --ink: #2B2118;
  --ink2: #6B5D4F;
  --line: #EFE7DA;
  --line2: #E6DCCB;
  --main: #C2540A;
  --main-dark: #8F3D06;
  --accent: #F28C3A;
  --tint: #FDE8D4;
  --line-green: #06C755;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
[hidden] { display: none !important; }

/* 一般瀏覽器才顯示的頂列；LINE 裡面 LINE 自己有標題列 */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.in-line .top { display: none; }
.top-in { max-width: 1080px; margin: 0 auto; height: 52px; padding: 0 14px; display: flex; align-items: center; gap: 10px; }
.logo { width: 32px; height: 32px; border-radius: 16px; background: var(--accent); color: #2B2118; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.top-name { font-size: 16px; font-weight: 700; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 14px 14px 120px; display: flex; flex-direction: column; gap: 14px; }

.hello { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hello-sub { font-size: 13px; color: var(--ink2); }
.hello-main { font-size: 15px; font-weight: 700; }
.btn-line { border: 0; background: var(--line-green); color: #0B2E17; font-weight: 700; font-size: 14px; border-radius: 22px; height: 44px; padding: 0 16px; white-space: nowrap; }

.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line2); border-radius: 22px; padding: 0 14px; height: 44px; color: var(--ink2); }
.search input { border: 0; outline: none; flex: 1; min-width: 0; font-size: 16px; background: transparent; font-family: inherit; color: var(--ink); }
.search:focus-within { border-color: var(--main); }

.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.cats::-webkit-scrollbar { display: none; }
.cat { border: 1px solid var(--line2); background: var(--card); border-radius: 22px; padding: 0 16px; height: 44px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.cat[aria-pressed="true"] { border-color: var(--main); background: var(--main); color: #FFFFFF; font-weight: 700; }

.count { font-size: 12px; color: var(--ink2); min-height: 18px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card-img { border: 0; padding: 0; background: #F6EAD7; aspect-ratio: 1 / 1; width: 100%; display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; border: 0; background: none; padding: 0; text-align: left; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { font-size: 16px; font-weight: 800; color: var(--main); }
.price small { font-size: 11px; font-weight: 400; color: var(--ink2); }
.add { width: 44px; height: 44px; margin: -4px -4px -4px 0; border-radius: 22px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.add span { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.add:active span { background: var(--main); }

.more { text-align: center; color: var(--ink2); font-size: 13px; padding: 10px 0; min-height: 40px; }
.empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--ink2); }
.retry { border: 1px solid var(--line2); background: var(--card); border-radius: 22px; height: 44px; padding: 0 18px; margin-top: 10px; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 6; padding-bottom: env(safe-area-inset-bottom); }
.cartbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.cartbar-info { flex: 1; display: flex; flex-direction: column; }
.cartbar-n { font-size: 12px; color: var(--ink2); }
.cartbar-sum { font-size: 17px; font-weight: 800; }
.btn-main { border: 0; background: var(--main); color: #FFFFFF; border-radius: 24px; height: 48px; padding: 0 26px; font-size: 15px; font-weight: 700; }
.btn-main:disabled { background: #CFC4B4; color: #4E453B; cursor: default; }
.btn-wide { width: 100%; height: 50px; font-size: 16px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(43, 33, 24, .45); z-index: 8; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--bg); border-radius: 18px 18px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 82vh; display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto; }
.sheet-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.sheet-head { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.sheet-img { width: 72px; height: 72px; border-radius: 10px; background: #F6EAD7 center / cover no-repeat; flex-shrink: 0; }
.sheet-name { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-price { font-size: 20px; font-weight: 800; color: var(--main); }
.sheet-label { font-size: 13px; color: var(--ink2); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; overflow-y: auto; padding-bottom: 2px; min-height: 0; }
.sheet > .btn-wide, .sheet-head, .sheet-label { flex-shrink: 0; }
.opt { border: 1px solid var(--line2); background: var(--card); border-radius: 12px; min-height: 44px; padding: 8px 12px; font-size: 14px; text-align: left; }
.opt[aria-pressed="true"] { border: 2px solid var(--main); background: var(--tint); padding: 7px 11px; font-weight: 700; }
.opt:disabled { color: #8A7F72; background: #F3EDE2; cursor: default; }
.opt small { display: block; font-size: 12px; font-weight: 400; color: var(--ink2); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #2B2118; color: #FFFFFF; font-size: 14px; padding: 10px 16px; border-radius: 22px; z-index: 10; max-width: 86vw; text-align: center; }
