/* =========================================================
   LS Systems — เหล่าเส็นซิสเต็ม
   สี ฟอนต์ ระยะห่าง ที่ใช้ร่วมทุกหน้า แก้ที่นี่ที่เดียว
   ========================================================= */
:root {
  --ink: #1d1d1f;          /* ตัวอักษรหลัก */
  --ink-2: #3e434c;        /* เทาเข้มจากโลโก้ */
  --muted: #6e6e73;        /* ตัวอักษรรอง */
  --faint: #8a8a8f;
  --line: #e8e8ed;
  --surface: #f5f5f7;      /* พื้นการ์ด */
  --surface-2: #fbfbfd;
  --bg: #ffffff;
  --brand: #2a3993;        /* น้ำเงินจากโลโก้ */
  --brand-dark: #1f2b70;
  --brand-tint: #eef0f9;
  --radius: 22px;
  --radius-lg: 28px;
  --max: 1200px;
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.center { text-align: center; }
.eyebrow { font-size: 14px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.lead { font-size: 19px; color: var(--muted); line-height: 1.6; }
.h-section { font-size: clamp(28px, 3.4vw, 36px); }
.sub { margin-top: 8px; font-size: 17px; color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: #fff; padding: 8px 14px; border-radius: 8px; }

/* ---------- ส่วนหัว ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--ink-2); padding: 6px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand); }
.nav-cta { background: var(--brand); color: #fff !important; padding: 8px 16px !important; border-radius: 999px; }
.nav-cta:hover { background: var(--brand-dark); }
.nav-lang { font-weight: 500; letter-spacing: 0.04em; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px !important; }
.nav-lang:hover { border-color: var(--brand); }
.menu-btn {
  display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink); border-radius: 10px;
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 14px; text-align: center; border-bottom: 0 !important; }
  .nav-lang { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 14px 0 !important; }
}

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 28px; border-radius: 999px; font-size: 16px; font-weight: 500; transition: background .2s, color .2s; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--surface); }
.btn-link { color: var(--brand); padding: 0 12px; }
.btn-link:hover { color: var(--brand-dark); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }
.link-more { color: var(--brand); font-size: 15px; font-weight: 500; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(44px, 7vw, 84px); letter-spacing: -0.02em; line-height: 1.05; }
.hero-brand { height: clamp(22px, 2.6vw, 30px); width: auto; margin: 0 auto 22px; }
.hero .lead { max-width: 600px; margin: 20px auto 0; }
/* วิดีโอเป็น 16:9 และตัวเครื่องอยู่กลางภาพ: จอคอมแสดงเต็ม 16:9, มือถือครอปเป็น 4:5 */
.hero-media {
  position: relative; margin-top: 56px; aspect-ratio: 16 / 9; width: 100%; max-width: 100%;
  background: #d6d6d6; border-radius: var(--radius-lg); overflow: hidden;
}
.hero-media video, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .hero-media { aspect-ratio: 4 / 5; margin-top: 40px; } }

/* วิดีโอเต็ม (หน้าสินค้า) */
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #d6d6d6; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-caption { margin-top: 14px; text-align: center; font-size: 14px; color: var(--muted); }

/* กรอบว่างรอรูป: จะหายไปเองเมื่อมีไฟล์ภาพจริง */
.placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; text-align: center;
  color: var(--faint); font-size: 14px; padding: 16px;
}
.placeholder code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(0,0,0,0.05); padding: 2px 8px; border-radius: 6px; }
.has-media > .placeholder { display: none; }

/* ---------- การ์ดสินค้า ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 6px; min-height: 380px;
  transition: transform .25s ease, box-shadow .25s ease;
}
a.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,0.07); }
.card-tag { font-size: 13px; color: var(--muted); }
.card-title { font-size: 22px; font-weight: 600; }
.card-text { font-size: 15px; color: var(--muted); }
.card-media { position: relative; flex: 1; min-height: 170px; margin: 14px 0; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { a.card:hover { transform: none; } }
@media (max-width: 640px) { .card { min-height: 300px; } .card-media { min-height: 140px; } }

/* ---------- รายการบริการ (เส้นแบ่ง) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 40px; }
.tile { background: #fff; padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.tile-no { font-size: 13px; color: var(--faint); }
.tile-title { font-size: 20px; font-weight: 600; }
.tile-text { font-size: 15px; color: var(--muted); }
a.tile:hover .tile-title { color: var(--brand); }

.band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- แบรนด์ ---------- */
.brands { display: flex; gap: 64px; justify-content: center; flex-wrap: wrap; margin-top: 24px; font-size: 24px; font-weight: 500; color: #86868b; letter-spacing: 0.02em; }

/* ---------- ตัวเลข/จุดเด่น ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-top: 48px; }
.fact-num { font-size: 44px; font-weight: 600; color: var(--brand); line-height: 1.1; }
.fact-label { margin-top: 6px; color: var(--muted); }

/* ---------- แถบติดต่อ ---------- */
.cta {
  background: var(--ink); color: #f5f5f7; border-radius: var(--radius-lg);
  padding: 64px 48px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between;
}
.cta h2 { font-size: clamp(26px, 3vw, 34px); }
.cta p { margin-top: 10px; color: #c7c7cc; font-size: 17px; }
@media (max-width: 640px) { .cta { padding: 44px 28px; } }

/* ---------- หน้าย่อย ---------- */
.page-head { padding: 88px 0 48px; text-align: center; }
.page-head h1 { font-size: clamp(38px, 5vw, 60px); letter-spacing: -0.01em; }
.page-head .lead { max-width: 640px; margin: 16px auto 0; }
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.split > * { flex: 1 1 380px; min-width: 0; }
.split-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.split-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.split h2 { font-size: clamp(28px, 3vw, 36px); }
.split .lead { margin-top: 14px; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.ticks svg { flex: none; margin-top: 5px; }
.product-block + .product-block { border-top: 1px solid var(--line); }
.prose { max-width: 720px; margin: 0 auto; font-size: 18px; color: var(--ink-2); }
.prose p + p { margin-top: 20px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 32px; }
.contact-card h3 { font-size: 15px; color: var(--muted); font-weight: 500; }
.contact-card p { margin-top: 8px; font-size: 20px; font-weight: 500; }
.contact-card a { color: var(--brand); }
.work-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.work-media { position: relative; aspect-ratio: 4 / 3; background: #ececf0; }
.work-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-body { padding: 22px 24px 26px; }
.work-body h3 { font-size: 18px; }
.work-body p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.note { margin-top: 32px; padding: 20px 24px; border-radius: 16px; background: var(--brand-tint); color: var(--brand-dark); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 0; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 32px; padding: 56px 0 40px; }
.footer-cols h3 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-cols a, .footer-cols li, .footer-cols p { font-size: 14px; color: var(--muted); }
.footer-cols a:hover { color: var(--brand); }
.footer-brand img { height: 22px; width: auto; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 0 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--faint); }

/* เผยตัวเมื่อเลื่อนถึง */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- ตารางสเปก ---------- */
.specs { margin-top: 56px; }
.specs-title { font-size: 20px; margin-bottom: 16px; }
.specs-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.specs table { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.specs th { width: 30%; min-width: 130px; font-weight: 500; color: var(--muted); background: var(--surface-2); }
.specs td { color: var(--ink-2); }
.specs .num { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .specs th, .specs td { padding: 12px 14px; font-size: 14px; } .specs th { width: 38%; } }
.fine { font-size: 13px; color: var(--faint); margin-bottom: 24px; }

/* ---------- ขั้นตอน ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: 17px; }
.step-no { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: 15px; }

.page-head-solo { padding-bottom: 140px; }
.contact-card h2 { font-size: 15px; color: var(--muted); font-weight: 500; }
.contact-card .addr { font-size: 17px; }

/* ---------- หน้าต่างรายละเอียดสินค้า (เปิดเมื่อคลิกการ์ด) ---------- */
html:has(dialog.sheet[open]) { overflow: hidden; }
dialog.sheet {
  width: min(1040px, calc(100% - 48px)); max-width: none; max-height: calc(100% - 48px);
  margin: auto; padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
dialog.sheet::backdrop { background: rgba(20, 20, 26, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.sheet[open] { animation: sheet-in .28s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 14px 14px 0; pointer-events: none; }
.sheet-close {
  pointer-events: auto; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 245, 247, 0.92); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.sheet-close:hover { background: var(--line); }
.sheet-body { padding: 0 48px 48px; margin-top: -30px; }
.sheet-body .split { gap: 40px; }
.sheet-body .split-media { aspect-ratio: 1 / 1; }
.sheet-body h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 4px; }
.sheet-body .specs { margin-top: 40px; }
@media (max-width: 640px) {
  dialog.sheet { width: 100%; max-height: 92%; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  dialog.sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  .sheet-body { padding: 0 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .sheet-body .split-media { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
a.card[data-sheet] { cursor: pointer; }

/* ---------- วิดีโอโฆษณาบนสุดของหน้าสินค้า ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ad-hero { padding-block: 40px 56px; }
.sound-btn {
  position: absolute; right: 16px; bottom: 16px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500;
  background: rgba(29, 29, 31, 0.72); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sound-btn:hover { background: rgba(29, 29, 31, 0.88); }
.sound-btn .i-sound { display: none; }
.sound-btn[aria-pressed="true"] .i-sound { display: block; }
.sound-btn[aria-pressed="true"] .i-muted { display: none; }
@media (max-width: 640px) { .ad-hero { padding-block: 24px 40px; } .sound-btn { right: 10px; bottom: 10px; padding: 0 12px; font-size: 13px; } }
