/* ============================================================
   Pattarayond (ภัทรยนต์) — อะไหล่รถยนต์ญี่ปุ่น
   ภาษาดีไซน์ "เชิงช่าง / Blueprint": กระดาษเขียนแบบ + navy น้ำเงินเข้ม
   + เส้น grid แผนช่างจาง ๆ + มุมตัดเหลี่ยม (chamfer) + น็อตหกเหลี่ยม
   One shared stylesheet. Static site, no frameworks.
   ============================================================ */

/* ---------- Fonts (self-hosted only) ---------- */
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Medium-latin.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold-latin.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Bold-latin.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* subset ไทย — ประกาศทีหลัง latin: ตัวไทยใช้ไฟล์นี้ ตัว latin ตกไปใช้ไฟล์บน */
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Medium-thai.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold-thai.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Bold-thai.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_Rg.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_Bd.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* กระดาษเขียนแบบ (โทนเย็น) */
  --paper: #EEF2F6;
  --card: #FCFDFE;
  --steel-bg: #E1E8EF;
  --tint: #E3EBF3;              /* แถบ zebra ฟ้าอมเทา — สลับกับ paper */

  /* navy — พื้นเข้มทุกระดับ */
  --navy-950: #081827;
  --navy-900: #0A1F35;
  --navy-800: #0D2C4B;
  --navy-700: #164066;

  /* ตัวหนังสือ */
  --ink: #111A24;
  --ink-2: #243140;
  --steel-txt: #4C5B6B;
  --mist: #8FA0B0;
  --paper-on-dark: #E9EEF4;

  /* น้ำเงินอุตสาหกรรม — สีแบรนด์ */
  --brand: #1466B8;
  --brand-deep: #0F548F;
  --brand-bright: #2E8BE6;      /* ตกแต่งบนพื้นเข้มเท่านั้น */
  --brand-on-dark: #6FB3F2;     /* ตัวหนังสือ accent บน navy (AA) */

  /* เส้น */
  --hairline: rgba(17, 26, 36, .16);
  --hairline-soft: rgba(17, 26, 36, .09);
  --hairline-d: rgba(255, 255, 255, .18);
  /* grid แผนช่าง — พื้นหลังเท่านั้น จางกว่าระดับที่รบกวนตัวหนังสือมาก */
  --grid-line: rgba(20, 102, 184, .07);
  --grid-line-major: rgba(20, 102, 184, .12);
  --grid-line-d: rgba(255, 255, 255, .045);
  --grid-line-d-major: rgba(255, 255, 255, .09);

  --line-green: #06C755;        /* สีทางการ LINE — ใช้เฉพาะปุ่ม "สั่งผ่าน Line" */
  --line-green-dark: #05B34C;

  --font-display: "Chakra Petch", "LINE Seed Sans TH", "Helvetica Neue", Arial, sans-serif;
  --font-body: "LINE Seed Sans TH", "Helvetica Neue", Arial, sans-serif;

  --fs-display: clamp(2.6rem, 6.2vw, 5.4rem);
  --fs-h2: clamp(1.9rem, 4.4vw, 3.1rem);
  --fs-h3: clamp(1.25rem, 2.4vw, 1.55rem);
  --fs-lead: clamp(1.15rem, 1.9vw, 1.3rem);
  --fs-body: 1.125rem;          /* 18px */
  --fs-small: .9rem;
  --fs-eyebrow: .72rem;

  --track-caps: .16em;

  /* มุมตัดเหลี่ยม (chamfer) — เฉพาะ element ทึบไม่มีเส้นขอบ */
  --cut-btn: 8px;
  --cut-chip: 5px;
  --cut-panel: 14px;

  /* เงาแบน 2 ระดับ — เทคนิคัล ไม่ฟุ้ง */
  --shadow-1: 0 1px 2px rgba(10, 31, 53, .10);
  --shadow-2: 0 2px 10px rgba(10, 31, 53, .15);

  --ease: cubic-bezier(.2, .9, .3, 1);
  --t-fast: 180ms;

  --nav-h: 64px;
  --container: 1416px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  /* กระดาษเขียนแบบ: grid ช่างจาง ๆ ช่องละ 24px เส้นหลักทุก 120px — นิ่ง ไม่ขยับ */
  background:
    linear-gradient(var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul, ol, dl { margin: 0; padding: 0; }

/* attribute hidden ต้องชนะ display ของคลาส (เช่น .product-card เป็น flex)
   — ไม่งั้นตัวกรองแคตตาล็อกซ่อนการ์ดไม่ได้ */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.on-dark :focus-visible, .band-dark :focus-visible, .site-footer :focus-visible {
  outline-color: var(--brand-on-dark);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy-800); color: var(--paper-on-dark);
  padding: .6rem 1.2rem; z-index: 1200;
  text-decoration: none; font-weight: 700; font-size: var(--fs-small);
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Type voices ---------- */
.display, h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;              /* Chakra Petch ทรงตัดมุมอยู่แล้ว ไม่บีบ tracking */
  color: var(--ink);
}
h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); line-height: 1.06; }
h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-h3); line-height: 1.15;
}
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--paper-on-dark); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--steel-txt);
  font-variant-numeric: tabular-nums;
  margin: 0 0 1.1rem;
}
.on-dark .eyebrow { color: var(--mist); }
/* เส้นบอกขนาด (dimension line) — เส้นนอนมีขีดตั้งปิดหัวท้าย แบบแบบแผนช่าง */
.eyebrow::before {
  content: ""; display: inline-block; flex: none;
  width: 26px; height: 9px;
  background:
    linear-gradient(currentColor, currentColor) left center / 1px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 1px 9px no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
  opacity: .55;
}
.eyebrow--bare::before { display: none; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink); }
.on-dark .lead { color: var(--paper-on-dark); }
.muted { color: var(--steel-txt); }
.on-dark .muted { color: var(--mist); }
.small { font-size: var(--fs-small); }

.accent { color: var(--brand); }
.on-dark .accent, .band-dark .accent { color: var(--brand-on-dark); }

/* จุด full-stop ของแบรนด์ = น็อตหกเหลี่ยมเจาะรู (โลโก้)
   ใช้คู่กับ "." แบบ visually-hidden สำหรับ screen reader */
.accent-dot {
  display: inline-block;
  width: .18em; height: .18em;
  vertical-align: -.01em;
  margin-left: .05em;
  background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill-rule='evenodd' d='M96 50 73 89.8H27L4 50 27 10.2h46L96 50Zm-46 19a19 19 0 1 0 0-38 19 19 0 0 0 0 38Z'/%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 100 100'%3E%3Cpath fill-rule='evenodd' d='M96 50 73 89.8H27L4 50 27 10.2h46L96 50Zm-46 19a19 19 0 1 0 0-38 19 19 0 0 0 0 38Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.on-dark .accent-dot, .band-dark .accent-dot { background: var(--brand-bright); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4.5vw, 48px);
}
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

/* Zebra: section คู่ได้พื้นฟ้าอมเทาสลับกับกระดาษ ให้หน้าไม่ขาวโล่ง
   (hero/band-dark มีพื้นเข้มของตัวเอง — ยกเว้นไว้) */
main > section:nth-of-type(even):not(.band-dark):not(.hero) {
  background:
    linear-gradient(var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-major) 1px, transparent 1px),
    var(--tint);
  background-size: 120px 120px, 120px 120px;
  border-block: 1px solid var(--hairline-soft);
}

/* แถบเข้ม = กระดานแบบแผนช่างสี navy + grid ขาวจาง — นิ่ง ไม่มี animation */
.band-dark {
  background:
    linear-gradient(var(--grid-line-d-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d-major) 1px, transparent 1px),
    linear-gradient(var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d) 1px, transparent 1px),
    var(--navy-800);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  color: var(--paper-on-dark);
}
.band-dark p { color: #C3CEDA; }

.grid-2 {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2--wide-text { grid-template-columns: 7fr 5fr; }
}

/* ---------- เครื่องหมายน็อตหกเหลี่ยม ---------- */
.dot-mark, .hex-mark { display: inline-block; vertical-align: baseline; }
.dot-mark path { fill: currentColor; }

/* ---------- Wordmark ---------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex; align-items: baseline; gap: .08em;
  line-height: 1;
}
.wordmark .dot-mark { width: .3em; height: .3em; transform: translateY(.05em); }
.wordmark .dot-mark path { fill: currentColor; }
.on-dark .wordmark, .site-footer .wordmark { color: var(--paper-on-dark); }
@media (max-width: 700px) { .wordmark { font-size: 1.75rem; } }

.hex-mark path.hex { fill: var(--brand); }
.hex-mark path.pho { fill: var(--card); }
.wordmark .hex-mark { width: .78em; height: .78em; margin-left: .18em; transform: translateY(.06em); }
.wordmark .hex-mark path.hex { fill: var(--brand); }
.on-dark .wordmark .hex-mark path.hex,
.band-dark .wordmark .hex-mark path.hex,
.site-footer .wordmark .hex-mark path.hex { fill: var(--brand-bright); }

/* ---------- Glass (พื้นผิวรับน้ำหนัก — เกือบทึบ + เส้น hairline) ---------- */
.glass {
  background: rgba(252, 253, 254, .95);
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  border-bottom: 1px solid var(--hairline-soft);
  transition: box-shadow var(--t-fast) ease;
  background: rgba(252, 253, 254, .985);
}
.site-nav.scrolled { box-shadow: 0 6px 24px rgba(10, 31, 53, .12); }
.site-nav .container {
  height: 100%;
  display: flex; align-items: center; justify-content: flex-start;
  gap: clamp(.5rem, 2vw, 1.5rem);
}
.site-nav .wordmark { margin-right: auto; }
.nav-links { display: none; list-style: none; gap: clamp(1.1rem, 2.4vw, 2rem); }
.nav-links a {
  text-decoration: none; font-weight: 700; font-size: .95rem;
  color: var(--ink); padding: .3rem 0; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--brand);
  transition: right var(--t-fast) var(--ease);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { right: 0; }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-menu { display: none; }
}

/* เมนูมือถือ (details/summary — ใช้ได้แม้ไม่มี JS) */
.nav-menu { position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer;
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; align-items: center;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary span {
  display: block; width: 20px; height: 2px; background: var(--ink);
  transition: transform var(--t-fast) ease, opacity var(--t-fast) ease;
}
.nav-menu[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-menu[open] summary span:nth-child(2) { opacity: 0; }
.nav-menu[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 230px; padding: .6rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--shadow-2);
}
.nav-menu .menu-panel a {
  display: block; padding: .65rem .9rem;
  text-decoration: none; font-weight: 700; color: var(--ink);
}
.nav-menu .menu-panel a:hover { background: var(--steel-bg); }
.nav-menu .menu-panel a[aria-current="page"] { color: var(--brand); }

@media (max-width: 899.98px) {
  .site-nav > .container > nav[aria-label="เมนูหลัก"]:not(.menu-panel) { display: none; }
}
@media (max-width: 480px) {
  .site-nav .container { gap: .4rem; }
  .site-nav .wordmark { font-size: 1.45rem; }
}

/* ---------- ช่องค้นหาใน nav (ชื่อ/เลข OEM) ---------- */
.nav-search {
  display: none; align-items: center; gap: .45em;
  border: 1px solid var(--hairline);
  background: var(--card); padding: .32em .5em .32em .9em;
}
.nav-search input {
  border: 0; background: transparent; outline: none;
  font-family: var(--font-body); font-size: .9rem; width: 11em; color: var(--ink);
}
.nav-search input::placeholder { color: var(--mist); }
.nav-search button {
  border: 0; cursor: pointer; display: grid; place-items: center;
  width: 1.7em; height: 1.7em;
  background: var(--navy-800); color: var(--paper-on-dark);
}
.nav-search button:hover { background: var(--brand); }
.nav-search:focus-within { border-color: var(--brand); }
@media (min-width: 1100px) { .nav-search { display: inline-flex; } }

/* ค้นหาในเมนูมือถือ */
.menu-search { display: flex; gap: .5em; padding: .9rem 0 .2rem; }
.menu-search input {
  flex: 1; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  border: 1px solid var(--hairline);
  background: var(--card); padding: .6em 1.1em; outline: none;
}
.menu-search input:focus { border-color: var(--brand); }
.menu-search .btn { padding: .6em 1.2em; font-size: .95rem; }

/* ---------- Buttons ----------
   ปุ่มทึบ = มุมตัดเหลี่ยม (chamfer ผ่าน clip-path — ใช้ได้เพราะไม่มีเส้นขอบ/เงานอก)
   ปุ่มโปร่ง (--ghost) = เหลี่ยมตรง + เส้นขอบ 1px (clip-path จะตัดเส้นขอบขาด) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  padding: .85em 1.7em;
  border: 1px solid transparent;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease;
}
.btn--primary, .btn--ink, .btn--porcelain, .btn--line {
  border: 0;
  clip-path: polygon(var(--cut-btn) 0, 100% 0, 100% calc(100% - var(--cut-btn)), calc(100% - var(--cut-btn)) 100%, 0 100%, 0 var(--cut-btn));
}

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); }

.btn--ink { background: var(--navy-800); color: var(--paper-on-dark); }
.btn--ink:hover { background: var(--navy-700); }

.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--hairline);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.on-dark .btn--ghost, .band-dark .btn--ghost { color: var(--paper-on-dark); border-color: var(--hairline-d); }
.on-dark .btn--ghost:hover, .band-dark .btn--ghost:hover { border-color: var(--paper-on-dark); color: var(--paper-on-dark); }

.btn--porcelain { background: var(--card); color: var(--navy-800); }
.btn--porcelain:hover { background: #fff; }

/* ปุ่มสั่งผ่าน Line — เขียว LINE เสมอ ทุกพื้นหลัง */
.btn--line { background: var(--line-green); color: #fff; }
.btn--line:hover { background: var(--line-green-dark); }
.btn--line svg { width: 1.15em; height: 1.15em; flex: none; }

/* ปุ่ม Line ในแถบ nav — เล็กกว่าปุ่มปกติ และคงอยู่ทุกขนาดจอ */
.nav-line { padding: .55em 1.25em; font-size: .92rem; flex: none; }
@media (max-width: 700px) {
  .nav-line { padding: .5em .95em; font-size: .88rem; }
  .nav-line .full { display: none; }
}

.text-link {
  font-weight: 700; color: var(--ink); text-decoration: none;
  border-bottom: 2px solid var(--hairline);
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease;
  padding-bottom: 1px;
}
.text-link:hover { border-color: var(--brand); color: var(--brand); }
.band-dark .text-link, .on-dark .text-link { color: var(--paper-on-dark); border-color: var(--hairline-d); }
.band-dark .text-link:hover, .on-dark .text-link:hover { border-color: var(--brand-on-dark); color: var(--brand-on-dark); }

/* ---------- Plate (กรอบรูปสินค้า — สะอาด ตรงไปตรงมา) ---------- */
.plate {
  position: relative;
  overflow: hidden;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
}
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate--boxed { aspect-ratio: 1 / 1; }
.plate--tall { aspect-ratio: 4 / 5; }

.on-dark .plate, .band-dark .plate {
  box-shadow: inset 0 0 0 1px var(--hairline-d), var(--shadow-2);
}

.plate-caption {
  margin-top: .8rem;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt);
  display: flex; align-items: baseline; gap: .6em;
  font-variant-numeric: tabular-nums;
}
.on-dark .plate-caption, .band-dark .plate-caption { color: var(--mist); }

/* plate ที่ยังไม่มีรูปจริง */
.plate--pending {
  display: grid; place-items: center; text-align: center;
  padding: 2rem;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--card);
  background-size: 24px 24px, 24px 24px;
}
.plate--pending .dot-mark, .plate--pending .hex-mark { width: 64px; height: 64px; opacity: .18; margin-bottom: 1.1rem; }
.plate--pending .dot-mark path { fill: var(--brand); }
.plate--pending .hex-mark path.hex { fill: var(--brand); }
.plate--pending .hex-mark path.pho { fill: var(--paper); }
.plate--pending .pending-label {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt); line-height: 1.9;
}

/* แกลเลอรีบนการ์ด (ภาพหลายมุม crossfade) */
.plate.has-gallery { touch-action: pan-y; }
.plate .gallery-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .3s var(--ease);
  pointer-events: none;
}
.plate .gallery-img.is-active { opacity: 1; }
.plate-ticks {
  position: absolute; left: 0; right: 0; bottom: .7rem; z-index: 3;
  display: flex; justify-content: center; gap: .3rem;
  pointer-events: none;
}
.plate-tick {
  width: 16px; height: 3px;
  background: rgba(17, 26, 36, .2);
  transition: background-color .22s ease;
}
.plate-tick.is-active { background: var(--brand); }
.on-dark .plate-tick, .band-dark .plate-tick { background: rgba(255, 255, 255, .28); }
.on-dark .plate-tick.is-active, .band-dark .plate-tick.is-active { background: var(--brand-bright); }

/* ---------- แถบตัววิ่ง (marquee) — navy + ตัวหนังสือขาว + น็อตคั่นฟ้า ---------- */
.band-marquee {
  background:
    linear-gradient(var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d) 1px, transparent 1px),
    var(--navy-800);
  background-size: 24px 24px, 24px 24px;
  border-block: 1px solid var(--hairline-d);
  position: relative;
  overflow: hidden;
  padding-block: 1.05rem;
}
.marquee-track {
  display: flex; gap: 3.5rem; width: max-content;
  animation: py-marquee 46s linear infinite;
}
.band-marquee:hover .marquee-track,
.band-marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes py-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-seq {
  display: flex; gap: 3.5rem; align-items: center; white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--paper-on-dark);
  font-variant-numeric: tabular-nums;
}
.marquee-seq .dot-mark { width: 10px; height: 10px; flex: none; }
.marquee-seq .dot-mark path { fill: var(--brand-bright); }

/* ---------- Hero (นิ่ง — กระดาน navy + แบบแผนช่าง + finder ในตัว) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(var(--grid-line-d-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d-major) 1px, transparent 1px),
    linear-gradient(var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px, 100% 100%;
  color: var(--paper-on-dark);
  border-bottom: 1px solid var(--hairline-d);
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}
.hero-inner { width: 100%; }
.hero-grid { display: grid; gap: clamp(2rem, 4.5vw, 4rem); align-items: center; }
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr); }
}
.hero-copy { max-width: 42rem; }
.hero h1 { color: var(--paper-on-dark); max-width: 14em; }
.hero .lead { max-width: 32em; color: #D3DDE8; }
.hero .eyebrow { color: var(--brand-on-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
/* บรรทัดสเปกใต้ปุ่ม hero — ยี่ห้อรถที่ดูแล อ่านเหมือน stamp ในแบบแผนช่าง */
.hero-spec {
  margin: 2rem 0 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-eyebrow); letter-spacing: .14em; text-transform: uppercase;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid; gap: clamp(1.2rem, 2.6vw, 2rem);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.product-card {
  display: flex; flex-direction: column;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: box-shadow var(--t-fast) ease;
}
.product-card:hover {
  box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-2);
}
.product-card .plate { box-shadow: inset 0 -1px 0 var(--hairline-soft); }
.product-card .card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.product-card .eyebrow { margin-bottom: .2rem; }
.product-card h3 { margin: 0; }
.product-card .card-claim { color: var(--steel-txt); font-size: .98rem; line-height: 1.5; margin: 0; flex: 1; }
.card-specline {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--steel-txt); font-variant-numeric: tabular-nums;
  margin-top: .4rem;
}
.card-price {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-top: .7rem; padding-top: .9rem;
  border-top: 1px solid var(--hairline-soft);
}
.card-price .price { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.card-price .go {
  font-size: var(--fs-small); font-weight: 700; color: var(--steel-txt);
  transition: color var(--t-fast) ease;
}
.product-card:hover .go { color: var(--brand); }

/* จุดสีหมวด — สี่เหลี่ยมเล็กแบบ swatch ในตารางแบบ ไม่ใช่วงกลม */
.cat-dot {
  display: inline-block; width: 9px; height: 9px;
  box-shadow: inset 0 0 0 1px rgba(17, 26, 36, .22);
  flex: none;
}

/* บรรทัด OEM / รุ่นรถ / สถานะของ บนการ์ด — เลข OEM สไตล์ stencil */
.card-oem {
  margin: .15rem 0 0;
  font-size: .82rem; color: var(--steel-txt);
  font-variant-numeric: tabular-nums;
}
.card-oem b {
  color: var(--ink); font-weight: 700;
  font-family: var(--font-display); letter-spacing: .05em;
}
.card-fitline { margin: .1rem 0 0; font-size: .82rem; color: var(--steel-txt); }
.stock-chip {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .22em .8em;
  clip-path: polygon(var(--cut-chip) 0, 100% 0, 100% calc(100% - var(--cut-chip)), calc(100% - var(--cut-chip)) 100%, 0 100%, 0 var(--cut-chip));
  background: rgba(6, 199, 85, .14); color: #06793A;
}
.stock-chip--order { background: rgba(232, 162, 26, .16); color: #8A5F0A; }

/* ---------- ขั้นตอนสั่งซื้อ (หน้าแรก — 3 ช่อง) ---------- */
.step-rail { display: grid; gap: 1px; background: var(--hairline-soft); border-block: 1px solid var(--hairline-soft); }
@media (min-width: 760px) { .step-rail { grid-template-columns: repeat(3, 1fr); } }
.step-cell {
  background: var(--card);
  padding: 1.8rem 1.5rem 2rem;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: .4rem;
  transition: background-color var(--t-fast) ease;
}
.step-cell:hover { background: var(--steel-bg); }
.step-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 2.1rem; line-height: 1; color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.step-cell .eyebrow { margin: .4rem 0 .1rem; }
.step-cell .job { color: var(--steel-txt); font-size: .98rem; line-height: 1.5; margin: 0; flex: 1; }
.step-cell .go { font-size: var(--fs-small); font-weight: 700; margin-top: .8rem; color: var(--ink); }
.step-cell:hover .go { color: var(--brand); }

/* ---------- def-cards + ตัวเลขสถิติ ---------- */
.def-cards { display: grid; gap: 1.2rem; margin-top: 2.2rem; }
@media (min-width: 760px) { .def-cards { grid-template-columns: 1fr 1fr; } }
.def-card {
  background: var(--card);
  padding: 1.6rem 1.7rem;
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  border-left: 3px solid var(--brand);
}
.def-card h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.def-card p { margin: 0; color: var(--steel-txt); font-size: 1rem; line-height: 1.55; }
.def-card .eyebrow { margin-bottom: .6rem; }

.stat-line {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .6em;
}
.stat-line .stat {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.stat-line .stat-note { color: var(--steel-txt); max-width: 26em; font-size: 1rem; }

/* ---------- Spec definition list (PDP) ---------- */
.spec-list { border-top: 1px solid var(--hairline); }
.spec-row {
  display: grid; grid-template-columns: minmax(110px, 34%) 1fr;
  gap: 1rem; align-items: baseline;
  padding: .85rem 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.spec-row dt {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt);
}
.spec-row dd { margin: 0; font-size: 1.02rem; }
.spec-row--lead { background: linear-gradient(90deg, rgba(20, 102, 184, .07), transparent 70%); }
.spec-row--lead dt { color: var(--brand); }
.spec-row--lead dd { font-weight: 700; font-family: var(--font-display); letter-spacing: .04em; }
.spec-foot { font-size: var(--fs-small); color: var(--steel-txt); margin-top: .8rem; }

/* ---------- ช่องวิดีโอ (สถานะกำลังถ่ายทำ) ---------- */
.video-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d) 1px, transparent 1px),
    var(--navy-900);
  background-size: 24px 24px, 24px 24px;
  clip-path: polygon(var(--cut-panel) 0, 100% 0, 100% calc(100% - var(--cut-panel)), calc(100% - var(--cut-panel)) 100%, 0 100%, 0 var(--cut-panel));
  display: grid; place-items: center; text-align: center;
  overflow: hidden;
  padding: 1.5rem;
}
.video-slot .dot-mark, .video-slot .hex-mark { width: 44px; height: 44px; margin-inline: auto; }
.video-slot .dot-mark path { fill: rgba(255, 255, 255, .3); }
.video-slot .vs-status {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--mist);
  margin-top: 1.1rem;
}
.video-slot .rec {
  width: 10px; height: 10px;
  background: var(--brand-bright);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill-rule='evenodd' d='M96 50 73 89.8H27L4 50 27 10.2h46L96 50Zm-46 19a19 19 0 1 0 0-38 19 19 0 0 0 0 38Z'/%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 100 100'%3E%3Cpath fill-rule='evenodd' d='M96 50 73 89.8H27L4 50 27 10.2h46L96 50Zm-46 19a19 19 0 1 0 0-38 19 19 0 0 0 0 38Z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: py-blink 2.4s ease-in-out infinite;
}
@keyframes py-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.video-slot .vs-title {
  color: var(--paper-on-dark); font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: .5rem 0 0; line-height: 1.25; max-width: 24em;
}
.video-slot .vs-note { color: var(--mist); font-size: var(--fs-small); margin: .6rem 0 0; max-width: 34em; }

/* ---------- PDP layout ---------- */
.pdp { padding-top: calc(var(--nav-h) + 1.6rem); }
.breadcrumb {
  font-size: var(--fs-small); color: var(--steel-txt);
  margin-bottom: 1.6rem;
  display: flex; flex-wrap: wrap; gap: .5em; list-style: none;
}
.breadcrumb a { color: var(--steel-txt); text-decoration: none; font-weight: 700; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li + li::before { content: "/"; margin-right: .5em; opacity: .5; }

.pdp-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 980px) {
  .pdp-grid { grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr); align-items: start; }
  .buy-box { position: sticky; top: calc(var(--nav-h) + 1.2rem); }
}

.pdp-gallery { display: grid; gap: 1.4rem; }
.pdp-flow { display: flex; flex-direction: column; gap: clamp(2.6rem, 5vw, 4rem); margin-top: clamp(2.6rem, 5vw, 4rem); }
.pdp-flow section > .eyebrow { margin-bottom: .9rem; }
.pdp-flow h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }

.buy-box { padding: clamp(1.5rem, 3vw, 2.1rem); }
.buy-box .eyebrow { margin-bottom: .7rem; }
.buy-box h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: .6rem; }
.buy-box .claim { color: var(--steel-txt); font-size: 1.02rem; line-height: 1.55; }
.buy-price {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.1rem);
  margin: 1.1rem 0 .2rem;
  font-variant-numeric: tabular-nums;
}
.buy-price .per { font-family: var(--font-body); font-weight: 400; font-size: .95rem; color: var(--steel-txt); }

.variant-group { margin: 1rem 0 1.3rem; }
.variant-group .vg-label {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt); display: block; margin-bottom: .6rem;
}
.variant-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.variant-pills label { position: relative; }
.variant-pills input {
  position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer;
}
.variant-pills .pill {
  display: inline-flex; align-items: baseline; gap: .5em;
  padding: .55em 1.1em;
  border: 1px solid var(--hairline);
  font-size: .95rem; font-weight: 700;
  background: var(--card);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
  font-variant-numeric: tabular-nums;
}
.variant-pills .pill .p-price { font-weight: 400; color: var(--steel-txt); font-size: .88rem; }
.variant-pills input:checked + .pill {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.variant-pills input:focus-visible + .pill {
  outline: 2px solid var(--brand); outline-offset: 3px;
}

.buy-box .btn--line, .buy-box .btn--primary { width: 100%; margin-top: .4rem; font-size: 1.05rem; }
.buy-note { font-size: var(--fs-small); color: var(--steel-txt); margin: .9rem 0 0; line-height: 1.5; }
.buy-meta {
  margin-top: 1.2rem; padding-top: 1rem;
  border-top: 1px solid var(--hairline-soft);
  display: flex; flex-direction: column; gap: .3rem;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--steel-txt);
  font-variant-numeric: tabular-nums;
}

/* แถบสั่งซื้อมือถือ (ติดล่างจอ) */
.mobile-buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(20px, 4.5vw, 48px);
  padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hairline-soft);
}
.mobile-buy-bar .mb-name { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.mobile-buy-bar .mb-price {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.mobile-buy-bar .btn { padding: .7em 1.3em; font-size: .95rem; flex: none; }
@media (min-width: 980px) { .mobile-buy-bar { display: none; } }
@media (max-width: 979.98px) {
  .pdp-page main { padding-bottom: 86px; }
  /* มือถือ: ชื่อ/ราคา/ปุ่มสั่ง ขึ้นก่อน แกลเลอรีตามหลัง */
  .pdp-grid .buy-box { order: -1; }
}

/* มักซื้อคู่กัน */
.pair-cards { display: grid; gap: 1rem; }
@media (min-width: 640px) { .pair-cards { grid-template-columns: 1fr 1fr; } }
.pair-card {
  display: flex; gap: 1rem; align-items: center;
  background: var(--card);
  padding: 1rem 1.2rem;
  text-decoration: none; color: inherit;
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  transition: box-shadow var(--t-fast) ease;
}
.pair-card:hover { box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-2); }
.pair-card .plate { width: 74px; aspect-ratio: 1/1; flex: none; }
.pair-card .plate.plate--pending { padding: 0; }
.pair-card .plate--pending .dot-mark, .pair-card .plate--pending .hex-mark { width: 26px; height: 26px; margin: 0; }
.pair-card h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.pair-card p { margin: 0; font-size: .9rem; color: var(--steel-txt); line-height: 1.4; }

/* ---------- Products index ---------- */
.page-head { padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4.5rem)); padding-bottom: clamp(2rem, 4vw, 3rem); }
.page-head h1 { max-width: 14em; }
.page-head .lead { max-width: 34em; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: .6rem;
  padding-block: 1.2rem;
  border-block: 1px solid var(--hairline-soft);
  position: relative; z-index: 2;
}
.filter-btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .5em 1.1em;
  border: 1px solid var(--hairline);
  background: var(--card); color: var(--ink);
  font-family: var(--font-body); font-weight: 700; font-size: .92rem;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.filter-btn:hover { border-color: var(--brand); }
.filter-btn[aria-pressed="true"] {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.filter-btn[aria-pressed="true"] .cat-dot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.filter-note { font-size: var(--fs-small); color: var(--steel-txt); margin: 1rem 0 0; }

/* แถบตัวกรอง (หมวด + รถ) */
.filter-selects { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.filter-selects .select { min-width: 10.5em; }
.filter-selects .btn { padding: .62em 1.4em; font-size: .95rem; }

.select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  border: 1px solid var(--hairline);
  background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%234C5B6B' stroke-width='2'/></svg>") no-repeat right .9em center;
  padding: .68em 2.4em .68em 1em; cursor: pointer;
}
.select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.select:disabled { color: var(--mist); cursor: not-allowed; }
/* input[type=search] ใช้คลาส .select ร่วม (ฟอนต์/ขอบ/padding เดียวกัน) แต่ไม่มีลูกศร dropdown */
input.select { background-image: none; padding-right: 1em; }

/* ---------- เช็คเบอร์อะไหล่ (parts-lookup.html) ----------
   ผลลัพธ์จากสต็อกจริงของร้าน — ไม่มีรูป ต่างจาก .product-card โดยเจตนา
   (รายการที่ยังไม่ได้ถ่ายรูปก็ต้องค้นเจอได้ ไม่งั้นลูกค้าไม่รู้ว่าร้านมีของ) */
.lookup-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
  margin-top: 1.6rem;
}
@media (min-width: 640px) { .lookup-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .lookup-grid { grid-template-columns: repeat(3, 1fr); } }

.lookup-card {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  padding: 1.3rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.lookup-card h3 { margin: 0; font-size: 1.05rem; }
.lookup-card .lc-en { font-weight: 400; color: var(--steel-txt); font-size: .85em; }
.lookup-card .lc-oem { margin: 0; font-size: .85rem; color: var(--steel-txt); font-variant-numeric: tabular-nums; }
.lookup-card .lc-oem b { color: var(--ink); font-weight: 700; font-family: var(--font-display); letter-spacing: .05em; }
.lookup-card .lc-fits { margin: 0; font-size: .85rem; color: var(--steel-txt); }
/* รหัสร้าน — เลขที่พนักงานใช้ค้นจริงหน้าร้าน ลูกค้าบอกเลขนี้มาได้เลย
   ตัวเล็กกว่า OEM เพราะเป็นเลขภายใน ไม่ใช่เลขที่เอาไปเทียบกับกล่องได้ */
.lookup-card .lc-code { margin: 0; font-size: .8rem; color: var(--steel-txt); }
.lookup-card .lc-code b { color: var(--ink); font-weight: 700; font-family: var(--font-display); letter-spacing: .04em; }
/* ราคามี 2 สถานะ: ยืนยันแล้ว (ตัวเลข เน้น) กับ ยังไม่ยืนยัน ("สอบถามราคา" สีจางกว่า)
   ต่างกันชัดด้วยขนาด+สี ไม่ใช้แค่สีอย่างเดียว เผื่อคนตาบอดสี */
.lookup-card .lc-price { margin: .35rem 0 0; font-size: 1.15rem; color: var(--ink); }
.lookup-card .lc-price b { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.lookup-card .lc-price--ask { font-size: 1rem; color: var(--steel-txt); }
.lookup-card .lc-price-note {
  display: block; margin-top: .1rem;
  font-size: .76rem; font-weight: 400; color: var(--steel-txt); line-height: 1.35;
}
.lookup-card .lc-meta {
  margin: .1rem 0 0; font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mist);
}
.lookup-card .lc-disclaimer {
  margin: .5rem 0 0; padding-top: .6rem; border-top: 1px solid var(--hairline-soft);
  font-size: .78rem; color: var(--steel-txt); line-height: 1.4;
}
.lookup-card .btn--line { margin-top: .7rem; width: 100%; }

/* ---------- ลิงก์ลึกจากแชท (?code=) + ปุ่มไปหน้าสินค้าจริง ---------- */
/* การ์ดที่ลูกค้ากดลิงก์ตรงมา — ต้องแยกออกจาก "รายการใกล้เคียง" ให้เห็นชัดในแวบเดียว
   ใช้เส้นซ้ายหนาแทนการเปลี่ยนสีพื้น เพราะพื้นการ์ดสีอื่นจะทำให้อ่านตัวหนังสือยากลง
   และธีมนี้ห้ามใช้เงาฟุ้ง/เลื่อนตำแหน่งเป็นสัญญาณ (ดู 03_DESIGN_SYSTEM.md) */
.lookup-card.is-linked {
  box-shadow: inset 4px 0 0 0 var(--brand), inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
}
.lookup-card .lc-detail { margin-top: .7rem; width: 100%; }
.lc-related-head {
  grid-column: 1 / -1;
  margin: 1.6rem 0 .2rem;
  font-family: var(--font-display);
  font-size: .8rem;               /* ต่ำสุดที่ยอมได้คือ .66rem — ยังห่างพอ */
  line-height: 1.5;               /* ไทยต้อง >= 1.4 เสมอ สระบน+วรรณยุกต์ซ้อนสองชั้น */
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--steel-txt);
}

/* ---------- กล่องเลื่อนแนวนอน (ตาราง fitment ในหน้าสินค้า) ---------- */
.table-scroll {
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}

/* ---------- ป้ายยี่ห้อรถ (brands.html) ----------
   กริดเดียวกับ .lookup-grid แต่ช่องแคบกว่า — ป้ายมีแค่ชื่อยี่ห้อกับจำนวน
   จึงวางได้ถี่กว่าการ์ดสินค้า โดยไม่ต้องเพิ่ม breakpoint ใหม่ (auto-fit จัดเอง) */
.brand-grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin-top: 1.6rem;
}
.brand-tile {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline-soft), var(--shadow-1);
  padding: 1.2rem 1.1rem;
  display: flex; flex-direction: column; gap: .3rem;
  text-decoration: none; color: var(--ink);
  transition: box-shadow .18s ease, transform .18s ease;
}
.brand-tile:hover, .brand-tile:focus-visible {
  box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-2, var(--shadow-1));
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .brand-tile:hover, .brand-tile:focus-visible { transform: none; } }
.brand-tile__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: .06em;
}
.brand-tile__count { font-size: .82rem; color: var(--steel-txt); font-variant-numeric: tabular-nums; }

/* ---------- ตาราง Fitment (รถที่ใช้ได้) ---------- */
.fitment-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.fitment-table th, .fitment-table td {
  text-align: left; padding: .65em .9em;
  border-bottom: 1px solid var(--hairline-soft);
}
.fitment-table th {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt);
}
.fitment-table td:first-child { font-weight: 700; }
.fitment-table tr:last-child td { border-bottom: 0; }

/* ---------- บทความ / คู่มือ ---------- */
.guide-grid { display: grid; gap: clamp(1.2rem, 2.6vw, 2rem); }
@media (min-width: 760px) { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
.guide-card { display: flex; flex-direction: column; gap: .9rem; }
.guide-card .video-slot { padding: 1.2rem; }
.guide-card .video-slot .dot-mark, .guide-card .video-slot .hex-mark { width: 34px; height: 34px; }
.guide-card h3 { margin: 0; font-size: 1.15rem; }
.guide-card .g-meta { font-size: var(--fs-small); color: var(--steel-txt); margin: 0; }

/* ---------- คำพูดเด่น ---------- */
.pull-quote {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.15;
  margin: 0; padding-left: 1.2rem;
  border-left: 3px solid var(--brand);
  max-width: 18em;
}
.band-dark .pull-quote { border-color: var(--brand-bright); color: var(--paper-on-dark); }

/* ---------- Footer — navy เข้มสุด + grid ช่างจาง ๆ นิ่ง ---------- */
.site-footer {
  background:
    linear-gradient(var(--grid-line-d) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-d) 1px, transparent 1px),
    var(--navy-950);
  background-size: 24px 24px, 24px 24px;
  border-top: 1px solid var(--hairline-d);
  color: var(--mist);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  position: relative;
}
.footer-grid { display: grid; gap: 2.2rem; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-grid h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-eyebrow); letter-spacing: var(--track-caps);
  text-transform: uppercase; color: #7E92A6; margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.footer-grid a { color: #C3CEDA; text-decoration: none; font-size: .98rem; }
.footer-grid a:hover { color: var(--paper-on-dark); }
.footer-grid a.f-line { color: var(--line-green); font-weight: 700; }
.footer-brand p { color: #8FA0B0; font-size: .95rem; max-width: 26em; margin-top: 1rem; }
.footer-legal {
  margin-top: 3rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-wrap: wrap; gap: .6rem 2rem;
  font-size: var(--fs-small); color: #7E92A6;
}
.footer-legal p { margin: 0; }

/* ---------- ค้นหาด่วนตามรถ (finder) ---------- */
.finder {
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--shadow-2);
  padding: clamp(1.2rem, 3vw, 2rem);
}
/* หัวกล่อง finder ใน hero */
.finder .finder-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; color: var(--ink);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .5em;
}
.finder-row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .finder-row { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
  /* ใน hero กล่องแคบ — เรียงลงเสมอ */
  .hero .finder-row { grid-template-columns: 1fr; }
}
.finder-field { display: flex; flex-direction: column; gap: .4rem; }
.finder-field label {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--steel-txt);
}

/* ---------- การ์ดหมวดสินค้า 8 หมวด ---------- */
.cat-grid {
  display: grid; gap: 1px;
  background: var(--hairline-soft);
  border-block: 1px solid var(--hairline-soft);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 760px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-cell {
  background: var(--card);
  padding: clamp(1.1rem, 2.6vw, 1.8rem);
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: .45rem;
  transition: background-color var(--t-fast) ease;
}
.cat-cell:hover { background: var(--steel-bg); }
.cat-cell h3 { font-size: 1.06rem; margin: 0; display: flex; align-items: center; gap: .5em; }
.cat-cell .cat-blurb { margin: 0; font-size: .85rem; color: var(--steel-txt); line-height: 1.55; }
.cat-cell .go { font-size: .82rem; font-weight: 700; color: var(--steel-txt); margin-top: auto; transition: color var(--t-fast) ease; }
.cat-cell:hover .go { color: var(--brand); }

/* ---------- FAQ (details/summary) ---------- */
.faq { border-top: 1px solid var(--hairline-soft); }
.faq details { border-bottom: 1px solid var(--hairline-soft); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.05rem .2rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 500; color: var(--steel-txt); font-size: 1.3em; line-height: 1; }
.faq details[open] summary::after { content: "–"; color: var(--brand); }
.faq .faq-body { padding: 0 .2rem 1.2rem; color: var(--steel-txt); max-width: 62ch; }
.faq .faq-body p { margin: 0 0 .7em; }

/* ============================================================
   Mobile-first refinements — ใช้ผ่านโทรศัพท์ให้ลื่น
   ============================================================ */

/* anchor ที่ถูกลิงก์ (เช่น products.html#brake) ไม่มุดใต้แถบเมนู fixed */
[id] { scroll-margin-top: calc(var(--nav-h) + 14px); }

/* ---------- แถบด่วนมือถือ: โทร + LINE ติดล่างจอ (JS สร้าง; ยกเว้นหน้า PDP ที่มีแถบสั่งซื้อแล้ว) ---------- */
.quick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
  display: none; gap: .6rem;
  padding: .6rem clamp(16px, 4vw, 24px);
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
  background: rgba(252, 253, 254, .985);
  border-top: 1px solid var(--hairline-soft);
  box-shadow: 0 -4px 16px rgba(10, 31, 53, .08);
}
.quick-bar .btn { flex: 1; padding: .7em .9em; font-size: .95rem; }
@media (max-width: 767.98px) {
  .quick-bar { display: flex; }
  .has-quick-bar main { padding-bottom: 8px; }
  .has-quick-bar .site-footer {
    padding-bottom: calc(2rem + 68px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- ตัวกรองแคตตาล็อกบนมือถือ: ชิปเลื่อนนิ้วแนวนอน + select 2 คอลัมน์ ---------- */
@media (max-width: 700px) {
  .filter-bar {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: calc(-1 * clamp(20px, 4.5vw, 48px));
    padding-inline: clamp(20px, 4.5vw, 48px);
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { flex: none; white-space: nowrap; }
  .filter-selects { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-selects .select { min-width: 0; width: 100%; }
  .filter-selects .btn { grid-column: 1 / -1; }
}

/* ---------- เมนูมือถือ: แผงเกือบเต็มจอ รายการใหญ่กดง่าย ---------- */
@media (max-width: 700px) {
  .nav-menu .menu-panel {
    position: fixed; left: 12px; right: 12px; top: calc(var(--nav-h) + 8px);
    min-width: 0; padding: .8rem;
    max-height: calc(100dvh - var(--nav-h) - 24px);
    overflow-y: auto;
  }
  .nav-menu .menu-panel a { padding: .85rem 1rem; font-size: 1.05rem; }
}

/* ---------- Hero มือถือ: กระชับขึ้น ให้เห็นกล่องค้นหาเร็ว ---------- */
@media (max-width: 700px) {
  .hero { padding-top: calc(var(--nav-h) + 2.2rem); padding-bottom: 2.4rem; }
  .hero-grid { gap: 1.8rem; }
  .hero-actions { margin-top: 1.4rem; }
  .hero-spec { margin-top: 1.4rem; }
}

/* ---------- จอสัมผัส: เป้ากดขั้นต่ำ + กันซูม iOS + แรงตอบสนองตอนแตะ ---------- */
@media (hover: none) {
  .btn, .filter-btn { min-height: 44px; }
  .variant-pills .pill { min-height: 42px; align-items: center; }
  .faq summary { min-height: 48px; }
  .nav-search input, .menu-search input { font-size: 16px; }  /* <16px = iOS ซูมเอง */
  .btn:active, .filter-btn:active, .cat-cell:active, .step-cell:active { filter: brightness(.94); }
}

/* ---------- Reveal-on-scroll (เงียบ ๆ) ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}
html.no-js .reveal, html.reduce-motion .reveal { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .marquee-track { animation: none !important; }
  .band-marquee { overflow-x: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .video-slot .rec { animation: none !important; }
}
