:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #f59e0b;
  --brand-dark: #b45309;
  --brand-ink: #1c1917;
  --primary: #0f172a;
  --primary-ink: #f59e0b;
  --hero: #0f172a;
  --hero-2: #1e293b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --card: #162032;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #253349;
    --brand-dark: #fbbf24;
    --primary: #f59e0b;
    --primary-ink: #0f172a;
    --hero: #0b1220;
    --hero-2: #162032;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-alt: #0f172a; --card: #162032; --text: #e2e8f0; --muted: #94a3b8; --line: #253349;
  --brand-dark: #fbbf24; --primary: #f59e0b; --primary-ink: #0f172a; --hero: #0b1220; --hero-2: #162032;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
address { font-style: normal; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.brand:hover { background: #fbbf24; }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.lg { min-height: 50px; padding: 10px 24px; font-size: 1.05rem; }

/* ---------- แถบบน ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; }
.logo-img { display: block; width: auto; height: 54px; }
.footer .logo-img { height: 56px; margin-bottom: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .6)); } }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--bg-alt); }
.topbar .btn { margin-left: auto; }
@media (min-width: 760px) { .nav { display: flex; } .topbar .btn { margin-left: 0; } }

/* ---------- ฮีโร่ ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(245, 158, 11, .28), transparent 60%), linear-gradient(160deg, var(--hero), var(--hero-2)); color: #fff; padding: 56px 0 48px; }
.hero-grid { display: grid; gap: 32px; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--brand); text-transform: uppercase; margin-bottom: 12px; }
.lead { font-size: 1.1rem; color: rgba(255, 255, 255, .78); max-width: 42rem; margin: 16px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 16px; font-size: .9rem; color: rgba(255, 255, 255, .7); }
.hero-note a { color: #fff; font-weight: 600; text-decoration: none; }
.hero-media { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7); border: 1px solid rgba(255, 255, 255, .12); }
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.stats { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats li { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 16px; }
.stats strong { display: block; font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stats span { font-size: .9rem; color: rgba(255, 255, 255, .75); }
@media (min-width: 860px) {
  .hero { padding: 72px 0 56px; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; align-items: center; gap: 48px; }
  .stats { grid-template-columns: repeat(4, 1fr); margin-top: 48px; }
}

/* ---------- ส่วนทั่วไป ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

.services-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.service .icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--brand) 16%, var(--card)); font-size: 1.4rem; margin-bottom: 12px; }
.service h3 { margin-bottom: 6px; }
.service p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- ทำไมต้องเรา / บริการซ่อม-คอร์ส ---------- */
.why-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 16px; }
.why img { width: 64px; height: 64px; border-radius: 14px; margin-bottom: 12px; }
.why h3 { margin-bottom: 6px; }
.why p { color: var(--muted); font-size: .95rem; margin: 0; }
.duo-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.duo { display: grid; gap: 16px; padding: 0; overflow: hidden; }
.duo img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 5 / 4; }
.duo > div { padding: 0 20px 20px; }
.duo h3 { margin-bottom: 6px; }
.duo p { color: var(--muted); margin-bottom: 12px; }
@media (min-width: 560px) { .duo { grid-template-columns: 42% 1fr; align-items: center; } .duo > div { padding: 20px 20px 20px 0; } }

/* ---------- แกลเลอรี ---------- */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.gallery a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .25s ease; }
.gallery a:hover img { transform: scale(1.03); }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

/* ---------- เช็คราคา ---------- */
.price-tool label { display: block; font-weight: 600; margin-bottom: 6px; }
.model-row { display: flex; gap: 8px; margin-bottom: 16px; }
.model-row input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.model-row input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.price-result { min-height: 60px; }
.price-result h3 { margin-bottom: 10px; }
.price-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 16px; }
.price-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg-alt); }
.price-card .label { font-size: .9rem; color: var(--muted); }
.price-card .amount { font-size: 1.5rem; font-weight: 800; }
.price-card .amount small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.price-card.na .amount { font-size: 1rem; font-weight: 600; color: var(--muted); }
.maint-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 10px; }
.maint-head h3 { font-size: 1rem; margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-alt); font-weight: 600; color: var(--muted); font-size: .85rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.parts { white-space: normal; min-width: 220px; color: var(--muted); font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
.table-note { margin-top: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--brand); }

/* ---------- ขั้นตอน ---------- */
.steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.steps .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; margin-bottom: 10px; }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- ยี่ห้อ ---------- */
.brand-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.brand-list li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; }
.brand-list li span { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* ---------- สาขา ---------- */
.branches-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.branch h3 { margin-bottom: 8px; }
.branch address { color: var(--muted); margin-bottom: 8px; }
.branch .contact a { font-weight: 600; text-decoration: none; }
.branch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.branch .contact { line-height: 1.9; }
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- ท้ายหน้า ---------- */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-grid { display: grid; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.copy { margin: 0; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr auto auto; align-items: center; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .gallery img { transition: none; } .btn:hover { transform: none; } .gallery a:hover img { transform: none; } }
