/* ═══════════════════════════════════════════════════════════
   屹澧顧客端點餐 — iCHEF 風 Mobile-first
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 主色系 — 屹澧紫 */
  --primary: #ca7aeb;          /* 屹澧主紫 */
  --primary-dark: #a851d5;     /* 深紫(hover) */
  --primary-light: #f5e8fc;    /* 淺紫底 */
  --primary-deep: #8e2fc4;     /* 深紫(漸層終點) */
  --bg: #faf1fd;               /* 雪紫白底 */
  --card-bg: #FFFFFF;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9CA3AF;
  --border: #ead5f5;           /* 淺紫邊框 */
  --success: #2ECC71;
  --danger: #E74C3C;
  --warning: #F39C12;
  --hot-color: #E74C3C;
  --recommend-color: #F39C12;
  --new-color: #3498DB;
  --signature-color: #9B59B6;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 56px;
  --cart-bar-h: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, "Microsoft JhengHei", "PingFang TC", sans-serif;
}
body {
  background: var(--bg); color: var(--text);
  padding-top: var(--header-h); padding-bottom: var(--cart-bar-h);
  min-height: 100vh;
}
body.no-cart-bar { padding-bottom: 0; }
body.no-header { padding-top: 0; }
img { max-width: 100%; display: block; }

/* ── 頂部列 ─────────────────────── */
#topHeader {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  background: var(--primary); color: white;
  display: flex; align-items: center; padding: 0 12px;
  box-shadow: var(--shadow);
  transition: background-color 0.3s;
}
.btn-back, .btn-cart {
  background: transparent; border: 0; color: white; font-size: 24px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  position: relative; border-radius: 8px;
}
.btn-back:active, .btn-cart:active { background: rgba(255,255,255,0.2); }
.brand-logo { flex: 1; text-align: center; font-weight: 700; font-size: 18px; }
.cart-badge {
  position: absolute; top: 2px; right: 2px; background: white; color: var(--primary);
  border-radius: 10px; min-width: 18px; height: 18px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* ── 主內容容器 ─────────────── */
#app { padding: 0; min-height: calc(100vh - var(--header-h) - var(--cart-bar-h)); }
.page { padding: 16px; }
.loading { text-align: center; padding: 80px 20px; color: var(--text-muted); }

/* ── Toast ─────────────── */
#toastBox { position: fixed; top: 70px; left: 0; right: 0; z-index: 1000; pointer-events: none; }
.toast-bubble {
  background: rgba(0,0,0,0.85); color: white; padding: 10px 18px;
  border-radius: 24px; margin: 8px auto; max-width: fit-content;
  font-size: 14px; animation: toast-in 0.2s ease; box-shadow: var(--shadow);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 空狀態 ─────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 56px; margin-bottom: 12px; color: #ccc; }
.empty-state p { margin: 0 0 16px; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   首頁 (Home)
   ═══════════════════════════════════════════════════════════ */

.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; padding: 32px 16px; text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; }
.hero p { margin: 0; opacity: 0.9; font-size: 14px; }

.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 16px 8px;
  display: flex; align-items: center;
}

.store-list { padding: 0 16px; }
.store-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 14px;
  margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; gap: 12px; position: relative;
  transition: transform 0.1s;
}
.store-card:active { transform: scale(0.98); background: #f8f8f8; }
.store-card .fav-btn {
  position: absolute; top: 10px; right: 10px; font-size: 20px;
  background: transparent; border: 0; cursor: pointer;
  color: #ccc; padding: 6px;
}
.store-card .fav-btn.active { color: var(--danger); }
.store-card .store-body { flex: 1; min-width: 0; padding-right: 36px; }
.store-card .store-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.store-card .store-brand-tag {
  display: inline-block; background: var(--primary); color: white;
  padding: 1px 8px; border-radius: 10px; font-size: 10px; margin-right: 6px;
}
.store-card .store-meta { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.store-card .store-status { font-size: 11px; margin-top: 4px; }
.store-card .store-status.open { color: var(--success); }
.store-card .store-status.closed { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   菜單頁
   ═══════════════════════════════════════════════════════════ */

.store-banner {
  background: white; padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.store-banner .store-name-big { font-weight: 700; font-size: 17px; display: flex; align-items: center; }
.store-banner .store-info-small { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.store-banner .table-badge {
  display: inline-block; background: var(--text); color: white;
  padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; margin-left: 8px;
}

/* 黃金位置 Banner（首頁 hero 下方） */
.golden-banner {
  background: linear-gradient(135deg, #f5e8fc, #f5e8fc);
  margin: 12px 16px; padding: 14px; border-radius: var(--radius);
  border: 1px solid #D6BE85;
}
.golden-banner-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 10px;
}
.golden-banner-scroll {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 4px; scroll-snap-type: x mandatory;
}
.golden-banner-scroll::-webkit-scrollbar { display: none; }
.golden-item {
  flex: 0 0 auto; width: 140px; background: white;
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  scroll-snap-align: start; box-shadow: var(--shadow);
}
.golden-item .g-img {
  width: 100%; aspect-ratio: 1/1; background: #eee center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 32px; color: #bbb;
}
.golden-item .g-body { padding: 8px 10px; }
.golden-item .g-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.golden-item .g-price { color: var(--primary); font-weight: 700; font-size: 13px; margin-top: 3px; }

/* 活動商品區塊 */
.campaign-banner {
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  margin: 8px 16px; padding: 14px; border-radius: var(--radius);
  border: 1px solid #C8E6C9;
}
.campaign-banner-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; color: #E65100; margin-bottom: 10px;
}

/* 分類 Tab */
.category-tabs {
  position: sticky; top: var(--header-h); z-index: 49;
  background: white; border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 14px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 3px solid transparent; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.cat-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.category-section { padding: 16px; }
.category-heading {
  font-weight: 700; font-size: 17px; margin: 0 0 14px; color: var(--text);
  display: flex; align-items: center;
}
.category-heading .cat-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary); margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════
   商品卡三版型
   ═══════════════════════════════════════════════════════════ */

/* 共用：徽章 */
.badge-pill {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
  color: white; background: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 2;
}
.badge-pill.hot { background: var(--hot-color); }
.badge-pill.recommend { background: var(--recommend-color); }
.badge-pill.new { background: var(--new-color); }
.badge-pill.signature { background: var(--signature-color); }
.badge-pill.combo { background: #6366F1; }

/* 版型 1：橫向小卡 */
.product-grid.small .product-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 12px;
  margin-bottom: 10px; box-shadow: var(--shadow); display: flex; gap: 12px;
  cursor: pointer; position: relative;
}
.product-grid.small .product-card:active { background: #f7f7f7; }
.product-grid.small .prod-img {
  width: 84px; height: 84px; border-radius: var(--radius-sm); background: #eee center/cover no-repeat;
  flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 28px;
}
.product-grid.small .prod-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-grid.small .prod-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.product-grid.small .prod-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-grid.small .prod-price { font-weight: 700; color: var(--primary); font-size: 15px; margin-top: auto; }
.product-grid.small .btn-add-fab {
  position: absolute; right: 12px; bottom: 12px;
  background: var(--primary); color: white; border: 0; border-radius: 50%;
  width: 32px; height: 32px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); font-weight: 700;
}

/* 版型 2：雙欄網格（預設） */
.product-grid.grid2 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.product-grid.grid2 .product-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.product-grid.grid2 .product-card:active { transform: scale(0.98); }
.product-grid.grid2 .prod-img {
  width: 100%; aspect-ratio: 1/1; background: #eee center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 36px;
  position: relative;
}
.product-grid.grid2 .prod-body { padding: 10px 12px 44px; flex: 1; position: relative; }
.product-grid.grid2 .prod-name {
  font-weight: 700; font-size: 14px; line-height: 1.25; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 35px;
}
.product-grid.grid2 .prod-desc { display: none; }
.product-grid.grid2 .prod-price { font-weight: 700; color: var(--primary); font-size: 15px; margin-top: 4px; }
.product-grid.grid2 .btn-add-fab {
  position: absolute; right: 10px; bottom: 10px;
  background: var(--primary); color: white; border: 0; border-radius: 50%;
  width: 30px; height: 30px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); font-weight: 700;
}

/* 版型 3：iCHEF 風大圖卡 */
.product-grid.big .product-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  margin-bottom: 14px; position: relative;
}
.product-grid.big .product-card:active { transform: scale(0.99); }
.product-grid.big .prod-img {
  width: 100%; aspect-ratio: 4/3; background: #eee center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 44px;
  position: relative;
}
.product-grid.big .prod-body { padding: 14px 16px; position: relative; }
.product-grid.big .prod-name { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.product-grid.big .prod-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; }
.product-grid.big .prod-price { font-weight: 700; color: var(--primary); font-size: 18px; }
.product-grid.big .btn-add-fab {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: var(--primary); color: white; border: 0; border-radius: 50%;
  width: 36px; height: 36px; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); font-weight: 700;
}
.product-grid.big .prod-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* 通用 tags（冷熱/辣/素） */
.prod-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: #F0F0F0; color: var(--text-muted);
}
.tag.spicy { background: #FFE5E5; color: var(--danger); }
.tag.veg { background: #E8F5E9; color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   商品詳情：全頁從右側滑入
   ═══════════════════════════════════════════════════════════ */

.product-detail-page {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); overflow: hidden;
  transform: translateX(100%); transition: transform 0.28s ease-out;
  display: flex; flex-direction: column;
}
.product-detail-page.open { transform: translateX(0); }
.pdp-header {
  height: var(--header-h); background: var(--primary); color: white;
  display: flex; align-items: center; padding: 0 12px; flex-shrink: 0;
}
.pdp-header .btn-close {
  background: transparent; border: 0; color: white; font-size: 24px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.pdp-header .pdp-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.pdp-body { flex: 1; overflow-y: auto; padding-bottom: 100px; }
.pdp-hero-img {
  width: 100%; aspect-ratio: 16/9; background: #eee center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 72px;
  flex-shrink: 0;
}
.pdp-info { background: white; padding: 16px; }
.pdp-name { font-weight: 700; font-size: 22px; margin-bottom: 4px; }
.pdp-desc { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.pdp-price { color: var(--primary); font-weight: 700; font-size: 22px; margin-top: 10px; }

.pdp-section { background: white; padding: 16px; margin-top: 10px; }
.pdp-section-label {
  font-weight: 700; font-size: 15px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.pdp-section-label .option-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.pdp-section-label .option-required { color: var(--danger); margin-left: 4px; }

.option-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.option-items.size { grid-template-columns: repeat(3, 1fr); }
.option-item {
  background: #F5F5F5; border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 8px; text-align: center; cursor: pointer; font-size: 14px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: all 0.1s;
}
.option-item:active { transform: scale(0.96); }
.option-item.selected {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary);
}
.option-item .opt-price { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.option-item.selected .opt-price { color: var(--primary); }

.pdp-notes {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; font-size: 14px; resize: vertical; min-height: 60px;
  font-family: inherit;
}

/* 推薦商品橫捲（商品詳情底部） */
.recommend-strip { padding: 16px; background: var(--primary-light); margin-top: 10px; }
.recommend-strip-title {
  font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.recommend-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.recommend-scroll::-webkit-scrollbar { display: none; }
.recommend-item {
  flex: 0 0 120px; background: white; border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; box-shadow: var(--shadow);
}
.recommend-item .r-img {
  width: 100%; aspect-ratio: 1/1; background: #eee center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 28px;
}
.recommend-item .r-body { padding: 8px; }
.recommend-item .r-name { font-size: 12px; font-weight: 700; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 30px;
}
.recommend-item .r-price { color: var(--primary); font-weight: 700; font-size: 12px; margin-top: 4px; }

/* 商品詳情底部：數量 + 加入購物車 */
.pdp-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
  background: white; border-top: 1px solid var(--border);
  padding: 10px 16px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
.qty-control { display: flex; align-items: center; gap: 0; }
.qty-control button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: white; font-size: 18px; color: var(--primary); font-weight: 700;
  cursor: pointer;
}
.qty-control button:disabled { color: #ccc; cursor: not-allowed; }
.qty-control .qty-val { width: 40px; text-align: center; font-weight: 700; font-size: 16px; }

.btn-primary-custom {
  flex: 1; background: var(--primary); color: white; border: 0; border-radius: var(--radius-sm);
  padding: 12px 16px; font-weight: 700; font-size: 16px; cursor: pointer;
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-primary-custom:active { background: var(--primary-dark); }
.btn-primary-custom:disabled { background: #ccc; }

/* ═══════════════════════════════════════════════════════════
   加購 Bottom Sheet
   ═══════════════════════════════════════════════════════════ */

.addon-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.addon-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.addon-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 301;
  background: white; border-radius: 16px 16px 0 0;
  transform: translateY(100%); transition: transform 0.3s;
  max-height: 75vh; display: flex; flex-direction: column;
}
.addon-sheet.open { transform: translateY(0); }
.addon-sheet-header {
  padding: 16px 16px 8px; position: relative; text-align: center;
}
.addon-sheet-header::before {
  content: ''; display: block; width: 40px; height: 4px; background: #ddd;
  border-radius: 2px; margin: -8px auto 12px;
}
.addon-sheet-title { font-weight: 700; font-size: 18px; }
.addon-sheet-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.addon-sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.addon-sheet-item {
  display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f2f2f2;
  align-items: center;
}
.addon-sheet-item:last-child { border-bottom: 0; }
.addon-sheet-item .a-img {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  background: #eee center/cover no-repeat; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 22px;
}
.addon-sheet-item .a-body { flex: 1; min-width: 0; }
.addon-sheet-item .a-name { font-weight: 700; font-size: 14px; }
.addon-sheet-item .a-price { color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 2px; }
.addon-sheet-item .a-add {
  background: var(--primary); color: white; border: 0; border-radius: 50%;
  width: 34px; height: 34px; font-size: 20px; font-weight: 700;
}
.addon-sheet-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}
.addon-sheet-footer .btn-skip {
  flex: 1; background: #F0F0F0; color: var(--text-muted); border: 0;
  border-radius: var(--radius-sm); padding: 12px; font-weight: 600; font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════
   購物車 + 結帳
   ═══════════════════════════════════════════════════════════ */

/* ── 空購物車 ── */
.cart-empty {
  text-align: center; padding: 60px 32px 40px;
  display: flex; flex-direction: column; align-items: center;
}
.cart-empty-icon {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.cart-empty-icon i { font-size: 44px; color: var(--primary); }
.cart-empty-title {
  margin: 0 0 8px; font-size: 20px; font-weight: 700; color: #333;
}
.cart-empty-desc {
  margin: 0 0 24px; font-size: 14px; color: #999; line-height: 1.5;
}
.cart-empty-btn {
  padding: 12px 36px; border-radius: 28px;
  background: var(--primary); color: white; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cart-empty-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

.cart-item {
  background: white; border-radius: var(--radius); padding: 12px;
  margin-bottom: 10px; box-shadow: var(--shadow); display: flex; gap: 12px;
}
.cart-item .cart-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: #eee center/cover no-repeat; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 22px;
}
.cart-item .cart-body { flex: 1; min-width: 0; }
.cart-item .cart-name { font-weight: 700; font-size: 14px; }
.cart-item .cart-opts { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cart-item .cart-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cart-item .cart-price { font-weight: 700; color: var(--primary); }
.cart-item .btn-remove {
  background: transparent; border: 0; color: var(--danger); font-size: 18px;
  margin-left: auto; padding: 4px 8px;
}

.promo-input-row {
  background: white; border-radius: var(--radius); padding: 12px;
  margin-bottom: 10px; box-shadow: var(--shadow); display: flex; gap: 8px;
}
.promo-input-row input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 14px;
}

.cart-summary {
  background: white; border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.cart-summary .row-line {
  display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0;
}
.cart-summary .row-line.discount { color: var(--success); }
.cart-summary .row-total {
  font-size: 20px; font-weight: 700; color: var(--primary);
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px;
}

/* 底部浮動購物車條（常駐，只要 cart 有東西） */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  height: var(--cart-bar-h); background: white; border-top: 1px solid var(--border);
  padding: 10px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.cart-bar .cart-icon {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  flex-shrink: 0;
}
.cart-bar .cart-icon .cart-count {
  position: absolute; top: -4px; right: -4px;
  background: white; color: var(--primary); border-radius: 12px;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; box-shadow: var(--shadow);
  border: 2px solid var(--primary);
}
.cart-bar .cart-info { flex: 1; min-width: 0; }
.cart-bar .cart-info .lbl { font-size: 11px; color: var(--text-muted); }
.cart-bar .cart-info .total {
  font-weight: 700; font-size: 20px; color: var(--primary);
}
.cart-bar .btn-go-checkout {
  background: var(--primary); color: white; border: 0; border-radius: var(--radius-sm);
  padding: 12px 20px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.cart-bar .btn-go-checkout:active { background: var(--primary-dark); }
/* v2.47.281 第 93 條：本日公休小標籤，浮在「去結帳」正上方。
   🔴 一定要 absolute —— 排進 flex 會把手機版的 cart-bar 擠到換行／金額被壓掉。 */
.cart-bar .cart-bar-holiday {
  position: absolute; right: 16px; bottom: calc(100% - 6px);
  display: flex; align-items: center; gap: 4px;
  background: #fff3cd; color: #856404; border: 1px solid #ffe08a;
  border-radius: 14px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cart-bar .cart-bar-holiday:active { background: #ffe9a8; }
.cart-bar.empty { display: none; }
.cart-bar.force-hide { display: none !important; }
body.has-bottom-nav .cart-bar { bottom: 60px; }
body.has-bottom-nav .btn-checkout { bottom: 60px; }

/* 營養資訊首次提示浮動視窗 */
.nut-tooltip-float {
  position: absolute; top: -8px; left: 12px; right: 12px;
  transform: translateY(-100%);
  background: var(--primary); color: white; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: nutTipIn 0.3s ease;
  z-index: 50;
}
.nut-tooltip-float::after {
  content: ''; position: absolute; bottom: -6px; left: 24px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 6px solid var(--primary);
}
@keyframes nutTipIn {
  from { opacity: 0; transform: translateY(-100%) translateY(8px); }
  to { opacity: 1; transform: translateY(-100%); }
}

/* 底部固定結帳按鈕（購物車頁 / 結帳頁） */
.btn-checkout {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin: 0; border: 0; outline: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 16px; font-weight: 700; font-family: inherit;
  padding: 18px 24px; cursor: pointer;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
/* v2.47.281 第 93 條：購物車頁的本日公休標籤，浮在「前往結帳」上方。
   bottom 是預設值，實際會由 cart.js 量 .btn-checkout 的高度校正（字級會變）。 */
.cart-holiday-float {
  /* 🔴 對齊結帳按鈕內容的右緣（按鈕左右內距 24px，寫 16px 會突出去一截）。
     大螢幕時按鈕不是滿版，right 會由 cart.js 量實際位置校正。 */
  position: fixed; right: 24px; bottom: 68px; z-index: 91;
  display: flex; align-items: center; gap: 4px;
  background: #fff3cd; color: #856404; border: 1px solid #ffe08a;
  border-radius: 14px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cart-holiday-float:active { background: #ffe9a8; }
body.has-bottom-nav .cart-holiday-float { bottom: 128px; }
.btn-checkout:active { transform: scale(0.98); filter: brightness(0.92); }
.btn-checkout:disabled {
  background: #ccc; color: #888; cursor: not-allowed;
  box-shadow: none;
}
.btn-checkout span:first-child {
  display: flex; align-items: center; gap: 6px;
}
.btn-checkout span:last-child {
  font-size: 18px; letter-spacing: 0.5px;
}
/* 2026-09-15 第 123 條:結帳頁「送出訂單」文字 + 金額一起靠右。
   🔴 只掛在結帳頁那顆;購物車頁「前往結帳」也用 .btn-checkout,
   而且 cart.js 會量它的位置擺「本日公休」標籤,不可以直接改 .btn-checkout。 */
.btn-checkout.btn-checkout-end {
  justify-content: flex-end; gap: 16px;
}
/* 2026-09-15 第 123 條:送出訂單按鈕上方的提示框,提醒客人要按按鈕才算下單。
   bottom / right 是預設值,實際由 checkout.js _positionSubmitHint() 量按鈕位置校正。
   🔴 pointer-events:none —— 不擋底下的內容,也不會被當成送出按鈕按到。 */
.checkout-submit-hint {
  position: fixed; right: 24px; bottom: 70px; z-index: 91;
  background: #fff3cd; color: #b42318; border: 1px solid #f5c26b;
  border-radius: 12px; padding: 7px 14px;
  font-size: 15px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
  animation: checkoutHintBob 1.6s ease-in-out infinite;
}
.checkout-submit-hint::before,
.checkout-submit-hint::after {
  content: ''; position: absolute; right: 28px;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
}
.checkout-submit-hint::before { bottom: -8px; border-top: 8px solid #f5c26b; }
.checkout-submit-hint::after { bottom: -6px; border-top: 8px solid #fff3cd; }
@keyframes checkoutHintBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .checkout-submit-hint { animation: none; }
}

/* 結帳表單 */
.form-section {
  background: white; border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.form-section h6 { font-weight: 700; font-size: 15px; margin: 0 0 12px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px;
  font-size: 15px; box-sizing: border-box; font-family: inherit;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.form-row select {
  -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}
.form-row textarea { resize: vertical; min-height: 60px; }

.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.radio-option.selected { border-color: var(--primary); background: var(--primary-light); }
.radio-option input { margin: 0; }
.radio-option .radio-label { flex: 1; font-weight: 600; }
.radio-option .radio-desc { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* 結帳前「最後一籰」 */
.last-chance-page .lc-header { padding: 30px 20px 10px; text-align: center; }
.last-chance-page .lc-title { font-weight: 700; font-size: 22px; }
.last-chance-page .lc-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.last-chance-page .lc-items { padding: 10px 16px; }
.last-chance-page .btn-skip-checkout {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  background: white; color: var(--text); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; font-weight: 700; font-size: 15px;
  z-index: 80;
}

/* ── AI 營養師 ── */
.prod-combo-desc {
  font-size: 11px; color: #e65100; line-height: 1.3; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cal-badge {
  display: inline-block; font-size: 11px; color: #888;
  background: #f0f0f0; padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.nutrition-panel {
  background: #fafffe; border: 1px solid #e0f2e9; border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0;
}
.nutrition-panel .nut-title {
  font-size: 13px; font-weight: 600; color: #2e7d32; margin-bottom: 10px;
}
.nut-main { text-align: center; margin-bottom: 12px; }
.nut-cal { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1; }
.nut-cal-unit { font-size: 12px; color: #999; }
.nut-daily-pct { font-size: 11px; color: #888; margin-top: 2px; }
.nut-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
.nut-grid-item { padding: 6px 2px; }
.nut-grid-val { font-size: 15px; font-weight: 700; color: #333; }
.nut-grid-label { font-size: 11px; color: #999; margin-top: 1px; }
.nut-grid-pct { font-size: 10px; color: #aaa; margin-top: 1px; }
.nut-row { display: flex; justify-content: space-around; text-align: center; }
.nut-item .nut-val { font-size: 16px; font-weight: 700; color: #333; }
.nut-item .nut-label { font-size: 11px; color: #999; }
.allergen-tags { margin-top: 8px; font-size: 12px; color: #e65100; }
.allergen-tag { display: inline-block; background: #fff3e0; padding: 1px 8px; border-radius: 10px; margin: 2px 2px; font-size: 11px; }
.nut-disclaimer { font-size: 10px; color: #bbb; text-align: center; margin-top: 8px; }
.cart-nutrition-bar { background: #f8f9fa; border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.nut-bar-label { display: flex; justify-content: space-between; font-size: 13px; color: #666; margin-bottom: 6px; }
.nut-bar-track { height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.nut-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.nut-filter-pills { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; }
.nut-filter-pill { flex-shrink: 0; padding: 4px 12px; border-radius: 16px; font-size: 12px; border: 1px solid var(--border); background: #fff; color: #666; cursor: pointer; }
.nut-filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   底部導航列
   ═══════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60px; z-index: 100;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  display: flex; align-items: stretch;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}
.bottom-nav-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: #6b7280; text-decoration: none;
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: color 0.15s, background 0.15s;
}
.bottom-nav-item i { font-size: 22px; }
.bottom-nav-item span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.bottom-nav-item.active { color: #ca7aeb; font-weight: 700; }
.bottom-nav-item.active i { filter: drop-shadow(0 2px 4px rgba(202,122,235,0.30)); }
.bottom-nav-item:active { background: #f5f5f5; }

/* ── 「更多」抽屜選單 ── */
.more-drawer-overlay {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.2s;
}
.more-drawer-overlay.open { opacity: 1; }
.more-drawer {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.25s ease;
  max-height: 80vh; overflow-y: auto;
}
.more-drawer-overlay.open .more-drawer { transform: translateY(0); }
.more-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.more-drawer-title {
  font-size: 17px; font-weight: 700; color: #1f2937;
}
.more-drawer-close {
  background: none; border: none;
  font-size: 26px; line-height: 1;
  color: #9ca3af; cursor: pointer; padding: 0 6px;
}
.more-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
}
.more-drawer-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: #374151;
  cursor: pointer;
  padding: 4px 2px;
}
.more-drawer-item:active { transform: scale(0.95); }
.more-drawer-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: #f5e8fc;
  color: #ca7aeb;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.more-drawer-label {
  font-size: 12px; font-weight: 500;
  text-align: center; line-height: 1.2;
}

/* ── 公告列表(首頁專用,固定貼在下方選單上方,一行一行) ── */
.home-annbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 60px;             /* 緊貼 bottom-nav 上緣 */
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  z-index: 99;
  display: flex; flex-direction: column;
}
/* v2.47.27 桌面下公告置中(實際寬度同步綁定在檔案尾巴的 sync 區塊) */
@media (min-width: 768px) {
  .home-annbar {
    left: 50%; right: auto;
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
    border-left: 1px solid rgba(0,0,0,0.06);
    border-right: 1px solid rgba(0,0,0,0.06);
  }
}
.home-annbar-row {
  height: 36px;
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 10px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.15s;
}
.home-annbar-row:last-child { border-bottom: none; }
.home-annbar-row:active { background: #f5f3ff; }
.home-annbar-thumb {
  width: 28px; height: 28px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
  background: #f3f4f6;
}
.home-annbar-icon {
  color: #ca7aeb; font-size: 17px; flex-shrink: 0;
  width: 28px; text-align: center;
}
.home-annbar-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
.home-annbar-chev {
  color: #9ca3af; font-size: 14px; flex-shrink: 0;
}
/* 有公告列表時 body 多 padding,避免內容被遮住 */
body.has-ticker {
  padding-bottom: calc(var(--cart-bar-h) + 60px + var(--ann-bar-h, 0px));
}

/* 有底部導航列時 body padding */
body.has-bottom-nav { padding-bottom: calc(var(--cart-bar-h) + 60px); }
/* cart-bar 被隱藏時(寄餐券、會員中心、條碼等頁面),body 只需保留 bottom-nav 空間,
   避免多 72px 死區而出現不必要的滑動條 */
body.has-bottom-nav:has(.cart-bar.force-hide),
body.has-bottom-nav:has(#cartBar.force-hide) { padding-bottom: 60px; }

/* ═══════════════════════════════════════════════════════════
   PWA 安裝提示
   ═══════════════════════════════════════════════════════════ */
.pwa-install-banner {
  position: fixed; bottom: 70px; left: 12px; right: 12px; z-index: 200;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease;
}
.pwa-install-content {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
}
.pwa-install-content img { border-radius: 10px; flex-shrink: 0; }
.pwa-install-text { flex: 1; }
.pwa-install-text strong { display: block; font-size: 14px; }
.pwa-install-text small { font-size: 12px; color: var(--text-muted); }
.pwa-install-btn {
  background: var(--primary); color: white; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pwa-install-close {
  background: none; border: none; font-size: 20px; color: var(--text-muted);
  cursor: pointer; padding: 4px; line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   登入頁
   ═══════════════════════════════════════════════════════════ */
.login-page { max-width: 400px; margin: 0 auto; padding-top: 32px; }
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 64px; color: var(--primary); margin-bottom: 8px; }
.login-brand-logo {
  display: block; margin: 0 auto 12px;
  width: 88px; height: 88px; border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.login-helper {
  margin: 14px 0 18px; padding: 12px 14px;
  background: #faf1fd; border: 1px solid #ead5f5; border-radius: 10px;
}
.login-helper p {
  margin: 0; padding: 4px 0;
  font-size: 13px; color: #4b3a2f; line-height: 1.5;
  display: flex; align-items: center; gap: 8px;
}
.login-helper p i { color: #ca7aeb; font-size: 15px; flex-shrink: 0; }

/* 密碼輸入 + 眼睛 toggle */
.login-pw-row { position: relative; margin-bottom: 14px; }
.login-pw-row .login-input { padding-right: 44px; margin-bottom: 0; }
.login-pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.login-pw-eye:hover { color: var(--primary); }

/* OTP 輸入 + 發送按鈕並排 */
.login-otp-row {
  display: flex; gap: 8px; margin-bottom: 6px;
}
.login-otp-row .login-input { flex: 1; margin-bottom: 0; }
.login-otp-btn {
  flex-shrink: 0; min-width: 110px;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  border: none; border-radius: 8px; padding: 0 14px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 8px rgba(202,122,235,0.25);
}
.login-otp-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.login-otp-countdown {
  text-align: right; font-size: 12px; color: var(--text-muted);
  min-height: 16px; margin-bottom: 14px;
}

/* Step 2 切手機提示中的連結按鈕 */
.login-hint .login-link {
  margin-left: 6px; font-size: 12px;
}

/* 密碼安全建議區塊 */
.pw-tips {
  margin: 4px 0 16px; padding: 12px 14px;
  background: #faf1fd; border: 1px solid #ead5f5; border-radius: 10px;
}
.pw-tips-title {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #b34418;
  display: flex; align-items: center; gap: 6px;
}
.pw-tips-title i { color: #ca7aeb; }
.pw-tips ol {
  margin: 0; padding-left: 20px;
  font-size: 12.5px; line-height: 1.6; color: #5a3f2f;
}
.pw-tips ol li { margin-bottom: 4px; }
.pw-tips ol li:last-child { margin-bottom: 0; }
.pw-tips strong { color: #b34418; }
.login-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.login-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }
.login-step { margin-bottom: 24px; }
.login-step-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.login-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.login-input {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; outline: none; transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--primary); }
.login-input:disabled { background: #f5f5f5; color: var(--text-muted); }
.login-phone-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.login-phone-prefix {
  padding: 12px 12px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-muted); white-space: nowrap;
}
.login-phone-row .login-input { flex: 1; margin-bottom: 0; }
.login-code-row { margin-bottom: 16px; }
.login-code-input { text-align: center; letter-spacing: 8px; font-size: 24px; font-weight: 700; }
.login-btn {
  width: 100%; padding: 14px; background: var(--primary); color: white; border: none;
  border-radius: var(--radius); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.login-btn:active { background: var(--primary-dark); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-resend { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.login-link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 14px; padding: 8px;
}
.login-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.login-gender-row { display: flex; gap: 16px; margin-bottom: 16px; }
.login-gender-option { display: flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.login-footer { text-align: center; margin-top: 32px; padding-bottom: 32px; }

/* ── 好友綁定條款同意(Step 0)─────────────────────── */
.terms-gate { padding-bottom: 32px; }
.terms-gate-header { text-align: center; margin-bottom: 16px; }
.terms-gate-logo {
  display: block; margin: 0 auto 12px;
  width: 88px; height: 88px; border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.terms-gate-title {
  margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--text);
}
.terms-gate-sub {
  margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-muted);
}
.terms-gate-divider {
  border: none; border-top: 1px dashed #d4d4d4; margin: 18px 0 16px;
}
.terms-block-title {
  margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--text); text-align: center;
}
.terms-block-corp {
  margin: 0 0 8px; font-size: 13px; text-align: center; color: var(--text);
}
.terms-block-corp small { color: var(--text-muted); font-size: 11px; }
.terms-meta {
  margin: 0 0 10px; font-size: 12px; color: var(--text-muted); text-align: center;
}
.terms-content-box {
  max-height: 260px; overflow-y: auto;
  border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 12px 14px; background: #fafafa;
  font-size: 13px; line-height: 1.7; color: #333;
  margin-bottom: 16px;
}
.terms-content-box p { margin: 0 0 10px; }
.terms-content-box p:last-child { margin-bottom: 0; }
.terms-content-box strong { color: var(--primary-dark, #c2410c); }
.terms-checkbox-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; line-height: 1.5; color: var(--text);
  margin-bottom: 14px; cursor: pointer;
}
.terms-checkbox-row input[type="checkbox"] {
  margin-top: 3px; flex-shrink: 0; transform: scale(1.2);
}
.terms-checkbox-row strong { color: var(--primary); }
#btnTermsNext:disabled { opacity: 0.45; }

/* ── 未登入空狀態(會員中心 / 我的訂單)──────────── */
.guest-gate {
  max-width: 360px; margin: 0 auto; padding: 48px 20px 32px; text-align: center;
}
.guest-gate-hero {
  width: 104px; height: 104px; margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(202,122,235,0.32);
}
.guest-gate-hero i { font-size: 52px; color: #fff; }
.guest-gate-title {
  margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--text);
}
.guest-gate-sub {
  margin: 0 0 22px; font-size: 14px; color: var(--text-muted); line-height: 1.55;
}
.guest-gate-perks {
  text-align: left; list-style: none; padding: 0; margin: 0 0 24px;
  background: #faf1fd; border: 1px solid #ead5f5; border-radius: 12px;
  padding: 14px 16px;
}
.guest-gate-perks li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 14px; color: #4b3a2f; line-height: 1.4;
}
.guest-gate-perks li i {
  color: #ca7aeb; font-size: 16px; flex-shrink: 0;
}
.guest-gate-cta {
  width: 100%; padding: 13px 0; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(202,122,235,0.32);
  transition: transform 0.1s, box-shadow 0.1s;
}
.guest-gate-cta:active {
  transform: translateY(1px); box-shadow: 0 3px 10px rgba(202,122,235,0.28);
}
.guest-gate-skip {
  display: inline-block; margin-top: 16px;
  background: none; border: none; padding: 6px 12px;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
}
.guest-gate-skip:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   會員中心
   ═══════════════════════════════════════════════════════════ */
.member-page { padding-top: 0; }
.member-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: var(--radius); margin: 16px; padding: 20px;
  box-shadow: var(--shadow-lg);
}
.member-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.member-avatar { font-size: 48px; opacity: 0.9; }
.member-info { flex: 1; }
.member-name { font-size: 18px; font-weight: 700; }
.member-phone { font-size: 13px; opacity: 0.85; }
.member-level-badge {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.member-card-bottom {
  display: flex; justify-content: space-around; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 16px;
}
.member-stat { text-align: center; cursor: pointer; }
.member-stat-value { font-size: 20px; font-weight: 700; }
.member-stat-label { font-size: 12px; opacity: 0.85; }

.member-section { margin: 0 16px 12px; }
.member-level-progress { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.level-progress-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.level-progress-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.level-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--warning)); border-radius: 4px; transition: width 0.5s ease; }
.level-max { text-align: center; color: var(--warning); font-size: 14px; font-weight: 600; padding: 8px; }

.member-menu { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.member-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); text-decoration: none;
}
.member-menu-item:last-child { border-bottom: none; }
.member-menu-item i:first-child { font-size: 20px; color: var(--primary); width: 24px; text-align: center; }
.member-menu-item span { flex: 1; font-size: 15px; }
.member-menu-item i:last-child { color: var(--text-light); font-size: 14px; }
.member-menu-item:active { background: var(--primary-light); }

.member-logout-btn {
  width: 100%; padding: 14px; background: white; color: var(--danger); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; cursor: pointer;
}
.member-logout-btn:active { background: #ffeaea; }

/* ── 會員中心改版(v2.44.x):大頭貼 + 圈圈快捷 + section 標題 ── */
.member-avatar-img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}
.member-avatar-letter {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.22); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  border: 2px solid rgba(255,255,255,0.5);
}

.member-quick-row {
  display: flex; justify-content: space-around; gap: 8px;
  padding: 16px 12px; margin: 0 16px 12px;
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.member-quick-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; padding: 6px 2px; border-radius: 10px;
  text-decoration: none; color: var(--text);
}
.member-quick-item:active { background: #fff3eb; }
.member-quick-circle {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(202,122,235,0.28);
}
.member-quick-circle i { font-size: 22px; color: #fff; }
.member-quick-label { font-size: 12px; font-weight: 600; color: var(--text); }

.member-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text);
  padding: 4px 4px 10px;
}
.member-section-title i { color: var(--primary); font-size: 18px; }

.member-level-hint {
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px;
}
.member-level-hint i { color: var(--primary); }

.member-logout-soft {
  display: block; margin: 24px auto 32px;
  width: 160px; padding: 10px 0;
  background: white; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; cursor: pointer;
}
.member-logout-soft:active { background: #f5f5f5; color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   寄餐券商店(v2.45)
   ═══════════════════════════════════════════════════════════ */
.vshop-page {
  background: #faf1fd;
  min-height: calc(100vh - var(--header-h) - 60px);
  padding-bottom: 0;
}
.vshop-hero {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4);
  color: #fff; padding: 24px 20px 22px; text-align: left;
  border-bottom-left-radius: 24px; border-bottom-right-radius: 24px;
  box-shadow: 0 4px 14px rgba(202,122,235,0.18);
  margin-bottom: 14px;
}
.vshop-hero-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.vshop-hero-sub { font-size: 13.5px; opacity: 0.92; }
.vshop-hero-link {
  display: inline-block; margin-top: 14px;
  background: rgba(255,255,255,0.22); color: #fff;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; text-decoration: none; font-weight: 600;
}
.vshop-hero-link:active { background: rgba(255,255,255,0.35); }

.vshop-cat-row {
  display: flex; gap: 4px; padding: 6px 12px 14px;
  overflow-x: auto; scrollbar-width: none;
}
.vshop-cat-row::-webkit-scrollbar { display: none; }
.vshop-cat {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  width: 64px; padding: 4px 0; cursor: pointer; text-decoration: none; color: var(--text);
  transition: transform 0.1s;
}
.vshop-cat:active { transform: scale(0.94); }
.vshop-cat-circle {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.10);
  opacity: 0.6;
}
.vshop-cat.active .vshop-cat-circle {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.20);
}
.vshop-cat-circle i { font-size: 22px; color: #fff; }
.vshop-cat-label { font-size: 12px; font-weight: 600; color: var(--text); }
.vshop-cat.active .vshop-cat-label { color: var(--primary); }

.vshop-tab-row {
  display: flex; gap: 8px; padding: 0 14px 12px; overflow-x: auto;
}
.vshop-tab {
  flex-shrink: 0; padding: 8px 16px; border: 1px solid #E0CFB0;
  background: #fff; color: var(--text-muted); border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.vshop-tab.active {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  border-color: transparent; box-shadow: 0 3px 8px rgba(202,122,235,0.30);
}

.vshop-list { padding: 0 14px; }
.vshop-empty {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.vshop-empty i { font-size: 48px; opacity: 0.3; display: block; margin-bottom: 12px; }

.vshop-card {
  display: block; background: #fff; border-radius: 14px; margin-bottom: 12px;
  text-decoration: none; color: var(--text); overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.1s, box-shadow 0.1s;
}
.vshop-card:active {
  transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.vshop-card-imgwrap {
  position: relative; width: 100%; height: 140px;
  background: #f5e8fc; overflow: hidden;
}
.vshop-card-img {
  width: 100%; height: 100%; object-fit: cover;
}
.vshop-card-img-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #EFE3CB, #DCC9A0);
}
.vshop-card-img-fallback i { font-size: 56px; color: rgba(202,122,235,0.55); }
.vshop-card-badge {
  position: absolute; top: 10px; left: 10px;
  background: #ef4444; color: #fff; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(239,68,68,0.32);
}
.vshop-card-body { padding: 12px 14px 14px; }
.vshop-card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.vshop-card-desc {
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.vshop-card-meta {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.vshop-card-meta i { color: var(--primary); }
.vshop-card-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #ead5f5;
}
.vshop-card-pricebox { line-height: 1.2; }
.vshop-card-orig {
  font-size: 11px; color: var(--text-muted);
  text-decoration: line-through;
}
.vshop-card-price {
  font-size: 22px; font-weight: 800; color: #ef4444; line-height: 1.05;
}
.vshop-card-cta {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 3px 8px rgba(202,122,235,0.32);
}

/* ── 寄餐券詳情/購買頁 ── */
.vbuy-page {
  background: #faf1fd;
  min-height: calc(100vh - var(--header-h) - 60px);
  padding-bottom: 80px;  /* 留底部 CTA 空間 */
}
body.has-bottom-nav .vbuy-page { padding-bottom: 80px; }
.vbuy-hero {
  position: relative; width: 100%; height: 280px;
  background: linear-gradient(135deg, #EFE3CB, #DCC9A0); overflow: hidden;
}
.vbuy-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vbuy-hero-img-fallback {
  display: flex; align-items: center; justify-content: center;
}
.vbuy-hero-img-fallback i { font-size: 96px; color: rgba(202,122,235,0.55); }
.vbuy-hero-badge {
  position: absolute; top: 14px; left: 14px;
  background: #ef4444; color: #fff; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; box-shadow: 0 3px 8px rgba(239,68,68,0.32);
}
.vbuy-title-section { background: #fff; padding: 16px 18px 12px; }
.vbuy-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; color: var(--text); }
.vbuy-desc { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }

.vbuy-section {
  background: #fff; margin-top: 10px; padding: 16px 18px;
}
.vbuy-section-title {
  margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.vbuy-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f3f4f6;
}
.vbuy-row:last-child { border-bottom: none; }
.vbuy-row-label { color: var(--text-muted); font-size: 14px; }
.vbuy-row-value { font-weight: 600; font-size: 14px; }

.vbuy-qty {
  display: flex; align-items: center; border: 1px solid #E0CFB0;
  border-radius: 999px; overflow: hidden; background: #fff;
}
.vbuy-qty-btn {
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 20px; font-weight: 700; color: var(--primary); cursor: pointer;
}
.vbuy-qty-btn:disabled { color: #ccc; cursor: not-allowed; }
.vbuy-qty-val {
  min-width: 36px; text-align: center; font-size: 16px; font-weight: 700;
}

.vbuy-summary {
  background: #faf1fd; border-left: 3px solid #ca7aeb;
  padding: 10px 12px; margin-top: 10px;
  border-radius: 0 8px 8px 0; font-size: 13px; color: #4b3a2f;
}
.vbuy-summary div { padding: 2px 0; }
.vbuy-summary strong { color: #b34418; }

.vbuy-terms-content {
  font-size: 13px; line-height: 1.7; color: var(--text);
  max-height: 120px; overflow: hidden; position: relative;
  transition: max-height 0.3s;
}
.vbuy-terms-content.expanded { max-height: 2000px; }
.vbuy-terms-content:not(.expanded)::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 32px;
  background: linear-gradient(rgba(255,255,255,0), #fff);
}
.vbuy-terms-content p { margin: 0 0 8px; }
.vbuy-terms-toggle {
  margin-top: 8px; background: none; border: none;
  color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer;
}

.vbuy-notes {
  margin: 0; padding-left: 22px; font-size: 13px;
  line-height: 1.7; color: var(--text);
}
.vbuy-notes li { margin-bottom: 4px; }

.vbuy-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 720px; margin: 0 auto;
  background: #fff; padding: 12px 14px; z-index: 101;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.10);
  display: flex; align-items: center; gap: 12px;
}
body.has-bottom-nav .vbuy-bottom { bottom: 60px; }
.vbuy-bottom-price { flex: 1; }
.vbuy-bottom-orig {
  font-size: 11px; color: var(--text-muted); text-decoration: line-through;
}
.vbuy-bottom-cur {
  font-size: 20px; font-weight: 800; color: #ef4444;
}
.vbuy-bottom-savings {
  display: inline-block; margin-left: 8px;
  background: #fee2e2; color: #b91c1c;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.vbuy-bottom-btn {
  flex-shrink: 0; padding: 14px 22px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(202,122,235,0.36); cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.vbuy-bottom-btn:active { transform: translateY(1px); }

/* ── 寄餐券結帳頁 ── */
.vchk-page {
  background: #faf1fd;
  min-height: calc(100vh - var(--header-h) - 60px);
  padding-bottom: 110px;  /* 留底部結帳列空間 */
}
body.has-bottom-nav .vchk-page { padding-bottom: 110px; }
.vchk-header {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  padding: 22px 20px 18px;
  border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
  margin-bottom: 12px;
}
.vchk-header-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.vchk-header-sub { margin: 0; font-size: 13px; opacity: 0.92; }

.vchk-section { background: #fff; padding: 14px 18px; margin-bottom: 10px; }
.vchk-section-title {
  margin: 0 0 10px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.vchk-item { display: flex; gap: 12px; align-items: flex-start; }
.vchk-thumb-img {
  width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.vchk-thumb-fallback {
  background: linear-gradient(135deg, #EFE3CB, #DCC9A0);
  display: flex; align-items: center; justify-content: center;
}
.vchk-thumb-fallback i { font-size: 32px; color: rgba(202,122,235,0.55); }
.vchk-item-info { flex: 1; min-width: 0; }
.vchk-item-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.vchk-item-meta { font-size: 12px; color: var(--text-muted); }
.vchk-item-price {
  font-size: 16px; font-weight: 700; color: #ef4444; flex-shrink: 0;
}

.vchk-buyer { font-size: 14px; }
.vchk-buyer-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid #f3f4f6;
}
.vchk-buyer-row:last-of-type { border-bottom: none; }
.vchk-buyer-row span:first-child { color: var(--text-muted); }
.vchk-buyer-row span:last-child { font-weight: 600; }
.vchk-buyer-note {
  margin-top: 8px; font-size: 12px; color: var(--primary);
  background: #faf1fd; padding: 8px 10px; border-radius: 6px;
}

.vchk-pay-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 2px solid #f3f4f6; border-radius: 12px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
}
.vchk-pay-option.active {
  border-color: #ca7aeb; background: #faf1fd;
}
.vchk-pay-option input { margin-right: 4px; }
.vchk-pay-info { flex: 1; }
.vchk-pay-label { font-size: 15px; font-weight: 700; }
.vchk-pay-desc { font-size: 12px; color: var(--text-muted); }
.vchk-pay-icon { font-size: 28px; color: var(--text-muted); }
.vchk-pay-option.active .vchk-pay-icon { color: #ca7aeb; }

.vchk-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 720px; margin: 0 auto;
  background: #fff; padding: 14px; z-index: 101;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.10);
}
body.has-bottom-nav .vchk-bottom { bottom: 60px; }
.vchk-bottom-summary { margin-bottom: 10px; }
.vchk-bottom-orig {
  font-size: 11px; color: var(--text-muted); text-decoration: line-through;
}
.vchk-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; padding: 4px 0;
}
.vchk-bottom-row strong { font-size: 22px; font-weight: 800; color: #ef4444; }
.vchk-bottom-savings {
  font-size: 12px; color: #b91c1c; background: #fee2e2;
  padding: 3px 10px; border-radius: 999px; display: inline-block;
}
.vchk-bottom-btn {
  width: 100%; padding: 14px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(202,122,235,0.36); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.vchk-bottom-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.vchk-bottom-btn:active { transform: translateY(1px); }

/* ── 通用浮動視窗 (UI.confirm / UI.alert) ── */
.ui-modal-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
.ui-modal-backdrop.open { opacity: 1; pointer-events: auto; }
.ui-modal-card {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 360px;
  padding: 24px 22px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  transform: translateY(8px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ui-modal-backdrop.open .ui-modal-card { transform: translateY(0) scale(1); }
.ui-modal-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #f5e8fc; color: #ca7aeb; font-size: 30px;
}
.ui-modal-icon.danger { background: #fee2e2; color: #dc2626; }
.ui-modal-icon.success { background: #dcfce7; color: #16a34a; }
.ui-modal-title {
  font-size: 17px; font-weight: 800; color: #1f2937;
  text-align: center; margin-bottom: 10px;
}
.ui-modal-msg {
  font-size: 14px; color: #4b5563; line-height: 1.6;
  text-align: center; margin-bottom: 20px;
  white-space: pre-wrap;
}
.ui-modal-actions {
  display: flex; gap: 10px;
}
.ui-modal-btn {
  flex: 1; padding: 12px; border: none; border-radius: 999px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.ui-modal-btn:active { transform: translateY(1px); }
.ui-modal-btn-ghost {
  background: #f3f4f6; color: #6b7280;
}
.ui-modal-btn-ghost:hover { background: #e5e7eb; }
.ui-modal-btn-primary {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  box-shadow: 0 3px 10px rgba(202,122,235,0.32);
}
.ui-modal-btn-danger {
  background: #dc2626; color: #fff;
  box-shadow: 0 3px 10px rgba(220,38,38,0.32);
}
.ui-modal-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; font-size: 16px;
  outline: none; transition: border-color 0.15s;
  margin-top: 4px; background: #fff;
  box-sizing: border-box;
}
.ui-modal-input:focus { border-color: #ca7aeb; }

/* ═══════════════════════════════════════════════════════════
   歷史訂單
   ═══════════════════════════════════════════════════════════ */
.order-card {
  background: white; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: pointer;
}
.order-card:active { box-shadow: var(--shadow-hover); }
.order-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-date { font-size: 13px; color: var(--text-muted); }
.order-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.order-status-pending { background: #FFF3CD; color: #856404; }
.order-status-info { background: #D1ECF1; color: #0C5460; }
.order-status-warning { background: #FFF3CD; color: #856404; }
.order-status-success { background: #D4EDDA; color: #155724; }
.order-status-muted { background: #E2E3E5; color: #383D41; }
.order-status-danger { background: #F8D7DA; color: #721C24; }
.order-card-body { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-items-preview { font-size: 14px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-total { font-size: 16px; font-weight: 700; color: var(--primary); margin-left: 12px; white-space: nowrap; }
.order-card-bottom { display: flex; justify-content: space-between; align-items: center; }
.order-store { font-size: 12px; color: var(--text-muted); }
.order-reorder-btn {
  background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.order-reorder-btn:active { background: var(--primary); color: white; }

/* ═══════════════════════════════════════════════════════════
   點數
   ═══════════════════════════════════════════════════════════ */
.points-balance-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: var(--radius); padding: 24px; margin-bottom: 16px; text-align: center;
}
.points-balance-label { font-size: 14px; opacity: 0.9; margin-bottom: 4px; }
.points-balance-value { font-size: 40px; font-weight: 800; }
.points-redeem-btn {
  margin-top: 16px; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px; padding: 8px 20px; font-size: 14px; cursor: pointer;
}
/* 舊會員(快一點)點數轉移入口 —— 點數頁餘額卡下方 */
.points-legacy-entry {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 16px; font-size: 14px; color: var(--text);
}
.points-legacy-entry span { flex: 1; }
.points-legacy-entry .bi-arrow-left-right { color: var(--primary); font-size: 18px; }
.points-legacy-entry .bi-chevron-right { color: #9ca3af; font-size: 14px; }

.points-list { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.points-list-title { font-size: 15px; font-weight: 600; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.points-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.points-item:last-child { border-bottom: none; }
.points-item-reason { font-size: 14px; color: var(--text); }
.points-item-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.points-item-right { font-size: 16px; font-weight: 700; white-space: nowrap; }
.points-earn { color: var(--success); }
.points-spend { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   個人資料
   ═══════════════════════════════════════════════════════════ */
.profile-page { max-width: 400px; margin: 0 auto; }
.profile-avatar-section { text-align: center; padding: 24px 0 16px; }
.profile-avatar { font-size: 72px; color: var(--primary); }
.profile-form { padding: 0 16px; }
.profile-form .login-label { margin-top: 12px; }
.profile-form .login-input { margin-bottom: 4px; }
.profile-form .login-btn { margin-top: 20px; }
.profile-info {
  margin: 24px 16px; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.profile-info-item {
  display: flex; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.profile-info-item:last-child { border-bottom: none; }
.profile-referral { font-weight: 700; color: var(--primary); letter-spacing: 2px; }

/* ═══════════════════════════════════════════════════════════
   優惠券
   ═══════════════════════════════════════════════════════════ */
.coupon-section-title { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.coupon-card {
  display: flex; background: white; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.coupon-left {
  width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary); color: white; padding: 12px 8px; text-align: center;
  border-right: 2px dashed rgba(255,255,255,0.3);
}
.coupon-discount { font-size: 16px; font-weight: 800; line-height: 1.2; }
.coupon-condition { font-size: 10px; opacity: 0.85; margin-top: 4px; }
.coupon-right { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.coupon-code { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: 1px; }
.coupon-expires { font-size: 11px; color: var(--text-muted); }
.coupon-use-btn {
  align-self: flex-start; margin-top: 4px;
  background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary);
  border-radius: 4px; padding: 4px 10px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.coupon-used .coupon-left, .coupon-expired .coupon-left { background: #ccc; }
.coupon-used, .coupon-expired { opacity: 0.6; }

/* AI 營養師首次提示 */
.ai-nut-tip {
  position: absolute; bottom: calc(100% + 8px); left: 12px; right: 12px;
  background: #27ae60; color: white; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: nutTipIn 0.3s ease; z-index: 50;
}
.ai-nut-tip::after {
  content: ''; position: absolute; bottom: -6px; left: 50%;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 6px solid #27ae60;
}

/* ═══════════════════════════════════════════════════════════
   AI 營養師面板
   ═══════════════════════════════════════════════════════════ */
.nut-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 400;
  opacity: 0; transition: opacity 0.3s;
}
.nut-sheet-overlay.open { opacity: 1; }
.nut-sheet-overlay.open .nut-sheet { transform: translateY(0); }
.nut-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-height: 88vh; background: white; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.3s ease-out;
}
.nut-sheet-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; font-size: 18px; font-weight: 700; color: #27ae60;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.nut-sheet-body { overflow-y: auto; padding: 16px 20px 32px; flex: 1; }
.nut-mode-tabs {
  display: flex; gap: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--primary); margin-bottom: 16px;
}
.nut-mode-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600;
  border: none; background: white; color: var(--primary); cursor: pointer;
}
.nut-mode-tab.active { background: var(--primary); color: white; }
.nut-section-label {
  font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px;
}
.nut-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.nut-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 2px solid var(--border); border-radius: 20px; font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.nut-chip:has(input:checked) { border-color: #27ae60; background: #e8f8f0; color: #27ae60; font-weight: 600; }
.nut-chip.allergen:has(input:checked) { border-color: #e74c3c; background: #fde8e8; color: #c0392b; }
.nut-chip input { display: none; }
.nut-form-row { margin-bottom: 12px; }
.nut-form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.nut-form-row input, .nut-form-row select {
  width: 100%; padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 15px; outline: none;
}
.nut-form-row input:focus, .nut-form-row select:focus { border-color: #27ae60; }
.nut-radio-group { display: flex; gap: 12px; }
.nut-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 15px; }
.nut-radio input { accent-color: #27ae60; width: 18px; height: 18px; }
.nut-calc-result {
  background: #e8f8f0; border-radius: 12px; padding: 14px; margin: 12px 0; color: #27ae60;
}
.nut-calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-size: 13px; margin-top: 8px; }
.nut-recommend-btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700; border: none;
  border-radius: 12px; background: linear-gradient(135deg,#27ae60,#2ecc71); color: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px;
}
.nut-recommend-btn:active { opacity: 0.85; }
/* 推薦結果卡片 */
.nut-result-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: white; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s;
}
.nut-result-card:active { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.nut-result-img {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  background: #f5f5f5 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.nut-result-body { flex: 1; min-width: 0; }
.nut-result-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.nut-result-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 2px; }
.nut-tag {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: #FFF3E0; color: #E65100;
}
.nut-tag.pro { background: #E3F2FD; color: #1565C0; }
.nut-tag.fib { background: #E8F5E9; color: #2E7D32; }
.nut-result-price { font-size: 13px; font-weight: 700; color: var(--primary); }
.nut-result-score {
  flex-shrink: 0; font-size: 13px; font-weight: 700; color: #27ae60;
  background: #e8f8f0; padding: 4px 8px; border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════
   營養日記頁面
   ═══════════════════════════════════════════════════════════ */
.nd-month-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 0; font-size: 17px; font-weight: 700;
}
.nd-month-nav button {
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%;
  background: white; font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.nd-calendar { background: white; border-radius: 14px; padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.nd-cal-header { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; font-size: 12px; color: #999; margin-bottom: 6px; }
.nd-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.nd-cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.nd-cal-cell.empty { cursor: default; }
.nd-cal-cell.has-data { background: #e8f8f0; }
.nd-cal-cell.over { background: #FFF3E0; }
.nd-cal-cell.today { border: 2px solid #27ae60; font-weight: 700; }
.nd-cal-cell.selected { background: #27ae60; color: white; }
.nd-cal-cell.selected .nd-cal-kcal { color: white; }
.nd-cal-day { font-size: 14px; }
.nd-cal-kcal { font-size: 9px; color: #27ae60; margin-top: 1px; }

.nd-section { background: white; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.nd-section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.nd-daily-bar { margin-bottom: 12px; }
.nd-daily-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.nd-daily-track { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.nd-daily-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.nd-daily-macros { display: flex; gap: 12px; font-size: 12px; color: #666; margin-top: 6px; }

.nd-meal-group { margin-bottom: 12px; }
.nd-meal-label { font-size: 14px; font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.nd-meal-item { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }

.nd-body-list { font-size: 13px; }
.nd-body-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; align-items: center; }
.nd-body-date { color: #999; min-width: 40px; }
.nd-body-val { font-weight: 600; min-width: 55px; }
.nd-body-note { color: #999; font-size: 11px; }

.nd-record-btn {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700; border: 2px solid #27ae60;
  background: white; color: #27ae60; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   營養師功能頁
   ═══════════════════════════════════════════════════════════ */
.nt-tabs {
  display: flex; gap: 0; border-radius: 12px; overflow: hidden;
  border: 2px solid #27ae60; margin-bottom: 16px;
}
.nt-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600;
  border: none; background: white; color: #27ae60; cursor: pointer;
}
.nt-tab.active { background: #27ae60; color: white; }
.nt-card {
  background: white; border-radius: 14px; padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.nt-card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

/* 圓環圖 */
.nt-ring-row { display: flex; align-items: center; gap: 20px; }
.nt-ring {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--color) calc(var(--pct) * 1%), #eee calc(var(--pct) * 1%));
  display: flex; align-items: center; justify-content: center;
}
.nt-ring-inner {
  width: 88px; height: 88px; border-radius: 50%; background: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.nt-ring-val { font-size: 24px; font-weight: 700; color: var(--text); }
.nt-ring-unit { font-size: 12px; color: #999; }
.nt-ring-info { font-size: 14px; line-height: 2; }

/* 營養素長條 */
.nt-macro-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 8px;
}
.nt-macro-bar > div { min-width: 4px; transition: width 0.3s; }
.nt-macro-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #555; }

/* 今日餐點 */
.nt-meal-section { margin-bottom: 10px; }
.nt-meal-header {
  font-size: 14px; font-weight: 600; padding: 6px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  display: flex; justify-content: space-between;
}
.nt-meal-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; color: #555; }

/* 週報長條圖 */
.nt-bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 0 4px; }
.nt-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.nt-bar { width: 100%; border-radius: 6px 6px 0 0; min-height: 4px; transition: height 0.3s; }
.nt-bar-val { font-size: 10px; color: #666; margin-bottom: 2px; min-height: 14px; }
.nt-bar-label { font-size: 11px; color: #999; margin-top: 4px; text-align: center; line-height: 1.2; }
.nt-week-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13px;
}
.nt-week-summary div { display: flex; justify-content: space-between; }

/* 身體趨勢圖 */
.nt-body-current { font-size: 14px; margin-bottom: 8px; }
.nt-line-chart {
  position: relative; height: 100px; margin: 12px 8px;
  border-bottom: 1px solid #eee; border-left: 1px solid #eee;
}
.nt-dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #27ae60; border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
}
.nt-dot-label {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: #27ae60; font-weight: 600; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   桌面版自適應（768px 以上）
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* 主內容區置中限寬 */
  #app { max-width: 960px; margin: 0 auto; }
  .page { padding: 20px 24px; }

  /* 頂部標題列 */
  #topHeader { padding: 0 24px; }
  #topHeader .brand-logo { font-size: 18px; }

  /* 分類標籤 */
  .category-tabs { padding: 0 8px; }
  .cat-tab { padding: 14px 22px; font-size: 15px; }

  /* 商品網格：2欄→3欄 */
  .product-grid.grid2 { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .product-grid.small .product-card { max-width: 100%; }

  /* 商品卡片放大 */
  .prod-name { font-size: 15px; }
  .prod-price { font-size: 15px; }

  /* 推薦橫幅項目放大 */
  .golden-item { width: 180px; }
  .golden-banner { margin: 16px 0; padding: 18px; }

  /* 購物車項目 */
  .cart-item .cart-img { width: 80px; height: 80px; }
  .cart-summary { padding: 20px; }

  /* 底部購物車條置中 */
  .cart-bar { max-width: 960px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }

  /* 結帳按鈕置中 */
  .btn-checkout { max-width: 960px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }

  /* 表單欄位 */
  .form-section { padding: 20px 24px; }

  /* 商品詳情頁：改為置中彈窗 */
  .product-detail-page {
    width: 560px; max-width: 90vw;
    left: 50% !important; right: auto !important;
    transform: translateX(100%);
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  }
  .product-detail-page.open { transform: translateX(-50%); }

  /* 底部導航列置中 */
  .bottom-nav { max-width: 960px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  body.has-bottom-nav .cart-bar { left: 50%; transform: translateX(-50%); }

  /* AI 營養師面板 — 桌面置中 */
  .nut-sheet { max-width: 560px; left: 50%; transform: translateX(-50%) translateY(100%); border-radius: 20px 20px 0 0; }
  .nut-sheet-overlay.open .nut-sheet { transform: translateX(-50%) translateY(0); }
}

/* 大螢幕（1200px 以上）*/
@media (min-width: 1200px) {
  #app { max-width: 1100px; }
  .cart-bar, .btn-checkout, .bottom-nav { max-width: 1100px; }
  body.has-bottom-nav .cart-bar { max-width: 1100px; }

  /* 商品網格：3欄→4欄 */
  .product-grid.grid2 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* 大卡版面也用網格 */
  .product-grid.big { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* 推薦橫幅項目更大 */
  .golden-item { width: 200px; }

  /* 商品詳情頁更寬 */
  .product-detail-page { width: 640px; }
}


/* ═══════════════════════════════════════════════════════
   首頁改版樣式
   ═══════════════════════════════════════════════════════ */

.home-page { padding-bottom: 20px; }

/* ── Header：天氣 + 條碼 ── */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: white;
}
.home-header-left {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: #333;
}
.home-city { font-weight: 600; }
.home-weather-icon { font-size: 16px; }
.home-weather-temp { font-weight: 600; color: var(--primary); }
.home-weather-rain { font-size: 11px; color: #999; }
.home-header-right {
  display: flex; align-items: center; gap: 2px;
}
.home-barcode-btn {
  background: none; border: none; font-size: 22px; color: var(--primary);
  padding: 6px; cursor: pointer; border-radius: 8px; position: relative;
}
.home-barcode-btn:active { background: #f0f0f0; }
.home-cart-badge {
  position: absolute; top: 0; right: 0; background: var(--primary); color: white;
  border-radius: 10px; min-width: 16px; height: 16px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── 首頁隱藏頂部列時取消 padding-top + 紫白漸層底 ── */
body.home-no-header {
  padding-top: 0;
  background: linear-gradient(180deg, #ca7aeb 0%, #ca7aeb 18%, #ffffff 50%, #ffffff 100%) fixed;
}
body.home-no-header .home-page { padding-top: 8px; }

/* ── 首頁 header 透明 + 4 顆白色浮動按鈕 ── */
body.home-no-header .home-header {
  background: transparent;
  padding: 12px 14px;
}
body.home-no-header .home-header-left {
  background: #ffffff;
  padding: 7px 14px;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  color: #2A2A2A;
}
body.home-no-header .home-header-right { gap: 8px; }

/* 會員資訊塊(取代天氣) */
.home-member-name { font-weight:700; color:#1F2937; font-size:14px; }
.home-member-level {
  display:inline-flex; align-items:center; gap:3px;
  color:#fff; font-size:11px; font-weight:600;
  padding:2px 8px; border-radius:10px; white-space:nowrap;
}
.home-member-level i { font-size:11px; }
.home-member-points {
  display:inline-flex; align-items:center; gap:3px;
  font-size:13px; color:#374151;
}
.home-member-points strong { color:#F59E0B; font-weight:700; }
.home-member-cta { font-weight:600; color:#374151; font-size:13px; }
body.home-no-header .home-barcode-btn {
  background: #ffffff;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
body.home-no-header .home-barcode-btn:active { background: #f3f3f3; }

/* ── 商品分類圓圈(v2.46.x — McD-style)── */
.home-cat-row {
  display: flex; justify-content: space-around; align-items: flex-start;
  background: #fff; border-radius: 16px;
  margin: 6px 14px 12px; padding: 12px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow-x: auto;
  scrollbar-width: none;
}
.home-cat-row::-webkit-scrollbar { display: none; }
.home-cat {
  flex: 1; min-width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: transform 0.1s;
  padding: 2px 0;
}
.home-cat:active { transform: scale(0.94); }
.home-cat-circle {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f5e8fc; color: var(--cat-color, #ca7aeb);
  font-size: 24px;
  transition: all 0.2s;
}
.home-cat:active .home-cat-circle,
.home-cat.active .home-cat-circle {
  background: var(--cat-color, #ca7aeb); color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: scale(1.05);
}
.home-cat-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}

/* ── 廣告輪播 ── */
.home-banner-carousel {
  position: relative; overflow: hidden; border-radius: 12px;
  margin: 8px 16px 12px;
}
.banner-track {
  display: flex; transition: transform 0.35s ease;
}
.banner-slide { min-width: 100%; cursor: pointer; }
.banner-slide img {
  width: 100%; aspect-ratio: 16 / 7; object-fit: cover;
  border-radius: 12px; display: block;
}
.banner-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.banner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5); transition: background 0.2s;
}
.banner-dot.active { background: white; box-shadow: 0 0 4px rgba(0,0,0,0.3); }

/* ── 廣告區 + 外帶/內用選擇 ── */
.home-ad-fulfillment {
  position: relative; margin: 0 16px 32px;
}
.home-ad-banner {
  width: 100%; height: 180px; border-radius: 14px; overflow: hidden;
  background: transparent;
}
.home-ad-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block;
}
.home-ad-empty {
  width: 100%; height: 100%; border-radius: 14px;
  background: transparent;
  border: 2px dashed rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: rgba(0,0,0,0.32);
}
.home-ad-empty i { font-size: 48px; opacity: 0.5; }
.home-ad-empty span { font-size: 13px; font-weight: 500; letter-spacing: 1px; }
.home-fulfillment-float {
  position: absolute; bottom: -20px; left: 16px; right: 16px;
  display: flex; gap: 12px; z-index: 2;
}
.home-fulfillment-section { padding: 0 16px 12px; }
.fulfillment-btn {
  flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 14px; background: white;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; color: #1f2937;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.fulfillment-btn:active {
  background: #faf1fd;
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.fulfillment-btn i { font-size: 18px; color: var(--primary); }
.home-ad-fulfillment + .home-fulfillment-section { padding-top: 24px; }
.home-selected-store {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: #f0f7ff; border-radius: 8px; font-size: 13px; color: #1976d2;
}
.home-selected-store i { color: #1976d2; }

/* ── 門市選擇 Modal ── */
.store-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); animation: fadeIn 0.2s;
}
.store-modal {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-height: 85vh; background: white;
  border-radius: 20px 20px 0 0; overflow: hidden;
  animation: slideUp 0.3s ease; display: flex; flex-direction: column;
}
.store-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: 1px solid #f0f0f0;
}
.store-modal-header h3 { margin: 0; font-size: 18px; }
.store-modal-tabs {
  display: flex; padding: 0 16px; gap: 0; border-bottom: 1px solid #f0f0f0;
}
.smt-tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  font-size: 13px; font-weight: 500; color: #888; cursor: pointer;
  border-bottom: 3px solid transparent; transition: all 0.2s;
}
.smt-tab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.store-modal-list { flex: 1; overflow-y: auto; padding: 8px 16px; max-height: 55vh; }
.store-modal-item {
  padding: 12px; border-bottom: 1px solid #f5f5f5; cursor: pointer;
  border-radius: 8px; transition: background 0.15s;
}
.store-modal-item:active { background: #f8f9fa; }
.smi-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.smi-addr { font-size: 12px; color: #888; }
.smi-meta { display: flex; gap: 8px; font-size: 12px; margin-top: 4px; }
/* v2.47.86 合約失效/逾期 — 反灰不可點 */
.store-modal-item--blocked {
  background: #f3f4f6 !important;
  cursor: not-allowed !important;
  opacity: 0.75;
}
.store-modal-item--blocked .smi-name,
.store-modal-item--blocked .smi-addr { color: #9ca3af !important; }
.store-modal-item--blocked:active { background: #f3f4f6 !important; }

/* ── QR 掃碼 Modal ── */
.scanner-modal-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.7); animation: fadeIn 0.2s;
}
.scanner-modal {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: white; border-radius: 20px 20px 0 0;
  animation: slideUp 0.3s ease; overflow: hidden;
}

/* ── 經典商品水平滾動 ── */
.home-section { padding: 0 0 8px; }
.home-section-title {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px 8px; font-size: 16px; font-weight: 700; color: #333;
}
.home-product-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 8px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.home-product-scroll::-webkit-scrollbar { display: none; }
.home-product-card {
  flex-shrink: 0; width: 130px; background: white;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.15s;
}
.home-product-card:active { transform: scale(0.97); }
.hpc-img { width: 130px; height: 130px; overflow: hidden; background: #f8f8f8; }
.hpc-img img { width: 100%; height: 100%; object-fit: cover; }
.hpc-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 32px; color: #ddd;
}
.hpc-name { padding: 6px 8px 4px; font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpc-badge { padding: 0 8px 6px; font-size: 10px; color: var(--primary); }

/* v2.47.114 「經典必吃」Tab 內商品名稱顯示完整不裁切
   scope 到 #homeTabContent 只影響 Tab,不動上方「經典商品」水平滾動區塊 */
#homeTabContent .home-product-scroll .hpc-name {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}
/* v2.47.116 「經典必吃」Tab 售價「XX元起」樣式
   scope 到 #homeTabContent 只影響 Tab,不動上方水平滾動 */
#homeTabContent .home-product-scroll .hpc-price {
  padding: 2px 8px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ── 三 Tab ── */
.home-tab-bar {
  display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid #f0f0f0;
}
.home-tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  font-size: 13px; font-weight: 500; color: #888; cursor: pointer;
  border-bottom: 3px solid transparent; transition: all 0.2s;
}
.home-tab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.home-tab-content { min-height: 100px; padding: 12px 16px; }

/* ── 商品網格（Tab 內容）── */
.home-product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.home-grid-card {
  display: flex; gap: 10px; background: white; border-radius: 10px;
  padding: 8px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: transform 0.15s;
}
.home-grid-card:active { transform: scale(0.98); }
.hgc-img { width: 60px; height: 60px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f8f8f8; }
.hgc-img img { width: 100%; height: 100%; object-fit: cover; }
.hgc-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #ddd; }
.hgc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.hgc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hgc-price { font-size: 14px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.hgc-count { font-size: 11px; color: #999; }

/* ── 商品預覽懸浮視窗 ── */
.product-preview-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); animation: fadeIn 0.2s;
}
.product-preview {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: white; border-radius: 20px 20px 0 0;
  animation: slideUp 0.3s ease; overflow: hidden;
}
.pp-close {
  position: absolute; top: 12px; right: 16px; font-size: 24px;
  color: #999; cursor: pointer; z-index: 2;
  width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; background: rgba(255,255,255,0.9); border-radius: 50%;
}
.pp-img { width: 100%; height: 200px; object-fit: cover; }
.pp-img-placeholder {
  width: 100%; height: 200px; display: flex; align-items: center;
  justify-content: center; background: #f8f8f8;
}
.pp-body { padding: 16px; }
.pp-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.pp-cal { font-size: 13px; color: #999; margin-bottom: 4px; }
.pp-price { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.pp-actions { display: flex; gap: 10px; }
.pp-btn {
  flex: 1; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: none;
}
.pp-btn-outline { background: white; border: 2px solid var(--primary); color: var(--primary); }
.pp-btn-primary { background: var(--primary); color: white; }

/* ── 會員條碼 Modal ── */
.barcode-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6); display: flex;
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s;
}
.barcode-modal {
  background: white; border-radius: 20px; padding: 24px;
  width: 300px; text-align: center; animation: scaleIn 0.25s ease;
}
.barcode-header { margin-bottom: 16px; }
.barcode-name { font-size: 18px; font-weight: 700; margin-right: 8px; }
.barcode-level {
  font-size: 12px; padding: 2px 10px; border-radius: 12px;
  background: #fdf2e9; color: #e67e22; font-weight: 600;
}
.barcode-1d { margin: 12px 0 8px; }
.barcode-1d svg { width: 100%; height: auto; }
.barcode-qr { margin: 0 auto 8px; }
.barcode-qr canvas { display: block; margin: 0 auto; }
.barcode-number { font-size: 16px; font-weight: 600; letter-spacing: 2px; color: #333; margin-bottom: 16px; }
.barcode-close-btn {
  padding: 8px 32px; border: 1px solid #ddd; background: white;
  border-radius: 8px; font-size: 14px; color: #666; cursor: pointer;
}

/* ── 公告輪播 ── */
.home-ann-carousel {
  position: relative; overflow: hidden; border-radius: 10px;
  margin: 0 16px 8px; aspect-ratio: 16 / 5;
}
.ann-track { display: flex; transition: transform 0.35s ease; }
.ann-slide { min-width: 100%; }
.ann-slide img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.home-ann-text { padding: 0 16px; }
.ann-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #555; }

/* ── 公告卡片(大圖 + 標題 + 日期區間,垂直堆疊) ── */
.home-ann-chips {
  padding: 4px 16px 12px;
  display: flex; gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.home-ann-chips::-webkit-scrollbar { display: none; }
.home-ann-chip {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.home-ann-chip:active { transform: scale(0.96); }
.home-ann-chip.active {
  background: var(--primary, #ca7aeb);
  color: #fff;
  border-color: var(--primary, #ca7aeb);
}
.home-ann-cards {
  padding: 0 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.home-ann-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-ann-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.home-ann-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
  overflow: hidden;
}
.home-ann-card-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.home-ann-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 56px;
}
.home-ann-card-body {
  padding: 12px 16px 14px;
}
.home-ann-card-title {
  font-size: 16px; font-weight: 700; color: #1f2937;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-ann-card-date {
  margin-top: 6px;
  font-size: 13px; color: #9ca3af;
  letter-spacing: 0.3px;
}

/* ── 動畫 ── */
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ═══════════════════════════════════════════════════════════
   點數兌換頁(v2.46)
   ═══════════════════════════════════════════════════════════ */
.rdm-page {
  background: #faf1fd;
  min-height: calc(100vh - var(--header-h) - 60px);
  padding: 16px 14px 32px;
}
.rdm-balance-card {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  border-radius: 16px; padding: 18px 20px;
  margin-bottom: 18px; text-align: center;
  box-shadow: 0 6px 18px rgba(202,122,235,0.30);
}
.rdm-balance-lbl { font-size: 12px; opacity: 0.92; margin-bottom: 4px; }
.rdm-balance-val { font-size: 36px; font-weight: 800; line-height: 1.1; }
.rdm-balance-hint { font-size: 11.5px; opacity: 0.85; margin-top: 6px; }

.rdm-list-title {
  font-size: 15px; font-weight: 700; color: #1f2937;
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.rdm-list-title i { color: #ca7aeb; }

.rdm-list { display: flex; flex-direction: column; gap: 10px; }
.rdm-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px;
  padding: 10px 12px; border: 1px solid #ead5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.rdm-item.disabled { opacity: 0.6; }
.rdm-item-img {
  width: 64px; height: 64px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; background: #f5e8fc;
}
.rdm-item-img-fallback {
  display: flex; align-items: center; justify-content: center;
  color: #ca7aeb; font-size: 28px;
}
.rdm-item-body { flex: 1; min-width: 0; }
.rdm-item-name {
  font-size: 14.5px; font-weight: 700; color: #1f2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rdm-item-points {
  font-size: 16px; font-weight: 800; color: #ca7aeb;
  margin-top: 2px;
}
.rdm-item-points::after { content: ""; }
.rdm-item-limit { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.rdm-item-btn {
  background: linear-gradient(135deg, #ca7aeb, #8e2fc4); color: #fff;
  border: none; padding: 9px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  flex-shrink: 0; box-shadow: 0 3px 8px rgba(202,122,235,0.30);
}
.rdm-item-btn:active { transform: translateY(1px); }
.rdm-item-btn-disabled {
  background: #e5e7eb; color: #9ca3af;
  box-shadow: none; cursor: not-allowed;
}

.rdm-back {
  display: block; margin: 24px auto 0;
  background: transparent; border: 1px solid #e5e7eb;
  color: #6b7280; padding: 10px 28px; border-radius: 24px;
  font-size: 14px; cursor: pointer;
}
.rdm-back:active { background: #f9fafb; }

/* ═══════════════════════════════════════════════════════════
   會員條碼頁(v2.46)— 亮色模式(整頁白底,手機自動亮度會推上去)
   ═══════════════════════════════════════════════════════════ */
body.mb-bright-active {
  background: #fff !important;
}
/* 亮色模式下 bottom-nav 改成淺底深字,讓整個畫面更白(手機自動亮度感應器更敏感) */
body.mb-bright-active .bottom-nav {
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
body.mb-bright-active .bottom-nav-item { color: rgba(0,0,0,0.5); }
body.mb-bright-active .bottom-nav-item.active { color: #ca7aeb; }
body.mb-bright-active .bottom-nav-item.active i { filter: none; }
.mb-page {
  background: #fff;
  color: #1f2937; min-height: calc(100vh - var(--header-h) - 60px);
  padding: 18px 16px 24px;
}
.mb-qr-card {
  background: #fff; border-radius: 16px; padding: 22px;
  max-width: 360px; margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid #f3f4f6;
}
.mb-qr-wrap { display: flex; justify-content: center; }
.mb-bar {
  height: 4px; background: #10b981; margin-top: 14px;
  border-radius: 2px; transition: width 1s linear, background 0.3s;
}
.mb-meta { text-align: center; margin-bottom: 14px; }
.mb-name { font-size: 20px; font-weight: 700; color: #1f2937; }
.mb-hint {
  font-size: 12.5px; color: #6b7280; line-height: 1.6;
  text-align: center; margin-bottom: 18px;
}
.mb-countdown { font-weight: 600; }

/* ── 會員卡綁定資料 ── */
.mb-bindings {
  background: #f9fafb;
  border-radius: 14px; padding: 12px 10px 4px;
  max-width: 480px; margin: 0 auto 16px;
}
.mb-bindings-title {
  font-size: 13px; font-weight: 700; color: #1f2937;
  padding: 4px 6px 12px; display: flex; align-items: center; gap: 8px;
}
.mb-bindings-hint {
  font-size: 11px; font-weight: 400; color: #9ca3af; margin-left: auto;
}
.mb-bind-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  padding: 12px 14px; border-radius: 10px;
  margin-bottom: 6px; cursor: pointer;
  transition: background 0.15s;
  border: 1px solid #f3f4f6;
}
.mb-bind-row:active { background: #f9fafb; }
.mb-bind-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.mb-bind-body { flex: 1; min-width: 0; }
.mb-bind-label { font-size: 13px; color: #6b7280; }
.mb-bind-value {
  font-size: 14px; font-weight: 600; margin-top: 2px;
  color: #1f2937;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-bind-empty { font-weight: 400; color: #9ca3af; font-size: 13px; }
.mb-bind-arrow { color: #d1d5db; flex-shrink: 0; }

.mb-back-btn {
  display: block; margin: 18px auto 0;
  background: transparent; border: 1px solid #e5e7eb;
  color: #6b7280; padding: 10px 28px; border-radius: 24px;
  font-size: 14px; cursor: pointer;
}
.mb-back-btn:active { background: #f9fafb; }

/* 優惠券選擇列表(極致緊湊版) */
.mb-coupon-pick {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px; border-radius: 7px;
  background: #f8fafc; border: 1.5px solid transparent;
  cursor: pointer; margin-bottom: 3px;
  transition: all 0.15s;
}
.mb-coupon-pick:active { transform: scale(0.98); }
.mb-coupon-pick.selected {
  background: #f5e8fc; border-color: #ca7aeb;
}
.mb-coupon-pick-icon {
  width: 24px; height: 24px; border-radius: 50%;
  background: #f5e8fc; color: #a851d5;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.mb-coupon-pick.selected .mb-coupon-pick-icon {
  background: #ca7aeb; color: #fff;
}
.mb-coupon-pick-line {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 8px;
  white-space: nowrap; overflow: hidden;
}
.mb-coupon-pick-title {
  font-size: 13px; font-weight: 600; color: #1f2937;
  overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 1; min-width: 0;
}
.mb-coupon-pick-meta {
  font-size: 11px; color: #6b7280;
  flex-shrink: 0;
}
.mb-coupon-check {
  color: #ca7aeb; font-size: 14px; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   優惠頁(/promo)— Phase 1
   ═══════════════════════════════════════════════════════ */

.promo-page { padding: 12px 0 24px; }

/* ── 區 1:會員 QR ── */
.promo-qr-card {
  margin: 0 16px 18px;
  background: #fff;
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  text-align: center;
}
.promo-qr-wrap {
  display: flex; justify-content: center;
  margin-bottom: 12px;
}
.promo-qr-caption {
  font-size: 14px;
  font-weight: 700;
  color: #6f4fcc;
  background: #f5e8fc;
  padding: 8px 16px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center; gap: 6px;
}
.promo-qr-caption i { color: #ca7aeb; }
.promo-qr-counter {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 10px;
}

/* 未登入版 */
.promo-qr-guest {
  padding: 30px 18px 22px;
}
.promo-qr-icon {
  font-size: 54px;
  color: #ca7aeb;
  opacity: 0.55;
  margin-bottom: 10px;
}
.promo-qr-guest-title {
  font-size: 15px; font-weight: 700; color: #4b5563;
  margin-bottom: 8px;
}
.promo-qr-guest .promo-qr-caption { margin-bottom: 16px; }
.promo-qr-login {
  background: linear-gradient(135deg, #ca7aeb 0%, #8e2fc4 100%);
  color: #fff; border: none;
  padding: 11px 28px;
  border-radius: 100px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(202,122,235,0.30);
}
.promo-qr-login:active { transform: translateY(1px); }

/* ── 共用區塊樣式 ── */
.promo-section { margin-bottom: 22px; }
.promo-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px 10px;
}
.promo-section-title {
  font-size: 16px; font-weight: 700; color: #1f2937;
  display: inline-flex; align-items: center; gap: 6px;
}
.promo-section-title i { color: #ca7aeb; font-size: 17px; }
.promo-section-more {
  font-size: 12px; color: #ca7aeb; cursor: pointer;
  display: inline-flex; align-items: center; gap: 2px;
}
.promo-empty-mini {
  padding: 24px 16px; text-align: center;
  color: #9ca3af; font-size: 13px;
}

/* ── 區 2:回饋區橫向卡片 ── */
.promo-redeem-scroll {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scrollbar-width: none;
}
.promo-redeem-scroll::-webkit-scrollbar { display: none; }
.promo-redeem-card {
  flex-shrink: 0;
  width: 140px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none; color: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s;
  display: flex; flex-direction: column;
}
.promo-redeem-card:active { transform: scale(0.97); }
.promo-redeem-img {
  width: 100%; aspect-ratio: 1 / 1;
  background: #faf1fd; overflow: hidden;
}
.promo-redeem-img img { width: 100%; height: 100%; object-fit: cover; }
.promo-redeem-img-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #ca7aeb; opacity: 0.5;
}
.promo-redeem-pts {
  margin: 8px 10px 2px;
  font-size: 13px; font-weight: 800;
  color: #8e2fc4;
}
.promo-redeem-name {
  margin: 0 10px 10px;
  font-size: 12px; font-weight: 600;
  color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 區 3:限時優惠分類 tab + 空狀態 ── */
.promo-cat-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.promo-cat-tabs::-webkit-scrollbar { display: none; }
.promo-cat-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid #ead5f5;
  background: #fff;
  color: #6b7280;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.promo-cat-tab.active {
  background: linear-gradient(135deg, #ca7aeb 0%, #a851d5 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 8px rgba(202,122,235,0.30);
}
.promo-limited-empty {
  margin: 0 16px;
  background: #fff;
  border-radius: 14px;
  padding: 34px 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.promo-limited-empty i {
  font-size: 44px;
  color: #ca7aeb; opacity: 0.55;
}
.promo-limited-empty-title {
  margin-top: 10px;
  font-size: 15px; font-weight: 700; color: #4b5563;
}
.promo-limited-empty-sub {
  margin-top: 6px;
  font-size: 12px; color: #9ca3af;
  line-height: 1.5;
}

/* ── 限時優惠卡片 ── */
.promo-limited-list { padding: 0 16px; }
.promo-card {
  display: flex; gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-decoration: none; color: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.promo-card:active { transform: scale(0.98); }
.promo-card-img {
  width: 100px; height: 100px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #faf1fd;
}
.promo-card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.promo-card-img-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #ca7aeb; opacity: 0.6;
  font-size: 32px;
}
.promo-card-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.promo-card-title {
  font-size: 14px; font-weight: 700; color: #1f2937;
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-clamp: 1;
}
.promo-card-desc {
  font-size: 11.5px; color: #6b7280;
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  margin-bottom: 6px;
}
.promo-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto;
  padding-bottom: 4px;
}
.promo-card-price {
  font-size: 15px; font-weight: 800;
  color: #ca7aeb;
}
.promo-card-price-line {
  display: flex; align-items: baseline; gap: 6px;
}
.promo-card-orig {
  font-size: 11px; color: #9ca3af;
  text-decoration: line-through;
}
.promo-card-stock {
  font-size: 11px; color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 100px;
}
.promo-card-action {
  margin-top: 6px;
  font-size: 12px; font-weight: 700;
  color: #8e2fc4;
  display: inline-flex; align-items: center; gap: 4px;
}
.promo-card-action i { font-size: 13px; }

/* ── 立即使用:雙按鈕選擇 ── */
.promo-use-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.promo-use-btn {
  border: none; cursor: pointer;
  border-radius: 12px;
  padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  transition: transform 0.1s, box-shadow 0.15s;
}
.promo-use-btn:active { transform: scale(0.97); }
.promo-use-btn i { font-size: 26px; }
.promo-use-btn-cart {
  background: linear-gradient(135deg, #ca7aeb 0%, #8e2fc4 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(202,122,235,0.25);
}
.promo-use-btn-qr {
  background: #faf1fd;
  color: #6f4fcc;
  border: 1.5px solid #ead5f5;
}

/* ── 立即使用:QR 顯示 ── */
.promo-use-qr {
  display: flex; justify-content: center;
  padding: 16px;
  background: #faf1fd;
  border-radius: 14px;
}


/* ����������������������������������������������������������������������������������������������������������������������
   v2.47.27 �ୱ�j��(/shop�B�u�W�I�\���A�t�q���ù�)
   �쥻�� 768/1200 breakpoint �w�s�b,�o�h�A�w��j�ù��[�j
   ���������������������������������������������������������������������������������������������������������������������� */

/* ���O��V / �p�ୱ (1024px+) */
@media (min-width: 1024px) {
  #app { max-width: 1080px; }
  .cart-bar, .btn-checkout { max-width: 1080px; }
  body.has-bottom-nav .cart-bar { max-width: 1080px; }

  /* �ӫ~ grid2:4 �� */
  .product-grid.grid2 { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  /* �j�d�����]����� */
  .product-grid.big { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* �s�i��������,�K�Q�� */
  .banner-slide img { max-height: 280px; }

  /* �����������Զ}���Z */
  .home-cat-row { padding: 16px 24px; gap: 8px; }
  .home-cat-circle { width: 60px; height: 60px; font-size: 28px; }
  .home-cat-label { font-size: 13px; }

  /* �������˾���d����j */
  .golden-item { width: 200px; }
}

/* �ୱ (1280px+) �X �쥻 1200 �[�j */
@media (min-width: 1280px) {
  #app { max-width: 1280px; }
  .cart-bar, .btn-checkout { max-width: 1280px; }
  body.has-bottom-nav .cart-bar { max-width: 1280px; }

  .product-grid.grid2 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .product-grid.big   { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  .banner-slide img { max-height: 320px; }

  /* �ӫ~�Ա����ԭ��O�[�e */
  .product-detail-page { width: 720px; }
}

/* �j�ù� (1600px+) */
@media (min-width: 1600px) {
  #app { max-width: 1440px; }
  .cart-bar, .btn-checkout { max-width: 1440px; }
  body.has-bottom-nav .cart-bar { max-width: 1440px; }

  .product-grid.grid2 { grid-template-columns: repeat(6, 1fr); }
  .product-grid.big   { grid-template-columns: repeat(3, 1fr); }

  .banner-slide img { max-height: 360px; }
}

/* �ୱ�q�� �X ���� hover �ĪG,�� PC �ާ@��۵M */
@media (hover: hover) and (min-width: 1024px) {
  .product-card { transition: transform .15s, box-shadow .15s; }
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .cat-tab { transition: color .15s, background .15s; }
  .cat-tab:hover:not(.active) { background: #faf3fe; color: var(--primary); }
  .home-cat:hover .home-cat-circle {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  }
  .banner-slide:hover img { filter: brightness(1.03); }
  .store-card { transition: box-shadow .15s, transform .15s; }
  .store-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  }
  .btn-add-fab:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
}

/* �ӫ~�d���b�ୱ�U,�Ϥ��e����O������,�קK�Ԥӫ� */
@media (min-width: 1024px) {
  .product-grid.grid2 .prod-img { aspect-ratio: 1 / 1; height: auto; }
  .product-grid.big .prod-img   { aspect-ratio: 4 / 3; height: auto; }
}

/* ���b���P�ʪ������ୱ�m���d���� */
@media (min-width: 1024px) {
  .page { padding: 24px 32px; }
  .form-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f3f4f6;
    padding: 22px 26px;
    margin-bottom: 16px;
  }
  .cart-summary {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f3f4f6;
    padding: 22px 26px;
  }
  .store-banner { padding: 18px 24px; }
}

/* �ୱ�U,�������⺥�h�I�����������e�m�� */
@media (min-width: 1024px) {
  body.home-no-header {
    background: linear-gradient(180deg, #ca7aeb 0%, #ca7aeb 15%, #ffffff 45%, #ffffff 100%) fixed;
  }
  body.home-no-header #app {
    background: transparent;
  }
}


/* ��������������������������������������������������������������������������������������������������������������
   v2.47.27 [�̧�] ���i + ���������e�צP�B
   ������b�Ҧ��³W�h����,�~���л\�J�� 1200+ �� 1100px
   �������������������������������������������������������������������������������������������������������������� */
@media (min-width: 768px)  { .home-annbar, .bottom-nav { max-width: 960px !important; } }
@media (min-width: 1024px) { .home-annbar, .bottom-nav { max-width: 1080px !important; } }
@media (min-width: 1280px) { .home-annbar, .bottom-nav { max-width: 1280px !important; } }
@media (min-width: 1600px) { .home-annbar, .bottom-nav { max-width: 1440px !important; } }
