/* Trang danh mục (products.html) và chi tiết sản phẩm (san-pham/*.html), 11/2026. Nạp sau home.css, dùng chung token màu,
   đầu trang, chân trang. Các trang này do scripts/build-products.mjs sinh ra từ dữ liệu trang quản trị. */

.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 40px 0 44px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs li { display: flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; letter-spacing: -0.02em; margin-top: 20px; max-width: 820px; }
.page-head .intro { margin-top: 14px; }

/* ---------- Danh mục ---------- */
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.cat-bar a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); }
.cat-bar a small { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-bar a:hover { border-color: var(--ink); }
.cat-bar a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-bar a[aria-current="true"] small { color: #B9C3D1; }

.catalog { padding: 48px 0 96px; }
.cat-group + .cat-group { margin-top: 64px; }
.cat-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: 24px; }
.cat-group-head h2 { font-size: 22px; }
.cat-group-head p { color: var(--muted); font-size: 14px; }
.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: #fff; transition: border-color .2s; }
.sp-card:hover { border-color: var(--ink); }
.sp-card-img { aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.sp-card-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.sp-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 20px 20px; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sp-meta .t-ac { color: #157A33; } /* xanh logo đậm hơn để đủ tương phản 4.5:1 ở cỡ chữ 13px */
.sp-meta .t-dc { color: var(--brand); }
.sp-meta .t-other { color: var(--red); }
.sp-card h3 { font-size: 18px; line-height: 1.35; margin-top: 8px; }
.sp-card h3 a::after { content: ""; position: absolute; inset: 0; }
.sp-card p { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.sp-card .link-arrow { margin-top: auto; padding-top: 14px; font-size: 14px; }
.is-hidden { display: none !important; }

.help-band { background: var(--navy); color: #C9D3E0; position: relative; }
.help-band::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--stripe); }
.help-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding: 64px 0; }
.help-band h2 { color: #fff; font-size: clamp(24px, 2.6vw, 32px); }
.help-band p { margin-top: 12px; max-width: 560px; }
.help-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.help-band .btn-line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.help-band .btn-line:hover { border-color: #fff; }

/* ---------- Chi tiết sản phẩm ---------- */
.pd { padding: 40px 0 72px; }
.pd-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start; }
.pd-gallery { position: sticky; top: calc(var(--header-h) + 20px); }
.pd-main { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 32px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.pd-main img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pd-thumbs button { width: 76px; height: 76px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; }
.pd-thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd-info h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin-top: 10px; }
.pd-lead { margin-top: 16px; font-size: 17px; color: var(--body); }
.pd-facts { margin-top: 24px; border-top: 1px solid var(--line); }
.pd-facts div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pd-facts dt { color: var(--muted); }
.pd-facts dd { margin: 0; color: var(--ink); font-weight: 600; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pd-source { margin-top: 16px; font-size: 14px; color: var(--muted); }
.pd-source a { color: var(--brand); font-weight: 600; }

.pd-section { padding: 64px 0; border-top: 1px solid var(--line); }
.pd-cols { display: grid; grid-template-columns: 280px 1fr; gap: 48px; }
.pd-cols h2 { font-size: 24px; }
.pd-text p + p { margin-top: 14px; }
.pd-text { font-size: 16px; max-width: 760px; }
.feat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.feat-list li { position: relative; padding: 12px 0 12px 28px; border-bottom: 1px solid var(--line); font-size: 15px; }
.feat-list li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.svc-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc-mini li { padding: 20px; border: 1px solid var(--line); border-radius: var(--r); }
.svc-mini b { display: block; color: var(--ink); font-size: 16px; }
.svc-mini span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.svc-mini i { display: block; width: 24px; height: 3px; margin-bottom: 14px; background: var(--c); }

@media (max-width: 960px) {
  .sp-grid { grid-template-columns: 1fr 1fr; }
  .help-inner { grid-template-columns: 1fr; gap: 24px; padding: 48px 0; }
  .help-actions { justify-content: flex-start; }
  .pd-grid { grid-template-columns: 1fr; gap: 32px; }
  .pd-gallery { position: static; }
  .pd-main { aspect-ratio: 4 / 3; }
  .pd-cols { grid-template-columns: 1fr; gap: 20px; }
  .svc-mini { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-head { padding: 28px 0 32px; }
  .sp-grid { grid-template-columns: 1fr; }
  .feat-list { grid-template-columns: 1fr; }
  .pd-facts div { grid-template-columns: 120px 1fr; }
  .pd-actions .btn { flex: 1 1 100%; }
  .pd-section { padding: 48px 0; }
}

/* ---------- Bảng thông số kỹ thuật ---------- */
.spec-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.spec { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.spec th, .spec td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.spec thead th { background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.spec tbody th { width: 28%; color: var(--muted); font-weight: 500; }
.spec td { color: var(--ink); font-weight: 500; }
.spec td + td { border-left: 1px solid var(--line); }
.spec .spec-group th { background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.spec tbody tr:last-child > * { border-bottom: 0; }
.spec-note { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 760px; }
@media (max-width: 640px) {
  .spec { font-size: 14px; }
  .spec th, .spec td { padding: 10px 12px; }
}

/* =========================================================================================
   Trang danh mục (thiết kế lại 11/2026): dàn sản phẩm, biểu đồ công suất, thẻ lớn + thẻ đổi góc ảnh.
   Ảnh sản phẩm nền trắng: đặt trên nền --stage với mix-blend-mode: multiply để nền trắng của ảnh chìm vào nền.
   ========================================================================================= */
:root { --stage: #EDF0F3; }
.cat-hero { background: linear-gradient(180deg, #F6F7F9 0%, var(--stage) 100%); padding-top: 32px; overflow: hidden; }
.cat-hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: end; margin-top: 28px; }
.cat-hero h1 { font-size: clamp(30px, 3.8vw, 50px); line-height: 1.1; letter-spacing: -0.025em; margin-top: 16px; max-width: 760px; }
.cat-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin: 0; border-top: 1px solid var(--line-strong); }
.cat-stats div { padding: 14px 20px 0 0; }
.cat-stats div + div { padding-left: 20px; border-left: 1px solid var(--line-strong); }
.cat-stats dt { font-size: 13px; color: var(--muted); }
.cat-stats dd { margin: 4px 0 0; font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cat-stats dd small { font-size: 15px; font-weight: 600; color: var(--muted); }
.cat-stats dd.sm { font-size: 15px; line-height: 1.4; letter-spacing: 0; padding-top: 6px; }

.lineup { margin-top: 36px; position: relative; }
.lineup::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(180deg, transparent, rgba(14, 26, 43, .06)); pointer-events: none; }
.lineup-row { --stage-h: clamp(220px, 27vw, 380px); display: flex; align-items: flex-end; gap: clamp(10px, 2vw, 36px); width: min(1280px, 100% - 32px); margin-inline: auto; height: calc(var(--stage-h) + 28px); }
/* Mỗi trụ chiếm phần rộng bằng nhau, ảnh co theo cả chiều cao (--h × sàn) lẫn chiều rộng: không bao giờ tràn khung. */
.lineup-item { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px; }
.lineup-item::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 18px; height: 12px; border-radius: 50%; background: radial-gradient(closest-side, rgba(14, 26, 43, .22), transparent); }
.lineup-item img { position: relative; max-height: calc(var(--stage-h) * var(--h)); max-width: 100%; width: auto; height: auto; mix-blend-mode: multiply; transition: transform .35s ease; }
.lineup-item span { position: absolute; bottom: -4px; left: 50%; transform: translate(-50%, 8px); white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; opacity: 0; transition: opacity .2s, transform .2s; }
.lineup-item:hover img, .lineup-item:focus-visible img { transform: translateY(-6px); }
.lineup-item:hover span, .lineup-item:focus-visible span { opacity: 1; transform: translate(-50%, 0); }

.cat-sticky { position: sticky; top: var(--header-h); z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.cat-sticky .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.cat-sticky .cat-bar { margin-top: 0; }
.cat-jump { font-size: 14px; font-weight: 600; color: var(--brand); white-space: nowrap; }

/* ---------- Biểu đồ công suất ---------- */
.power-sec { padding: 72px 0 24px; }
.power-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 32px; }
.ladder { border-top: 1px solid var(--ink); }
.lad-axis, .lad-row { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: center; }
.lad-axis { height: 56px; border-bottom: 1px solid var(--line); }
.lad-scale { position: relative; height: 100%; }
.lad-scale .zone { position: absolute; top: 8px; height: 18px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-left: 1px dashed var(--line-strong); padding-left: 8px; white-space: nowrap; overflow: hidden; }
.lad-scale i { position: absolute; bottom: 6px; transform: translateX(-50%); font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lad-row { min-height: 64px; border-bottom: 1px solid var(--line); transition: background .15s; }
.lad-row:hover { background: #F7F8FA; }
.lad-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lad-name img { width: 44px; height: 44px; object-fit: contain; mix-blend-mode: multiply; flex: none; }
.lad-name b { display: block; font-size: 14px; line-height: 1.3; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lad-name > span { min-width: 0; }
.lad-name small { font-size: 12px; font-weight: 600; }
.lad-track { position: relative; height: 100%; }
.lad-track i { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 999px; background: currentColor; transition: height .15s, margin .15s; }
.lad-track i.t-dc { color: var(--brand); }
.lad-track i.t-ac { color: #157A33; }
.lad-track i.t-other { color: var(--red); }
.lad-track em { position: absolute; top: 50%; transform: translate(10px, -50%); font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lad-track em.to-left { transform: translate(-10px, -50%); }
.lad-row:hover .lad-track i { height: 14px; margin-top: -7px; }

/* ---------- Nhóm sản phẩm ---------- */
.catalog { padding: 56px 0 96px; }
.cat-group + .cat-group { margin-top: 88px; }
.grp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: end; padding-bottom: 16px; border-bottom: 1px solid var(--ink); margin-bottom: 24px; }
.grp-no { font-size: 56px; line-height: .9; font-weight: 700; color: #75839A; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.grp-head h2 { font-size: clamp(24px, 2.6vw, 32px); }
.grp-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.grp-count { font-size: 14px; font-weight: 600; color: var(--muted); }

.kw { margin-top: 10px; color: var(--muted); font-size: 15px; font-weight: 600; }
.kw b { font-size: 30px; line-height: 1; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 8px; }

.feat-card { display: grid; grid-template-columns: 1.25fr 1fr; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.feat-media { background: var(--stage); padding: 32px 32px 20px; display: flex; flex-direction: column; }
.feat-main { flex: 1; display: grid; place-items: center; min-height: 380px; }
.feat-main img { max-height: 440px; width: auto; mix-blend-mode: multiply; transition: transform .4s ease; }
.feat-card:hover .feat-main img { transform: scale(1.03); }
.feat-angles { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feat-angles li { aspect-ratio: 1 / 1; display: grid; place-items: center; background: rgba(255, 255, 255, .55); border-radius: 4px; padding: 6px; }
.feat-angles img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.feat-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.feat-kicker { font-size: 13px; font-weight: 600; color: var(--muted); }
.feat-body h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; margin-top: 10px; }
.feat-body .kw b { font-size: 44px; }
.feat-desc { margin-top: 16px; color: var(--body); }
.feat-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.tile-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 16px; margin-top: 16px; }
.tile { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; transition: border-color .2s; }
.tile:hover { border-color: var(--ink); }
.tile-img { position: relative; aspect-ratio: 1 / 1; background: var(--stage); display: grid; place-items: center; padding: 28px; }
.tile-img img { position: absolute; inset: 28px; width: calc(100% - 56px); height: calc(100% - 56px); object-fit: contain; mix-blend-mode: multiply; transition: opacity .35s ease, transform .35s ease; }
.tile-img img.alt { opacity: 0; }
.tile.has-alt:hover .tile-img img:not(.alt) { opacity: 0; }
.tile.has-alt:hover .tile-img img.alt { opacity: 1; transform: scale(1.02); }
.tile-count { position: absolute; left: 14px; top: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.tile-type { font-size: 13px; font-weight: 600; }
.tile-type.t-ac { color: #157A33; }
.tile-type.t-dc { color: var(--brand); }
.tile-type.t-other { color: var(--red); }
.tile h3 { font-size: 18px; line-height: 1.3; margin-top: 4px; }
.tile h3 a::after { content: ""; position: absolute; inset: 0; }
.tile .link-arrow { margin-top: auto; padding-top: 16px; font-size: 14px; }

@media (max-width: 960px) {
  .cat-hero-grid, .power-head { grid-template-columns: 1fr; gap: 20px; }
  .tile-grid { --cols: 2 !important; }
  .lad-axis, .lad-row { grid-template-columns: 170px 1fr; gap: 14px; }
  .feat-card { grid-template-columns: 1fr; }
  .feat-main { min-height: 280px; }
  .feat-main img { max-height: 320px; }
  .feat-body { padding: 28px 24px; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .cat-jump { display: none; }
}
@media (max-width: 640px) {
  .cat-stats { grid-template-columns: 1fr 1fr; }
  .cat-stats div:last-child { display: none; }
  .cat-stats dd { font-size: 24px; }
  .lineup-row { --stage-h: 170px; gap: 6px; }
  .lineup-item:nth-child(4), .lineup-item:nth-child(5) { display: none; }
  .lad-axis { display: none; }
  .lad-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .lad-track { height: 22px; background-color: var(--bg-soft); border-radius: 999px; }
  .lad-track em { font-size: 12px; }
  .grp-no { font-size: 40px; }
  .grp-count { display: none; }
  .grp-head { grid-template-columns: auto 1fr; }
  .feat-angles { gap: 6px; }
  .feat-body .kw b { font-size: 36px; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile-img img { inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); }
  .tile-body { padding: 12px 12px 14px; }
  .tile h3 { font-size: 15px; }
  .tile .kw b { font-size: 22px; }
  .tile .chips li { font-size: 11px; padding: 2px 6px; }
  .tile-count { display: none; }
  .cat-sticky .cat-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cat-sticky .cat-bar a { flex: none; }
}
