/* 手工貢丸網站：前台樣式。版面與色票沿用 WordPress 主題「貢丸家」。 */
/* ===== 色票與字體（跟 WordPress 主題 my-theme/theme.json 相同） ===== */
:root {
  --base: #FBF6EE; --surface: #FFFFFF; --cream: #F3E9DA; --border: #E6D8C3;
  --muted: #8A7462; --text: #3D2A1C; --brown: #5A3A22; --accent: #C8402F; --accent-dark: #A5301F;
  --line: #06C755;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --content: 760px; --wide: 1120px; --gutter: 1.25rem; --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--base); color: var(--text); font: 1.0625rem/1.8 var(--sans); -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--serif); color: var(--brown); line-height: 1.35; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 6vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.35rem); }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }
.wrap--wide { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: .6em 1.7em; border: 2px solid transparent; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }
.btn--outline { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn--outline:hover { background: var(--brown); color: #fff; }
.btn--small { min-height: 38px; padding: .3em 1.2em; font-size: .95em; }
.btn--block { width: 100%; }
.btn--line { background: var(--line); }
.btn--line:hover { background: #05a84f; }
.btn--ghost { background: none; color: var(--accent); border: 0; padding-inline: 0; min-height: auto; }
.btn--ghost:hover { background: none; color: var(--accent-dark); text-decoration: underline; }
.btns { display: flex; flex-wrap: wrap; gap: .8rem; }
.price { color: var(--accent); font-weight: 700; font-size: 1.15em; }

/* ===== 頁首 ===== */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 246, 238, .95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--brown); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--brown); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav__links { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav__links a { color: var(--text); text-decoration: none; font-weight: 500; padding: .4rem 0; border-bottom: 2px solid transparent; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.nav__toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--brown); }
.nav__toggle svg { width: 26px; height: 26px; }
@media (max-width: 781px) {
  .nav__toggle { display: grid; place-items: center; }
  .nav__cta { display: none; }
  .nav__links {
    position: fixed; inset: 0; top: 0; z-index: 60; flex-direction: column; gap: 0;
    padding: calc(5rem + env(safe-area-inset-top, 0px)) 2rem 2rem; background: var(--base);
    font-size: 1.3rem;
  }
  .nav__links:not(.is-open) { display: none; }
  .nav__links a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--border); }
  .nav__close { position: fixed; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; z-index: 61; }
}
@media (min-width: 782px) { .nav__close { display: none; } }

/* ===== 頁面共用 ===== */
main { min-height: 60vh; }
.page { padding-block: 2.5rem 4rem; }
.page-title::after { content: ''; display: block; width: 48px; height: 4px; margin-top: .8rem; border-radius: 2px; background: var(--accent); }
.lead { font-size: clamp(1.15rem, 3vw, 1.3rem); color: var(--brown); }
.section { padding-block: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 2rem); }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title::after { content: ''; display: block; width: 40px; height: 4px; margin: .7rem auto 0; border-radius: 2px; background: var(--accent); }
.more { text-align: center; font-weight: 700; margin-top: 1.5rem; }
.more a { text-decoration: none; }

/* ===== 首頁主視覺 ===== */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3.5rem, 10vw, 7rem);
  background:
    radial-gradient(circle at 88% 30%, rgba(200, 64, 47, .10) 0 120px, transparent 121px),
    radial-gradient(circle at 78% 78%, rgba(90, 58, 34, .08) 0 80px, transparent 81px),
    var(--cream);
}
.hero::after {
  content: ''; position: absolute; right: max(var(--gutter), calc(50% - 560px)); top: 50%;
  width: clamp(140px, 26vw, 300px); aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%;
  background:
    radial-gradient(circle at 36% 38%, #d9c2a1 0 11%, transparent 11.5%),
    radial-gradient(circle at 62% 34%, #cfb592 0 10%, transparent 10.5%),
    radial-gradient(circle at 50% 60%, #d4bb97 0 11%, transparent 11.5%),
    radial-gradient(circle at 30% 64%, #7a9a4a 0 2%, transparent 2.5%),
    radial-gradient(circle at 70% 56%, #7a9a4a 0 2%, transparent 2.5%),
    radial-gradient(circle at 50% 50%, #f6ead3 0 58%, #ffffff 58.5% 68%, var(--brown) 68.5% 71%, transparent 71.5%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .lead { max-width: 30em; }
@media (max-width: 781px) { .hero::after { top: 1.25rem; transform: none; width: 110px; opacity: .6; } }
.eyebrow {
  display: inline-block; padding: .2em .9em; border-radius: 999px; margin-bottom: .5rem;
  background: var(--accent); color: #fff; font-size: .9rem; font-weight: 700; letter-spacing: .08em;
}

.band { margin-top: clamp(2rem, 6vw, 4rem); padding-block: clamp(3rem, 8vw, 5rem); background: var(--brown); color: #F3E9DA; }
.band h2, .band h3 { color: #fff; }
.craft { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); text-align: center; }
.craft__num { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; line-height: 1; color: #e9a08f; margin: 0; }
.craft h3 { margin: .25rem 0 .4rem; }

.flow { list-style: none; padding: 0; margin: 0; counter-reset: flow; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.flow li { counter-increment: flow; position: relative; padding: 3.4rem 1.2rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.flow li::before {
  content: counter(flow); position: absolute; top: 1rem; left: 1.2rem;
  width: 1.9rem; height: 1.9rem; line-height: 1.9rem; text-align: center; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
}
.flow strong { display: block; color: var(--brown); font-size: 1.1rem; }

.stall { margin-top: clamp(2rem, 6vw, 3rem); padding-block: clamp(3rem, 8vw, 4.5rem); background: var(--cream); text-align: center; }

/* ===== 商品卡片 ===== */
.products { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card__body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.1rem; flex: 1; }
.card h3 { margin: 0; font-size: 1.25rem; }
.card__unit { margin: 0; color: var(--muted); font-size: .9rem; }
.card__desc { margin: .25rem 0 0; font-size: .95rem; }
.card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .75rem; }

/* ===== 規則表 ===== */
.rules { margin: 1rem 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rules div { display: grid; grid-template-columns: 6.5em 1fr; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); }
.rules div:last-child { border-bottom: 0; }
.rules dt { color: var(--muted); }
.rules dd { margin: 0; }

/* ===== FAQ ===== */
details.faq { padding: 1rem 1.2rem; margin-bottom: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details.faq summary { font-weight: 700; color: var(--brown); cursor: pointer; }
details.faq[open] summary { margin-bottom: .5rem; }
details.faq p { margin: 0; }

/* ===== 表單 ===== */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: .6em .8em;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font: inherit; font-weight: 400; color: inherit;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.req { color: var(--accent); }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fieldset { margin: 0 0 1.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fieldset legend { padding: 0 .5rem; font-weight: 700; font-size: 1.15rem; color: var(--brown); font-family: var(--serif); }

.alert { padding: 1rem 1.2rem; margin: 0 0 1.25rem; border-radius: 10px; background: var(--cream); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert--error { background: #fdecea; color: #8a1c10; border: 1px solid #f5c2bb; }
.alert--success { background: #eaf6ec; color: #1d5a2c; border: 1px solid #bfe3c6; }
.alert--tip { background: #fff8e6; border: 1px dashed #e0b85a; }
.alert:focus { outline: none; }

.pick { list-style: none; margin: 0; padding: 0; }
.pick__item { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .75rem .6rem; border-bottom: 1px dashed var(--border); border-radius: 10px; transition: background .15s; }
.pick__item:last-child { border-bottom: 0; }
.pick__item.is-picked { background: var(--base); }
.pick__img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.pick__info { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.pick__name { font-size: 1.05rem; }
.pick__unit { color: var(--muted); font-size: .85rem; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 1.3rem; color: var(--brown); border-radius: 50%; }
.stepper button:hover { background: var(--cream); }
.stepper input { width: 2.4em; border: 0; text-align: center; font: inherit; font-weight: 700; background: none; color: inherit; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.summary { padding: 1.25rem; border-radius: var(--radius); background: var(--brown); color: #fff; }
.summary dl { margin: 0 0 .5rem; }
.summary dl div { display: flex; justify-content: space-between; padding: .15rem 0; }
.summary dt { opacity: .85; }
.summary dd { margin: 0; font-weight: 700; }
.summary__total { font-size: 1.3rem; border-top: 1px solid rgba(255,255,255,.25); margin-top: .4rem; padding-top: .5rem !important; }
.summary__hint { margin: 0 0 .75rem; font-size: .9rem; min-height: 1.4em; color: #ffe6b0; }
.summary__hint.is-warning { color: #ffc2b8; font-weight: 700; }
.summary__note { margin: .6rem 0 0; font-size: .85rem; opacity: .85; }
@media (max-width: 781px) {
  .summary {
    position: sticky; bottom: 0; z-index: 20; margin-inline: calc(-1 * var(--gutter));
    border-radius: var(--radius) var(--radius) 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(0,0,0,.15);
  }
  .summary dl div:not(.summary__total) { display: none; }
  .summary__total { border-top: 0; margin-top: 0; padding-top: 0 !important; }
  .summary__note { display: none; }
  .pick__item { grid-template-columns: 52px 1fr auto; gap: .6rem; }
  .pick__img { width: 52px; height: 52px; }
}

/* ===== 訂單明細與狀態 ===== */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; border-radius: var(--radius); border: 1px solid var(--border); }
.items { width: 100%; border-collapse: collapse; background: var(--surface); }
.items th, .items td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); text-align: left; }
.items thead th { background: var(--cream); font-weight: 500; font-size: .9rem; }
.items .num { text-align: right; white-space: nowrap; }
.items tfoot th { font-weight: 400; color: var(--muted); }
.items tfoot tr:last-child th, .items tfoot tr:last-child td { color: inherit; font-weight: 700; border-bottom: 0; }
.items small { color: var(--muted); }
.items td:first-child { min-width: 6.5em; }

.order-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.order-head__label { display: block; font-size: .85rem; color: var(--muted); }
.order-head__no { font-size: 1.3rem; letter-spacing: .03em; }
.badge { display: inline-block; padding: .25em .9em; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.badge--pending { background: #fde7d9; color: #9a3412; }
.badge--accepted { background: #fef3c7; color: #92400e; }
.badge--paid { background: #dbeafe; color: #1e40af; }
.badge--shipped { background: #e0e7ff; color: #3730a3; }
.badge--completed { background: #dcfce7; color: #166534; }
.badge--cancelled { background: #f3f4f6; color: #6b7280; }

.steps { display: flex; list-style: none; margin: 0 0 1.5rem; padding: 0; counter-reset: step; }
.steps li { flex: 1; position: relative; text-align: center; font-size: .85rem; color: var(--muted); padding-top: 2.2rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; border-radius: 50%; background: var(--cream); color: var(--muted); font-weight: 700; }
.steps li + li::after { content: ''; position: absolute; top: .9rem; right: 50%; width: 100%; height: 2px; background: var(--border); }
.steps li.is-done, .steps li.is-current { color: var(--brown); font-weight: 700; }
.steps li.is-done::before { content: '✓'; background: var(--brown); color: #fff; }
.steps li.is-current::before { background: var(--accent); color: #fff; }
.steps li.is-done::after, .steps li.is-current::after { background: var(--brown); }

.pay { padding: 1.25rem; margin-bottom: 1.5rem; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.pay h3 { margin-top: 0; }
.bank { background: var(--base); border-radius: 10px; padding: .75rem 1rem; margin: .75rem 0; }
.bank div { display: flex; gap: 1rem; padding: .2rem 0; }
.bank dt { color: var(--muted); min-width: 3em; }
.bank dd { margin: 0; font-weight: 700; }

/* ===== 頁尾 ===== */
.footer { padding-block: 3rem 2rem; background: #3D2A1C; color: #E6D8C3; font-size: .9rem; }
.footer__cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer h3 { color: #fff; font-family: var(--sans); font-size: 1rem; margin-bottom: .5rem; }
.footer .brand { color: #fff; }
.footer a { color: #F3E9DA; }
.footer__copy { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.15); color: #a8927c; }

/* ===== 手機底部按鈕 ===== */
.mobile-bar { display: none; }
@media (max-width: 781px) {
  .mobile-bar {
    display: flex; gap: .6rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(251, 246, 238, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--border);
  }
  .mobile-bar a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; font-weight: 700; text-decoration: none; color: #fff; }
  .mobile-bar__order { background: var(--accent); }
  .mobile-bar__line { background: var(--line); }
  body.has-mobile-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ===== 其他 ===== */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: .6rem 1rem; background: var(--brown); color: #fff; }
.skip-link:focus { left: 1rem; top: 1rem; }
main:focus { outline: none; }
.empty { color: var(--muted); text-align: center; padding: 2em 0; }
.hp { position: absolute; left: -9999px; }
.lookup { max-width: 420px; }
.pay__form { margin-top: 1rem; }
.page ul:not([class]), .page ol:not([class]), .front-text ul:not([class]), .front-text ol:not([class]) { padding-left: 1.4em; margin: 0 0 1em; }
.page h2 { margin-top: 2rem; }
.page h3 { margin-top: 1.5rem; }
.page .btns, .page .rules, .page .flow, .page .products { margin-bottom: 1.5rem; }
.front-text { padding-block: 1.5rem; }

/* 首頁的區段放在一般內頁時，改成圓角卡片 */
.page .hero, .page .band, .page .stall { margin-block: 1.5rem; padding: 2rem 1.25rem; border-radius: var(--radius); }
.page .hero::after { display: none; }
.hero .btns { margin-top: 1.5rem; }
.stall .btns, .stall .btn--line { margin-top: .5rem; }

/* ===== 沒有照片時的佔位圖 ===== */
.placeholder { display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff8ec 0 18%, var(--cream) 60%, #eadbc4 100%); }
.placeholder span {
  display: grid; place-items: center; width: 42%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #efe1cc, #c9ad8a 70%, #a88761);
  color: var(--brown); font-family: var(--serif); font-weight: 700; font-size: clamp(1.2rem, 5vw, 2rem);
  box-shadow: 0 6px 16px rgba(90, 58, 34, .18);
}
.pick__img.placeholder span { font-size: 1.1rem; }
