/* =====================================================================
   宏龍軟花生糖 2026 改版樣式
   載入順序：在佈景原本的 stylesheet.css 與 megnor/*.css 之後（header.tpl）
   新元件一律用 .hl- 前綴；檔案後段是對 OpenCart 共用元件（表單、提示、分頁、
   會員與結帳頁）的統一調整。
   ===================================================================== */

:root {
  --hl-sugar: #FFFFFF;       /* 糖白：主底色 */
  --hl-tea: #E4E8E1;         /* 茶灰綠：區塊底、商品圖底 */
  --hl-tea-line: #CDD3C9;    /* 細線 */
  --hl-roast: #5A3A22;       /* 焙炒棕：主色 */
  --hl-roast-deep: #432A17;  /* 焙炒棕 hover */
  --hl-ink: #2B2420;         /* 墨：內文 */
  --hl-ink-soft: #5E5650;    /* 次要文字 */
  --hl-malt: #C8902F;        /* 麥芽琥珀：色塊、focus 外框 */
  --hl-malt-text: #8F5C14;   /* 麥芽琥珀：文字用（白底 5.3:1） */
  --hl-red: #A8282E;         /* 紅紙：錯誤訊息 */

  --hl-font-display: "LXGW WenKai TC", "Kaiti TC", "DFKai-SB", "BiauKai", serif;
  --hl-font-body: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;

  --hl-fs-14: 0.875rem;
  --hl-fs-16: 1rem;
  --hl-fs-20: 1.25rem;
  --hl-fs-25: 1.5625rem;
  --hl-fs-31: 1.9375rem;
  --hl-fs-39: 2.4375rem;
  --hl-fs-61: 3.8125rem;

  --hl-wrap: 1200px;
  --hl-gutter: clamp(16px, 4vw, 40px);
  --hl-section: clamp(56px, 8vw, 104px);
}

/* ---------- 基礎 ---------- */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--hl-sugar);
  color: var(--hl-ink);
  font-family: var(--hl-font-body);
  font-size: var(--hl-fs-16);
  font-weight: 400;          /* 舊佈景是 500，正黑體會變粗體 */
  letter-spacing: 0;         /* 舊佈景是 1px */
  line-height: 1.75;
}

/* 標題換行：優先在空格處斷行（避免「一口軟花生／糖」），太長時才在字中間斷 */
.hl-story__quote, .hl-hero__title, .hl-pdp__title, .hl-listing__title, .hl-product__name, .hl-cat__name {
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
  font-family: var(--hl-font-body);
  color: var(--hl-ink);
  letter-spacing: 0;
  text-transform: none;
}

a { color: var(--hl-roast); text-underline-offset: 0.2em; }
a:hover, a:focus { color: var(--hl-roast-deep); }

:focus-visible {
  outline: 3px solid var(--hl-malt);
  outline-offset: 3px;
}

.hl-wrap {
  max-width: var(--hl-wrap);
  margin: 0 auto;
  padding: 0 var(--hl-gutter);
}

.hl-display {
  font-family: var(--hl-font-display) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.hl-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.hl-skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--hl-roast);
  color: var(--hl-sugar);
}
.hl-skip:focus { top: 8px; color: var(--hl-sugar); }

/* ---------- 頁首 ---------- */
.hl-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--hl-sugar);
  border-bottom: 1px solid var(--hl-tea-line);
  padding: 0;
  margin: 0;
}

.hl-header__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
}

.hl-header__logo { flex: none; }
.hl-header__logo img { display: block; height: 48px; width: auto; max-width: none; }

.hl-nav { flex: 1; }

.hl-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-nav a {
  display: block;
  padding: 8px 0;
  color: var(--hl-ink);
  text-decoration: none;
  font-size: var(--hl-fs-16);
}

.hl-nav a:hover,
.hl-nav a[aria-current="page"] {
  color: var(--hl-roast);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--hl-roast);
}

.hl-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.hl-tool,
.hl-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--hl-ink);
  font: inherit;
  font-size: var(--hl-fs-14);
  text-decoration: none;
  cursor: pointer;
}

.hl-tool:hover, .hl-menu-btn:hover { color: var(--hl-roast); text-decoration: none; }

.hl-tool svg, .hl-menu-btn svg { width: 22px; height: 22px; flex: none; }

.hl-menu-btn { display: none; }

/* 會員選單（沿用 bootstrap dropdown） */
.hl-account { position: relative; }
.hl-account .dropdown-menu {
  min-width: 160px;
  margin-top: 0;
  padding: 8px 0;
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  box-shadow: none;
}
.hl-account .dropdown-menu > li > a {
  padding: 8px 20px;
  color: var(--hl-ink);
  font-size: var(--hl-fs-14);
}
.hl-account .dropdown-menu > li > a:hover { background: var(--hl-tea); color: var(--hl-roast); }

/* 購物車：保留 OpenCart 的 #cart 結構（common.js 會更新它） */
.hl-header #cart { position: relative; width: auto; margin: 0; float: none; }
.hl-header #cart > .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;               /* 舊佈景固定 37×25px，會把圖示擠掉 */
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  color: var(--hl-ink);
  font-size: var(--hl-fs-14);
  text-shadow: none;
}
.hl-header #cart > .btn:hover { color: var(--hl-roast); }
.hl-header #cart > .btn .fa { display: none; }
.hl-header #cart > .btn::before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 8h14l-1.2 12H6.2z'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 8h14l-1.2 12H6.2z'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hl-header #cart-total {
  position: static;          /* 舊佈景是 absolute */
  border: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--hl-roast);
  color: var(--hl-sugar);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.hl-header #cart .dropdown-menu {
  right: 0;
  left: auto;
  width: min(380px, 92vw);
  margin-top: 0;
  padding: 16px;
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  box-shadow: none;
  background: var(--hl-sugar);
}
.hl-header #cart .dropdown-menu table { width: 100%; margin-bottom: 12px; font-size: var(--hl-fs-14); }
.hl-header #cart .dropdown-menu td { padding: 6px 4px; border-color: var(--hl-tea); vertical-align: middle; background: none !important; }
.hl-header #cart .dropdown-menu .img-thumbnail { width: 48px; padding: 0; border: 0; background: var(--hl-tea); }
.hl-header #cart .button-container { display: flex; gap: 8px; }
.hl-header #cart .button-container a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--hl-roast);
  border-radius: 2px;
  color: var(--hl-roast);
  text-decoration: none;
  font-size: var(--hl-fs-14);
}
.hl-header #cart .button-container a.checkout { background: var(--hl-roast); color: var(--hl-sugar); }
.hl-header #cart .dropdown-menu p { margin: 8px 0; color: var(--hl-ink-soft); }

/* 搜尋：保留 OpenCart 的 #search（common.js 綁定） */
.hl-search {
  display: none;
  border-top: 1px solid var(--hl-tea);
  background: var(--hl-sugar);
}
.hl-search.is-open { display: block; }
.hl-search #search {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px var(--hl-gutter);
  float: none;
  width: auto;
}
.hl-search #search .form-control {
  flex: 1;
  height: 48px;
  border: 1px solid var(--hl-tea-line);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  box-shadow: none;
  font-size: var(--hl-fs-16);
}
.hl-search #search .input-group-btn { width: auto; }
.hl-search #search .btn {
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--hl-roast);
  border-radius: 0 2px 2px 0;
  background: var(--hl-roast);
  color: var(--hl-sugar);
}

@media (max-width: 900px) {
  .hl-header__bar { gap: 4px; min-height: 60px; }
  .hl-header__logo { margin-right: auto; }
  .hl-header__logo img { height: 38px; }
  .hl-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--hl-sugar);
    border-bottom: 1px solid var(--hl-tea-line);
  }
  .hl-nav.is-open { display: block; }
  .hl-nav ul { flex-direction: column; padding: 8px var(--hl-gutter) 16px; }
  .hl-nav a { padding: 12px 0; border-bottom: 1px solid var(--hl-tea); }
  .hl-nav a:hover, .hl-nav a[aria-current="page"] { box-shadow: none; }
  .hl-menu-btn { display: inline-flex; order: -1; padding: 0; }
  .hl-tool__label { display: none; }
  .hl-tools { margin-left: 0; }
}

/* ---------- 按鈕 ---------- */
.hl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid var(--hl-roast);
  border-radius: 2px;
  background: var(--hl-roast);
  color: var(--hl-sugar);
  font: inherit;
  font-size: var(--hl-fs-16);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.hl-btn:hover, .hl-btn:focus { background: var(--hl-roast-deep); border-color: var(--hl-roast-deep); color: var(--hl-sugar); text-decoration: none; }
.hl-btn--ghost { background: transparent; color: var(--hl-roast); }
.hl-btn--ghost:hover, .hl-btn--ghost:focus { background: var(--hl-roast); color: var(--hl-sugar); }
.hl-btn--block { width: 100%; }
.hl-btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- 首頁 Hero ---------- */
.hl-hero { padding-top: clamp(40px, 7vw, 88px); }

.hl-hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
}

.hl-hero__origin {
  margin: 0 0 12px;
  color: var(--hl-ink-soft);
  letter-spacing: 0.12em;
}

body .hl-hero__title {
  margin: 0;
  color: var(--hl-roast);
  font-size: clamp(var(--hl-fs-31), 4.4vw, var(--hl-fs-61));
}

.hl-hero__sub { margin: 8px 0 0; font-size: clamp(var(--hl-fs-20), 2vw, var(--hl-fs-25)); }
.hl-hero__note { margin: 4px 0 0; color: var(--hl-malt-text); font-size: var(--hl-fs-20); }

.hl-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* 直排標語：整頁唯一的大膽處 */
.hl-couplet {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(8px, 1.6vw, 20px);
  margin: 0;
}

.hl-couplet__line {
  writing-mode: vertical-rl;
  margin: 0;
  color: var(--hl-roast);
  font-family: var(--hl-font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5.6vw, 4.75rem);
  line-height: 1.15;
  letter-spacing: 0.12em;
}
.hl-couplet__line + .hl-couplet__line { margin-top: 1.4em; }

.hl-couplet__by {
  writing-mode: vertical-rl;
  align-self: flex-end;
  margin: 0;
  color: var(--hl-ink-soft);
  font-size: var(--hl-fs-14);
  letter-spacing: 0.2em;
}

/* 五種口味花生糖切面（裁自 image/catalog/banner/banner01-1903x590.png） */
.hl-candy-band {
  position: relative;
  margin-top: clamp(32px, 5vw, 64px);
  aspect-ratio: 1258 / 122;
  overflow: hidden;
  background: #8b5a2b;
}
.hl-candy-band img {
  position: absolute;
  left: -25.6%;
  bottom: 0;
  width: 151.3%;
  max-width: none;
  height: auto;
  animation: hl-fade 900ms ease-out both;
}

@media (max-width: 640px) {
  .hl-hero__grid { align-items: start; }
  .hl-hero__actions .hl-btn { flex: 1 1 100%; }
  .hl-candy-band { aspect-ratio: 500 / 122; }
  .hl-candy-band img { left: -216%; width: 380.6%; }
}

@keyframes hl-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hl-candy-band img { animation: none; }
}

/* ---------- 區塊 ---------- */
.hl-section { padding: var(--hl-section) 0; }
.hl-section--tea { background: var(--hl-tea); }
.hl-section--flush-top { padding-top: 0; }

body .hl-section__title {
  margin: 0 0 clamp(24px, 3vw, 40px);
  color: var(--hl-roast);
  font-size: var(--hl-fs-31);
}

/* ---------- 首頁分類入口 ---------- */
.hl-cats {
  --hl-cats-gap: clamp(32px, 6vw, 80px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--hl-cats-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hl-cats li { position: relative; }
.hl-cats li + li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--hl-cats-gap) / -2);
  border-left: 1px solid var(--hl-tea-line);
}

.hl-cat {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--hl-ink);
  text-decoration: none;
}
.hl-cat:hover { text-decoration: none; color: var(--hl-ink); }

.hl-cat__img {
  aspect-ratio: 4 / 3;
  padding: 6%;
  overflow: hidden;
  background: var(--hl-tea);
}
.hl-cat__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

body .hl-cat__name { margin: 20px 0 6px; color: var(--hl-roast); font-size: var(--hl-fs-25); }
.hl-cat:hover .hl-cat__name { text-decoration: underline; text-underline-offset: 0.25em; }
.hl-cat__desc { margin: 0; color: var(--hl-ink-soft); font-size: var(--hl-fs-14); line-height: 1.8; }

@media (max-width: 720px) {
  .hl-cats { grid-template-columns: 1fr; }
  .hl-cats li + li::before { display: none; }
  .hl-cats li + li { border-top: 1px solid var(--hl-tea-line); }
  .hl-cat {
    display: grid;
    grid-template-columns: 112px 1fr;
    column-gap: 16px;
    align-items: center;
    padding: 16px 0;
  }
  .hl-cat__img { grid-row: span 2; aspect-ratio: 1; }
  body .hl-cat__name { margin: 0; align-self: end; }
  .hl-cat__desc { align-self: start; }
}

/* ---------- 商品格與商品卡 ---------- */
.hl-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(32px, 4vw, 48px) clamp(16px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 900px) { .hl-products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .hl-products { grid-template-columns: repeat(2, 1fr); } }

.hl-product { display: flex; flex-direction: column; height: 100%; }

.hl-product__img {
  display: block;
  aspect-ratio: 1;
  padding: 10%;
  overflow: hidden;
  background: var(--hl-tea);
}
.hl-product__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;   /* 白底商品照融入茶灰綠底 */
}

body .hl-product__name {
  margin: 14px 0 4px;
  font-size: var(--hl-fs-16);
  font-weight: 400;
  line-height: 1.6;
}
.hl-product__name a { color: var(--hl-ink); text-decoration: none; }
.hl-product__name a:hover { color: var(--hl-roast); text-decoration: underline; }

.hl-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.hl-price__now {
  color: var(--hl-malt-text);
  font-size: var(--hl-fs-20);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hl-price__old { color: var(--hl-ink-soft); font-size: var(--hl-fs-14); text-decoration: line-through; }
.hl-price__tax { flex-basis: 100%; color: var(--hl-ink-soft); font-size: var(--hl-fs-14); }

.hl-product .hl-btn { margin-top: auto; min-height: 44px; padding: 0 12px; }

/* ---------- 品牌故事（HTML 模組） ---------- */
.hl-story {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.hl-story__img { margin: 0; }
.hl-story__img img { width: 100%; height: auto; }
.hl-story__quote {
  margin: 0 0 28px;
  color: var(--hl-roast);
  font-family: var(--hl-font-display);
  font-size: var(--hl-fs-25);
  line-height: 1.6;
}
.hl-story__body p { margin: 0 0 1em; max-width: 34em; }
.hl-story__body a { color: var(--hl-roast); text-decoration: underline; }
.hl-story__award { padding-left: 16px; border-left: 3px solid var(--hl-malt); }
@media (max-width: 900px) { .hl-story { grid-template-columns: 1fr; } }

/* ---------- 購物須知（HTML 模組） ---------- */
.hl-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 0;
}
.hl-info dt {
  margin-bottom: 8px;
  color: var(--hl-roast);
  font-family: var(--hl-font-display);
  font-size: var(--hl-fs-20);
  font-weight: 700;
}
.hl-info dd { margin: 0; font-size: var(--hl-fs-14); line-height: 1.9; }
@media (max-width: 900px) { .hl-info { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hl-info { grid-template-columns: 1fr; } }

/* ---------- 頁尾 ---------- */
.hl-footer {
  margin-top: 0;
  padding: 64px 0 24px;
  background: var(--hl-roast);
  color: #EFE8E1;
  font-size: var(--hl-fs-14);
}
.hl-footer, .hl-footer a, .hl-footer p, .hl-footer li, .hl-footer address { font-weight: 400; letter-spacing: 0; }
.hl-footer a { color: #EFE8E1; text-decoration: none; }
.hl-footer a:hover { color: var(--hl-sugar); text-decoration: underline; }

.hl-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
body .hl-footer h2 {
  margin: 0 0 12px;
  color: var(--hl-sugar);
  font-family: var(--hl-font-display);
  font-size: var(--hl-fs-20);
}
.hl-footer ul { margin: 0; padding: 0; list-style: none; line-height: 2.2; }
.hl-footer address, .hl-footer p { margin: 0; font-style: normal; line-height: 2; }

.hl-footer__order {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hl-footer__copy { margin-top: 16px; color: #D9CEC4; }

@media (max-width: 720px) {
  .hl-footer__grid { grid-template-columns: 1fr 1fr; }
  .hl-footer__grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- 麵包屑 ---------- */
.hl-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--hl-fs-14);
  color: var(--hl-ink-soft);
}
.hl-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--hl-tea-line); }
.hl-crumbs a { color: var(--hl-ink-soft); }

/* ---------- 分類頁 ---------- */
.hl-listing__head { padding: 24px 0 32px; }
body .hl-listing__title { margin: 16px 0 8px; color: var(--hl-roast); font-size: var(--hl-fs-39); }
.hl-listing__desc { max-width: 40em; color: var(--hl-ink-soft); }
.hl-listing__desc p { margin: 0 0 0.6em; }

.hl-subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.hl-subcats a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  color: var(--hl-ink);
  font-size: var(--hl-fs-14);
  text-decoration: none;
}
.hl-subcats a:hover { border-color: var(--hl-roast); color: var(--hl-roast); }

.hl-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 12px 0;
  border-top: 1px solid var(--hl-tea-line);
  border-bottom: 1px solid var(--hl-tea-line);
  font-size: var(--hl-fs-14);
}
.hl-toolbar__count { color: var(--hl-ink-soft); }
.hl-toolbar label { margin: 0 8px 0 0; font-weight: 400; }
.hl-toolbar select {
  width: auto;
  min-width: 10em;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  color: var(--hl-ink);
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  background: var(--hl-sugar);
  font: inherit;
}

.hl-pagination { margin: 48px 0 0; }
.hl-pagination .pagination { margin: 0; }

.hl-empty { padding: 48px 0; color: var(--hl-ink-soft); }

.hl-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; }
.hl-layout--single { grid-template-columns: 1fr; }
@media (max-width: 900px) { .hl-layout { grid-template-columns: 1fr; } }

/* ---------- 商品頁 ---------- */
.hl-pdp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  padding: 32px 0 var(--hl-section);
}

.hl-gallery { position: sticky; top: 96px; align-self: start; }

.hl-gallery__main {
  display: block;
  aspect-ratio: 1;
  padding: 8%;
  overflow: hidden;
  background: var(--hl-tea);
}
.hl-gallery__main img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.hl-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.hl-gallery__thumbs button {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 8%;
  border: 2px solid transparent;
  background: var(--hl-tea);
  cursor: pointer;
}
.hl-gallery__thumbs button[aria-pressed="true"] { border-color: var(--hl-roast); }
.hl-gallery__thumbs img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

body .hl-pdp__title { margin: 0 0 12px; color: var(--hl-roast); font-size: var(--hl-fs-31); }

.hl-pdp .hl-price__now { font-size: var(--hl-fs-31); }

.hl-pdp__meta { margin: 0 0 8px; padding: 0; list-style: none; color: var(--hl-ink-soft); font-size: var(--hl-fs-14); }

.hl-rating { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: var(--hl-fs-14); }
.hl-rating .fa-stack { width: 1em; height: 1em; line-height: 1em; color: var(--hl-malt); }

.hl-buy { margin: 24px 0 0; }
.hl-buy__row { display: flex; gap: 12px; align-items: flex-end; }
.hl-buy .form-group { margin-bottom: 16px; }
.hl-qty label { display: block; margin-bottom: 4px; font-size: var(--hl-fs-14); font-weight: 400; }
.hl-qty input {
  width: 88px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  font: inherit;
  text-align: center;
}
.hl-buy__row .hl-btn { flex: 1; }

.hl-pdp__links {
  display: flex;
  gap: 20px;
  margin: 16px 0 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hl-tea-line);
}
.hl-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--hl-roast);
  font: inherit;
  font-size: var(--hl-fs-14);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

body .hl-pdp h2 { margin: 32px 0 12px; color: var(--hl-roast); font-size: var(--hl-fs-20); }

/* 商品描述來自後台編輯器，內含大量 Word 貼上的行內樣式，在這裡統一 */
.hl-desc { font-size: var(--hl-fs-16); line-height: 1.85; }
.hl-desc *:not(img) {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  background: none !important;
}
.hl-desc h1, .hl-desc h2, .hl-desc h3, .hl-desc h4 { margin: 0 0 0.6em; font-weight: 700; }
.hl-desc p { margin: 0 0 0.5em !important; padding: 0 !important; text-indent: 0 !important; }
/* Word 貼上的空段落（只有 <br>）與 Wingdings 項目符號（換字型後會變成字母 l） */
.hl-desc p:empty,
.hl-desc p:has(> br:only-child),
.hl-desc p:has(> span:only-child > br:only-child),
.hl-desc p:has(> font:only-child > span:only-child > br:only-child),
.hl-desc [style*="Wingdings"] { display: none !important; }
.hl-desc img { max-width: 100%; height: auto !important; }
.hl-desc table { width: 100%; border-collapse: collapse; }
.hl-desc td, .hl-desc th { padding: 8px; border-bottom: 1px solid var(--hl-tea-line); }

.hl-spec { width: 100%; border-collapse: collapse; font-size: var(--hl-fs-14); }
.hl-spec th, .hl-spec td { padding: 12px 0; border-bottom: 1px solid var(--hl-tea-line); text-align: left; vertical-align: top; }
.hl-spec th { width: 8em; color: var(--hl-ink-soft); font-weight: 400; }
.hl-spec caption { padding: 16px 0 4px; color: var(--hl-ink); font-weight: 700; text-align: left; }

.hl-reviews .form-group { margin-bottom: 16px; }
.hl-reviews .help-block { font-size: var(--hl-fs-14); }

@media (max-width: 900px) {
  .hl-pdp { grid-template-columns: 1fr; }
  .hl-gallery { position: static; }
}

/* ---------- 一頁式結帳 ---------- */
.hl-checkout { padding-bottom: var(--hl-section); }
.hl-co { max-width: 720px; counter-reset: hl-step; }

.hl-co-step {
  padding: 28px 0;
  border-top: 1px solid var(--hl-tea-line);
}
.hl-co-step--plain { padding-top: 8px; border-top: 0; }
.hl-co-step[hidden] { display: none; }

body .hl-co-step__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--hl-roast);
  font-size: var(--hl-fs-20);
}
.hl-co-step__title::before {
  counter-increment: hl-step;
  content: counter(hl-step);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hl-roast);
  color: var(--hl-sugar);
  font-family: var(--hl-font-body);
  font-size: var(--hl-fs-14);
}
.hl-co-step[data-state="pending"] .hl-co-step__title { color: var(--hl-ink-soft); margin-bottom: 0; }
.hl-co-step[data-state="pending"] .hl-co-step__title::before { background: var(--hl-tea-line); color: var(--hl-ink); }

/* 子樣板的 panel 外框歸零 */
.hl-co .panel-body { padding: 0; }
.hl-co fieldset { margin: 0 0 8px; padding: 0; border: 0; }
.hl-co legend {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--hl-ink);
  font-size: var(--hl-fs-16);
  font-weight: 700;
}
.hl-co .form-group { margin-bottom: 16px; }
.hl-co .control-label { font-weight: 400; font-size: var(--hl-fs-14); }
.hl-co .form-control { height: 48px; }
.hl-co textarea.form-control { height: auto; }
.hl-co .required > .control-label::before { color: var(--hl-red); }

/* 用不到的欄位：市話（傳真） */
.hl-co .form-group:has(> #input-payment-fax),
.hl-co .form-group:has(> #input-shipping-fax) { display: none; }
/* 只有隱藏欄位的空 form-group */
.hl-co .form-group:not(:has(:not(input[type="hidden"]))) { display: none; }

.hl-co .buttons { margin-top: 8px; }
.hl-co .buttons .pull-right { float: none !important; }
.hl-co #button-guest, .hl-co #button-payment-address, .hl-co #button-shipping-address, .hl-co #button-guest-shipping {
  width: 100%;
  min-height: 48px;
  font-size: var(--hl-fs-16);
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* 登入 */
.hl-co-login { display: grid; gap: 12px; justify-items: start; }
.hl-co-login__form { width: 100%; max-width: 420px; }
.hl-co-login__form[hidden] { display: none; }
.hl-co-login__forgot { display: inline-block; margin-top: 6px; font-size: var(--hl-fs-14); }

/* 運送、付款選項 */
.hl-choices { display: grid; gap: 8px; margin-bottom: 20px; }
.hl-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  font-weight: 400;
  cursor: pointer;
}
.hl-choice:has(input:checked) { border-color: var(--hl-roast); box-shadow: inset 0 0 0 1px var(--hl-roast); }
.hl-choice input { margin: 0; accent-color: var(--hl-roast); width: 18px; height: 18px; }
.hl-choice__price { color: var(--hl-malt-text); font-weight: 700; }
.hl-choice__note { grid-column: 2 / -1; color: var(--hl-ink-soft); font-size: var(--hl-fs-14); }

/* 確認訂單 */
.hl-co-items { margin: 0 0 16px; padding: 0; list-style: none; }
.hl-co-items li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--hl-tea);
}
.hl-co-items__name a { color: var(--hl-ink); }
.hl-co-items__name small { display: block; color: var(--hl-ink-soft); }
.hl-co-items__qty { color: var(--hl-ink-soft); font-size: var(--hl-fs-14); font-variant-numeric: tabular-nums; }
.hl-co-items__total { font-variant-numeric: tabular-nums; }

.hl-co-totals { margin: 0 0 24px; }
.hl-co-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.hl-co-totals dt { font-weight: 400; color: var(--hl-ink-soft); }
.hl-co-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.hl-co-totals div:last-child { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--hl-tea-line); }
.hl-co-totals div:last-child dt, .hl-co-totals div:last-child dd { color: var(--hl-ink); font-size: var(--hl-fs-20); font-weight: 700; }
.hl-co-totals div:last-child dd { color: var(--hl-malt-text); }

.hl-co-pay h2 { margin: 0 0 8px; font-size: var(--hl-fs-16); font-weight: 700; color: var(--hl-ink); }
.hl-co-pay .well { padding: 16px; border: 0; border-radius: 2px; background: var(--hl-tea); box-shadow: none; font-size: var(--hl-fs-14); }
.hl-co-pay #button-confirm {
  width: 100%;
  font-weight: 400;
  min-height: 56px;
  font-size: var(--hl-fs-20);
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .hl-co-items li { grid-template-columns: 1fr auto; }
  .hl-co-items__qty { grid-column: 1; }
  .hl-co-items__total { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}

/* =====================================================================
   OpenCart 共用元件統一（會員、結帳、資訊頁等沿用原佈景 markup 的頁面）
   ===================================================================== */

#content h1, #content .page-title, #content > h2:first-child {
  color: var(--hl-roast);
  font-family: var(--hl-font-display);
  font-weight: 700;
}

.breadcrumb { background: none; padding: 24px 0 0; margin: 0 0 16px; font-size: var(--hl-fs-14); }
.breadcrumb > li + li::before { color: var(--hl-tea-line); }
.breadcrumb a { color: var(--hl-ink-soft); }

.btn-primary, .btn-primary:focus,
#content .btn-primary, .buttons .btn-primary {
  border: 1px solid var(--hl-roast) !important;
  border-radius: 2px !important;
  background: var(--hl-roast) !important;
  background-image: none !important;
  color: var(--hl-sugar) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.btn-primary:hover, #content .btn-primary:hover { background: var(--hl-roast-deep) !important; border-color: var(--hl-roast-deep) !important; }

.btn-default {
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  background: var(--hl-sugar);
  background-image: none;
  color: var(--hl-ink);
  text-shadow: none;
  box-shadow: none;
}

.form-control {
  border: 1px solid var(--hl-tea-line);
  border-radius: 2px;
  box-shadow: none;
  font-size: var(--hl-fs-16);   /* 16px 避免 iOS 自動放大 */
}
.form-control:focus { border-color: var(--hl-roast); box-shadow: 0 0 0 3px rgba(200, 144, 47, 0.25); }

.text-danger { color: var(--hl-red); }
.has-error .form-control { border-color: var(--hl-red); }
.has-error .control-label { color: var(--hl-red); }

.alert { border-radius: 2px; }
.alert-success { border-color: #B9CDB8; background: #EEF4EC; color: #2E4A2C; }
.alert-danger  { border-color: #E2B4B6; background: #FBEFEF; color: var(--hl-red); }
.alert-info    { border-color: var(--hl-tea-line); background: var(--hl-tea); color: var(--hl-ink); }
.alert a { color: inherit; text-decoration: underline; }

.pagination > li > a, .pagination > li > span { border-color: var(--hl-tea-line); color: var(--hl-ink); }
.pagination > .active > a, .pagination > .active > span,
.pagination > .active > a:hover, .pagination > .active > span:hover { background: var(--hl-roast); border-color: var(--hl-roast); color: var(--hl-sugar); }

.table > thead > tr > td, .table > thead > tr > th { background: var(--hl-tea); }

/* 加入購物車的通知 */
[data-notify="container"].alert-success { z-index: 2031; border: 1px solid #B9CDB8; box-shadow: none; }
