/* ===== 作伙點・團購點單 設計系統（森林米色風，合併自 code_artifact.html） ===== */
:root {
  --bg-outer: #E8DAC6;     /* 桌面版外圍 */
  --bg: #F4E9D8;           /* 手機殼內底色 */
  --card: #FBF6EE;
  --card-soft: #F7EFE2;
  --pill-bg: #EDE4D4;
  --nav-bg: #FBF7F0;
  --border: #E5D6C3;
  --border-strong: #D4C0A8;
  --caramel: #A6754B;
  --caramel-hover: #8E613B;
  --sage: #8B947E;
  --sage-dark: #556149;
  --sage-soft: #E6ECE0;
  --text-title: #3B2818;
  --text-dark: #2B1C10;
  --text-muted: #7C6A58;
  --danger: #B85B4E;
  --danger-soft: #F7E5E2;
  --warn-bg: #F8EBD3;
  --warn-line: #D9A35A;
  --warn-ink: #7A4A16;
  --shadow-card: 0 8px 20px rgba(120, 90, 60, .12);
  --shadow-btn: 0 4px 12px rgba(166, 117, 75, .28);
  --shadow-nav: 0 10px 28px rgba(74, 54, 36, .16);
  --radius-card: 20px;
  --radius-input: 14px;
  --serif: 'Noto Serif TC', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg-outer);
  color: var(--text-dark);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text-title); line-height: 1.3; }
h2 { font-size: 1.02rem; font-weight: 700; color: var(--text-title); }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
[v-cloak] { display: none !important; }

/* ----- 手機殼（桌面版置中，外圍深一階米色） ----- */
.shell {
  max-width: 480px; min-height: 100vh; margin: 0 auto;
  background: var(--bg);
  position: relative; overflow-x: hidden;
  box-shadow: 0 0 40px rgba(59, 40, 24, .12);
}
/* 不設 z-index：避免形成堆疊層，讓內部的彈出視窗（z-index 120）能蓋過底部導覽列 */
.content-layer { position: relative; }

/* 四邊手繪植物（不影響點擊） */
.bg-botanical { position: absolute; pointer-events: none; z-index: 0; user-select: none; }
.bg-mid-right { top: 235px; right: -12px; width: 82px; opacity: .92; }
.bg-mid-left { top: 470px; left: -14px; width: 72px; opacity: .95; }
.bg-bottom-left { bottom: 84px; left: -8px; width: 86px; opacity: .9; }
.bg-bottom-right { bottom: 80px; right: -10px; width: 96px; opacity: .92; }

/* ----- 頁面 ----- */
.page {
  padding: 18px 18px 120px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 100vh;
}
.page.has-cart { padding-bottom: 200px; }
.cols, .col { display: flex; flex-direction: column; gap: 14px; }

/* 首頁標題（兩側葉枝與小松樹） */
.hero-header { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.hero-title {
  margin: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 700;
  color: var(--text-title); letter-spacing: .04em; white-space: nowrap;
}
.hero-svg-left { width: 34px; height: 40px; flex-shrink: 0; }
.hero-svg-right { width: 52px; height: 46px; flex-shrink: 0; margin-left: -4px; }
.page-title { display: flex; align-items: center; gap: 10px; }
.page-title h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- 卡片 ----- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, .65);
  display: flex; flex-direction: column; gap: 12px;
}
.card.row { flex-direction: row; align-items: center; gap: 12px; }
.card.link { text-decoration: none; transition: transform .15s; }
.card.link:active { transform: translateY(1px); }
.card.soft { background: var(--card-soft); border-color: var(--border); box-shadow: none; }
.card.accent { background: var(--sage); color: #FFFDF9; }
.card.accent h2, .card.accent p, .card.accent .muted { color: #FFFDF9; }
.card.success { box-shadow: 0 0 0 2px var(--caramel), var(--shadow-card); }

/* ----- 按鈕（皆 >= 44px） ----- */
.btn, .btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  white-space: nowrap; flex-shrink: 0; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.btn:active:not(:disabled), .btn2:active:not(:disabled) { transform: scale(.97); }
.btn { background: var(--caramel); color: #FFFDF9; box-shadow: var(--shadow-btn); }
.btn:hover:not(:disabled) { background: var(--caramel-hover); }
.btn.big { width: 100%; min-height: 50px; font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }
.btn.yellow { background: var(--caramel); }
.btn.sage { background: var(--sage); box-shadow: 0 4px 10px rgba(139, 148, 126, .28); }
.btn2 { background: var(--card); border-color: var(--border-strong); color: var(--text-title); }
.btn2:hover:not(:disabled) { background: #FFFDF9; }
.btn2.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.block, .btn2.block { width: 100%; }
.google-btn { background: #fff; border-color: var(--border-strong); color: #3c4043; gap: 10px; min-height: 48px; }
.card.account { flex-direction: row; align-items: center; gap: 12px; }
.account img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.icon-btn { width: 44px; padding: 0; flex: none; }
.plus-btn { width: 44px; padding: 0; font-size: 1.5rem; font-weight: 400; flex: none; }

/* ----- 表單 ----- */
.input {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px;
  font-size: 16px; /* 16px 避免 iOS 自動放大 */
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-input);
  background: #FFFDF9; color: var(--text-dark); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(166, 117, 75, .16); }
.input::placeholder { color: #B5A291; }
.input[readonly] { background: var(--card-soft); }
.input.code { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
textarea.input { min-height: 78px; resize: vertical; }
.label { font-size: .88rem; font-weight: 600; color: var(--text-title); display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row > .grow { flex: 1; min-width: 0; }

/* ----- 標籤 ----- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
  background: var(--pill-bg); color: var(--text-title);
}
.pill.open { background: var(--sage-soft); color: var(--sage-dark); }
.pill.closed { background: var(--danger-soft); color: var(--danger); }
.pill.tilt { align-self: flex-start; }
.muted { font-size: .84rem; color: var(--text-muted); }
.price { color: var(--caramel); font-weight: 700; }

/* ----- 插畫 ----- */
.illus { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.illus svg { width: 100%; height: 100%; overflow: visible; }
.thumb {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-soft); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn { padding: 0; border: 0; background: none; border-radius: 18px; cursor: zoom-in; flex: none; }

/* ----- 菜單照片與放大檢視 ----- */
.menu-img-wrap {
  position: relative; display: block; width: 100%; padding: 0;
  border-radius: var(--radius-input); overflow: hidden;
  border: 1px solid var(--border); background: var(--card-soft); cursor: zoom-in;
}
.menu-img-wrap img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.menu-img-hint {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(59, 40, 24, .78); color: #FFFDF9;
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.sheet-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-input); }
.lightbox { align-items: center; padding: 16px; cursor: zoom-out; z-index: 150; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 14px; object-fit: contain; box-shadow: var(--shadow-nav); }
.lightbox .btn2 { position: fixed; top: 16px; right: 16px; }

/* ----- 類別膠囊列（橫向捲動） ----- */
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: none; border-radius: 999px;
  background: var(--caramel); color: #FFFDF9;
  font-size: .92rem; font-weight: 600; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(120, 90, 60, .14);
  transition: background-color .15s ease, transform .12s ease;
}
.tab:active { transform: scale(.96); }
.tab.on { background: var(--sage); box-shadow: 0 4px 10px rgba(139, 148, 126, .34); }

/* ----- 規格選項 ----- */
.grp-title { font-size: .84rem; font-weight: 700; color: var(--text-title); margin-bottom: 8px; }
.grp-title .req { color: var(--danger); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #FFFDF9;
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
}
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip:has(input:checked) { background: var(--sage); border-color: var(--sage); color: #FFFDF9; }
.chip:has(input:checked) .add { color: #EEF2E8; }
.chip:has(input:focus-visible) { outline: 3px solid var(--sage-dark); outline-offset: 2px; }
.chip .add { margin-left: 6px; font-size: .8rem; }

/* ----- 列表、統計 ----- */
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 40px; }
.count { background: var(--sage-soft); color: var(--sage-dark); border-radius: 999px; padding: 2px 12px; font-weight: 700; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sage) !important; color: #FFFDF9;
  font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--card-soft) !important; color: var(--text-dark) !important;
  border: 1px solid var(--border); border-radius: var(--radius-input);
  box-shadow: none; padding: 12px; gap: 2px; text-align: center;
}
.stat .muted { color: var(--text-muted) !important; }
.stat b { font-size: 1.18rem; font-weight: 800; color: var(--text-title); }
.progress { height: 10px; background: var(--pill-bg); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--sage); border-radius: 999px; transition: width .25s ease; }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.warn-title { font-size: .9rem; font-weight: 600; color: var(--warn-ink); }
.notice { font-size: .9rem; line-height: 1.5; color: var(--danger); font-weight: 600; }
.drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-input); min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); text-align: center; padding: 8px; cursor: pointer; background: #FFFDF9;
}
.drop:hover { border-color: var(--caramel); }
.sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

.qty { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty button {
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  border: 1.5px solid var(--border-strong); background: #FFFDF9; color: var(--text-title);
  font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qty button:last-child { background: var(--caramel); border-color: var(--caramel); color: #FFFDF9; }
.qty span { min-width: 24px; text-align: center; font-weight: 700; }

.check { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: .84rem; color: var(--text-muted); }
.check input { width: 20px; height: 20px; accent-color: var(--sage); }

/* ----- 開團步驟 ----- */
.steps { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.steps span:not(.arrow) { border-radius: 999px; padding: 4px 12px; background: var(--pill-bg); }
.steps span.on { background: var(--sage); color: #FFFDF9; }

/* ----- 2 欄店家卡片 ----- */
.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.store-card {
  align-items: center; text-align: center; justify-content: space-between;
  gap: 0; padding: 16px 12px 14px;
}
.store-card .illus { margin-bottom: 8px; }
.store-card .name {
  margin: 0 0 8px; font-size: 1.08rem; font-weight: 700; color: var(--text-dark); line-height: 1.25;
  width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-card .meta {
  display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: .78rem; color: var(--text-title); font-weight: 600;
}
.store-card .btn { width: 100%; font-size: .9rem; padding: 0 10px; box-shadow: 0 3px 8px rgba(166, 117, 75, .22); }
.text-link { background: none; border: 0; color: var(--text-muted); font-size: .8rem; text-decoration: underline; padding: 6px; min-height: 32px; }
.menu-peek { width: 100%; border-top: 1px solid var(--border); padding-top: 6px; margin-bottom: 8px; font-size: .8rem; text-align: left; }
.new-store { flex-direction: row; align-items: center; gap: 14px; text-align: left; }
.new-store .plus {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex: none;
}
button.card { width: 100%; cursor: pointer; font: inherit; }

/* ----- 點單送出條（位於導覽列上方） ----- */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: calc(100% - 32px); max-width: 448px;
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 10px 10px 10px 16px; box-shadow: var(--shadow-nav);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  z-index: 45; color: var(--text-dark);
}
.cartbar .sub { font-size: .8rem; color: var(--text-muted); }
.cartbar button {
  background: var(--caramel); color: #FFFDF9; border: 0; border-radius: 999px;
  min-height: 44px; padding: 0 18px; font-weight: 700; box-shadow: var(--shadow-btn);
}

/* ----- 底部懸浮導覽列 ----- */
.nav-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 28px); max-width: 452px; z-index: 50;
}
.nav {
  background: var(--nav-bg); border-radius: 28px; box-shadow: var(--shadow-nav);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden; border: 1px solid rgba(255, 255, 255, .85);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 64px; padding: 8px 4px; text-decoration: none;
  color: var(--text-title); font-size: .76rem; font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { background: var(--sage); color: #FFFDF9; border-radius: 24px; }

/* ----- 底部彈出視窗 ----- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(59, 40, 24, .45); backdrop-filter: blur(4px);
  z-index: 120; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-nav);
  display: flex; flex-direction: column; gap: 16px;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet .card { box-shadow: none; background: var(--card-soft); border-color: var(--border); }

/* ----- 提示 ----- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(59, 40, 24, .94); color: #FFFDF9;
  padding: 10px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow-nav);
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.fade-enter-active, .fade-leave-active { transition: opacity .2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.demo-bar { font-size: .78rem; color: var(--text-muted); text-align: center; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; margin-top: 4px; }
.demo-bar a { font-weight: 700; }
.empty { text-align: center; align-items: center; }

.spin { width: 18px; height: 18px; border: 3px solid var(--pill-bg); border-top-color: var(--caramel); border-radius: 50%; animation: r .7s linear infinite; display: inline-block; }
@keyframes r { to { transform: rotate(360deg); } }

/* ----- 列印（彙整頁） ----- */
@media print {
  html, body { background: #fff; font-size: 12pt; }
  .shell { max-width: none; box-shadow: none; background: #fff; }
  .no-print, .bg-botanical, .cartbar, .toast, .demo-bar, .nav-wrap { display: none !important; }
  .page { padding: 0; min-height: 0; }
  .card { box-shadow: none; border: 1px solid #999; border-radius: 8px; break-inside: avoid; margin-bottom: 10px; background: #fff !important; }
  .stat, .count, .pill, .avatar { background: #fff !important; color: #000 !important; }
  .progress { display: none; }
}
