* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; background: #faf6ef; color: #2e2a26; }
/* Safety net against any stray wide element causing page-level horizontal
   panning on phones. `clip` (unlike hidden/auto) creates no scroll container,
   so the sticky .site-header keeps working. */
html, body { overflow-x: clip; }
:root { --accent: #e8562a; --accent-dark: #c7431f; --stuck-h: 108px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 14px; }
a { color: #7a4a21; }
.site-header { background: #fff; color: #222; padding: 10px 0 0; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid #eee5d8; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.header-in { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.site-logo { height: 38px; width: auto; display: block; flex-shrink: 0; }
.site-title { font-size: 17px; font-weight: 700; min-width: 0; }
.header-nav { flex-shrink: 0; white-space: nowrap; }
.header-nav a { color: var(--accent); margin-left: 14px; text-decoration: none; font-size: 14px; font-weight: 600; }
.site-footer { color: #999; font-size: 12px; text-align: center; padding: 26px 0 40px; }
.notice-bar { background: #fff7f0; border: 1px solid #f3ddcb; border-radius: 10px; margin: 10px 0 2px; overflow: hidden; }
.notice-line { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 12px; font-size: 13px; color: #6b4a2a; cursor: pointer; text-align: left; font-family: inherit; }
.notice-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-more { flex-shrink: 0; color: var(--accent); font-weight: 600; white-space: nowrap; }
.notice-detail { padding: 2px 12px 10px; }
.notice-detail p { margin: 5px 0; font-size: 13px; line-height: 1.55; color: #555; }
.notice-detail b { color: #7a4a21; }
.cat-title { margin: 16px 0 2px; font-size: 15px; font-weight: 700; color: #333; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: #fff; border: 1px solid #ead9c2; border-radius: 12px; padding: 10px; min-width: 0; }
@media (min-width: 700px) { .card { padding: 12px; } }
.card h3 { margin: 0; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 700px) { .card h3 { font-size: 16px; } }
.sub-name { color: #999; font-size: 12px; margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 8px; margin-bottom: 8px; display: block; }
@media (min-width: 700px) { .card-img { height: 150px; } }
.opt-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; flex-wrap: wrap; }
.opt-row > span { color: #7a4a21; font-weight: 600; min-width: 34px; }
.opt-row select { flex: 1; padding: 6px; border: 1px solid #d8c9ae; border-radius: 6px; font-size: 14px; background: #fff; }
.tops { margin: 6px 0; font-size: 14px; }
.tops summary { cursor: pointer; color: #7a4a21; }
.top-item { display: inline-block; margin: 4px 8px 0 0; font-size: 13px; }
.price-big { font-size: 16px; font-weight: 700; color: var(--accent); margin: 4px 0 8px; }
@media (min-width: 700px) { .price-big { font-size: 18px; } }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.plain-card .card-foot { flex-direction: column; align-items: stretch; }
.plain-card .qty-ctrl { justify-content: center; }
@media (min-width: 700px) { .plain-card .card-foot { flex-direction: row; align-items: center; } .plain-card .qty-ctrl { justify-content: flex-start; } }
.qty-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.qty-ctrl button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #d8c9ae; background: #fff8ee; font-size: 16px; cursor: pointer; }
.qty-ctrl.small button { width: 26px; height: 26px; font-size: 14px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--accent-dark); }
.btn.big { width: 100%; padding: 13px; font-size: 16px; }
.btn.added { background: #b3541e; }
.btn.danger { background: #b03a2e; }
.btn.grey { background: #888; }
#cart-bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; color: #222; z-index: 30; box-shadow: 0 -2px 12px rgba(0,0,0,.14); border-top: 1px solid #f0e6d8; padding-bottom: env(safe-area-inset-bottom); }
#cart-bar.bar-hidden { display: none; }
.bottom-spacer { height: calc(88px + env(safe-area-inset-bottom)); }
.bottom-spacer.spacer-hidden { display: none; }
.cart-bar-in { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
.cart-sum { font-size: 14px; min-width: 0; }
#cart-bar .btn { flex-shrink: 0; }
.cart-sum b { color: #ffd98a; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-box { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 16px; }
@media (min-width: 640px) { .modal { align-items: center; } .modal-box { border-radius: 14px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.x-btn { border: 0; background: none; font-size: 18px; cursor: pointer; }
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e3d5bd; }
.cl-name { font-size: 14px; }
.muted { color: #999; font-size: 13px; }
.totals { margin: 12px 0; font-size: 15px; line-height: 1.7; }
.totals .pay-row { font-size: 17px; }
.totals .pay-row b { color: var(--accent); }
#checkout-form label { display: block; margin: 10px 0; font-size: 14px; }
#checkout-form input[type=text], #checkout-form input:not([type=checkbox]) { width: 100%; padding: 9px; border: 1px solid #d8c9ae; border-radius: 6px; margin-top: 4px; font-size: 15px; }
.check-line { display: flex !important; gap: 8px; align-items: flex-start; }
.err { color: #b03a2e; min-height: 18px; font-size: 14px; }
.closed-box { background: #fff; border: 1px solid #ead9c2; border-radius: 12px; padding: 22px; text-align: center; margin: 18px 0; }
.order-box { background: #fff; border: 1px solid #ead9c2; border-radius: 12px; padding: 16px; margin: 14px 0; }
.order-box h2 { margin-top: 0; }
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines td, table.lines th { padding: 6px 4px; border-bottom: 1px solid #f0e6d4; text-align: left; vertical-align: top; }
table.lines td.r, table.lines th.r { text-align: right; white-space: nowrap; }
.status { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; color: #fff; }
.status.pending { background: #d48806; }
.status.done { background: #4c7a3f; }
.status.cancelled { background: #999; }
.flash { padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.flash.ok { background: #e6f4e0; } .flash.bad { background: #fbe9e7; }
.big-no { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
/* admin */
.admin-nav { background: #2e2a26; }
.admin-nav .wrap { display: flex; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.admin-nav a { color: #ffd98a; text-decoration: none; font-size: 14px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.admin { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.admin th, table.admin td { border: 1px solid #e3d5bd; padding: 6px 8px; text-align: left; vertical-align: top; }
table.admin th { background: #fff8ee; }
.admin-form label { display: block; margin: 8px 0; font-size: 14px; }
.admin-form input, .admin-form select, .admin-form textarea { padding: 7px; border: 1px solid #d8c9ae; border-radius: 6px; font-size: 14px; }
.admin-form textarea { width: 100%; min-height: 54px; }
.inline-form { display: inline; }
.small-btn { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
details.edit-box { margin: 4px 0; }
summary { cursor: pointer; }
@media print {
  .site-header, .site-footer, .admin-nav, .no-print { display: none !important; }
  body { background: #fff; }
}
.opt-group { margin: 12px 0; }
.og-title { font-weight: 600; color: #7a4a21; margin-bottom: 6px; font-size: 14px; }
.opt-choice { display: inline-block; margin: 0 12px 8px 0; font-size: 14px; }
.drink-card { cursor: pointer; transition: transform .08s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent; }
.drink-card:hover { box-shadow: 0 4px 14px rgba(232, 86, 42, .25); }
.drink-card:active { transform: scale(.97); box-shadow: 0 1px 4px rgba(232, 86, 42, .2); }
.tap-hint { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
@media (min-width: 700px) { .tap-hint { font-size: 13px; } }

/* ---- v6: scan-to-order layout (search / category rail / item rows) ---- */
.hidden { display: none !important; }
.hidden-x { display: none !important; }
.search-row { padding-bottom: 10px; }
.search-box { display: flex; align-items: center; gap: 7px; background: #f4f1ec; border-radius: 999px; padding: 8px 13px; }
.search-ico { font-size: 13px; flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; outline: none; font-family: inherit; color: #333; }
.search-clear { border: 0; background: none; color: #999; font-size: 13px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.menu-layout { display: flex; align-items: flex-start; margin: 4px -14px 0; }
.cat-rail { position: sticky; top: var(--stuck-h); flex: 0 0 86px; max-height: calc(100dvh - var(--stuck-h)); overflow-y: auto; background: #f6f3ee; display: flex; flex-direction: column; padding: 6px 0 24px; scrollbar-width: thin; }
@media (min-width: 700px) { .cat-rail { flex-basis: 112px; } }
.rail-item { border: 0; background: transparent; text-align: left; padding: 11px 8px 11px 14px; font-size: 13.5px; line-height: 1.35; color: #444; cursor: pointer; position: relative; font-family: inherit; }
.rail-item.active { background: #fff; color: var(--accent); font-weight: 700; }
.rail-item.active::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--accent); }
.menu-main { flex: 1; min-width: 0; padding: 0 14px 0 12px; }
.cat-section { scroll-margin-top: calc(var(--stuck-h) + 6px); }
/* Let the last group always scroll up to the sticky offset (page bottom
   would otherwise stop short and scrollspy/rail clicks land mid-group). */
.cat-section:last-of-type { min-height: calc(100dvh - var(--stuck-h) - 120px); }
.row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1e9dc; align-items: flex-start; min-width: 0; }
.drink-row { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.drink-row:active { background: #fff8f2; }
.thumb { width: 62px; height: 62px; border-radius: 8px; object-fit: cover; flex-shrink: 0; display: block; }
@media (min-width: 700px) { .thumb { width: 72px; height: 72px; } }
.thumb-ph { background: linear-gradient(135deg, #f7e3c8, #f3cf9f); color: #b3541e; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.row-body { flex: 1; min-width: 0; }
.row-body h3 { margin: 0; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-body .sub-name { margin: 2px 0 6px; }
.row-price { color: var(--accent); font-weight: 700; font-size: 15px; }
.from-tag { font-size: 11px; font-weight: 400; color: #999; }
.row-plus-wrap { position: relative; flex-shrink: 0; align-self: center; display: block; }
.round-plus { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 19px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.row-badge { position: absolute; top: -7px; right: -7px; background: #2e2a26; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.stepper { display: flex; align-items: center; gap: 7px; flex-shrink: 0; align-self: center; }
.step-btn { width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.step-plus { background: var(--accent); color: #fff; border: 0; }
.step-plus:active { background: var(--accent-dark); }
.step-minus { background: #fff; color: #666; border: 1px solid #ddd; }
.step-count { min-width: 16px; text-align: center; font-size: 14px; }
.cart-bar-in2 { display: flex; align-items: center; gap: 12px; max-width: 980px; margin: 0 auto; padding: 8px 14px; }
.cart-fab { position: relative; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); border: 0; font-size: 20px; cursor: pointer; margin-top: -20px; box-shadow: 0 3px 9px rgba(232, 86, 42, .45); display: flex; align-items: center; justify-content: center; }
.cart-badge { position: absolute; top: -4px; right: -5px; background: #d93025; color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.cart-total { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-amt { color: var(--accent); font-size: 17px; }
.ct-count { color: #888; margin-left: 6px; font-size: 13px; }
.order-now-btn { flex-shrink: 0; border-radius: 999px; padding: 10px 26px; font-size: 15px; font-weight: 700; }

/* ---- v7: item cards in the right column (v6 rail/search/cart-bar kept;
   the v6 .row list styles above are now unused by the menu page) ---- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 6px 0 16px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.menu-card { background: #fff; border: 1px solid #ead9c2; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.mc-media { position: relative; flex-shrink: 0; }
.mc-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.mc-ph { background: linear-gradient(135deg, #f7e3c8, #f3cf9f); color: #b3541e; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; }
.card-badge { position: absolute; top: 6px; right: 6px; z-index: 2; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mc-body { padding: 8px 10px 10px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mc-body h3 { margin: 0; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-body .sub-name { margin: 2px 0 6px; }
.mc-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: flex-end; }

/* ---- v8: customer view toggle (list rows / cards), default list ---- */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .search-box { flex: 1; min-width: 0; }
.view-toggle { display: flex; background: #f4f1ec; border-radius: 999px; padding: 3px; flex-shrink: 0; }
.view-toggle button { border: 0; background: transparent; font-family: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; cursor: pointer; color: #666; white-space: nowrap; }
.view-toggle button.active { background: var(--accent); color: #fff; font-weight: 700; }
.cards { display: none; }
html.view-cards .cards { display: grid; }
html.view-cards .rows { display: none; }
.row-media { position: relative; flex-shrink: 0; }
.row-media .card-badge { top: 4px; right: 4px; }
