/* =========================================================
   New Bonsai — ไฟล์สไตล์กลางของทุกหน้า
   โครงสร้าง: 1) ตัวแปรสี/ระยะ  2) พื้นฐาน  3) ส่วนประกอบ (ปุ่ม การ์ด ฯลฯ)
             4) ส่วนของแต่ละหน้า  5) ตะกร้า / lightbox / toast
   ========================================================= */

/* ---------- 1) Design tokens ---------- */
:root {
  /* โทนเขียวเข้ม + ครีม (ธีมสว่างเป็นค่าเริ่มต้น) */
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #efe8da;
  --text: #1c211d;
  --muted: #5b625c;
  --line: #ddd5c4;
  --primary: #2f4a3a;
  --primary-hover: #233a2d;
  --primary-soft: #e2e9de;
  --on-primary: #ffffff;
  --danger: #a3392a;
  --success: #2f6b45;
  --hero-bg: #121713;

  --font-head: "Noto Serif Thai", Georgia, serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;

  /* ระยะห่างใช้สเกลเดียวกันทั้งเว็บ */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(20, 28, 22, .06), 0 4px 12px rgba(20, 28, 22, .06);
  --header-h: 68px;
  --container: 1200px;
  --gutter: 24px;
}

:root[data-theme="dark"] {
  --bg: #121613;
  --surface: #1a201c;
  --surface-2: #222a24;
  --text: #ece7dc;
  --muted: #a6ada3;
  --line: #313a33;
  --primary: #8fb79a;
  --primary-hover: #a6c9b0;
  --primary-soft: #23302a;
  --on-primary: #0f1511;
  --danger: #e2806f;
  --success: #8fcf9f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .25);
}

/* ---------- 2) พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; margin: 0 0 var(--s3); }
p { margin: 0 0 var(--s4); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s4); top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s4); border-radius: var(--radius); }
.skip-link:focus { top: var(--s3); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s9) 0; }
.section--alt { background: var(--surface-2); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto var(--s7); }
.section__head p { color: var(--muted); margin: 0; }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--s2); }
.h1 { font-size: clamp(32px, 5vw, 56px); }
.h2 { font-size: clamp(26px, 3.4vw, 38px); }
.lead { font-size: 18px; color: var(--muted); }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3) ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 46px; padding: 0 var(--s5);
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--outline { border-color: var(--line); background: var(--surface); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }
.btn--light { border-color: rgba(255, 255, 255, .7); color: #fff; background: transparent; }
.btn--light:hover { background: #fff; color: #1c211d; }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 var(--s4); font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--added { background: var(--primary-soft); color: var(--primary); }
.btn--added:hover { background: var(--primary-soft); }

.icon-btn {
  display: inline-grid; place-items: center; position: relative;
  width: 44px; height: 44px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header / เมนู ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: var(--s5); height: var(--header-h); }
.brand { font-family: var(--font-head); font-size: 22px; font-weight: 600; text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.brand span { color: var(--primary); }
.nav { margin-left: auto; }
.nav__list { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.nav__link { display: block; padding: var(--s2) var(--s3); border-radius: var(--radius); text-decoration: none; font-weight: 500; color: var(--muted); }
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.header-actions { display: flex; gap: var(--s2); }
.cart-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--primary); color: var(--on-primary);
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.cart-badge[hidden] { display: none; }
.menu-toggle { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--hero-bg); color: #d9d5cb; padding: var(--s8) 0 var(--s6); }
.site-footer a { color: #d9d5cb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: var(--s7); }
.footer-grid h3 { font-size: 18px; color: #fff; margin-bottom: var(--s4); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.footer-grid li { display: flex; gap: var(--s2); align-items: flex-start; }
.footer-grid .icon { margin-top: 4px; width: 18px; height: 18px; }
.site-footer .brand { color: #fff; display: inline-block; margin-bottom: var(--s3); }
.site-footer .brand span { color: #9fc4a8; }
.footer-note { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid #2c342e; font-size: 14px; color: #a39f95; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); }

/* ---------- Page header (หน้าย่อย) ---------- */
.page-head { padding: var(--s8) 0 var(--s7); text-align: center; border-bottom: 1px solid var(--line); }
.page-head p { max-width: 640px; margin: 0 auto; }

/* ---------- 4) หน้าแรก: Hero ---------- */
.hero { position: relative; display: grid; min-height: min(calc(100svh - var(--header-h)), 780px); background: var(--hero-bg); color: #fff; overflow: hidden; }
.hero > * { grid-area: 1 / 1; }
.hero__media { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero__overlay { background: rgba(8, 11, 9, .58); }
.hero__content { align-self: center; justify-self: center; text-align: center; max-width: 820px; padding: var(--s8) var(--gutter); }
.hero__content .eyebrow { color: #cfe3d4; }
.hero__content p { font-size: 19px; color: #e9e6df; max-width: 620px; margin: 0 auto var(--s6); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); }
.hero__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s6); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid rgba(255, 255, 255, .22); }
.hero__stats strong { display: block; font-family: var(--font-head); font-size: 28px; color: #fff; }
.hero__stats span { font-size: 14px; color: #d4d0c6; }

/* การ์ดบริการ */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s6) var(--s5); }
.service { text-align: center; }
.service__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); margin-bottom: var(--s4); }
.service__icon .icon { width: 26px; height: 26px; }
.service h3 { font-size: 20px; }
.service p { color: var(--muted); margin: 0; font-size: 15px; }

/* ส่วนภาพ + ข้อความ */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s8); align-items: center; }
.split__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); cursor: zoom-in; }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s3); }
.checklist li { display: flex; gap: var(--s3); align-items: flex-start; }
.checklist .icon { color: var(--primary); margin-top: 4px; }

/* ขั้นตอนการซื้อ */
.steps { counter-reset: step; }
.step { text-align: center; }
.step__num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary); font-weight: 600; margin-bottom: var(--s3); }
.step h3 { font-size: 19px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

/* ภาพผลงานตัวอย่างหน้าแรก */
.works-teaser { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s4); }
.works-teaser img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-lg); cursor: zoom-in; }
.works-teaser img:first-child { aspect-ratio: auto; }

.cta-band { background: var(--primary); color: var(--on-primary); border-radius: var(--radius-lg); padding: var(--s8) var(--s6); text-align: center; }
.cta-band p { opacity: .9; max-width: 560px; margin: 0 auto var(--s5); }
.cta-band .btn { background: var(--on-primary); color: var(--primary); }
.cta-band .btn:hover { opacity: .9; }
.center { text-align: center; }
.mt-6 { margin-top: var(--s6); }

/* ---------- การ์ดสินค้า ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s5); }
.product { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.product__media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); border: 0; padding: 0; cursor: zoom-in; overflow: hidden; }
.product__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .5s; }
.product__media img.is-loaded { opacity: 1; }
.product__media:hover img { transform: scale(1.03); }
.product__media .zoom-hint { position: absolute; right: var(--s3); bottom: var(--s3); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.product__badge { position: absolute; left: var(--s3); top: var(--s3); background: var(--surface); color: var(--primary); font-size: 13px; font-weight: 600; padding: 2px var(--s3); border-radius: 999px; border: 1px solid var(--line); }
.img-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s2); color: var(--muted); font-size: 14px; }
.img-fallback .icon { width: 32px; height: 32px; }
.product__body { display: flex; flex-direction: column; flex: 1; padding: var(--s4) var(--s5) var(--s5); }
.product__cat { font-size: 13px; font-weight: 600; color: var(--primary); letter-spacing: .04em; }
.product__name { font-size: 20px; margin: var(--s1) 0 var(--s1); }
.product__style { font-size: 15px; color: var(--muted); margin-bottom: var(--s3); }
.product__desc { font-size: 14px; color: var(--muted); margin-bottom: var(--s4); }
.product__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.price { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.stock-note { font-size: 13px; color: var(--muted); width: 100%; }

/* แถบเครื่องมือหน้าสินค้า */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; justify-content: space-between; margin-bottom: var(--s6); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 40px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.toolbar__right { display: flex; gap: var(--s3); flex-wrap: wrap; }
.field-inline { position: relative; }
.field-inline .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: var(--s2) var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-inline .input { padding-left: 38px; width: 240px; }
.select { width: auto; padding-right: var(--s6); }
.result-count { color: var(--muted); font-size: 15px; margin-bottom: var(--s4); text-align: center; }
.empty-state { text-align: center; padding: var(--s8) var(--s4); border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); }
.empty-state .icon { width: 40px; height: 40px; color: var(--primary); margin: 0 auto var(--s3); }
.empty-state h3 { color: var(--text); }

/* ---------- หน้าผลงาน ---------- */
.works-highlights { margin-bottom: var(--s8); }
.highlight { text-align: center; }
.highlight strong { display: block; font-family: var(--font-head); font-size: 34px; color: var(--primary); }
.highlight span { color: var(--muted); font-size: 15px; }
.chips--center { justify-content: center; margin-bottom: var(--s6); }
.masonry { columns: 3 300px; column-gap: var(--s4); }
.work { break-inside: avoid; margin: 0 0 var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.work button { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; }
.work img { width: 100%; height: auto; }
.work figcaption { padding: var(--s3) var(--s4); font-size: 15px; }
.work figcaption small { display: block; color: var(--primary); font-weight: 600; font-size: 13px; }

/* ---------- หน้าติดต่อ ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--s7); align-items: start; }
.info-list { display: grid; gap: var(--s4); }
.info-item { display: flex; gap: var(--s4); align-items: flex-start; }
.info-item__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); }
.info-item h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin: 0; }
.info-item p { margin: 0; color: var(--muted); }
.info-item a { color: var(--primary); }
.contact-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); margin-top: var(--s5); cursor: zoom-in; }
.form { display: grid; gap: var(--s4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.field label { display: block; font-weight: 500; margin-bottom: var(--s1); font-size: 15px; }
.field .req { color: var(--danger); }
.textarea { min-height: 140px; resize: vertical; }
.field-error { display: none; color: var(--danger); font-size: 14px; margin-top: var(--s1); align-items: center; gap: var(--s1); }
.field-error .icon { width: 16px; height: 16px; }
.field.is-invalid .field-error { display: flex; }
.field.is-invalid .input, .field.is-invalid .textarea, .field.is-invalid .select { border-color: var(--danger); }
.form-note { font-size: 14px; color: var(--muted); margin: 0; }
.order-summary { background: var(--primary-soft); border-radius: var(--radius); padding: var(--s4); font-size: 15px; }
.order-summary h3 { font-family: var(--font-body); font-size: 16px; margin-bottom: var(--s2); }
.order-summary ul { margin: 0 0 var(--s2); padding-left: var(--s5); }
.order-summary[hidden] { display: none; }
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--radius); border: 1px solid; }
.alert--success { border-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert--error { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alert p { margin: 0; color: var(--text); }
.alert[hidden] { display: none; }
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: var(--s3); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { margin: var(--s3) 0 0; color: var(--muted); }

/* ---------- 5) ตะกร้าสินค้า (drawer) ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100%); background: var(--surface); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s ease; box-shadow: var(--shadow); }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-open .drawer { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 22px; margin: 0; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s4) var(--s5); }
.drawer__foot { border-top: 1px solid var(--line); padding: var(--s4) var(--s5) var(--s5); display: grid; gap: var(--s3); }
.drawer__row { display: flex; justify-content: space-between; }
.drawer__total { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.cart-item { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 76px; height: 92px; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.cart-item h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin: 0; }
.cart-item__meta { font-size: 14px; color: var(--muted); }
.cart-item__row { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s2); gap: var(--s2); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.qty button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; }
.qty .icon { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; color: var(--danger); cursor: pointer; display: inline-flex; gap: var(--s1); align-items: center; font-size: 14px; padding: var(--s1); }
.link-btn .icon { width: 16px; height: 16px; }
.cart-empty { text-align: center; padding: var(--s8) var(--s4); color: var(--muted); }
.cart-empty .icon { width: 44px; height: 44px; color: var(--primary); margin: 0 auto var(--s3); }

/* ---------- Lightbox (ดูภาพเต็มจอ) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(6, 8, 7, .94); display: none; grid-template-rows: auto 1fr auto; color: #fff; }
.lightbox.is-open { display: grid; }
.lightbox__top { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s4); font-size: 15px; color: #cfcbc2; }
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; touch-action: pan-y; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.lightbox__caption { text-align: center; padding: var(--s3) var(--s4) var(--s5); color: #e9e6df; }
.lb-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .15); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: var(--s3); }
.lb-next { right: var(--s3); }
.lb-btn .icon { width: 24px; height: 24px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: var(--s5); z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: var(--s2); background: var(--text); color: var(--bg); padding: var(--s3) var(--s5); border-radius: var(--radius); box-shadow: var(--shadow); transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .split { gap: var(--s6); }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .nav { position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--s3) var(--gutter) var(--s5); display: none; }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; }
  .nav__link { padding: var(--s3); text-align: center; font-size: 18px; }
  .header-actions { margin-left: auto; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split__text { text-align: center; }
  .checklist { justify-items: center; }
  .checklist li { text-align: left; }
  .grid-3 { grid-template-columns: 1fr; }
  .works-teaser { grid-template-columns: 1fr 1fr; }
  .works-teaser img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .chips { justify-content: center; }
  .toolbar__right { justify-content: center; }
  .contact-info { text-align: center; }
  .info-item { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; --header-h: 62px; }
  .section { padding: var(--s8) 0; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: var(--s6); }
  .footer-grid li { justify-content: center; }
  .footer-note { justify-content: center; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .field-inline, .field-inline .input, .select { width: 100%; }
  .toolbar__right { flex-direction: column; }
  .product-grid { grid-template-columns: 1fr; }
  .hero__stats { gap: var(--s5); }
  .lightbox__stage { padding: 0 var(--s2); }
  .lb-prev, .lb-next { top: auto; bottom: var(--s2); transform: none; }
  .lightbox__caption { padding-bottom: 72px; }
  .brand { font-size: 20px; }
}

/* มือถือแนวตั้ง: ภาพ Hero อยู่บน ข้อความอยู่ล่าง (ไม่ทับกัน อ่านง่ายกว่า) */
@media (max-width: 700px) and (orientation: portrait) {
  .hero { display: block; min-height: 0; }
  .hero__media { height: auto; aspect-ratio: 4 / 3; object-position: 62% 60%; }
  .hero__overlay { display: none; }
  .hero__content { padding: var(--s7) var(--gutter) var(--s8); }
  .hero__content p { font-size: 17px; }
}

/* จอแนวนอนเตี้ย (มือถือแนวนอน) */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 0; }
  .hero__content { padding: var(--s6) var(--gutter); }
  .hero__stats { margin-top: var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* หัวข้อภาษาไทย: กระจายบรรทัดให้สมดุล และห้ามตัดกลางคำที่ใส่ .nw */
h1, h2, h3 { text-wrap: balance; }
.nw { white-space: nowrap; }

/* การ์ดสินค้า: ราคาอยู่บน ปุ่มเต็มความกว้างอยู่ล่าง ให้ทุกการ์ดเท่ากัน */
.product__foot { display: grid; gap: var(--s2); justify-content: stretch; }
.product__foot .price { order: 1; }
.product__foot .stock-note { order: 2; margin-top: calc(var(--s1) * -1); }
.product__foot .btn { order: 3; width: 100%; margin-top: var(--s2); }
.field .select { width: 100%; }

/* แท็บเล็ต: แถบตัวกรองจัดกึ่งกลางเมื่อขึ้นบรรทัดใหม่ */
@media (max-width: 1180px) {
  .toolbar { flex-direction: column; align-items: center; }
  .chips { justify-content: center; }
}

/* มือถือ: toast ขึ้นด้านบน ไม่บังปุ่มในตะกร้า/คำบรรยายภาพ */
@media (max-width: 600px) {
  .toast { top: calc(var(--header-h) + var(--s3)); bottom: auto; transform: translate(-50%, -20px); width: max-content; }
  .toast.is-show { transform: translate(-50%, 0); }
}

/* มือถือ: ไฮไลต์หน้าผลงานเป็น 2x2 ให้เห็นภาพผลงานเร็วขึ้น */
@media (max-width: 600px) {
  .works-highlights { grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s6); }
  .highlight { padding: var(--s4) var(--s3); }
  .highlight strong { font-size: 22px; }
  .highlight span { font-size: 13px; line-height: 1.5; display: block; }
}
