/* Loaded only on the homepage. */
@font-face {
  font-family: 'Dongguang Hero';
  src: url('/assets/fonts/hero-title-bold.woff2?v=2a621ad055') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
.dg-hero { --hero-focus-x: 65%; --hero-frame-ratio: 3.7; --hero-image-ratio: 3; --hero-image-scale: calc(var(--hero-frame-ratio) / var(--hero-image-ratio)); position: relative; isolation: isolate; background: #f4f0e5; color: var(--color-text-primary); }
.dg-hero-photo { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
/* Preserve the reference's vertical crop at every width. The image scales with
   hero height; narrower viewports reveal less of the same horizontal canvas. */
.dg-hero-photo img { position: absolute; width: auto; max-width: none; height: calc(100% * var(--hero-image-scale)); top: calc((1 - var(--hero-image-scale)) * 67%); left: var(--hero-focus-x); transform: translateX(calc(-1 * var(--hero-focus-x))); }
.dg-hero-inner { width: calc(100% - 32px); max-width: var(--content-max-width); margin: auto; min-height: max(410px, calc(100vw / var(--hero-frame-ratio))); display: flex; align-items: flex-start; padding: 52px 0; }
.dg-hero-copy { width: 100%; }
.dg-hero-eyebrow, .dg-hero h1, .dg-hero-sub { max-width: 54%; }
.dg-hero-sub span { display: inline-block; }
.dg-hero-eyebrow { color: var(--color-primary-dark); font-size: 16px; font-weight: 500; letter-spacing: .02em; margin-bottom: 14px; border-left: 3px solid var(--color-primary); padding-left: 12px; }
.dg-hero h1 { font-family: 'Dongguang Hero', var(--font-heading); font-synthesis: none; color: var(--color-text-primary); font-size: 40px; line-height: 1.45; letter-spacing: .03em; margin-bottom: 12px; font-weight: var(--font-weight-bold); }
.dg-hero-sub { color: var(--color-text-secondary); font-size: 16px; line-height: 1.85; }
.dg-hero .dg-hero-search { width: 100%; max-width: 480px; margin: 26px 0 0; }
.dg-hero-search input { min-height: 52px; font-size: 16px; padding-right: 88px; }
.dg-hero-search button { position: absolute; right: 5px; top: 4px; bottom: 4px; min-width: 72px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-full); background: var(--color-primary-dark); color: #fff; font-family: var(--font-primary); font-size: 16px; cursor: pointer; }
.dg-hero-search button:hover { background: var(--color-text-primary); }
.dg-hero-search button:focus-visible { outline: 3px solid var(--color-primary-dark); outline-offset: 3px; }
@media (max-width: 1000px) {
  .dg-hero-inner { padding: 36px 0; }
  .dg-hero h1 { font-size: 32px; }
  .dg-hero .dg-hero-search { max-width: 400px; margin-top: 22px; }
}
@media (max-width: 600px) {
  /* A single photograph supplies the wall, light, and floor. No overlay or
     separate solid-color column; use its natural empty space for the copy. */
  .dg-hero-inner { padding: 28px 0; }
  .dg-hero-eyebrow, .dg-hero h1 { max-width: max(48%, 244px); }
  .dg-hero h1 { font-size: 28px; line-height: 1.45; letter-spacing: .02em; }
  .dg-hero-sub { max-width: max(42%, 216px); }
  .dg-hero .dg-hero-search { max-width: 300px; margin-top: 20px; }
  .dg-hero-search input { min-height: 50px; padding-left: 38px; padding-right: 76px; }
  .dg-hero-search button { top: 3px; bottom: 3px; right: 3px; min-width: 64px; padding: 0 10px; }
  .dg-hero-search svg { left: 12px; }
}
@media (max-width: 360px) {
  .dg-hero h1 { font-size: 26px; max-width: 228px; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-hero * { transition: none !important; }
}

/* Open catalog cards: the photo, name and price supply the hierarchy. */
.cat-section.home-screen1 { padding-bottom: 12px; }
.cat-section.home-screen2 { padding-top: 12px; }
:is(.home-screen1, .home-screen2) .cat-cat-head { gap: 18px; padding-bottom: 0; border-bottom: 0; margin-bottom: 20px; }
/* Match the proposal: a light rule, substantial rounded marker and soft badges.
   Reuse the existing brand family rather than introducing another orange. */
:is(.home-screen1, .home-screen2) .cat-cat-head::after { content: ''; height: 2px; flex: 1; align-self: center; background: var(--color-primary-light); }
:is(.home-screen1, .home-screen2) .cat-cat-head h2 { position: relative; padding-left: 22px; font-size: 24px; }
:is(.home-screen1, .home-screen2) .cat-cat-head h2::before { content: ''; position: absolute; left: 0; top: .3em; bottom: .3em; width: 8px; border-radius: 3px; background: var(--color-primary); }
.home-screen2 .cat-cat-more { order: 2; }
/* 商品卡本身的樣式在 product-card.css，全站共用。 */

/* Bestsellers keep their existing batch navigation and hot labels. */
.home-screen1 .home-feat .cat-cat-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.home-screen1 .home-feat .cat-cat-head::before { content: ''; height: 2px; margin-right: 28px; background: var(--color-primary-light); }
/* Equal grid tracks center the words; only the left rule reserves icon space. */
.home-screen1 .home-feat .cat-cat-head h2 { padding: 0; text-align: center; }
.home-feat-flame { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); width: .85em; height: 1.08em; color: var(--color-primary); }
.home-feat-flame-inner { fill: var(--color-primary-light); }
.home-screen1 .home-feat .cat-cat-head h2::before { display: none; }
.dg-batch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--card-gap-col); align-content: start; touch-action: pan-y pinch-zoom; }
.dg-batch-viewport { position: relative; overflow: hidden; padding: 3px 0; margin: -3px 0; }
.dg-batch-viewport .dg-batch-outgoing { position: absolute; top: 3px; left: 0; width: 100%; pointer-events: none; }
.dg-product-batch [hidden] { display: none !important; }
.dg-product-batch .cat-card-photo::before { content: '熱銷'; position: absolute; top: 0; left: 1px; z-index: 1; padding: 2px 11px; border-radius: 4px; transform: skewX(-4deg); background: var(--color-primary); color: var(--color-surface); font-size: 14px; font-weight: 700; line-height: 1.5; pointer-events: none; }
.dg-batch-pages { display: flex; justify-content: center; gap: 4px; min-height: 44px; margin: 8px auto 0; }
.dg-batch-page { display: flex; align-items: center; justify-content: center; flex: 0 0 52px; min-width: 0; min-height: 44px; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: 4px; }
.dg-batch-page span { display: block; width: 44px; height: 4px; background: #d8cebf; border-radius: 3px; }
.dg-batch-page[aria-current="page"] span { background: var(--color-primary-dark); }
.dg-batch-page:hover span { background: var(--color-primary); }
.dg-batch-page:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
@media (max-width: 1000px) and (min-width: 601px) {
  .dg-batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-product-batch .cat-card-photo { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
  .dg-batch-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :is(.home-screen1, .home-screen2) .cat-cat-head { gap: 10px; margin-bottom: 16px; }
  :is(.home-screen1, .home-screen2) .cat-cat-head h2 { font-size: 21px; }
  .home-screen1 .home-feat .cat-cat-head::before { margin-right: 26px; }
  .dg-product-batch .cat-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 12px 0; overflow: visible; }
  .dg-product-batch .cat-card:first-child { padding-top: 0; }
  .dg-product-batch .cat-card:hover { transform: none; box-shadow: none; }
  .dg-product-batch .cat-card-photo { aspect-ratio: 1; padding: 2px; }
  .dg-product-batch .cat-card-photo::before { padding: 1px 7px; font-size: 12px; }
  .dg-product-batch .cat-card-body { padding: 0; gap: 4px; }
  .dg-product-batch .cat-card-body h3 { min-height: 0; font-size: 18px; }
  .dg-product-batch .cat-card-price { font-size: 21px; margin-top: 0; padding-top: 4px; border-top: 0; }
  .dg-product-batch .cat-tags { margin-top: 2px; }
  .dg-product-batch .cat-badge { font-size: 13px; padding: 1px 6px; }
  .dg-batch-pages { gap: 4px; margin-top: 4px; }
}
@media (max-width: 360px) {
  .dg-product-batch .cat-card { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-product-batch .cat-card, .dg-product-batch .cat-card-photo img { transition: none; }
}

/* 全部商品：左側分類目錄＋一次一類（互動見 assets/js/home-browse.js）。
   顏色全沿用 design-system.css 的品牌橘與暖色中性。依店家要求不顯示任何件數。 */
.home-browse { margin-bottom: 28px; }
.hb-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.hb-side { position: sticky; top: calc(var(--header-total) + 16px); display: flex; flex-direction: column; gap: 2px; padding-right: 14px; border-right: 1px solid var(--color-border-light); transition: top .28s ease; }
.intro-header.header-hidden ~ .cat-main .hb-side { top: 16px; }
.hb-tab { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: var(--radius-md); color: var(--color-text-secondary); font-size: 16px; text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast); }
.hb-tab svg { flex: none; }
.hb-tab:hover { background: var(--color-primary-pale); color: var(--color-primary-dark); }
.hb-tab[aria-current="true"] { background: var(--color-primary-pale); color: var(--color-primary-dark); font-weight: 700; }
.hb-tab:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
.hb-panels { scroll-margin-top: calc(var(--header-total) + 16px); }
.hb-panel[hidden], .hb-panel .cat-card[hidden], .hb-more[hidden] { display: none !important; }
.hb-panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
.hb-panel-head h3 { margin: 0; font-size: 22px; color: var(--color-text-primary); }
.hb-subs { color: var(--color-text-secondary); font-size: 14px; }
.hb-link { margin-left: auto; color: var(--color-primary-dark); font-size: 15px; white-space: nowrap; text-decoration: none; }
.hb-link:hover { text-decoration: underline; }
.hb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--card-gap-row) var(--card-gap-col); }
.hb-more { display: flex; justify-content: center; margin-top: 24px; }
.hb-more button { min-height: 44px; padding: 0 26px; border: 1.5px solid var(--color-primary); border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-primary-dark); font-family: var(--font-primary); font-size: 15px; font-weight: 600; cursor: pointer; }
.hb-more button:hover { background: var(--color-primary-pale); }
.hb-more button:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
/* 窄螢幕：目錄改成排在上方、可換行的分類標籤 */
@media (max-width: 1000px) {
  .hb-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hb-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 0; border-right: 0; margin-bottom: 22px; }
  .hb-tab { min-height: 44px; padding: 0 16px; border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-text-primary); font-size: 15px; gap: 6px; }
  /* 白字壓在 --color-primary 上對比只有約 3.3:1，選中的標籤改用深一階的橘 */
  .hb-tab[aria-current="true"] { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: var(--color-surface); }
  .hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-panel-head h3 { font-size: 20px; }
  .hb-subs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-side, .hb-tab { transition: none; }
}
