/* ==========================================================================
   产品中心：列表筛选、车型网格、产品详情（图集、关键参数、参数表、详情、询价、相关车型）
   只在产品列表、产品分类、产品详情页加载（inc/setup.php）；变量与通用组件见 main.css。
   移动端优先；断点 640 / 900 / 1100
   ========================================================================== */

/* ---------- 列表筛选（复用 .subnav 胶囊）：不换行，一行放不下时左右滑动 ---------- */
/* position: relative 让胶囊里绝对定位的读屏文字（.visually-hidden）也被滚动容器裁剪，否则会把整页撑宽 */
.product-filter .subnav__list {
  position: relative; flex-wrap: nowrap; gap: 8px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  overflow-x: auto; scrollbar-width: thin;
}
.product-filter .subnav__list > li { flex: none; }
.product-filter .subnav__link { gap: 8px; min-height: 44px; }
.product-filter .subnav__link[aria-current="true"] { background: var(--navy-900); color: var(--white); }
.product-filter__count { font-family: var(--font-latin); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.product-filter .subnav__link[aria-current] .product-filter__count { color: var(--on-dark-muted); }

.product-filter__series { display: flex; align-items: center; gap: 0 14px; border-top: 1px solid var(--line); }
.product-filter__label { flex-shrink: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.product-filter__series .subnav__list { flex: 1; min-width: 0; margin-left: -6px; padding-block: 10px; padding-left: 6px; }
.product-filter__series .subnav__link { padding: 0 16px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.product-filter__series .subnav__link[aria-current="page"] { background: var(--teal-50); border-color: var(--teal-600); color: var(--teal-700); }
.product-filter__series .subnav__link[aria-current="page"] .product-filter__count { color: var(--teal-700); }

/* ---------- 车型网格 ---------- */
.product-catalog.page-section { padding-top: clamp(28px, 4vw, 48px); }
.catalog-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.catalog-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 15px; color: var(--muted); }
.catalog-count strong { margin-right: 2px; font-family: var(--font-cond); font-size: 28px; font-weight: 700; line-height: 1; color: var(--ink); }
.catalog-page { font-family: var(--font-latin); font-size: 14px; }
@media (min-width: 1100px) {
  .models-grid.models-grid--catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}
/* 手机端：列表卡片也显示三个重要参数，整行放在图文下方（拆开 .model-info，让参数能跨两列） */
@media (max-width: 639px) {
  .models-grid--catalog .model-card { grid-template-rows: auto auto 1fr; row-gap: 0; }
  .models-grid--catalog .model-media { grid-row: 1 / span 3; }
  .models-grid--catalog .model-info { display: contents; }
  .models-grid--catalog .model-tag { justify-self: start; }
  .models-grid--catalog .model-specs { display: grid; grid-column: 1 / -1; margin-top: 12px; padding-top: 10px; }
  .models-grid--catalog .model-specs div { display: flex; flex-direction: column; }
  .models-grid--catalog .model-specs dd { margin-top: auto; padding-top: 4px; }
}

/* 分类完整介绍（列表下方） */
.line-about { max-width: 820px; }
.line-about__title { font-size: clamp(22px, 3vw, 28px); }
.line-about .prose { margin-top: 14px; }
.lang-en .line-about__title { font-family: var(--font-latin); font-weight: 600; }
.line-about--gallery { max-width: none; }
.line-about--gallery .prose p { text-wrap: pretty; }
.line-about--gallery .prose img { margin-inline: 0; }

/* ==========================================================================
   产品详情
   ========================================================================== */

/* ---------- 首屏：图集 + 概要 ---------- */
.product-intro { padding-block: 28px var(--section-y); }
.product-intro__grid { display: grid; grid-template-areas: "head" "gallery" "body"; gap: 24px; }
.product-intro__head { grid-area: head; min-width: 0; }
.product-intro__gallery { grid-area: gallery; min-width: 0; }
.product-intro__body { grid-area: body; min-width: 0; }

.product-tag { position: relative; }
.product-tag::after { content: ""; position: absolute; inset: -11px -4px; } /* 扩大点击区域到 44px */
.product-tag:hover { color: var(--teal-700); text-decoration: underline; text-underline-offset: 2px; }
.product-model {
  display: block; margin-top: 12px;
  font-family: var(--font-cond); font-weight: 700; font-size: clamp(36px, 9vw, 60px); line-height: 1; letter-spacing: 0.02em;
  color: var(--ink); overflow-wrap: anywhere;
}
.product-name { display: block; margin-top: 12px; font-size: clamp(20px, 4.6vw, 26px); line-height: 1.4; font-weight: 700; color: var(--ink); }
.lang-en .product-name { font-family: var(--font-latin); font-weight: 600; letter-spacing: 0; }
.product-subtitle { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--muted); }

.product-excerpt { color: var(--body); }
.product-keyspecs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 1px;
  margin: 24px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line);
}
.product-keyspec { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 10px; background: var(--white); }
.product-keyspec dt { font-size: 13px; line-height: 1.4; color: var(--muted); }
/* 数值字号按长度分三档（is-mid 5–7 个字符、is-long 8 个以上），保证 375px 下数值和单位在一行 */
.product-keyspec dd {
  order: -1; margin: 0; overflow-wrap: anywhere;
  font-family: var(--font-cond); font-weight: 700; font-size: clamp(26px, 7vw, 32px); line-height: 1.05; letter-spacing: 0.01em; color: var(--ink);
}
.product-keyspec dd.is-mid { font-size: clamp(20px, 5.6vw, 28px); }
.product-keyspec dd.is-long { font-size: clamp(17px, 4.6vw, 22px); }
.product-keyspec dd small { margin-left: 3px; font-family: var(--font-latin); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.product-keyspec .spec-na { color: var(--muted); }

.product-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.product-actions .latin { font-weight: 600; letter-spacing: 0.02em; }
.product-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 12px; }
.product-links a { min-height: 44px; }

@media (max-width: 639px) {
  .product-actions .btn { flex: 1 1 100%; }
}
@media (min-width: 900px) {
  .product-intro { padding-top: 48px; }
  .product-intro__grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "gallery head" "gallery body";
    gap: 20px 48px; align-items: start;
  }
  .product-intro__gallery { position: sticky; top: calc(var(--header-h) + 24px); }
  .product-intro__head { padding-top: 4px; }
  .product-model { font-size: clamp(40px, 4.4vw, 60px); }
  .product-name { font-size: clamp(20px, 2.2vw, 26px); }
  .product-keyspec { padding: 16px 14px; }
  .product-keyspec dd { font-size: clamp(26px, 2.6vw, 34px); }
  .product-keyspec dd.is-mid { font-size: clamp(22px, 2.2vw, 30px); }
  .product-keyspec dd.is-long { font-size: clamp(18px, 1.8vw, 24px); }
}
@media (min-width: 1100px) {
  .product-intro__grid { column-gap: 72px; }
}

/* ---------- 图集 ---------- */
.product-gallery__stage { display: grid; gap: 12px; }
.product-gallery__slide {
  position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg); background: var(--surface); cursor: zoom-in;
}
.product-gallery__slide img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.product-gallery__slide:hover img { transform: scale(1.03); }
.product-gallery__slide--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: default; }
.product-gallery__zoom {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--navy-950) 62%, transparent); color: var(--white);
  transition: background-color var(--dur) var(--ease);
}
.product-gallery__slide:hover .product-gallery__zoom, .product-gallery__slide:focus-visible .product-gallery__zoom { background: var(--teal-600); }

.product-gallery__thumbs { display: none; }
.js .product-gallery.has-thumbs .product-gallery__slide:not(.is-active) { display: none; }
.js .product-gallery.has-thumbs .product-gallery__slide.is-active { animation: product-gallery-in 360ms var(--ease); }
.js .product-gallery__thumbs {
  position: relative; display: flex; gap: 10px; margin-top: 12px; padding: 2px; overflow-x: auto;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.product-gallery__thumbs li { flex: 0 0 auto; scroll-snap-align: start; }
.product-gallery__thumb {
  display: block; width: 88px; aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface);
  opacity: 0.72; transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery__thumb:hover { opacity: 1; }
.product-gallery__thumb[aria-current="true"] { border-color: var(--teal-500); opacity: 1; }
@media (min-width: 640px) { .product-gallery__thumb { width: 104px; } }
@keyframes product-gallery-in { from { opacity: 0.35; } to { opacity: 1; } }

/* ---------- 技术参数表 ---------- */
.spec-layout { display: grid; gap: 28px; }
.spec-aside .section-head { margin-bottom: 0; }
.spec-aside__cta { margin-top: 14px; min-height: 44px; }
.spec-main { min-width: 0; }
.spec-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-sm); }
.spec-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; line-height: 1.6; }
.spec-table thead th {
  padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left;
  font-family: var(--font-latin); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.spec-table thead th:first-child { width: 46%; }
.spec-table tbody th, .spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.spec-table tbody th { font-weight: 500; color: var(--body); }
.spec-table td { font-family: var(--font-latin); font-weight: 600; color: var(--ink); }
.spec-table td.is-text { font-weight: 400; color: var(--body); } /* 长段文字（如“注”）不加粗 */
.spec-table tbody tr:not(.spec-table__group):hover > * { background: var(--surface); }
.spec-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.spec-table__unit {
  display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 4px; background: var(--surface);
  font-family: var(--font-latin); font-size: 12px; font-weight: 500; line-height: 20px; color: var(--muted); white-space: nowrap; vertical-align: 1px;
}
.spec-table__group th {
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--teal-50); text-align: left;
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em; color: var(--teal-700);
}
.spec-table tbody + tbody .spec-table__group th { border-top: 1px solid var(--line); }
.spec-na { color: var(--muted); font-weight: 400; }
.spec-note {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; padding: 12px 16px;
  border-left: 3px solid var(--teal-500); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--white);
  font-size: 14px; line-height: 1.7; color: var(--body);
}
.spec-note strong { color: var(--ink); }
@media (min-width: 640px) {
  .spec-table { font-size: 15px; }
  .spec-table thead th, .spec-table tbody th, .spec-table td, .spec-table__group th { padding-inline: 20px; }
  .spec-table thead th:first-child { width: 42%; }
}
@media (min-width: 1100px) {
  .spec-layout { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.6fr); gap: 64px; align-items: start; }
  .spec-aside { position: sticky; top: calc(var(--header-h) + 32px); }
  .spec-table tbody th, .spec-table td { padding-block: 14px; }
}

/* ---------- 产品详情（正文） ---------- */
.product-details .prose > :first-child { margin-top: 0; }
.product-details .prose .wp-block-table { margin-block: 1.4em; }
/* 配置表按内容分配列宽（编辑器默认的等宽布局在手机上会把“配置”列挤得很窄） */
.product-details .prose .wp-block-table table { table-layout: auto; }
.product-details .prose .wp-block-table thead th { white-space: nowrap; }
.product-zoom { display: block; cursor: zoom-in; }

/* ---------- 询价区 ---------- */
.product-inquiry .inquiry-copy h2 { overflow-wrap: anywhere; }
.product-inquiry__form { min-width: 0; }

/* ---------- 相关车型、上一款/下一款 ---------- */
.product-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.product-pager__link {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; padding: 12px 18px;
  border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); color: var(--ink);
  transition: box-shadow var(--dur) var(--ease);
}
.product-pager__link:hover { box-shadow: var(--shadow); color: var(--ink); }
.product-pager__link--next { margin-left: auto; align-items: flex-end; text-align: right; }
.product-pager__dir { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.product-pager__model { font-family: var(--font-cond); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.product-pager__link:hover .product-pager__model { color: var(--teal-600); }

/* ---------- 打印：只保留产品信息与参数 ---------- */
@media print {
  .site-header, .site-footer, .action-bar, .page-hero, .product-gallery__thumbs, .product-actions, .product-links,
  .spec-aside__cta, .product-inquiry, .product-related, .skip-link { display: none !important; }
  .product-intro, .section { padding-block: 16px; }
  .product-intro__gallery { position: static; }
  .spec-layout { display: block; }
  .spec-card { box-shadow: none; border: 1px solid var(--line); }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
