/* 新洽記商行 樣式表
   想改哪一區，搜尋下面的編號標題（例如「7. 首頁｜本季熱門商品」）即可找到。 */

/* ========================================
   0. 顏色、字體、版面寬度（改主色調從這裡改）
   ======================================== */
:root {
  --primary: #cda786;
  --red: #a83225;
  --ink: #2a211c;
  --muted: #6f625b;
  --paper: #fffaf2;
  --cream: #f3e6d5;
  --line: rgba(42, 33, 28, 0.16);
  --white: #ffffff;
  --font-serif: "Noto Serif TC", serif;
  --font-sans: "Noto Sans TC", sans-serif;
  --content: 1220px;
  --pad: max(24px, calc((100vw - var(--content)) / 2));
}


/* ========================================
   1. 基本設定與標題字級
   ======================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* 點選單跳到區塊時，留出頁首高度，標題不會被擋住 */
section[id] { scroll-margin-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.75;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
/* select、textarea 也要繼承字體，否則瀏覽器會用很小的預設字（iPhone 小於 16px 點下去還會自動放大畫面） */
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(205, 167, 134, 0.8);
  outline-offset: 3px;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  line-height: 1.25;
  letter-spacing: 0;
}
h1 { font-size: clamp(54px, 8vw, 116px); font-weight: 900; }
h2 { font-size: clamp(34px, 4vw, 58px); font-weight: 800; }
h3 { font-size: 28px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.section { padding: clamp(42px, 6vw, 78px) var(--pad); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.section-head > p { max-width: 450px; margin: 0; color: var(--muted); font-size: 20px; }
.section-head.centered { display: block; text-align: center; }
.center { margin-top: 26px; text-align: center; }


/* ========================================
   2. 按鈕
   ======================================== */
.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--red); border-color: var(--red); color: var(--white); }
.button.ghost { color: var(--white); border-color: rgba(255,255,255,0.8); }
.button.outline:hover { background: var(--ink); color: var(--white); }


/* ========================================
   3. 頂部公告
   ======================================== */
.announcement {
  position: relative;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px 54px;
  background: var(--red);
  color: var(--white);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
.announcement p { margin: 0; }
.announcement button {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0;            /* 「×」字元本身偏低，改用下面兩條線畫，才會和文字置中對齊 */
  transform: translateY(-50%);
  cursor: pointer;
}
.announcement button::before,
.announcement button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.announcement button::before { transform: translate(-50%, -50%) rotate(45deg); }
.announcement button::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.announcement button:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }


/* ========================================
   4. 頁首與選單
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: rgba(255, 250, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img {
  width: auto;
  height: 62px;
  object-fit: contain;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; font-weight: 900; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2vw, 34px); font-size: 17px; font-weight: 800; }
.site-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
/* 滑鼠移到選單項目（或鍵盤選取）時變色並加底線 */
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--red); border-bottom-color: var(--red); }
.nav-cta { padding: 8px 18px !important; background: var(--ink); color: var(--white); }
.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible { background: var(--red); color: var(--white); border-bottom-color: transparent; }
.menu-button { display: none; border: 0; background: transparent; }


/* ========================================
   5. 首頁｜主視覺
   ======================================== */
.hero {
  position: relative;
  min-height: calc(100vh - 112px);
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: clamp(80px, 10vw, 140px) var(--pad) 56px;
  color: var(--white);
}
.hero-bg, .hero-shade { position: absolute; inset: 0; height: 100%; }
/* 照片左右翻轉，讓紅色花生移到右側，不被左邊的文字擋住 */
.hero-bg { object-fit: cover; object-position: center 45%; transform: scaleX(-1); }
.hero-shade {
  background:
    linear-gradient(90deg, rgba(28,18,12,0.84), rgba(28,18,12,0.38) 52%, rgba(28,18,12,0.08)),
    linear-gradient(0deg, rgba(28,18,12,0.5), transparent 42%);
}
.hero-content { position: relative; max-width: 860px; z-index: 1; }
.hero-content .eyebrow { color: var(--primary); }
.hero-romanization {
  margin: 6px 0 0;
  color: #f1dfca;
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hero-lead { max-width: 760px; margin: 18px 0 28px; font-size: clamp(22px, 2.2vw, 32px); font-weight: 700; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-card {
  position: absolute;
  right: var(--pad);
  bottom: 84px; /* 留空間給右下角 IG / FB 按鈕 */
  z-index: 1;
  width: 170px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px 12px;
  background: var(--primary);
  color: var(--ink);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-card small { font-size: 14px; font-weight: 900; letter-spacing: 0.08em; }
.hero-card img { width: 118px; height: 118px; margin: 6px 0 2px; }
.hero-card-link {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(42, 33, 28, 0.3);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}
.hero-card[href]:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.25); }
.hero-card.no-link .hero-card-link { display: none; }


/* ========================================
   6. 首頁｜我們在意的三件事
   ======================================== */
.kitchen { background: var(--cream); }
.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.kitchen-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
}
.kitchen-grid img { height: 260px; object-fit: cover; }
.kitchen-grid h3 { padding: 20px 20px 0; }
.kitchen-grid p { margin: 10px 20px 22px; color: var(--muted); font-size: 19px; }


/* ========================================
   7. 首頁｜本季熱門商品
   ======================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 170px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
}
.product-image { height: 100%; background: var(--cream); }
.product-image img { height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.product-card:hover img { transform: scale(1.04); }
.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
}
.product-info {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}
.product-info h3 { font-size: 26px; }
.product-info p { margin: 0; color: var(--muted); font-size: 17px; }
.product-price { color: var(--red); font-size: 17px; font-weight: 900; }


/* ========================================
   8. 首頁｜送禮橫幅
   ======================================== */
.feature-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 470px;
  background: var(--ink);
  color: var(--white);
}
.feature-banner img { height: 100%; min-height: 470px; object-fit: cover; }
.feature-banner div { padding: clamp(34px, 6vw, 80px); }
.feature-banner p:not(.eyebrow) { max-width: 580px; color: #f1dfca; font-size: 22px; }


/* ========================================
   9. 首頁｜品牌故事
   ======================================== */
.intro {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  background: var(--paper);
}
.heritage-photo { margin: 0; }
.heritage-photo img { aspect-ratio: 4 / 3; object-fit: cover; border: 12px solid var(--cream); }
.intro-story p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 23px; }


/* ========================================
   10. 首頁｜最新消息
   ======================================== */
.news-list { border-top: 2px solid var(--ink); }
.news-item {
  width: 100%;
  display: grid;
  grid-template-columns: 150px 150px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 18px;
  padding: 22px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.2s ease, padding 0.2s ease;
}
.news-item:hover { padding-left: 18px; background: var(--cream); }
.news-item time, .news-category { font-size: 20px; font-weight: 900; }
.news-category { color: var(--red); }
.news-item h3 { font-size: 27px; }
.news-item span:last-child {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
}


/* ========================================
   11. 首頁｜活動花絮
   ======================================== */
.gallery { background: var(--cream); }
/* 左右滑動的相簿輪播：最後一本的下一本會回到第一本
   --per-view 是一次顯示幾本（平板、手機在下方 18、19 區調整） */
.gallery-carousel { --per-view: 3; --gap: 16px; position: relative; }
.gallery-viewport { overflow: hidden; touch-action: pan-y; cursor: grab; }
.gallery-viewport.dragging { cursor: grabbing; }
.gallery-track {
  display: flex;
  gap: var(--gap);
  transition: transform 0.45s ease;
  will-change: transform;
}
.gallery-track.no-anim { transition: none; }
.gallery-item {
  position: relative;
  flex: 0 0 calc((100% - var(--gap) * (var(--per-view) - 1)) / var(--per-view));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 26px rgba(42, 33, 28, 0.06);
}
.gallery-item img {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
  -webkit-user-drag: none;
  user-select: none;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption {
  display: block;
  min-height: 78px;
  padding: 14px 16px 16px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.35;
}
.gallery-caption small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
}
.gallery-number,
.gallery-count {
  position: absolute;
  top: 14px;
  padding: 5px 10px;
  color: var(--white);
  font-size: 15px;
  font-weight: 900;
}
.gallery-number { left: 14px; background: var(--ink); font-family: var(--font-serif); letter-spacing: 0.04em; }
.gallery-count { right: 14px; background: var(--red); }

/* 左右箭頭 */
.gallery-nav {
  position: absolute;
  top: calc(var(--photo-height, 220px) / 2);
  z-index: 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 0;            /* 「‹ ›」字元本身偏一邊，改用下面的 ::before 畫箭頭才會置中 */
  box-shadow: 0 8px 20px rgba(42, 33, 28, 0.2);
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease;
}
.gallery-nav::before {
  content: "";
  position: absolute;      /* 不受按鈕裡原本的字元影響，固定在圓心 */
  top: 50%;
  left: 50%;
  width: 28%;
  height: 28%;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
}
/* 轉 45 度後箭頭尖端會偏向一側，往反方向挪一點，看起來才在正中間 */
.gallery-nav.next::before { transform: translate(-62%, -50%) rotate(45deg); }
.gallery-nav.prev::before { transform: translate(-38%, -50%) rotate(-135deg); }
/* 只有滑鼠才有停留變色；手機點完不會一直卡在深色 */
@media (hover: hover) {
  .gallery-nav:hover { background: var(--ink); color: var(--white); }
}
.gallery-nav:active { background: var(--ink); color: var(--white); }
.gallery-nav.prev { left: -20px; }
.gallery-nav.next { right: -20px; }

/* 下方編號 */
.gallery-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 20px; }
.gallery-counter { font-family: var(--font-serif); font-size: 18px; font-weight: 900; letter-spacing: 0.06em; }
.gallery-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gallery-dots button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(42, 33, 28, 0.25);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}
.gallery-dots button:hover { border-color: var(--ink); }
.gallery-dots button.active { background: var(--ink); border-color: var(--ink); color: var(--white); }


/* ========================================
   12. 首頁｜聯絡我們
   ======================================== */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  background: var(--ink);
  color: var(--white);
}
.contact-copy p:not(.eyebrow) { color: #ead9c6; font-size: 21px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact-links a {
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,0.4);
  font-weight: 800;
}

/* ========================================
   13. 頁尾
   ======================================== */
footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 30px;
  padding: 34px var(--pad) 24px;
  background: #1d1714;
  color: #ead9c6;
}
footer h4 { margin: 0 0 10px; color: var(--white); }
.footer-brand { align-self: start; gap: 18px; }
.footer-brand img { height: 96px; }
footer a { display: block; margin: 5px 0; }
.footer-brand { color: var(--white); }
.footer-brand small { color: #bfae9c; }
.copyright { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.14); font-size: 13px; }


/* ========================================
   14. 右下角 IG / FB 按鈕
   ======================================== */
.social-rail {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  display: flex;
  gap: 8px;
}
.social-rail a {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--white);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

/* 回到頂部（js/common.js 產生）：首頁疊在 IG / FB 上方；選購頁有底部購物車列時往上讓 */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 26;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--red);   /* 和 IG / FB 按鈕同色 */
  color: var(--white);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, bottom 0.2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.back-to-top svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* 手機／平板：疊在 IG／FB 上方；電腦：排在 IG 左邊（16 + 兩顆 48 + 間距 8 + 8） */
.social-rail ~ .back-to-top { bottom: 72px; }
@media (min-width: 901px) {
  .social-rail ~ .back-to-top { right: 128px; bottom: 16px; }
}
@media (max-width: 900px) {
  body.has-cart-bar .back-to-top { bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}


/* ========================================
   15. 彈出視窗（消息、相簿）
   ======================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 15, 12, 0.72); }
.modal-panel {
  position: absolute;
  inset: 4vh 4vw;
  max-width: 1160px;
  overflow: auto;
  margin: auto;
  padding: clamp(24px, 4vw, 54px);
  background: var(--paper);
}
.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  width: 46px;
  height: 46px;
  border: 0;
  background: var(--ink);
  color: var(--white);
  font-size: 28px;
}
.modal-header { margin-bottom: 22px; padding-right: 58px; }
.modal-header p, .modal-copy { color: var(--muted); font-size: 21px; }
.news-detail { max-width: 820px; }
.news-detail time { color: var(--red); font-weight: 900; }
.news-detail h2 { margin: 14px 0 18px; }
.album-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.album-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 0; background: var(--cream); }
.album-thumb img { height: 100%; object-fit: cover; }
.album-thumb span { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; background: var(--red); color: var(--white); font-weight: 900; }
.album-back { margin-bottom: 14px; border: 0; border-bottom: 2px solid currentColor; background: transparent; font-weight: 900; }
.album-stage { position: relative; background: #111; }
.album-stage img { height: min(64vh, 640px); object-fit: contain; }
.album-control {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 0;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  font-size: 28px;
  transform: translateY(-50%);
}
.album-control.prev { left: 12px; }
.album-control.next { right: 12px; }
.album-meta { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 900; }


/* ========================================
   16. 選購頁 shop.html
   ======================================== */
.shop-page { background: #fff7ec; }
.shop-hero {
  padding: clamp(54px, 8vw, 100px) var(--pad);
  background:
    linear-gradient(90deg, rgba(42,33,28,0.88), rgba(42,33,28,0.45)),
    url("../images/produce/produce_1.jpg") center / cover no-repeat;
  color: var(--white);
}
.shop-hero > div { max-width: 820px; }
.shop-hero p:not(.eyebrow) { max-width: 720px; margin: 18px 0 0; color: #f5e3d0; font-size: 24px; font-weight: 700; }
.shop-hero .shop-hero-en { margin-top: 10px; color: var(--primary); font-family: var(--font-serif); font-size: 22px; font-style: italic; letter-spacing: 0.02em; }
.shop-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 26px;
  padding-bottom: 26px;
  background: var(--cream);
}
.shop-flow article {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.shop-flow b { color: var(--red); font-size: 16px; }
.shop-flow span { font-family: var(--font-serif); font-size: 22px; font-weight: 900; line-height: 1.35; }
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 18px; }
/* 商品列表標題右邊的說明文字：比其他區塊窄一點 */
.catalog-head > p { max-width: 360px; }
.catalog-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  background: #fffaf4;
  border: 1px solid rgba(205, 167, 134, 0.5);
  border-radius: 18px;
}
.catalog-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;   /* 規格換行變高時，左邊標籤維持原本大小 */
  gap: 8px;
  padding: 20px 20px 12px;
}
.catalog-card-head span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(205, 167, 134, 0.35);
  border-radius: 999px;
  background: var(--white);
  color: #7d4a16;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
/* 規格固定在卡片右上角（換行時也靠右） */
.catalog-card-head span:last-child { margin-left: auto; color: var(--muted); border-color: transparent; text-align: right; line-height: 1.35; border-radius: 12px; }
.catalog-card-head span:only-child { margin-left: 0; }
.catalog-photo {
  padding: 14px 32px 28px;
  background: #fffaf4;
  border-bottom: 1px solid rgba(205, 167, 134, 0.35);
}
.catalog-photo img {
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(42, 33, 28, 0.14);
}
.catalog-copy { display: grid; align-content: start; gap: 9px; padding: 22px; }
.catalog-copy h3 { color: #5b2f1f; font-size: 24px; }
.catalog-copy p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.catalog-copy .catalog-shelf { color: #7d4a16; font-size: 14px; font-weight: 900; }
.catalog-copy .coming-soon {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f6eee5;
  border-radius: 14px;
  color: #7d4a16;
  font-weight: 900;
  text-align: center;
}
.promo-box {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding: 11px 13px;
  background: #fffdf2;
  border: 1px solid #f2c24e;
  border-radius: 14px;
}
.promo-box strong { color: #6a3d15; font-size: 16px; }
.promo-box span {
  width: fit-content;
  padding: 3px 10px;
  border: 1px solid #f0b72f;
  border-radius: 9px;
  background: var(--white);
  color: #5b2f1f;
  font-size: 16px;
  font-weight: 900;
}
.unit-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 12px 14px;
  background: #f6eee5;
  border-radius: 14px;
}
.unit-price span { color: var(--muted); font-weight: 900; }
.unit-price strong { color: #4f3026; font-size: 24px; }
.catalog-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.catalog-actions > span { color: var(--muted); font-size: 16px; font-weight: 900; }
.product-quantity {
  display: grid;
  grid-template-columns: 34px minmax(42px, 1fr) 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}
.product-quantity button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #9b5f24;
  font-weight: 900;
}
.product-quantity input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-weight: 900;
  appearance: textfield;
  -moz-appearance: textfield;
}
.product-quantity input::-webkit-outer-spin-button,
.product-quantity input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.catalog-actions > button {
  grid-column: 2;
  min-height: 40px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: #9b5f24;
  color: var(--white);
  font-weight: 900;
}
.cart-panel {
  position: static;
  padding: 20px;
  background: var(--white);
  border: 2px solid var(--ink);
}
.cart-panel h2 { margin-bottom: 14px; font-size: 34px; }
.cart-empty { margin: 0; color: var(--muted); }
.cart-list { display: grid; gap: 12px; }
.cart-item {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.cart-item strong, .cart-item span { display: block; }
.cart-item span { color: var(--muted); font-size: 15px; }
.quantity-control {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  border: 1px solid var(--line);
}
.quantity-control button {
  height: 38px;
  border: 0;
  background: var(--cream);
  font-weight: 900;
}
.quantity-control output { text-align: center; font-weight: 900; }
.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: 22px;
  font-weight: 900;
}
.cart-total strong { color: var(--red); }
.cart-checkout { width: 100%; }
.checkout { background: var(--cream); }
/* 電腦版：左邊表單、右邊訂單摘要（跟著捲動） */
.checkout-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 28px;
}
.checkout-summary {
  position: sticky;
  top: 104px;
  padding: 20px;
  background: var(--white);
  border: 2px solid var(--ink);
}
.checkout-summary h3 { margin-bottom: 12px; font-size: 26px; }
.summary-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}
.summary-list li span:last-child { flex-shrink: 0; font-weight: 700; }
.summary-fees {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.free-shipping-hint { margin: 8px 0 0; color: var(--red); font-size: 15px; font-weight: 700; }
.free-shipping-hint:empty { display: none; }
.cart-panel .free-shipping-hint { margin: -8px 0 14px; color: var(--muted); font-weight: 500; }
.summary-total { margin: 14px 0 10px; }
.summary-edit { color: var(--muted); font-size: 15px; text-decoration: underline; }
.checkout-head > p {
  max-width: 430px;
  text-align: right;
}
.checkout-form {
  display: grid;
  gap: 22px;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.checkout-form label, .payment-box label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}
.required-label::after {
  content: " *";
  color: var(--red);
}
.checkout-form input, .checkout-form select, .checkout-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-weight: 500; /* 不跟著標籤用粗體，填寫的內容比較好讀 */
}
/* 提示文字用淡色細字，才不會看起來像已經填好 */
.checkout-form ::placeholder { color: #a39890; font-weight: 400; opacity: 1; }
.form-wide { grid-column: 1 / -1; }
/* 郵局宅配：縣市＋鄉鎮市區兩個下拉選單並排（手機也並排） */
.address-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: inherit;
}
.address-picker[hidden] { display: none; }
.checkout-form select:disabled { background: #f3eee9; color: #a39890; cursor: not-allowed; }
/* 配送方式下方的運費規則 */
.shipping-rules {
  margin: -6px 0 0;
  padding: 10px 14px 10px 32px;
  background: var(--white);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.payment-box label.is-disabled { opacity: .5; cursor: not-allowed; }
.payment-box {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 2px solid var(--ink);
}
.payment-box legend {
  padding: 0 8px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
}
.payment-box label {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
}
.payment-box input { width: auto; margin-top: 8px; }
.payment-box span {
  grid-column: 2;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}
.bank-info {
  padding: 18px;
  background: #fff;
  border: 2px solid var(--red);
}
.bank-info h3 { margin-bottom: 12px; color: var(--red); font-size: 25px; }
.bank-info dl { display: grid; gap: 10px; margin: 0; }
.bank-info dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.bank-info dt { color: var(--muted); font-weight: 900; }
.bank-info dd { margin: 0; font-weight: 900; }
.account-row dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.account-row button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  background: var(--ink);
  color: var(--white);
  font-weight: 900;
}
.bank-info p { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.order-result {
  margin-top: 20px;
  padding: 22px;
  background: var(--white);
  border: 2px solid var(--red);
}
.order-result h3 { color: var(--red); }
.order-result ul { margin: 14px 0; padding-left: 22px; }
.result-total { font-size: 24px; font-weight: 900; }

/* 商品已在購物車：按鈕維持綠色（js/shop.js 的 syncProductCard） */
.catalog-actions > button.is-added { background: #4f7a3a; }
/* 改了數量、還沒按「修改數量」：黃色提醒（黃底配深色字才看得清楚） */
.catalog-actions > button.is-added.is-editing { background: #f2c24e; color: var(--ink); }
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  line-height: 1;
}
.cart-count[hidden] { display: none; }

/* 手機與平板：底部購物車列（電腦版不顯示） */
.cart-bar { display: none; }
@media (max-width: 900px) {
  .cart-bar {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: var(--ink);
    color: var(--white);
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(42, 33, 28, 0.3);
  }
  .cart-bar[hidden] { display: none; }
  .cart-bar b { color: var(--primary); }
  .cart-bar-go { flex-shrink: 0; font-size: 15px; }
  .cart-bar.bump { animation: cart-bump 0.4s ease; }
  body.has-cart-bar { padding-bottom: 76px; }
}
@keyframes cart-bump {
  40% { transform: scale(1.04); }
}


/* ========================================
   17. 捲動淡入動畫
   ======================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }


/* ========================================
   18. 平板（900px 以下）
   ======================================== */
@media (max-width: 900px) {
  .site-header { height: 72px; }
  .brand img { height: 52px; }
  .menu-button { width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; }
  .menu-button span { width: 26px; height: 2px; background: var(--ink); }
  .site-nav {
    position: absolute;
    inset: 72px 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px var(--pad) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .hero { min-height: 640px; }
  /* 平板與手機：Linktree 方塊改成主視覺下方的小按鈕（不顯示 QR Code） */
  .hero-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: fit-content;
    margin-top: 18px;
    grid-auto-flow: column;
    gap: 10px;
    padding: 10px 16px;
  }
  .hero-card img { display: none; }
  .hero-card .hero-card-link { margin: 0; padding: 0 0 0 10px; border-top: 0; border-left: 1px solid rgba(42, 33, 28, 0.3); }
  .kitchen-grid, .product-grid, .intro, .feature-banner, .contact, footer { grid-template-columns: 1fr; }
  .gallery-carousel { --per-view: 2; }
  .gallery-nav.prev { left: -12px; }
  .gallery-nav.next { right: -12px; }
  .feature-banner img { min-height: 320px; }
  .shop-flow { grid-template-columns: repeat(2, 1fr); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  /* 訂單摘要移到表單上方，不跟著捲動 */
  .checkout-body { grid-template-columns: 1fr; }
  .checkout-summary { position: static; order: -1; }
}


/* ========================================
   19. 手機（600px 以下）
   ======================================== */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .section { padding: 34px 20px; }
  .section-head { display: block; }
  .section-head > p { margin-top: 10px; font-size: 18px; }
  .checkout-head > p { text-align: left; }
  /* 商品列表：手機也維持「標題在左、說明在右」同一排 */
  .section-head.catalog-head { display: flex; align-items: end; gap: 16px; }
  .catalog-head > div { flex-shrink: 0; }
  .catalog-head > p { margin-top: 0; font-size: 15px; line-height: 1.6; }
  .brand img { height: 46px; }
  .footer-brand img { height: 80px; }
  .brand strong { font-size: 17px; }
  .site-header .brand small { display: none; }
  .announcement { padding-inline: 42px; font-size: 13px; }
  .hero { min-height: 560px; padding: 70px 20px 38px; }
  h1 { font-size: clamp(48px, 17vw, 76px); }
  h2 { font-size: 32px; }
  .hero-lead { font-size: 21px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { padding-inline: 12px; }
  .kitchen-grid img { height: 220px; }
  .product-card { grid-template-columns: 120px 1fr; min-height: 150px; }
  .product-info h3 { font-size: 22px; }
  .product-info p, .product-price { font-size: 15px; }
  .news-item { grid-template-columns: 1fr 38px; gap: 5px 12px; }
  .news-item time, .news-category, .news-item h3 { grid-column: 1; }
  .news-item span:last-child { grid-column: 2; grid-row: 1 / 4; }
  .news-item time, .news-category { font-size: 17px; }
  .news-item h3 { font-size: 22px; }
  /* 手機一次一本，露出下一本的邊緣，提示可以左右滑 */
  .gallery-carousel { --per-view: 1; --gap: 12px; }
  .gallery-item { flex-basis: 86%; }
  /* 卡片置中：整排往右移 (100% - 86%) / 2，左右各露出上一本、下一本的邊緣
     （width: 100% 固定寬度，卡片的 86% 才不會因為位移跟著變窄） */
  .gallery-track { width: 100%; margin-left: 7%; }
  .gallery-caption { min-height: 0; font-size: 21px; }
  /* 手機不顯示左右箭頭：用手指左右滑，或點下方編號切換 */
  .gallery-nav { display: none; }
  .modal-panel { inset: 0; padding: 18px; }
  .album-overview { grid-template-columns: repeat(2, 1fr); }
  .shop-hero { padding: 52px 20px; }
  .shop-hero p:not(.eyebrow) { font-size: 20px; }
  /* 選購流程：手機也維持 2×2，縮小間距與字級，不佔太多版面 */
  .shop-flow { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px 20px; }
  .shop-flow article { gap: 0; align-content: start; padding: 10px 12px; }
  .shop-flow b { font-size: 14px; }
  /* 最長的「人工確認付款與出貨」（9 字）要在一行內：字級隨螢幕寬度微調，且不換行 */
  .shop-flow span { font-size: clamp(13px, 4vw, 16px); white-space: nowrap; }
  .checkout-summary { padding: 14px 16px; }
  .checkout-summary h3 { margin-bottom: 8px; font-size: 22px; }
  .summary-total { margin: 10px 0 6px; padding-top: 10px; font-size: 20px; }

  /* 商品卡（手機）：照片在左、標題在右，優惠／單價／數量在下方整排，
     一張卡約半個畫面，不用一直往下滑。catalog-copy 用 display: contents
     讓裡面的元素直接排進卡片的格線 */
  .catalog-grid { grid-template-columns: 1fr; gap: 14px; }
  .catalog-card {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: none;
    gap: 6px 14px;
    align-content: start;
    padding: 14px;
  }
  .catalog-card-head { grid-column: 2; padding: 0; gap: 4px 6px; justify-content: flex-start; }
  .catalog-card-head span { min-height: 0; padding: 2px 9px; font-size: 13px; }
  .catalog-photo { grid-column: 1; grid-row: 1 / span 4; padding: 0; border: 0; }
  .catalog-photo img { aspect-ratio: 1 / 1; border-radius: 10px; box-shadow: 0 4px 10px rgba(42, 33, 28, 0.14); }
  .catalog-copy { display: contents; }
  .catalog-copy > * { grid-column: 2; }
  .catalog-copy h3 { font-size: 21px; line-height: 1.3; }
  .catalog-copy p { font-size: 15px; line-height: 1.55; }
  .catalog-copy .catalog-shelf { font-size: 13px; }
  .catalog-copy > .promo-box, .catalog-copy > .unit-price,
  .catalog-copy > .catalog-actions, .catalog-copy > .coming-soon { grid-column: 1 / -1; margin-top: 4px; }
  /* 優惠方案改成同一行並排 */
  .promo-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; }
  .promo-box strong { width: 100%; font-size: 14px; }
  .promo-box span { padding: 2px 8px; font-size: 14px; }
  .unit-price { padding: 6px 12px; border-radius: 12px; }
  .unit-price strong { font-size: 21px; }
  .catalog-copy .coming-soon { padding: 8px 12px; }
  /* 數量和「放入購物車」放同一排；「選購數量」文字只保留給螢幕閱讀器 */
  .catalog-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; }
  .catalog-actions > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .product-quantity { grid-template-columns: 40px minmax(30px, 1fr) 40px; }
  .product-quantity button { width: 40px; height: 42px; }
  .catalog-actions > button { grid-column: auto; min-height: 42px; padding-inline: 10px; }

  /* 訂購資料（手機）：收緊間距，姓名＋稱謂並排 */
  .checkout-head > p { font-size: 16px; }
  .checkout-body { gap: 16px; }
  .checkout-form { gap: 16px; padding: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px 10px; }
  .form-grid > label:nth-child(n+3) { grid-column: 1 / -1; }
  .checkout-form label { gap: 5px; }
  .checkout-form input, .checkout-form select, .checkout-form textarea { padding: 10px 12px; }
  .checkout-form textarea { height: 92px; }
  .payment-box { gap: 8px; padding: 10px 12px 12px; }
  .payment-box legend { padding: 0 6px; font-size: 22px; }
  .payment-box label { grid-template-columns: auto 1fr; gap: 2px 8px; padding: 10px; }
  .payment-box input { margin-top: 6px; }
  .payment-box span { font-size: 15px; line-height: 1.55; }
  .bank-info { padding: 12px 14px; }
  .bank-info h3 { margin-bottom: 8px; font-size: 20px; }
  .bank-info dl { gap: 6px; }
  .bank-info dl > div { grid-template-columns: 76px 1fr; gap: 8px; padding-bottom: 6px; }
  .account-row dd { gap: 8px; }
  .account-row button { min-height: 32px; padding: 4px 10px; }
  .bank-info p { margin-top: 8px; font-size: 15px; }

  /* ---- 手機篇幅縮短：字級不變，只收緊留白、圖片高度與排列方式 ---- */
  .section { padding: 28px 20px; }
  .section-head { margin-bottom: 18px; }
  .hero { min-height: 480px; padding: 56px 20px 30px; }
  .hero-lead { margin: 14px 0 22px; }

  /* 三件事：小圖在左、文字在右（和選購頁商品卡同樣做法） */
  .kitchen-grid { gap: 12px; }
  .kitchen-grid article {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-content: start;
    gap: 2px 14px;
    padding: 12px;
  }
  .kitchen-grid img { grid-row: 1 / span 2; height: 104px; }
  .kitchen-grid h3 { padding: 0; line-height: 1.3; }
  .kitchen-grid p { margin: 0; line-height: 1.6; }

  /* 送禮橫幅：圖片降低高度 */
  .feature-banner img { height: 220px; min-height: 0; }
  .feature-banner div { padding: 28px 20px; }

  /* 品牌故事 */
  .intro { gap: 20px; }
  .heritage-photo img { border-width: 8px; }

  /* 選購頁 */
  .shop-hero { padding: 36px 20px; }
  /* 多件特惠：從一格一格的方框改成連續一段文字 */
  .promo-box { display: block; padding: 8px 12px; line-height: 1.6; }
  .promo-box strong { width: auto; }
  .promo-box span { display: inline; width: auto; padding: 0; border: 0; background: none; white-space: nowrap; }
  .promo-box span + span::before { content: "・"; color: #b08a2e; }
  .checkout-form { gap: 12px; }
}
