/* pc-header.css — 新站 header 移植到舊站（桌面＋手機共用）。
   對照新站：TopBar.tsx（utility #fdf7f4／main h-72px）、PromoBadges.tsx（四色膠囊）、
   HorizontalNav.tsx（nav 15px／hover 底線／<lg 漢堡）。
   鐵律：全部規則只針對 #pc-header 入面，唔准全域污染，唔准 !important。 */
#pc-header {
  --pch-primary: #c0604a;
  --pch-primary-soft: #fdf2ef;
  --pch-text: #3c3c3c;
  --pch-gray700: #374151;
  --pch-muted: #6b7280;
  --pch-faint: #9ca3af;
  --pch-border: #f3f4f6;
  --pch-gray: #f3f4f6;
  --pch-utility-bg: #fdf7f4;
  position: relative;
  /* 唔設 z-index：如果設咗，#pc-header 會自成 stacking context，
     入面嘅 panel 就永遠低過舊站右側浮動工具列（z-index:999999）。
     panel／drawer 自己各自設 z-index，就可以直接喺 root context 排層。 */
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC",
    "PingFang HK", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--pch-text);
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-align: left;
}
#pc-header, #pc-header *, #pc-header *::before, #pc-header *::after { box-sizing: border-box; }
#pc-header ul { list-style: none; margin: 0; padding: 0; }
#pc-header li { list-style: none; margin: 0; padding: 0; }
#pc-header a { text-decoration: none; color: inherit; }
#pc-header h4, #pc-header p { margin: 0; font-size: inherit; }
#pc-header button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#pc-header img { border: 0; vertical-align: middle; }
#pc-header [hidden] { display: none; }
.pch-wrap { max-width: 1152px; margin: 0 auto; padding: 0 16px; }

/* ── ① 服務承諾 + 帳戶工具列 ── */
.pch-utility { background: var(--pch-utility-bg); border-bottom: 1px solid var(--pch-border); }
.pch-utility-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.pch-badges { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pch-badges::-webkit-scrollbar { display: none; }
.pch-badges li { flex-shrink: 0; }
.pch-badge { display: block; white-space: nowrap; border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 500; line-height: 16px; color: #fff; cursor: default; }
.pch-account { display: flex; align-items: center; gap: 16px; color: var(--pch-muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.pch-account a:hover { color: var(--pch-primary); }
#pc-header .pch-lang { position: relative; }
#pc-header .pch-lang-btn { color: var(--pch-muted); font-size: 12px; }
#pc-header .pch-lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1000001; min-width: 132px; padding: 6px; background: #fff; border: 1px solid var(--pch-border, #e5e7eb); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
#pc-header .pch-lang-menu a { display: block; padding: 6px 10px; font-size: 12px; color: var(--pch-text, #364153); border-radius: 6px; white-space: nowrap; }
#pc-header .pch-lang-menu a:hover { background: var(--pch-gray, #f5f5f5); color: var(--pch-primary, #f77514); }
#pc-header .pch-lang-menu a.pch-lang-active { color: var(--pch-primary, #f77514); font-weight: 600; }

/* ── ② 主 bar ── */
.pch-main { background: #fff; border-bottom: 1px solid var(--pch-border); }
.pch-main-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.pch-logo { flex-shrink: 0; display: flex; align-items: center; }
.pch-logo img { height: 32px; width: 147px; object-fit: contain; }
/* 新站只喺 DOM 保留 tagline，視覺上唔顯示；舊站跟隨，令搜尋框可以有 640px */
.pch-tagline { display: none; color: var(--pch-muted); font-size: 12px; line-height: 1.4; white-space: nowrap; border-left: 1px solid #e5e7eb; padding-left: 16px; }
#pc-header .pch-search-toggle { display: none; }
.pch-search { flex: 0 1 640px; display: flex; flex-direction: row-reverse; align-items: center; width: 640px; max-width: 640px; margin-left: auto; margin-right: 0; background: var(--pch-gray); border: 1px solid transparent; border-radius: 999px; overflow: hidden; }
.pch-search:focus-within { background: #fff; border-color: var(--pch-primary); }
.pch-search input { flex: 1; min-width: 0; height: 40px; padding: 0 16px 0 4px; border: 0; background: transparent; font-size: 14px; color: var(--pch-text); outline: none; border-radius: 0; -webkit-appearance: none; }
.pch-search button { display: flex; align-items: center; justify-content: center; width: 44px; height: 40px; margin-left: 6px; color: var(--pch-muted); flex-shrink: 0; }
.pch-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pch-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; color: var(--pch-gray700); }
.pch-icon:hover { color: var(--pch-primary); background: var(--pch-primary-soft); }
/* 購物車 CTA：對齊新站（terracotta 膠囊按鈕） */
.pch-cart-cta { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: #c0604a; color: #fff; font-size: 14px; font-weight: 500; }
.pch-cart-cta:hover { background: #a94f3b; color: #fff; }
.pch-cart-cta svg { flex-shrink: 0; }
.pch-cart-cta .pch-qty { position: static; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: rgba(255,255,255,.25); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.pch-qty { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--pch-primary); color: #fff; font-size: 10px; line-height: 18px; text-align: center; font-weight: 700; }

/* ── ③ 分類 nav ── */
.pch-nav { background: #fff; border-top: 1px solid var(--pch-border); }
.pch-nav-inner { position: relative; display: flex; align-items: center; }
.pch-nav-list { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
/* li 預設 static：大 panel 要相對 .pch-nav-inner 置中，唔可以相對每個 li */
.pch-nav-item { position: static; display: flex; align-items: center; }
#pc-header .pch-nav-link { position: relative; display: flex; align-items: center; padding: 10px; font-size: 15px; font-weight: 500; color: #364153; white-space: nowrap; }
.pch-nav-link::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--pch-primary); transform: scaleX(0); transition: transform .15s; }
.pch-nav-item:hover > .pch-nav-link, .pch-nav-item.is-open > .pch-nav-link { color: var(--pch-primary); }
.pch-nav-item:hover > .pch-nav-link::after, .pch-nav-item.is-open > .pch-nav-link::after { transform: scaleX(1); }
.pch-caret { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 24px; margin-left: -6px; color: var(--pch-faint); }
.pch-caret svg { width: 14px; height: 14px; transition: transform .15s; }
.pch-nav-item:hover .pch-caret svg, .pch-nav-item.is-open .pch-caret svg { transform: rotate(180deg); color: var(--pch-primary); }

/* 細 panel（關於我們／會員專區）跟返新站：貼住嗰個 L1，最右兩個改右對齊 */
.pch-nav-item--simple { position: relative; }
.pch-nav-item--simple > .pch-panel { left: 0; right: auto; transform: none; }
.pch-nav-item--simple:nth-last-child(-n+2) > .pch-panel { left: auto; right: 0; }

/* ── panels ── */
.pch-panel { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: -1px; background: #fff; border: 1px solid #e5e7eb; border-top: 2px solid var(--pch-primary); border-radius: 0 0 8px 8px; box-shadow: 0 12px 32px rgba(0,0,0,.1); max-height: 75vh; overflow: auto; z-index: 1000000; display: none; text-align: left; }
.pch-panel--simple { width: 256px; }
.pch-panel--grid { width: min(96vw, 736px); }
.pch-panel--blog { width: min(96vw, 896px); }
.pch-panel--grouped { width: min(96vw, 960px); }
.pch-panel--brand { width: min(96vw, 1024px); }
.pch-nav-item:hover > .pch-panel, .pch-nav-item.is-open > .pch-panel { display: block; }
.pch-panel-inner { padding: 20px; font-size: 14px; }
.pch-simple ul li a, .pch-grid-col ul li a, .pch-pane-list li a { display: block; padding: 4px 0; color: var(--pch-muted); }
.pch-simple a:hover, .pch-grid-col a:hover, .pch-pane-list a:hover { color: var(--pch-primary); }
.pch-grid { display: grid; grid-template-columns: repeat(var(--pch-cols, 4), minmax(0,1fr)); gap: 16px; }
.pch-panel--blog .pch-grid { grid-template-columns: repeat(var(--pch-cols, 3), minmax(0,1fr)); }
.pch-grid-title { display: block; font-weight: 600; color: var(--pch-text); padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--pch-border); }
.pch-wide { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--pch-border); }
.pch-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pch-chip { padding: 4px 12px; background: var(--pch-gray); border-radius: 999px; font-size: 12px; color: var(--pch-muted); }
.pch-chip:hover { background: var(--pch-primary-soft); color: var(--pch-primary); }

/* split（瘋狂喵／瘋狂犬） */
/* 貓狗大 panel：對齊新站 grouped 佈局（熱門 tag＋224px rail＋3 欄品牌） */
#pc-header .pch-split { padding: 0; }
#pc-header .pch-quick { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--pch-border); }
#pc-header .pch-quick > span { flex: none; font-size: 12px; color: var(--pch-muted); }
#pc-header .pch-quick ul { display: flex; flex-wrap: wrap; gap: 8px; }
#pc-header .pch-quick-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(192, 96, 74, .05); color: var(--pch-primary); font-size: 12px; line-height: 16px; }
#pc-header .pch-quick-tag:hover { background: rgba(192, 96, 74, .12); }
#pc-header .pch-split-body { display: grid; grid-template-columns: 224px minmax(0, 1fr); }
#pc-header .pch-rail { position: sticky; top: 0; align-self: start; padding: 0 20px 0 0; border-right: 1px solid var(--pch-border); background: #fff; }
#pc-header .pch-rail-title { padding: 0 8px; margin: 16px 0 4px; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: #9ca3af; }
#pc-header .pch-rail-title:first-child { margin-top: 0; }
#pc-header .pch-rail-list { margin: 0; }
#pc-header .pch-rail-title:first-child + .pch-rail-list { margin-top: 0; }
#pc-header .pch-rail-btn { display: block; width: 100%; text-align: left; padding: 5px 8px; border-left: 2px solid transparent; font-size: 13px; line-height: 20px; color: #4b5563; }
#pc-header .pch-rail-btn:hover { color: var(--pch-primary); }
#pc-header .pch-rail-btn.is-active { border-left-color: var(--pch-primary); color: var(--pch-primary); font-weight: 600; }
#pc-header .pch-detail { padding: 16px 20px; min-width: 0; }
#pc-header .pch-pane-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; border: 0; padding: 0; }
#pc-header .pch-pane-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
#pc-header .pch-pane-title { font-size: 15px; font-weight: 600; color: var(--pch-text); }
#pc-header .pch-pane-count { font-size: 12px; color: var(--pch-muted); white-space: nowrap; }
#pc-header .pch-pane-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#pc-header .pch-pane-search-wrap { position: relative; display: block; }
#pc-header .pch-pane-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
#pc-header .pch-pane-search { height: 32px; width: 176px; padding: 0 12px 0 28px; border: 1px solid var(--pch-border); border-radius: 999px; background: #fafafa; font-size: 13px; color: var(--pch-text); outline: none; }
#pc-header .pch-pane-search:focus { border-color: var(--pch-primary); background: #fff; }
#pc-header .pch-pane-all { font-size: 12px; color: var(--pch-primary); white-space: nowrap; }
#pc-header .pch-pane-list { columns: 3; column-gap: 24px; }
#pc-header .pch-pane-list li { break-inside: avoid; }
#pc-header .pch-pane-list li[hidden] { display: none; }

/* 品牌 */
.pch-brand-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pch-brand-bar { margin-bottom: 12px; }
.pch-brand-bar input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; }
.pch-brand-list { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; }
.pch-brand-list a { display: block; padding: 4px 0; font-size: 13px; color: var(--pch-muted); }
.pch-brand-list a:hover { color: var(--pch-primary); }

/* ── 手機抽屜 ── */
.pch-burger { display: none; }
.pch-nav-caption { display: none; font-size: 12px; font-weight: 500; color: var(--pch-faint); }
.pch-drawer { position: fixed; inset: 0; background: #fff; z-index: 1000001; display: flex; flex-direction: column; }
.pch-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.pch-drawer-head button { font-size: 18px; line-height: 1; padding: 8px; color: var(--pch-gray700); }
.pch-drawer-body { flex: 1; overflow: auto; padding: 8px 16px 24px; -webkit-overflow-scrolling: touch; }
.pch-drawer-list > li { border-bottom: 1px solid var(--pch-border); }
.pch-drawer-list > li > a, .pch-drawer-list summary { display: block; padding: 12px 0; font-size: 16px; font-weight: 500; color: var(--pch-text); cursor: pointer; }
.pch-drawer-list summary { position: relative; padding-right: 28px; list-style: none; }
.pch-drawer-list summary::-webkit-details-marker { display: none; }
.pch-drawer-list summary::after { content: "›"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--pch-faint); font-size: 18px; line-height: 1; }
.pch-drawer-list details[open] > summary::after { transform: translateY(-50%) rotate(-90deg); }
.pch-drawer-list details[open] > summary { color: var(--pch-primary); }
.pch-drawer-list details ul { padding-left: 12px; }
.pch-drawer-list .pch-m-l2 > a, .pch-drawer-list .pch-m-l2 > details > summary { font-size: 14px; font-weight: 400; padding: 8px 0; }
.pch-m-l3 a { display: block; padding: 6px 0; font-size: 13px; color: var(--pch-muted); }
.pch-m-all { display: block; font-size: 12px; color: var(--pch-primary); padding: 0 0 10px 12px; }
.pch-drawer-blog { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--pch-border); }
.pch-drawer-blog span { color: var(--pch-faint); font-size: 12px; }
.pch-drawer-account { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 16px; font-size: 14px; color: var(--pch-muted); }

@media (max-width: 1199px) {
  .pch-tagline { display: none; }
  .pch-nav-link { font-size: 14px; padding: 10px 6px; }
}
@media (max-width: 1023px) {
  .pch-utility { display: none; }
  /* 手機：logo+icon 一行，搜尋框獨佔第二行常駐（唔可以收埋，舊手機版本身有搜尋列） */
  .pch-main-inner { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .pch-logo { order: 1; }
  .pch-logo img { height: 24px; width: 110px; }
  .pch-actions { order: 2; margin-left: auto; }
  .pch-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .pch-search input { height: 36px; }
  .pch-search button { height: 36px; }
  .pch-nav-list { display: none; }
  .pch-nav-inner { justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
  .pch-nav-caption { display: block; }
  .pch-burger { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--pch-gray700); border-radius: 8px; }
  .pch-brand-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* 手機模板：任何寬度都用手機版式（包括 iPad 橫放），所以唔使輸出隱藏嘅桌面 nav。
   由 shell.htm 喺 $pc_header_variant=='mobile' 時加 .pch--mobile-only。 */
#pc-header.pch--mobile-only .pch-utility { display: block; }
#pc-header.pch--mobile-only .pch-account { display: none; }
#pc-header.pch--mobile-only .pch-utility-inner { min-height: 37px; }
#pc-header.pch--mobile-only .pch-main-inner { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
#pc-header.pch--mobile-only .pch-logo { order: 1; }
#pc-header.pch--mobile-only .pch-logo img { height: 24px; width: 110px; }
#pc-header.pch--mobile-only .pch-actions { order: 2; margin-left: auto; }
#pc-header.pch--mobile-only .pch-cart-cta { width: 36px; height: 36px; padding: 0; justify-content: center; background: transparent; color: var(--pch-gray700); }
#pc-header.pch--mobile-only .pch-cart-label { display: none; }
#pc-header.pch--mobile-only .pch-cart-cta .pch-qty { position: absolute; top: -2px; right: -2px; background: var(--pch-primary); }
#pc-header.pch--mobile-only .pch-search { display: none; order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
/* 手機搜尋：預設收埋做 icon（跟新站），按下先展開全寬輸入框 */
#pc-header.pch--mobile-only.is-search-open .pch-search { display: flex; }
#pc-header.pch--mobile-only .pch-search-toggle { display: flex; }
#pc-header.pch--mobile-only .pch-search input { height: 36px; }
#pc-header.pch--mobile-only .pch-search button { height: 36px; }
#pc-header.pch--mobile-only .pch-nav-list { display: none; }
/* 手機 nav 列收窄：新站 41px（caption + burger 同排，無上下 padding） */
#pc-header.pch--mobile-only .pch-nav-inner { justify-content: space-between; align-items: center; padding: 0; height: 41px; }
#pc-header.pch--mobile-only .pch-nav-caption { display: block; }
#pc-header.pch--mobile-only .pch-burger { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--pch-gray700); border-radius: 8px; }

/* 舊手機站 fixed header 嘅 50px 補位（.ht-zw 喺 header 之後嘅 body 都會出現）。
   新 header 已經喺文檔流入面，唔使補位。
   注意：呢個 CSS 檔只會喺新 header 開關打開時先被載入，所以呢條規則只影響新 header 頁面。 */
.ht-zw { display: none; }

/* 服務承諾 tooltip：還原舊站 hover 效果（舊站 styles/default.css .top-icon-box） */
#pc-header .pch-badge-item { position: relative; }
#pc-header .pch-badge-tip { display: none; position: absolute; left: 10px; top: calc(100% + 8px); background: #c0604a; color: #fff; border-radius: 4px; padding: 2px 10px; white-space: nowrap; font-size: 12px; line-height: 18px; z-index: 1000001; }
#pc-header .pch-badge-tip::before { content: ""; position: absolute; left: 16px; bottom: 100%; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #c0604a; }
#pc-header .pch-badge-item:hover .pch-badge-tip,
#pc-header .pch-badge-item:focus-within .pch-badge-tip { display: block; }
/* 關鍵：badges 容器本身 overflow-x:auto，會把 tooltip 裁走；桌面四個徽章放得晒就唔使捲 */
@media (min-width: 1024px) { #pc-header .pch-badges { overflow: visible; } }
/* 觸控冇 hover：唔好喺手機彈 tooltip */
@media (hover: none) { #pc-header .pch-badge-tip { display: none !important; } }

/* 專題分類：左邊幼貓特色卡 + 貓／狗健康兩欄，唔再出現空白欄 */
#pc-header .pch-panel--topics { width: min(96vw, 640px); }
#pc-header .pch-topics { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
#pc-header .pch-topic-feature { background: #fdf3ee; border: 1px solid #f3d9cc; border-radius: 8px; padding: 14px; }
#pc-header .pch-topic-feature-title { display: block; font-size: 15px; font-weight: 700; color: var(--pch-primary); }
#pc-header .pch-topic-feature-desc { margin: 6px 0 10px; font-size: 12px; color: var(--pch-muted); line-height: 1.6; }
#pc-header .pch-topic-all { font-size: 12px; color: var(--pch-primary); font-weight: 600; }
#pc-header .pch-topic-caption { display: block; font-size: 11px; letter-spacing: 1px; color: var(--pch-muted); margin-bottom: 4px; }
#pc-header .pch-topics .pch-grid { gap: 16px; }
/* 工具列購物車：唔用括號，有貨先出細 pill（同主 CTA 一致） */
#pc-header .pch-util-cart { display: inline-flex; align-items: center; gap: 4px; }
#pc-header .pch-qty--util { position: static; background: var(--pch-primary); color: #fff; }

/* 手機抽屜語言切換 */
#pc-header .pch-drawer-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0 0; margin-top: 8px; border-top: 1px solid var(--pch-border, #e5e7eb); }
#pc-header .pch-drawer-langs-title { font-size: 11px; color: var(--pch-muted, #6b7280); }
#pc-header .pch-drawer-langs a { padding: 4px 10px; font-size: 12px; color: var(--pch-text, #364153); border: 1px solid var(--pch-border, #e5e7eb); border-radius: 999px; }
#pc-header .pch-drawer-langs a.pch-lang-active { color: var(--pch-primary, #f77514); border-color: var(--pch-primary, #f77514); font-weight: 600; }
