/* ==========================================================================
   分類頁（SEO 靜態頁）
   沿用既有 tokens；只補這幾頁特有的表格與區塊樣式。
   ========================================================================== */


/* 主視覺之後的數據區。標題與導言已在主視覺裡，這裡只放型號數與常見應用。 */
.page-head {
  padding: 36px 0 0;
  background:
    linear-gradient(180deg, rgba(244,245,247,.82), rgba(255,255,255,0) 78%),
    var(--blueprint-grid);
  background-size: auto, 52px 52px;
}
.page-head__inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--page-pad); }









.cat-facts {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--border-default);
  background:
    linear-gradient(90deg, rgba(244,245,247,.92), rgba(255,255,255,.96)),
    var(--blueprint-grid);
  background-size: auto, 32px 32px;
  box-shadow: var(--shadow-panel);
}
.cat-facts li {
  min-width: 168px;
  padding: 18px 22px; font-size: var(--fs-xs); color: var(--text-muted);
  border-right: 1px solid var(--border-default);
}
.cat-facts li:last-child { flex: 1; border-right: none; }
.cat-facts strong {
  display: block; font-family: var(--font-mono); font-size: 20px;
  color: var(--text-heading); font-weight: 600;
}
.cat-use {
  max-width: 760px;
  margin: 18px 0 0; padding-bottom: 6px;
  font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-body);
}
.cat-use strong { color: var(--text-heading); }

/* ---- 頂部分類切換列 ----
   沿用型錄頁側欄的視覺語言（編號 + 中英標題 + 型號數），
   但改成橫向、貼在頁面最上方，讓客戶隨時能跳到別的分類。 */
.cat-switch {
  border-bottom: 1px solid rgba(184,190,200,.7);
  background: rgba(255,255,255,.96);
  position: sticky; top: 76px; z-index: 20;
  backdrop-filter: blur(12px);
}
.cat-switch__inner {
  max-width: var(--content-max); margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex; overflow-x: auto; scrollbar-width: none;
}
.cat-switch__inner::-webkit-scrollbar { display: none; }

.cat-switch__item {
  flex: 1 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; text-decoration: none; white-space: nowrap;
  color: var(--text-heading);
  border-right: 1px solid var(--border-default);
  box-shadow: inset 0 -3px 0 transparent;
  transition: background var(--t-control) var(--ease),
              box-shadow var(--t-control) var(--ease),
              color var(--t-control) var(--ease),
              transform var(--t-control) var(--ease);
}
.cat-switch__item:first-child { border-left: 1px solid var(--border-default); }
.cat-switch__item:hover { background: var(--surface-panel); transform: translateY(-1px); }
.cat-switch__item.is-active {
  background: linear-gradient(180deg, var(--surface-panel), var(--white));
  color: var(--ys-red-600);
  box-shadow: inset 0 -3px 0 var(--ys-red-600);
}
.cat-switch__no { font-family: var(--font-mono); font-size: 11px; color: var(--ys-red-600); }
.cat-switch__text { display: flex; flex-direction: column; gap: 1px; }
.cat-switch__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cat-switch__en {
  font-family: var(--font-display); font-size: 9px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}
.cat-switch__count {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  padding-left: 4px;
}
@media (max-width: 900px) {
  .cat-switch { top: 64px; }
  .cat-switch__inner { padding: 0 var(--page-pad-sm); }
  .cat-switch__item { flex: 0 0 auto; padding: 12px 14px; }
  .cat-switch__en { display: none; }
}

/* ★ 款式切換靠 hidden 屬性隱藏。
   img.group__photo 有 display:block，選擇器權重高於瀏覽器預設的 [hidden]{display:none}，
   結果兩張圖同時顯示、切換看起來沒反應。這裡把 hidden 的優先權補回來。 */
[hidden] { display: none !important; }

/* ---- 群組區塊 ----
   版面與型錄頁共用 catalogue.css 的 .group / .model-table，
   確保兩邊的排版、間距、hover 行為完全一致，不另外發明一套。 */
.cat-body {
  max-width: var(--content-max); margin: 0 auto;
  padding: 52px var(--page-pad) 96px;
  /* 與型錄頁的 .groups 相同的縱向節奏，兩邊看起來才是同一個網站 */
  display: flex; flex-direction: column; gap: 56px;
}

/* ---- 底部區塊 ----
   .cat-other 的清單樣式仍被 products.html 的「依分類瀏覽」使用，因此保留。 */
.cat-other {
  max-width: var(--content-max); margin: 0 auto;
  padding: 0 var(--page-pad) 72px;
}
.cat-other h2 {
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 14px; border-bottom: 1px solid var(--border-default);
}
.cat-other ul {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px;
}
.cat-other a {
  display: block; padding: 14px 18px; text-decoration: none;
  border: 1px solid var(--border-default); color: var(--text-heading); font-size: var(--fs-sm);
  transition: border-color var(--t-control) var(--ease), background var(--t-control) var(--ease);
}
.cat-other a:hover { border-color: var(--ink-900); background: var(--surface-subtle); }

/* 完整型錄的入口。給知道自己要什麼、想跨分類比較的老客戶。 */
.cat-other__all { margin-top: 18px; }
.cat-other__all a {
  display: inline-block; padding: 0; border: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ys-red-600);
}
.cat-other__all a:hover { background: none; text-decoration: underline; }

/* 給螢幕閱讀器與搜尋引擎的表格說明，視覺上不顯示 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  .page-head { padding: 28px 0 4px; }
  .page-head__inner, .cat-body, .cat-other { padding-left: var(--page-pad-sm); padding-right: var(--page-pad-sm); }
}
@media (max-width: 820px) {
  .cat-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .cat-facts li {
    width: auto;
    min-width: 0;
    min-inline-size: 0;
    padding: 14px 12px;
    border-right: 1px solid var(--border-default);
    overflow-wrap: anywhere;
  }
  .cat-facts li:last-child { grid-column: 1 / -1; }
  .cat-facts strong { font-size: 18px; }
}

/* ==========================================================================
   分類頁的型號篩選列
   建置時就寫進 HTML（不是 JS 生的），所以沒有 JS 也看得到、爬蟲也讀得到。
   ========================================================================== */
.cat-filter {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border-default);
  box-shadow: 0 10px 24px rgba(14,16,19,.04);
  backdrop-filter: blur(12px);
}

.cat-filter__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px var(--page-pad);
  display: flex;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
}

.cat-filter__set {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cat-filter__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.cat-filter__label b {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-heading);
  margin-left: 6px;
}

.cat-filter__group {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--border-default);
  background: var(--surface-panel);
  padding: 3px;
}

/* 沿用全站的 .tab，只補上數字徽章與停用狀態 */
.cat-filter .tab {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.cat-filter .tab:hover {
  background: var(--white);
  box-shadow: var(--shadow-1);
}
.cat-filter .tab.is-on {
  background: var(--ink-900);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(14,16,19,.22);
}
.cat-filter .tab--variant.is-on {
  background: var(--ys-red-600);
  color: var(--white);
}
.cat-filter .tab em {
  font-style: normal;
  font-family: var(--ys-font-en, inherit);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: .55;
}
.cat-filter .tab.is-on em { opacity: .8; }
.cat-filter .tab.is-empty {
  opacity: .35;
  cursor: not-allowed;
}

.cat-filter__total {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.cat-filter__total strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ys-red-600);
}

.cat-none {
  margin: 64px auto;
  text-align: center;
  color: var(--ys-muted, #8a8a8a);
}
.cat-none a { color: var(--ys-red-600, #e60000); }

@media (max-width: 860px) {
  .cat-filter { position: static; }         /* 手機上不黏頂，畫面已經很窄 */
  .cat-filter__inner { gap: 10px 16px; }
  .cat-filter__total { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .cat-filter .tab { transition: opacity .15s ease; }
}
