/* 視覺依 2027 瑪家文健站桌曆／月曆：白底、淡黃框、嫩綠大數字、灰線稿、圓形色塊 */
:root {
  --yellow: #f0ea94;      /* 封面外框的淡黃 */
  --yellow-soft: #f8f5c9;
  --green: #97cd8b;       /* 「2027」的嫩綠 */
  --green-deep: #4f8f4a;  /* 按鈕用，白字看得清楚 */
  --peach: #f7c497;       /* 月曆封面的橘色塊 */
  --pink: #f2a7c9;        /* 週日欄的粉紅 */
  --orange: #e69a2e;      /* 「中華民國116年」的小字橘 */
  --red: #d7263d;         /* 假日紅 */
  --ink: #3f3d3a;         /* 日期數字的深灰 */
  --muted: #77726c;
  --line: #cfccc6;        /* 日曆格線 */
  --cell: #f5f5f3;        /* 週末格子的淺灰 */
  --round: 'Varela Round', 'Noto Sans TC', sans-serif;
  --body: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  padding-bottom: 96px;
  overflow-x: hidden;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; position: relative; }

h1, h2, h3 { font-family: var(--round); font-weight: 500; margin: 0; }

/* 段落標題：照日曆頁「01 JAN」的寫法 */
h2 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 1.25rem; letter-spacing: .08em; color: var(--ink);
  margin: 48px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
h2 .num { font-family: var(--round); font-size: 2.5rem; line-height: 1; color: var(--green); letter-spacing: 0; }

:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 2px; }

/* ── 示範資料提示 ── */
.demo-banner {
  background: var(--ink); color: #fff;
  text-align: center; font-size: .8125rem; padding: 5px 12px;
}

/* ── 開頭：桌曆封面 ── */
.hero { max-width: 560px; margin: 0 auto; }
.hero-cover { display: block; width: 100%; height: auto; }
.hero-text { display: flex; align-items: baseline; gap: 12px; padding: 18px 16px 0; }
.hero-brand { margin: 0; font-size: .9375rem; letter-spacing: .2em; color: var(--orange); }
.hero h1 { font-size: 1.75rem; letter-spacing: .12em; }

.intro { margin: 10px 0 0; }

/* 日曆頁角落那顆圓 */
#shop::before, .done::before {
  content: ''; position: absolute; z-index: -1; border-radius: 50%;
  width: 170px; height: 170px; right: -118px; top: 150px; background: var(--yellow);
}
.done::before { background: var(--pink); top: -70px; right: -112px; }

/* ── 商品 ── */
.stock-note { margin: 0 0 14px; font-size: .875rem; color: var(--muted); }
.stock-note.is-error { color: var(--red); }
.stock-note button {
  font: inherit; color: var(--green-deep); background: none; border: 0; padding: 0;
  text-decoration: underline; cursor: pointer;
}

.products { display: grid; gap: 0; }

/* 商品一格一格排，像日曆格：上面一條線 */
.card {
  display: grid; grid-template-columns: 112px 1fr; gap: 14px;
  border-top: 1px solid var(--line); padding: 16px 0;
}
.card:first-child { border-top: 0; padding-top: 4px; }
.card.is-set {
  border: 0; background: var(--yellow-soft); padding: 14px; margin-top: 8px;
  outline: 4px solid var(--yellow); outline-offset: -4px;
}
.card.is-off .card-img { filter: grayscale(1) opacity(.55); }

.card-img {
  width: 112px; height: 112px; overflow: hidden;
  background: var(--yellow-soft); position: relative; border: 1px solid var(--line);
}
.card-img img, .card-img svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-img .ph-note {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-size: .6875rem; color: var(--muted); letter-spacing: .1em;
}

.card-body { min-width: 0; display: flex; flex-direction: column; }
.card-name { font-size: 1.25rem; line-height: 1.3; letter-spacing: .06em; margin: 0; }
.card-desc { margin: 2px 0 8px; font-size: .875rem; color: var(--muted); line-height: 1.55; }

.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: auto; }
.price { font-family: var(--round); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.price.is-tba { font-family: var(--body); font-size: .9375rem; color: var(--muted); }
.left { font-size: .875rem; color: var(--green-deep); font-variant-numeric: tabular-nums; }
.left.is-low { color: var(--orange); }
.left.is-out { color: var(--red); font-weight: 700; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.limit { font-size: .75rem; color: var(--muted); white-space: nowrap; }

.stepper { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--ink); border-radius: 999px; }
.stepper button {
  width: 44px; height: 44px; border: 0; background: none; color: var(--ink);
  font-size: 1.375rem; line-height: 1; cursor: pointer; border-radius: 999px;
  touch-action: manipulation;
}
.stepper button:disabled { color: var(--line); cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-family: var(--round); font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.card.is-off .stepper { border-color: var(--line); }

/* ── 金額 ── */
.summary dl, .bank dl { margin: 0; }
.summary dl > div, .bank dl > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.summary dt, .bank dt { color: var(--muted); white-space: nowrap; }
.summary dd, .bank dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.summary .total { border-bottom: 0; padding-top: 12px; }
.summary .total dt { color: var(--ink); font-weight: 700; }
.summary .total dd { font-family: var(--round); font-size: 1.75rem; line-height: 1.2; color: var(--green-deep); }

/* ── 表單 ── */
.form-lead { margin: 0 0 16px; font-size: .9375rem; color: var(--muted); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 0;
  padding: 11px 12px; min-height: 48px; appearance: none;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input.short { max-width: 9em; letter-spacing: .2em; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(151, 205, 139, .5); }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.method { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.method legend { padding: 0; font-weight: 500; margin-bottom: 6px; }
.choice {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 8px 12px; border: 1px solid var(--line); margin-bottom: -1px; cursor: pointer; font-weight: 400;
}
.field .choice { margin-bottom: -1px; }
.choice:has(input:checked) { background: var(--yellow-soft); border-color: var(--ink); position: relative; }
.choice input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; accent-color: var(--green-deep); appearance: auto; flex: none; }
.choice small { display: block; font-size: .8125rem; color: var(--muted); }
.hint { margin: 4px 0 0; font-size: .8125rem; color: var(--muted); }
.err { margin: 4px 0 0; font-size: .875rem; color: var(--red); }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 0 0 14px; padding: 10px 12px; border-left: 4px solid var(--red);
  background: #fdecee; color: #8f1526; font-size: .9375rem;
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; width: 100%;
  background: var(--green-deep); color: #fff; border: 0; border-radius: 0;
  font: 700 1.0625rem var(--body); letter-spacing: .12em; text-decoration: none; cursor: pointer;
}
.btn-primary:hover { background: #3f7a3b; }
.btn-primary:disabled { background: #a9bfa6; cursor: not-allowed; }

/* ── 底部金額列 ── */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--yellow);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bar-inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar p { margin: 0; line-height: 1.3; }
.bar p span { display: block; font-size: .75rem; color: var(--ink); }
.bar p strong { font-family: var(--round); font-weight: 400; font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.bar .btn-primary { width: auto; min-height: 46px; }

/* ── 成功頁 ── */
.done { padding-top: 28px; }
.done:focus { outline: 0; }
.done h2 { border: 0; margin: 0; font-size: 1.5rem; }
.done-id-label { margin: 18px 0 0; font-size: .875rem; color: var(--orange); letter-spacing: .1em; }
.done-id { margin: 0; font-family: var(--round); font-size: 1.75rem; color: var(--green-deep); font-variant-numeric: tabular-nums; word-break: break-all; }
.bank { margin-top: 22px; background: var(--yellow-soft); outline: 4px solid var(--yellow); outline-offset: -4px; padding: 20px 20px 10px; }
.bank h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: .04em; margin-bottom: 4px; }
.bank dl > div:last-child { border-bottom: 0; }
.bank .strong { font-family: var(--round); font-size: 1.1875rem; }
.bank dd:has(.btn-copy) { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; }
.btn-copy {
  font: inherit; font-size: .8125rem; color: var(--ink);
  background: #fff; border: 1px solid var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.done-mail { margin: 22px 0 0; padding-left: 12px; border-left: 4px solid var(--green); font-weight: 500; }
.done-mail.is-warn { border-color: var(--red); }
.done-foot { margin: 10px 0 0; color: var(--muted); font-size: .9375rem; }

.foot { max-width: 560px; margin: 56px auto 0; padding: 0 16px; font-size: .8125rem; color: var(--muted); }

@media (min-width: 480px) {
  .card { grid-template-columns: 136px 1fr; }
  .card-img { width: 136px; height: 136px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
