/* ============================================================
   LC 球道點餐 — Styles
   Mobile-first, max-width 480px
   ============================================================ */

:root {
  --bg:        #FAF6F1;
  --surface:   #FFFFFF;
  --primary:   #4A2C0A;
  --accent:    #C9773A;
  --ice:       #2A7FBF;
  --hot:       #C0392B;
  --text:      #1A1A1A;
  --text-sub:  #7A6A5A;
  --border:    #E8DDD3;
  --shadow:    0 1px 6px rgba(0,0,0,0.09);
  --radius:    12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, 'Noto Sans TC', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Top Banner (600×350) ── */
.top-banner-wrap {
  width: 100%;
  aspect-ratio: 600 / 350;
  background: var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.top-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-banner-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 13px; color: var(--text-sub); text-align: center; line-height: 1.6;
}

/* ── Banner 箭頭控制 ── */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  width: auto;
  height: auto;
  padding: 8px;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: color 0.3s;
}
.banner-arrow:hover {
  color: rgba(255, 255, 255, 0.8);
}
.banner-arrow--left {
  left: 8px;
}
.banner-arrow--right {
  right: 8px;
}

/* ── Banner 圓點指示器 ── */
.banner-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.banner-dot.active {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
}

/* ── Wrapper ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  max-width: 480px;
  margin: 0 auto;
}
.topbar__title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar__back {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 0 8px 0 0;
  display: flex; align-items: center; gap: 4px;
}
.topbar__back span { font-size: 15px; }

.cart-btn {
  position: relative;
  background: none; border: none;
  color: #fff; font-size: 24px; cursor: pointer;
  line-height: 1;
}
.cart-btn__badge {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Shop Closed Banner (固定在顶部，topbar 下方) ── */
#shopClosedBanner {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 999;
  background-color: #f8d7da;
  color: #721c24;
  padding: 12px;
  text-align: center;
  font-weight: bold;
  border-bottom: 2px solid #f5c6cb;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Steps ── */
.step { display: none; padding-bottom: 100px; padding-top: 48px; }
.step.active { display: block; }
/* 当关闭提示显示时，增加 padding-top */
#shopClosedBanner:not([style*="display:none"]) ~ #step1,
#shopClosedBanner:not([style*="display:none"]) ~ section {
  padding-top: 96px !important;
}

/* ── Category Section ── */
.category { margin-bottom: 8px; }

.category__header {
  padding: 18px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.category__title { font-size: 18px; font-weight: 700; color: var(--primary); }
.category__title-en { font-size: 12px; color: var(--text-sub); margin-top: 1px; }

/* ── Temp Toggle (category-wide) ── */
.temp-toggle {
  display: flex;
  gap: 8px;
  padding: 10px 16px 4px;
}
.temp-toggle__btn {
  flex: 1;
  padding: 7px 0;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-sub);
}
.temp-toggle__btn.ice.active  { background: var(--ice);  border-color: var(--ice);  color: #fff; }
.temp-toggle__btn.hot.active  { background: var(--hot);  border-color: var(--hot);  color: #fff; }

/* ── Item Card ── */
.item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.item-card__photo {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.item-photo-placeholder {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  background: var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--text-sub);
}
.item-card__info { flex: 1; min-width: 0; }
.item-card__name { font-size: 15px; font-weight: 600; }
.item-card__name-en { font-size: 11px; color: var(--text-sub); margin-top: 1px; }
.item-card__price { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 4px; }

/* Per-item temp mini toggle */
.mini-temp {
  display: flex; gap: 4px; margin-top: 6px;
}
.mini-temp__btn {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  color: var(--text-sub);
  transition: all .15s;
}
.mini-temp__btn.ice.active { background: var(--ice); border-color: var(--ice); color: #fff; }
.mini-temp__btn.hot.active { background: var(--hot); border-color: var(--hot); color: #fff; }

/* Qty control */
.qty-ctrl {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.qty-ctrl__btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 18px; font-weight: 300;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: background .15s;
}
.qty-ctrl__btn:active { background: var(--bg); }
.qty-ctrl__btn.add { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-ctrl__num { font-size: 15px; font-weight: 700; min-width: 20px; text-align: center; }

/* ── Item Badge (推薦 / 新品) ── */
.item-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.6;
}
.item-badge--rec  { background: var(--accent); color: #fff; }
.item-badge--new  { background: #2A8F8F;       color: #fff; }

/* ── Discount badge next to category title ── */
.category__discount {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Flavor Card (pour-over) ── */
.flavor-toggle {
  font-size: 12px; color: var(--accent);
  font-weight: 600; margin-top: 4px;
  cursor: pointer; text-decoration: underline dotted;
  display: inline-block;
}
.flavor-card {
  background: #FFF8F2;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 16px 10px;
  font-size: 13px;
}
.flavor-card__row { display: flex; gap: 6px; margin-bottom: 3px; }
.flavor-card__label { color: var(--text-sub); min-width: 48px; }
.flavor-card__value { color: var(--text); font-weight: 500; }
.flavor-card__flavors { margin-top: 6px; font-size: 14px; color: var(--primary); font-weight: 600; }

/* ── Combo Section ── */
.combo-section {
  background: #F3EBE3;
  padding-bottom: 8px;
}
.combo-section .category__header { border-bottom-color: #D9C9B8; background: transparent; }

.combo-coffee-select {
  display: flex; gap: 8px;
  padding: 10px 16px;
}
.combo-coffee-btn {
  flex: 1; padding: 10px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text-sub);
  transition: all .2s;
  text-align: center;
}
.combo-coffee-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.combo-hint {
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
  padding: 16px;
}

.combo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 8px;
}
.combo-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s;
  text-align: center;
  position: relative;
}
.combo-card.selected { border-color: var(--primary); }
.combo-card.in-cart  { border-color: var(--accent); }

.combo-photos {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  height: 64px;
  position: relative;
}
.combo-photo {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid #fff;
  position: absolute;
}
.combo-photo:first-child { left: 6px; z-index: 1; }
.combo-photo:last-child  { right: 6px; z-index: 2; }
.combo-photo-placeholder {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: var(--border);
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-sub);
  position: absolute;
}
.combo-photo-placeholder:first-child { left: 6px; z-index: 1; }
.combo-photo-placeholder:last-child  { right: 6px; z-index: 2; }

.combo-card__food { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.combo-card__price { font-size: 18px; font-weight: 800; color: var(--primary); }
.combo-card__savings {
  display: inline-block;
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.combo-card__qty {
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ── Floating Cart Bar ── */
.cart-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center;
  padding: 12px 16px;
  gap: 12px;
  z-index: 200;
  transition: transform .3s ease;
}
.cart-bar.hidden { transform: translateX(-50%) translateY(100%); }
.cart-bar__left { flex: 1; font-size: 14px; font-weight: 600; }
.cart-bar__discount {
  font-size: 11px; font-weight: 700;
  margin-top: 2px;
}
.cart-bar__discount--hint  { color: #F5D89A; }
.cart-bar__discount--saved { color: #7FFFB0; }
.cart-bar__total { font-size: 16px; font-weight: 800; }
.cart-bar__btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: 20px;
  padding: 10px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Step 2: Confirm ── */
.confirm-section { padding: 16px; }
.confirm-section + .confirm-section { padding-top: 0; }

.section-label {
  font-size: 13px; font-weight: 700;
  color: var(--text-sub); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 10px;
}

/* Order summary table */
.order-table { width: 100%; border-collapse: collapse; }
.order-table td { padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.order-table td:last-child { text-align: right; font-weight: 600; }
.order-table__total td { border-bottom: none; font-weight: 800; font-size: 16px; padding-top: 12px; }
.order-table__qty-cell { white-space: nowrap; }
.order-qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 16px; font-weight: 300;
  cursor: pointer;
  color: var(--primary);
  vertical-align: middle;
  line-height: 1;
}
.order-qty-btn.add { background: var(--primary); border-color: var(--primary); color: #fff; }
.order-qty-num { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; vertical-align: middle; }
.order-table__name { max-width: 140px; }
.order-table__temp {
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 8px;
  display: inline-block; margin-left: 4px;
}
.order-table__temp.ice { background: #EBF4FB; color: var(--ice); }
.order-table__temp.hot { background: #FDF0EE; color: var(--hot); }

/* Lane selector */
.floor-tabs {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.floor-tab {
  flex: 1; padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text-sub);
  transition: all .2s; text-align: center;
}
.floor-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.lane-panel { display: none; }
.lane-panel.active { display: block; }

.lane-select, .lane-input {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 15px;
  background: #fff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A6A5A' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.lane-input { background-image: none; }

.floor2-options { display: flex; flex-direction: column; gap: 8px; }
.dream-golf-btn {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer; color: var(--text-sub);
  text-align: center;
  transition: all .2s;
}
.dream-golf-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Payment */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.payment-btn {
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text-sub);
  text-align: center;
  transition: all .2s;
}
.payment-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Staff note */
.staff-note {
  text-align: center;
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.6;
  padding: 10px 0 4px;
}

/* Discount row in order table */
.order-table__discount td {
  padding: 6px 4px;
  font-size: 14px;
  color: var(--hot);
  border-bottom: 1px solid var(--border);
}

/* Submit btn */
.submit-btn {
  width: 100%; padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 17px; font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity .2s;
}
.submit-btn:disabled { opacity: .4; cursor: not-allowed; }
.submit-btn .spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Step 3: Done ── */
.done-page {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 40px 24px 24px;
  text-align: center;
}
.done-page__check { font-size: 56px; margin-bottom: 12px; }
.done-page__thanks { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.done-page__thanks-en { font-size: 14px; color: var(--text-sub); margin-bottom: 24px; }

.order-number-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 32px;
  margin-bottom: 8px;
}
.order-number-card__label { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.order-number-card__num { font-size: 52px; font-weight: 900; color: var(--primary); letter-spacing: 2px; }

.done-page__note {
  font-size: 14px; color: var(--text-sub);
  line-height: 1.7; margin-bottom: 28px;
  max-width: 300px;
}
.done-page__note--lg {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

.banner-wrap {
  width: 100%; max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.banner-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-placeholder { font-size: 13px; color: var(--text-sub); text-align: center; padding: 16px; }

.reorder-btn {
  padding: 14px 32px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.reorder-btn:active { background: var(--primary); color: #fff; }

/* ── Divider card group ── */
.card-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

/* ── Misc ── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
