:root {
  --orange: #eb6100;
  --chili: #c62828;
  --ink: #1a1a1a;
  --muted: #666;
  --bg: #f7f3ef;
  --card: #fff;
  --line: #e8e0d8;
  --ok: #1b7f4e;
  --danger: #b42318;
  --header-bg: #fffaf6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}
body { padding-bottom: 72px; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--header-bg) 100%);
  color: var(--ink);
  padding: 12px 16px;
  border-bottom: 2px solid var(--chili);
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.06);
}
.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(198, 40, 40, 0.12);
}
.brand-text {
  min-width: 0;
  flex: 1;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--ink);
}
.page-title {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--chili);
  letter-spacing: 0.04em;
}
.shop-notes {
  margin: 12px 16px 0;
  padding: 10px 12px 10px 30px;
  list-style: decimal;
  background: rgba(198, 40, 40, 0.05);
  border: 1px solid rgba(198, 40, 40, 0.12);
  border-radius: 10px;
}
.shop-notes li {
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.shop-notes li + li {
  margin-top: 4px;
}
.shop-notes.hidden {
  display: none;
}

#view { padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.product {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}
.product img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}
.product .title { font-weight: 600; font-size: 15px; }
.product .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
}
.qty span { min-width: 20px; text-align: center; font-weight: 600; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 4px;
}
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}
textarea { min-height: 72px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.btn:disabled { opacity: 0.5; }
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.link {
  background: transparent;
  color: var(--orange);
  border: none;
  font-weight: 600;
}

.summary {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  font-size: 14px;
}
.summary.total {
  font-size: 18px;
  font-weight: 700;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0ebe4;
  font-size: 12px;
  color: var(--muted);
}
.pill.ok { background: #e5f6ee; color: var(--ok); }
.pill.warn { background: #fff4e5; color: #9a6700; }
.pill.chilled { background: #e3f2fd; color: #1565c0; }
.pill.frozen { background: #e8eaf6; color: #283593; }

.product .title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.product .title .pill { font-size: 11px; padding: 2px 7px; }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabs button {
  border: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--muted);
}
.tabs button.active {
  color: var(--orange);
  font-weight: 700;
}

.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 50;
  max-width: 90%;
}
.toast.hidden { display: none; }

.pay-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.pay-options label.option {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
}
.pay-options input { width: auto; }
.pay-note {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Bank remit success modal — light beige, no system alert URL bar */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 32, 24, 0.35);
}
.modal-sheet {
  position: relative;
  width: min(100%, 360px);
  background: #f7f1e8;
  color: #000;
  border-radius: 16px;
  border: 1px solid #e5d9c8;
  box-shadow: 0 16px 40px rgba(40, 32, 24, 0.18);
  padding: 14px 16px 16px;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5d9c8;
}
.modal-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.modal-brand {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.02em;
}
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #000;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.modal-close:active { background: rgba(0, 0, 0, 0.06); }
.modal-body { padding: 14px 2px 4px; }
.modal-body h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #000;
}
.modal-amount {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  color: #000;
  letter-spacing: 0.01em;
}
.modal-bank {
  margin: 0;
  padding: 12px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-radius: 12px;
}
.modal-bank div {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: #000;
}
.modal-bank div + div { margin-top: 8px; }
.modal-bank dt {
  margin: 0;
  color: #444;
  font-weight: 600;
}
.modal-bank dd {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}
.modal-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #000;
}
.modal-ok {
  margin-top: 10px;
  background: #000;
  color: #fff;
}
#bank-modal-copy-actions {
  margin-top: 14px;
}
#bank-modal-copy-actions.hidden {
  display: none;
}
#bank-modal .btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.modal-field-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}
.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fffaf4;
  color: #000;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.modal-actions .btn {
  margin-top: 0;
  border-radius: 10px;
  min-height: 46px;
}
.order-actions-card {
  padding-top: 12px;
  padding-bottom: 12px;
}
.order-actions-card .muted {
  margin: 8px 0 0;
}

/* Orders list + detail */
.order-list-hint {
  margin: 0 0 12px;
  font-size: 13px;
}
button.card.order-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
button.card.order-row:active {
  background: #fff8f2;
}
.order-row-main { flex: 1; min-width: 0; }
.order-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.order-row-total {
  margin-top: 8px;
  font-weight: 700;
  font-size: 15px;
}
.order-chevron {
  flex-shrink: 0;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--chili);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.order-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.order-amount {
  margin: 10px 0 6px;
  font-size: 22px;
  font-weight: 800;
}
.order-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.order-line:last-child { border-bottom: none; padding-bottom: 0; }
.order-line:first-child { padding-top: 0; }
.order-line-title { font-weight: 600; font-size: 14px; }
.order-line-price { font-weight: 600; white-space: nowrap; }
.addr-block {
  margin: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink);
}
.detail-kv {
  display: grid;
  gap: 8px;
}
.detail-kv div {
  display: grid;
  grid-template-columns: 3.6em 1fr;
  gap: 8px;
  font-size: 14px;
  align-items: start;
}
.detail-kv dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.detail-kv dd {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}
.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.order-actions .btn {
  margin-top: 0;
  border-radius: 8px;
  min-height: 46px;
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn.danger:active {
  background: rgba(180, 35, 24, 0.06);
}
