/* ==========================================================================
   Simplete 團購站 — 設計系統

   品牌取樣自產品包裝:暖白瓶身 + 玫瑰金字。所以主色是銅金而不是常見的美妝粉,
   底色帶一點暖度(#faf7f4)而不是純白,讓去背的白色瓶身不會整個糊在背景裡。
   ========================================================================== */

:root {
  --bg: #faf7f4;
  --surface: #ffffff;
  --surface-alt: #f4efe9;
  --ink: #2e2a27;
  --ink-soft: #6f665f;
  --ink-faint: #a49a92;
  --line: #ece3d9;
  --line-strong: #d9c9b8;

  --brand: #b98a63;
  --brand-strong: #966842;
  --brand-soft: #f5eae0;

  --success: #3f7d5a;
  --success-soft: #e4f1e9;
  --danger: #b34a44;
  --danger-soft: #f8e6e4;
  --warn: #a97b2b;
  --warn-soft: #f8eed8;

  --font-body: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Noto Serif TC", Georgia, "Songti TC", serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 14px rgba(80, 58, 40, 0.07);
  --shadow-lift: 0 8px 28px rgba(80, 58, 40, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- 頂部 ---------- */
.announce {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: .85rem;
  padding: 8px 16px;
  letter-spacing: .02em;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: .06em;
  color: var(--brand-strong);
  font-weight: 400;
}
.logo:hover { text-decoration: none; }

/* 頁首的品牌鎖定:QQBELLE(主)+ 這一檔的商品品牌(次)。
   兩個品牌並置最怕變成「誰是誰」講不清楚,所以用大小拉開層級——
   QQBELLE 是經營這個站的公司(實體 logo、較大),simpleté 只是這一檔賣的東西。
   下一檔換品牌時只要換後半段。 */
.logo-lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-lockup:hover { text-decoration: none; }
.logo-mark { height: 26px; width: auto; display: block; }
.logo-campaign {
  font-family: var(--font-display); font-size: 1rem; letter-spacing: .04em;
  color: var(--brand-strong); white-space: nowrap;
  padding-left: 12px; border-left: 1px solid var(--line);
}
@media (max-width: 720px) {
  /* 手機上先保住 QQBELLE(客人要知道跟誰買),檔期名稱在 hero 的大字裡還會再出現 */
  .logo-mark { height: 22px; }
  .logo-campaign { font-size: .85rem; padding-left: 9px; }
}
@media (max-width: 420px) {
  .logo-campaign { display: none; }
}
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; font-size: .92rem; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--brand-strong); text-decoration: none; }

.cart-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-soft); color: var(--brand-strong);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem;
}

/* ---------- 通用元件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 22px; font-size: .95rem; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: #7f5734; color: #fff; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 6px 10px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

.tag {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 4px;
}
.tag-brand { background: var(--brand-soft); color: var(--brand-strong); }
.tag-save { background: var(--danger-soft); color: var(--danger); }
.tag-ok { background: var(--success-soft); color: var(--success); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-muted { background: var(--surface-alt); color: var(--ink-soft); }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.strike { text-decoration: line-through; color: var(--ink-faint); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }

.price { font-size: 1.35rem; font-weight: 700; color: var(--brand-strong); }
.price-lg { font-size: 1.8rem; }
.price small { font-size: .68em; font-weight: 600; }

.messages { margin: 16px 0; padding: 0; list-style: none; }
.messages li {
  padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: .92rem; border: 1px solid transparent;
}
.messages .success { background: var(--success-soft); color: var(--success); }
.messages .error   { background: var(--danger-soft);  color: var(--danger); }
.messages .info, .messages .warning { background: var(--warn-soft); color: var(--warn); }

/* ---------- 首頁 hero ---------- */
.hero {
  background: linear-gradient(160deg, #fdfaf7 0%, var(--brand-soft) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
  text-align: center;
}
.hero .eyebrow {
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--brand-strong); font-weight: 700; margin-bottom: 14px;
}
.hero h1 { font-family: var(--font-display); font-size: 2.3rem; font-weight: 400; }
.hero p { color: var(--ink-soft); max-width: 560px; margin: 0 auto 22px; }
.hero .countdown { font-weight: 700; color: var(--brand-strong); }

/* ---------- 商品格 ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.section-head h2 { font-family: var(--font-display); font-weight: 400; margin: 0; }
.section-head .sub { color: var(--ink-soft); font-size: .9rem; }

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.product-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s;
}
.product-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.product-card .thumb {
  aspect-ratio: 1 / 1; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product-card .thumb .placeholder { color: var(--ink-faint); font-size: .85rem; }
.product-card .body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.product-card h3 { margin: 0; font-size: 1rem; line-height: 1.45; }
.product-card h3 a { color: var(--ink); }
.product-card .contents { font-size: .82rem; color: var(--ink-soft); }
.product-card .contents li { margin: 0; }
.product-card .prices { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* ---------- 商品詳情 ---------- */
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 36px 0; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; gap: 24px; } }
.gallery-main {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.price-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.price-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: .92rem; }
.price-row.highlight { border-top: 1px dashed var(--line-strong); margin-top: 8px; padding-top: 12px; }
.qty-input { width: 76px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 1rem; text-align: center; font-family: inherit; }
.bullet-list { margin: 0; padding-left: 1.15em; color: var(--ink-soft); font-size: .92rem; }
.bullet-list li { margin-bottom: 5px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.table th, .table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: var(--surface-alt); font-size: .82rem; color: var(--ink-soft); font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- 表單 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field label .req { color: var(--danger); }
.field input, .field textarea, .field select {
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: .96rem; font-family: inherit; background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field .hint { font-size: .78rem; color: var(--ink-faint); }

/* ---------- 儀表板 ---------- */
.dash-header {
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 22px 0 0;
}
.dash-tabs { display: flex; gap: 4px; margin-top: 16px; }
.dash-tabs a {
  padding: 9px 16px; font-size: .9rem; color: var(--ink-soft);
  border-bottom: 2px solid transparent; font-weight: 600;
}
.dash-tabs a:hover { text-decoration: none; color: var(--brand-strong); }
.dash-tabs a.active { color: var(--brand-strong); border-bottom-color: var(--brand); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat .label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; letter-spacing: .02em; }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .note { font-size: .78rem; color: var(--ink-faint); margin-top: 2px; }
.stat.accent { background: linear-gradient(150deg, #fdfaf7, var(--brand-soft)); border-color: var(--line-strong); }
.stat.accent .value { color: var(--brand-strong); }

/* 級距進度條 */
.tier-track {
  position: relative; height: 12px; background: var(--surface-alt);
  border-radius: 999px; margin: 30px 0 8px; border: 1px solid var(--line);
}
.tier-fill {
  position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  border-radius: 999px;
}
.tier-marks { position: relative; height: 42px; }
.tier-mark { position: absolute; transform: translateX(-50%); text-align: center; font-size: .74rem; color: var(--ink-soft); }
.tier-mark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); margin: -26px auto 4px; border: 2px solid var(--surface); }
.tier-mark.reached .dot { background: var(--brand-strong); }
.tier-mark.reached { color: var(--brand-strong); font-weight: 700; }

/* 每日走勢 */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 8px; }
.spark .bar { flex: 1; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.spark .bar.has { background: var(--brand); }
.spark .bar:hover { background: var(--brand-strong); }
.spark-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-faint); margin-top: 6px; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88rem; background: var(--surface-alt); color: var(--ink);
}

.callout {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  padding: 13px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .9rem; color: var(--ink-soft);
}
.callout strong { color: var(--ink); }

/* ---------- 頁尾 ---------- */
.site-footer {
  margin-top: 56px; background: var(--ink); color: #cfc6bd;
  padding: 34px 0; font-size: .86rem;
}
.site-footer a { color: #e8dfd5; }
.site-footer .cols { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
/* 頁尾的 logo 是深底,原圖是黑字——反白處理才看得見 */
.footer-logo { height: 24px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .9; }
.footer-legal {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .78rem; color: #a1968c; line-height: 1.8;
}

@media (max-width: 680px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .site-header .inner { height: 56px; gap: 12px; }
  .nav { gap: 12px; font-size: .85rem; }
  .section { padding: 30px 0; }
}


/* ---------- 結帳:同上、配送方式 ---------- */
.same-as-buyer {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.same-as-buyer input { width: 16px; height: 16px; }

/* 組合商品的內含品項:品名靠左、原價靠右,才看得出「兩瓶單買要多少」 */
.bundle-items li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }

/* 配送方式做成兩張可點的卡片而不是下拉。
   宅配與超商取貨的資費、填的欄位、能不能貨到付款全都不一樣,
   藏在下拉裡客人不會察覺自己選了什麼。 */
.ship-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .ship-options { grid-template-columns: 1fr; } }
.ship-option {
  display: block; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s;
}
.ship-option:hover { border-color: var(--brand); }
.ship-option input { margin-right: 8px; }
.ship-option.is-active { border-color: var(--brand-strong); background: var(--brand-soft); }
.ship-option .title { font-weight: 700; font-size: .95rem; }
.ship-option .desc { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }

.store-box {
  margin-top: 14px; padding: 14px 16px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface-alt); font-size: .9rem;
}
.store-box.is-picked { border-style: solid; border-color: var(--success); background: var(--success-soft); }


/* ---------- 首頁橫幅 ---------- */
.banners { background: var(--surface); }
.banner { display: block; }
.banner img {
  display: block; width: 100%; height: auto;
  /* 橫幅圖片的比例由圖片自己決定,不要用 object-fit 硬裁——
     行銷排好的文字位置被裁掉之後,那張圖就白做了。 */
}
.banner + .banner { border-top: 1px solid var(--line); }

/* ---------- 商品頁輪播 ---------- */
.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: start; margin: 0;
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.88); color: var(--brand-strong);
  font-size: 1.5rem; line-height: 1; box-shadow: 0 1px 6px rgba(0,0,0,.14);
}
.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }
.gallery-arrow:hover { background: #fff; }

.gallery-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px;
}
.gallery-dots .dot {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.22);
}
.gallery-dots .dot.is-on { background: var(--brand); }

.gallery-thumbs {
  display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px;
}
.gallery-thumb {
  flex: 0 0 68px; height: 68px; padding: 0; cursor: pointer; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.gallery-thumb.is-on { border-color: var(--brand); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 商說圖 ---------- */
.product-manual figure { margin: 0; }
.product-manual img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  /* 手冊是很寬的跨頁,在窄畫面上會縮得很小——所以下面讓它可以橫向捲動看細節。 */
}
@media (max-width: 720px) {
  .product-manual figure, .product-manual > img { overflow-x: auto; }
  .product-manual img { min-width: 680px; }
}
