/* =========================================================
   IT Company Website — Public stylesheet
   สีหลัก/สีเน้น มาจากหน้า Admin (--primary / --accent)
   ========================================================= */
:root {
  --primary: #0b2a4a;
  --accent: #0e7cf2;
  --ink: #0f1b2b;
  --ink-2: #3c4a5c;
  --ink-3: #6b7788;
  --line: #e3e8ef;
  --line-2: #eef2f6;
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --bg-3: #eaf0f7;
  --ok: #12805c;
  --err: #c0362c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 43, .05), 0 8px 24px -12px rgba(15, 27, 43, .18);
  --shadow-lg: 0 2px 4px rgba(15, 27, 43, .04), 0 24px 48px -20px rgba(15, 27, 43, .28);
  --wrap: 1200px;
  --font: 'IBM Plex Sans Thai', 'Sarabun', 'Leelawadee UI', 'Tahoma', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; color: var(--ink); letter-spacing: -.005em; }
p { margin: 0 0 1em; }
.ic { flex: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72em 1.35em; border-radius: 999px; font: inherit; font-weight: 600; font-size: .95rem;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { transform: translateY(-1px); }
.btn-outline-light { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }
.btn-line { background: #06c755; color: #fff; }
.btn-block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; }
.link-arrow .ic { width: 16px; height: 16px; transition: transform .15s; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover .ic { transform: translateX(3px); }

/* ---------- Top bar & Header ---------- */
.topbar { background: var(--primary); color: rgba(255,255,255,.82); font-size: .84rem; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar a { color: #fff; }
.topbar-items { display: flex; gap: 22px; align-items: center; }
.topbar-items span, .topbar-items a { display: inline-flex; align-items: center; gap: 6px; }
.topbar .ic { width: 15px; height: 15px; opacity: .8; }
.hotline { background: rgba(255,255,255,.1); padding: 3px 12px; border-radius: 999px; font-weight: 600; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-2); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.brand img { height: 44px; width: auto; }
.brand-mark { width: 42px; height: 42px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.brand-mark .ic { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-3); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--bg-2); text-decoration: none; }
.nav a.on { color: var(--primary); background: var(--bg-3); font-weight: 600; }
.nav .btn { margin-left: 10px; padding: .6em 1.2em; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--bg-2), #fff 85%); }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 20%, transparent 75%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 88px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 22%, #fff); padding: 5px 14px 5px 10px; border-radius: 999px; margin-bottom: 20px; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.hero h1 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); font-weight: 700; line-height: 1.22; color: var(--primary); margin-bottom: 20px; white-space: pre-line; }
.hero .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 36em; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { position: relative; }
.hero-visual img { border-radius: 20px; box-shadow: var(--shadow-lg); aspect-ratio: 5/4; object-fit: cover; width: 100%; }
.hero-visual svg.topo { width: 100%; height: auto; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: -44px; position: relative; z-index: 2; }
.stat { padding: 22px 24px; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 1.9rem; font-weight: 700; color: var(--primary); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section-head .kicker { font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); margin: 0; color: var(--primary); }
.section-head p { color: var(--ink-3); margin: 10px 0 0; max-width: 40em; }

/* ---------- Page hero (หน้าย่อย) ---------- */
.page-hero { background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.page-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.page-hero .wrap { position: relative; z-index: 1; padding-top: 52px; padding-bottom: 52px; }
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0; }
.page-hero p { color: rgba(255,255,255,.75); margin: 10px 0 0; max-width: 44em; }
.crumbs { font-size: .85rem; color: rgba(255,255,255,.6); margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: rgba(255,255,255,.85); }

/* ---------- Service cards ---------- */
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.svc {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; color: inherit; text-decoration: none !important; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.svc:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.svc-ic { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-3); color: var(--primary); margin-bottom: 20px; transition: background .2s, color .2s; }
.svc:hover .svc-ic { background: var(--accent); color: #fff; }
.svc-ic .ic { width: 28px; height: 28px; }
.svc h3 { font-size: 1.15rem; margin-bottom: 8px; }
.svc p { color: var(--ink-3); font-size: .95rem; margin-bottom: 18px; flex: 1; }
.svc .link-arrow { color: var(--accent); font-size: .92rem; }

/* ---------- Product cards ---------- */
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none !important; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.card-media { position: relative; aspect-ratio: 4/3; background: var(--bg-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-media.contain img { object-fit: contain; padding: 18px; background: #fff; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--primary) 35%, #fff);
  background: radial-gradient(circle at 30% 20%, #fff 0, transparent 60%), linear-gradient(135deg, var(--bg-3), var(--bg-2)); }
.ph .ic { width: 30%; height: 30%; stroke-width: 1.2; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: .78rem; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.card-body h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body p { color: var(--ink-3); font-size: .88rem; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.price { font-weight: 700; color: var(--primary); font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.price small { font-weight: 500; font-size: .75rem; color: var(--ink-3); }
.price-ask { font-size: .88rem; color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-3); color: var(--primary); }
.badge-feat { position: absolute; top: 12px; left: 12px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }

/* ---------- Project cards ---------- */
.proj { position: relative; display: block; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none !important; aspect-ratio: 4/3.2; background: var(--primary); }
.proj img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.proj:hover img { transform: scale(1.05); }
.proj .ph { color: rgba(255,255,255,.18); background: radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%), var(--primary); }
.proj-info { position: absolute; inset: auto 0 0 0; padding: 22px; background: linear-gradient(transparent, rgba(6, 16, 30, .88) 45%); }
.proj-info .tag { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); margin-bottom: 10px; }
.proj-info h3 { color: #fff; font-size: 1.08rem; margin: 0 0 4px; }
.proj-info small { color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 6px; }
.proj-info small .ic { width: 14px; height: 14px; }

/* ---------- Why us ---------- */
.why { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.why-list { display: grid; gap: 20px; margin-top: 28px; }
.why-item { display: flex; gap: 16px; }
.why-item .n { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--accent); font-size: .9rem; background: #fff; }
.why-item h4 { margin: 0 0 2px; font-size: 1.02rem; }
.why-item p { margin: 0; color: var(--ink-3); font-size: .93rem; }
.sla { background: var(--primary); color: #fff; border-radius: 20px; padding: 34px; position: relative; overflow: hidden; }
.sla::before { content: ''; position: absolute; width: 320px; height: 320px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); }
.sla h3 { color: #fff; position: relative; font-size: 1.2rem; }
.sla-row { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sla-row:first-of-type { border-top: 0; }
.sla-ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.sla-ic .ic { width: 22px; height: 22px; }
.sla-row b { display: block; }
.sla-row span { color: rgba(255,255,255,.65); font-size: .9rem; }

/* ---------- Clients ---------- */
.clients { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.client { height: 88px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; padding: 14px; background: #fff; text-align: center; font-size: .85rem; color: var(--ink-3); font-weight: 500; }
.client img { max-height: 56px; width: auto; filter: grayscale(1); opacity: .75; transition: .2s; }
.client:hover img { filter: none; opacity: 1; }

/* ---------- CTA ---------- */
.cta { padding: 0 0 96px; }
.cta-box { background: var(--primary); color: #fff; border-radius: 24px; padding: 52px 56px; display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.cta-box::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 100% 0, color-mix(in srgb, var(--accent) 55%, transparent), transparent 55%); }
.cta-box > * { position: relative; }
.cta-box h2 { color: #fff; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.cta-box p { color: rgba(255,255,255,.75); margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Footer ---------- */
.site-footer { background: #07182b; color: rgba(255,255,255,.66); font-size: .92rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; padding-top: 64px; padding-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-text small { color: rgba(255,255,255,.5); }
.site-footer .brand-mark { background: var(--accent); }
.f-contact li { display: flex; gap: 10px; }
.f-contact .ic { width: 17px; height: 17px; margin-top: 4px; opacity: .6; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.07); display: grid; place-items: center; }
.socials a:hover { background: rgba(255,255,255,.14); }
.socials .ic { width: 19px; height: 19px; }
.f-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.f-bottom .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; font-size: .82rem; grid-template-columns: none; }

/* ---------- Floating contact (มือถือ) ---------- */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: none; flex-direction: column; gap: 10px; }
.fab a { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35); }
.fab .ic { width: 24px; height: 24px; }
.fab .f-phone { background: var(--accent); }
.fab .f-line { background: #06c755; }

/* ---------- Catalog ---------- */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
.side { position: sticky; top: 100px; }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.side-box h4 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px 6px; margin: 0; }
.side-box a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: .94rem; }
.side-box a .ic { width: 18px; height: 18px; color: var(--ink-3); }
.side-box a:hover { background: var(--bg-2); text-decoration: none; }
.side-box a.on { background: var(--bg-3); color: var(--primary); font-weight: 600; }
.side-box a.on .ic { color: var(--accent); }
.side-box a em { margin-left: auto; font-style: normal; font-size: .78rem; color: var(--ink-3); background: var(--bg-2); padding: 0 8px; border-radius: 999px; }
.search { display: flex; gap: 8px; margin-bottom: 24px; }
.search input { flex: 1; }
.results-meta { color: var(--ink-3); font-size: .9rem; margin-bottom: 18px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2); padding: 0 10px; }
.pager .on { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .ic { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .5; }

/* ---------- Product detail ---------- */
.pd { display: grid; grid-template-columns: 1.1fr 1fr; gap: 52px; align-items: start; }
.gallery-main { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.thumbs button { aspect-ratio: 1; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; padding: 0; cursor: pointer; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--primary); }
.pd-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-price { background: var(--bg-2); border-radius: var(--radius-sm); padding: 18px 20px; margin: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-price .price { font-size: 1.7rem; }
.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.specs { width: 100%; border-collapse: collapse; font-size: .94rem; }
.specs th, .specs td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.specs th { width: 38%; color: var(--ink-3); font-weight: 500; background: var(--bg-2); }
.specs tr:first-child th, .specs tr:first-child td { border-top: 1px solid var(--line-2); }
.prose { color: var(--ink-2); }
.prose p { margin-bottom: 1.1em; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .ic { width: 20px; height: 20px; color: var(--ok); margin-top: 3px; background: color-mix(in srgb, var(--ok) 12%, #fff); border-radius: 50%; padding: 3px; }
.tabs-h { font-size: 1.2rem; color: var(--primary); margin: 44px 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--line-2); }

/* ---------- Forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.form-card h3 { color: var(--primary); }
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg .full { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--ink-2); }
label.f em { color: var(--err); font-style: normal; }
input, textarea, select {
  font: inherit; font-size: .96rem; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
textarea { resize: vertical; min-height: 110px; }
.hp { position: absolute; left: -5000px; }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .95rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: #e8f6ef; color: #0d5c42; border: 1px solid #bfe6d3; }
.alert-error { background: #fdecea; color: #8a241c; border: 1px solid #f5c6c1; }
.note { font-size: .82rem; color: var(--ink-3); margin-top: 10px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: start; }
.cinfo { display: grid; gap: 14px; }
.cinfo-item { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cinfo-item .svc-ic { width: 46px; height: 46px; margin: 0; flex: none; }
.cinfo-item .svc-ic .ic { width: 22px; height: 22px; }
.cinfo-item small { color: var(--ink-3); display: block; font-size: .82rem; }
.cinfo-item b, .cinfo-item a { font-weight: 600; color: var(--ink); }
.map { border: 0; width: 100%; height: 380px; border-radius: var(--radius); display: block; margin-top: 40px; }

/* ---------- Portfolio ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.chip { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; background: #fff; }
.chip:hover { border-color: var(--ink-3); text-decoration: none; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.proj-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; }
.proj-facts div { background: #fff; padding: 18px 20px; }
.proj-facts small { color: var(--ink-3); display: block; font-size: .8rem; }
.proj-facts b { font-weight: 600; }
.pgallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pgallery a { display: block; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; position: relative; background: var(--bg-2); }
.pgallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pgallery a:hover img { transform: scale(1.04); }
.pgallery figcaption { position: absolute; inset: auto 0 0; padding: 8px 12px; font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.lightbox { position: fixed; inset: 0; background: rgba(5, 12, 22, .92); z-index: 100; display: none; place-items: center; padding: 30px; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 86vh; max-width: 92vw; border-radius: 8px; }
.lightbox button { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.1); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.vm { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.vm-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; background: #fff; }
.vm-card h3 { color: var(--primary); display: flex; gap: 10px; align-items: center; }
.vm-card h3 .ic { color: var(--accent); }
.about-visual { border-radius: 20px; overflow: hidden; aspect-ratio: 4/3.4; background: var(--primary); position: relative; }
.about-visual img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Error ---------- */
.err-page { min-height: 50vh; display: grid; place-items: center; text-align: center; padding: 80px 20px; }
.err-page h1 { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(3, 1fr); }
  .clients { grid-template-columns: repeat(4, 1fr); }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 900px) {
  .topbar-items.hide-sm { display: none; }
  .nav-toggle { display: block; }
  .nav { position: fixed; inset: 114px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 20px 24px; gap: 2px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
  .nav .btn { margin: 10px 0 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; padding-bottom: 72px; }
  .hero-visual { max-width: 560px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .why, .pd, .contact-grid, .about-grid, .catalog { grid-template-columns: 1fr; gap: 36px; }
  .side { position: static; }
  .side-box { display: flex; overflow-x: auto; gap: 4px; padding: 6px; }
  .side-box h4 { display: none; }
  .side-box a { white-space: nowrap; }
  .side-box a em { margin-left: 6px; }
  .cta-box { grid-template-columns: 1fr; padding: 38px 30px; }
  .cta-actions { justify-content: flex-start; }
  .proj-facts { grid-template-columns: 1fr 1fr; }
  .section { padding: 68px 0; }
  .fab { display: flex; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { justify-content: center; }
  .site-header .wrap { height: 66px; }
  .nav { inset: 104px 0 auto 0; }
  .brand-text small { display: none; }
  .g2, .g3, .g4, .vm, .pgallery { grid-template-columns: 1fr; }
  .g4.products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .g4.products .card-body { padding: 12px 14px 14px; }
  .g4.products .card-body p { display: none; }
  .g4.products .price { font-size: .95rem; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .fg { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 32px; }
  .f-bottom .wrap { flex-direction: column; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .form-card { padding: 22px; }
  .stat { padding: 16px 18px; }
  .stat b { font-size: 1.5rem; }
  .cta-box { padding: 30px 22px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .site-header, .site-footer, .fab, .cta { display: none !important; } }

/* เส้นข้อมูลวิ่งในภาพกราฟิกหน้าแรก */
.topo .flow { stroke-dasharray: 4 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.catalog .pgrid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .catalog .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .catalog .pgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hide-xs, .topbar .hide-xs { display: none; } .search .btn { padding: .72em 1em; } }

/* ช่องค้นหาสินค้าแบบพิมพ์แล้วแสดงผลทันที */
.search-field { position: relative; flex: 1; }
.search-field input { width: 100%; padding-left: 44px; padding-right: 16px; height: 50px; font-size: 1rem; border-radius: 12px; }
.search-field .search-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }

/* กันคอลัมน์ในหน้าสินค้าขยายเกินจอ (แถบหมวดหมู่เลื่อนแนวนอนบนมือถือ) */
.catalog > * { min-width: 0; }

.pgrid > [hidden] { display: none !important; }
