/* ==========================================================================
   Nicha-on Flower — ดอกไม้ไหมพรมถักมือ
   เขียนแบบ mobile-first : สไตล์พื้นฐานคือจอมือถือ แล้วค่อยขยายด้วย min-width
   ========================================================================== */

/* --- 1. โทเคนสี / ตัวอักษร ------------------------------------------------ */
:root {
  /* โหมดสว่าง */
  --paper:       #FAF8FF;   /* ขาวนวลอมม่วงอ่อน */
  --surface:     #FFFFFF;
  --surface-2:   #F3EEFF;   /* พาเนลสีลาเวนเดอร์จาง */
  --ink:         #211B33;   /* ม่วงเข้มเกือบดำ */
  --ink-2:       #6B6484;
  --line:        #E6DFF5;
  --brand:       #6C4EE8;   /* ม่วงองุ่น = สีหลัก */
  --brand-ink:   #533BC0;   /* ม่วงเข้มสำหรับตัวอักษรเล็ก */
  --brand-soft:  #EAE2FF;
  --on-brand:    #FFFFFF;   /* สีตัวอักษรบนปุ่มสีหลัก */
  --butter:      #FFD65A;   /* เหลืองบัตเตอร์ = สีทานตะวัน */
  --butter-soft: #FFF1BE;
  --mint:        #6FD3A6;
  --pink:        #FF9FC7;

  --stitch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7q7-7 14 0t14 0' fill='none' stroke='%23D6CCF0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --knit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16'%3E%3Cpath d='M2 14L9 3l7 11' fill='none' stroke='%23211B33' stroke-opacity='.06' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --shadow-s: 0 1px 2px rgba(33,27,51,.05), 0 4px 14px rgba(33,27,51,.06);
  --shadow-m: 0 2px 6px rgba(33,27,51,.06), 0 18px 40px rgba(84,60,180,.13);

  --r-s: 12px;
  --r-m: 20px;
  --r-l: 30px;

  --pad: clamp(1.15rem, 5vw, 2.5rem);      /* ระยะขอบซ้ายขวาของหน้า */
  --gap-sec: clamp(3.2rem, 11vw, 6.5rem);  /* ระยะห่างระหว่างส่วน */
  --wrap: 1180px;

  --font-display: "Mitr", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Charmonman", "Mitr", cursive;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #14111F;
    --surface:     #1D1830;
    --surface-2:   #262040;
    --ink:         #F2EEFF;
    --ink-2:       #A8A0C4;
    --line:        #342C52;
    --brand:       #A98CFF;
    --brand-ink:   #C4B0FF;
    --brand-soft:  #2E2550;
    --on-brand:    #1A1230;
    --butter:      #FFD65A;
    --butter-soft: #463A16;
    --mint:        #8FE6C0;
    --pink:        #FFAFD3;
    --shadow-s: 0 1px 2px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.35);
    --shadow-m: 0 2px 6px rgba(0,0,0,.5), 0 18px 40px rgba(0,0,0,.45);
    --stitch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7q7-7 14 0t14 0' fill='none' stroke='%234B3F78' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    --knit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16'%3E%3Cpath d='M2 14L9 3l7 11' fill='none' stroke='%23F2EEFF' stroke-opacity='.05' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:       #14111F;
  --surface:     #1D1830;
  --surface-2:   #262040;
  --ink:         #F2EEFF;
  --ink-2:       #A8A0C4;
  --line:        #342C52;
  --brand:       #A98CFF;
  --brand-ink:   #C4B0FF;
  --brand-soft:  #2E2550;
  --on-brand:    #1A1230;
  --butter:      #FFD65A;
  --butter-soft: #463A16;
  --mint:        #8FE6C0;
  --pink:        #FFAFD3;
  --shadow-s: 0 1px 2px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.35);
  --shadow-m: 0 2px 6px rgba(0,0,0,.5), 0 18px 40px rgba(0,0,0,.45);
  --stitch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7q7-7 14 0t14 0' fill='none' stroke='%234B3F78' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --knit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16'%3E%3Cpath d='M2 14L9 3l7 11' fill='none' stroke='%23F2EEFF' stroke-opacity='.05' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* --- 2. พื้นฐาน ---------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* เผื่อที่ให้แถบปุ่มติดต่อที่ลอยอยู่ล่างจอมือถือ */
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

img, svg { max-width: 100%; display: block; }
img { height: auto; }  /* ให้ aspect-ratio ใน CSS ทำงาน แทนค่า height ในแท็ก */
[hidden] { display: none !important; }  /* ให้ตัวกรองซ่อนการ์ดได้จริง แม้การ์ดจะตั้ง display ไว้ */
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2rem, 8.5vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 6vw, 2.5rem); }
h3 { font-size: clamp(1.12rem, 4vw, 1.3rem); }
p { margin: 0; }

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: var(--gap-sec); }

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.lead { color: var(--ink-2); font-size: 1.02rem; }

/* เส้นคั่น = ลายโซ่ถักไหมพรม */
.stitch-rule {
  height: 14px;
  background-image: var(--stitch);
  background-repeat: repeat-x;
  background-position: center;
  opacity: .9;
}

/* --- 3. ปุ่ม ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 50px;              /* พื้นที่กดบนมือถือ */
  padding: .7rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-s); }
.btn--primary:hover { box-shadow: var(--shadow-m); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--brand); }
.btn--line { background: #06C755; color: #fff; box-shadow: var(--shadow-s); }
.btn--block { width: 100%; }

/* --- 4. หัวเว็บ + เมนู --------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand__mark {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--butter);
  display: grid;
  place-items: center;
}
.brand__name {
  font-family: var(--font-script);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
}
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: .15rem;
}

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.nav__toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.nav__toggle span::before,
.nav__toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px;
  background: currentColor; border-radius: 2px; transition: transform .22s ease, opacity .22s ease;
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* เมนูแบบ drawer บนมือถือ */
.nav {
  position: fixed;
  inset: 62px 0 auto 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: .75rem var(--pad) 1.4rem;
  display: grid;
  gap: .15rem;
  box-shadow: var(--shadow-m);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav[data-open="true"] { opacity: 1; transform: none; visibility: visible; }
.nav a {
  text-decoration: none;
  font-weight: 500;
  padding: .85rem .25rem;
  border-bottom: 1px solid var(--line);
}
.nav a:last-of-type { border-bottom: 0; }
.nav .btn { margin-top: .8rem; }

/* --- 5. ฮีโร่ ------------------------------------------------------------ */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--butter-soft) 0%, var(--paper) 78%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--knit);
  opacity: .7;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  padding-block: clamp(1.25rem, 5vw, 4.5rem) clamp(2.6rem, 9vw, 5rem);
}
.hero__copy { display: grid; gap: 1.1rem; justify-items: start; }
.hero h1 .script {
  font-family: var(--font-script);
  color: var(--brand-ink);
  font-weight: 400;
}
.hero__actions { display: grid; gap: .7rem; width: 100%; }
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .4rem;
  padding: 0; margin: .4rem 0 0; list-style: none;
}
.hero__facts li {
  font-size: .85rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
}

/* บนมือถือให้รูปสินค้าขึ้นก่อนข้อความ ลูกค้าเห็นดอกไม้ตั้งแต่เปิดหน้า */
.hero__art { position: relative; order: -1; }
.hero__art img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 55%;
  border-radius: var(--r-l);
  box-shadow: var(--shadow-m);
  border: 1px solid var(--line);
}
.hero__seal {
  position: absolute;
  right: .6rem;
  bottom: -1rem;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--butter);
  color: #211B33;
  display: grid;
  place-content: center;
  text-align: center;
  gap: .1rem;
  box-shadow: var(--shadow-m);
  transform: rotate(-8deg);
}
.hero__seal b { font-size: 1.3rem; font-family: var(--font-display); line-height: 1; }
.hero__seal span { font-size: .68rem; letter-spacing: .08em; }

/* --- 6. แถบช่องทางติดต่อ -------------------------------------------------- */
.channels {
  display: grid;
  gap: .8rem;
  margin-top: calc(var(--gap-sec) * -0.35);
  position: relative;
  z-index: 2;
}
.channel {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .95rem 1.1rem;
  border-radius: var(--r-m);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease;
}
.channel:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.channel__icon {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
}
.channel--line .channel__icon { background: #06C755; }
.channel--tel  .channel__icon { background: var(--brand); color: var(--on-brand); }
.channel--ig   .channel__icon { background: linear-gradient(45deg, #F09433, #DC2743 55%, #BC1888); }
.channel--fb   .channel__icon { background: #1877F2; }
.channel b { display: block; font-size: 1.02rem; }
.channel small { color: var(--ink-2); font-size: .82rem; }

/* --- 7. หัวข้อส่วน -------------------------------------------------------- */
.sec-head { display: grid; gap: .7rem; margin-bottom: 1.8rem; }
.sec-head p { max-width: 62ch; }

/* --- 8. หมวดสินค้า (เลื่อนแนวนอนบนมือถือ) --------------------------------- */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 74%;
  gap: .9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .3rem var(--pad) 1.2rem;
  margin-inline: calc(var(--pad) * -1);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: center; }

.cat {
  position: relative;
  display: block;
  border-radius: var(--r-m);
  overflow: hidden;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cat img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.cat__label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.6rem .95rem .9rem;
  background: linear-gradient(to top, rgba(20,15,36,.85), rgba(20,15,36,0));
  color: #fff;
}
.cat__label b { font-family: var(--font-display); font-size: 1.14rem; }
.cat__label span { display: block; font-size: .8rem; opacity: .85; }
.rail-hint { font-size: .82rem; color: var(--ink-2); display: flex; align-items: center; gap: .4rem; }

/* --- 9. จุดเด่น ---------------------------------------------------------- */
.why { background: var(--surface-2); }
.why__grid { display: grid; gap: .9rem; }
.why__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 1.3rem 1.2rem;
  display: grid;
  gap: .5rem;
  align-content: start;
}
.why__card .ico {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid; place-items: center;
}
.why__card p { color: var(--ink-2); font-size: .95rem; }

/* --- 10. แกลเลอรีสินค้า -------------------------------------------------- */
.filters {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .6rem;
  margin-bottom: 1.3rem;
  margin-inline: calc(var(--pad) * -1);
  padding-inline: var(--pad);
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 42px;
  padding: .45rem 1.05rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: .93rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.grid-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .8rem;
}
.product {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.product__media { position: relative; }
.product__media img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.product__tag {
  position: absolute;
  top: .6rem; left: .6rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--butter);
  border: 0;
  color: #211B33;
}
.product__body { padding: .8rem .85rem 1rem; display: grid; gap: .45rem; align-content: start; }
.product__body h3 { font-size: 1rem; }
.product__price {
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}
.product__ask {
  margin-top: .2rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--brand);
  justify-self: start;
  padding-bottom: 1px;
}

/* --- 10b. คลิปผลงาน (วิดีโอแนวตั้ง 9:16) ------------------------------- */
.reels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 58%;
  gap: .8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .3rem var(--pad) 1rem;
  margin-inline: calc(var(--pad) * -1);
  scrollbar-width: none;
}
.reels::-webkit-scrollbar { display: none; }
.reel { margin: 0; display: grid; gap: .55rem; align-content: start; scroll-snap-align: center; }
.reel__frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.reel__video { width: 100%; height: 100%; object-fit: cover; }
.reel__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(to top, rgba(20,15,36,.5), rgba(20,15,36,0) 45%);
  transition: opacity .2s ease;
}
.reel__play span {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--butter);
  color: #211B33;
  box-shadow: 0 6px 20px rgba(20,15,36,.35);
  transition: transform .18s ease;
}
.reel__play span svg { margin-left: 3px; }  /* ชดเชยสามเหลี่ยมให้ดูอยู่กลางวง */
.reel__play:hover span { transform: scale(1.06); }
.reel.is-playing .reel__play { opacity: 0; pointer-events: none; }
.reel__time {
  position: absolute;
  top: .55rem; left: .55rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: rgba(20,15,36,.62);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.reel__mute {
  position: absolute;
  right: .55rem; bottom: .55rem;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20,15,36,.62);
  color: #fff;
  cursor: pointer;
}
.reel__mute .ico-muted,
.reel__mute.is-muted .ico-sound { display: none; }
.reel__mute.is-muted .ico-muted { display: block; }
.reel figcaption { font-size: .92rem; font-weight: 600; line-height: 1.45; }

/* --- 11. ขั้นตอนสั่งซื้อ (เป็นลำดับจริง จึงใส่ตัวเลขกำกับ) ------------------ */
.steps { counter-reset: step; display: grid; gap: .9rem; list-style: none; padding: 0; margin: 0; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}
.step::before {
  content: counter(step);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--butter);
  color: #211B33;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.step h3 { margin-bottom: .2rem; }
.step p { color: var(--ink-2); font-size: .95rem; }

/* --- 12. คำถามที่พบบ่อย --------------------------------------------------- */
.faq { display: grid; gap: .7rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 3rem 1.05rem 1.1rem;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem; top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--brand-ink);
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq p { padding: 0 1.1rem 1.15rem; color: var(--ink-2); font-size: .95rem; }

/* --- 13. แถบปิดการขาย ---------------------------------------------------- */
.cta-band {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-l);
  padding: clamp(1.6rem, 6vw, 3rem);
  display: grid;
  gap: 1.1rem;
  text-align: center;
  justify-items: center;
  background-image: var(--knit);
}
.cta-band h2 { color: var(--paper); }
.cta-band p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.cta-band .btn--ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }

/* --- 14. ท้ายเว็บ -------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding-block: clamp(2.2rem, 8vw, 3.4rem) 1.4rem;
}
.footer__grid { display: grid; gap: 1.8rem; }
.footer h4 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 .6rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer a:hover { color: var(--brand-ink); }
.footer__note {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--ink-2);
  display: grid;
  gap: .4rem;
}

/* --- 15. แถบติดต่อลอยล่างจอ (หัวใจของเวอร์ชันมือถือ) ---------------------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  padding: .55rem var(--pad) calc(.55rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.dock .btn { min-height: 48px; font-size: .97rem; }

/* --- 16. ไลท์บ็อกซ์ ------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 1.2rem;
  background: rgba(18,13,34,.88);
  backdrop-filter: blur(6px);
}
.lightbox[data-open="true"] { display: grid; }
.lightbox figure { margin: 0; display: grid; justify-items: center; }
.lightbox img { max-height: 76vh; width: auto; border-radius: var(--r-m); box-shadow: var(--shadow-m); }
.lightbox__close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox figcaption { color: #fff; text-align: center; margin-top: .8rem; font-size: .95rem; }

/* --- 17. เอฟเฟกต์ปรากฏตอนเลื่อน ------------------------------------------ */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .product, .channel { transition: none; }
}

/* --- 17b. หน้าเอกสาร: เกี่ยวกับเรา / ความเป็นส่วนตัว / เงื่อนไข ------------- */
.page-hero {
  background: linear-gradient(180deg, var(--butter-soft) 0%, var(--paper) 100%);
  padding-block: clamp(1.8rem, 7vw, 3.4rem) clamp(1.2rem, 4vw, 2rem);
}
.page-hero .wrap { display: grid; gap: .75rem; justify-items: start; }
.page-hero h1 { font-size: clamp(1.75rem, 7vw, 2.7rem); }
.page-meta { color: var(--ink-2); font-size: .88rem; }
.doc-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--pad) * -1);
  padding: .3rem var(--pad) .2rem;
  max-width: calc(100% + var(--pad) * 2);
}
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs a {
  flex: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: .4rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
}
.doc-tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.doc { padding-block: clamp(1.4rem, 5vw, 2.6rem) var(--gap-sec); }
.doc__body { max-width: 68ch; display: grid; gap: .95rem; }
.doc__body h2 { font-size: clamp(1.22rem, 4.6vw, 1.5rem); margin-top: 1.5rem; }
.doc__body h2:first-child { margin-top: 0; }
.doc__body h3 { font-size: 1.05rem; margin-top: .3rem; }
.doc__body p,
.doc__body li { color: var(--ink-2); }
.doc__body strong { color: var(--ink); font-weight: 600; }
.doc__body ul, .doc__body ol { margin: 0; padding-left: 1.25rem; display: grid; gap: .4rem; }
.doc__body a { color: var(--brand-ink); text-underline-offset: 3px; }
.doc-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 1rem 1.15rem;
  display: grid;
  gap: .45rem;
}
.doc-note--warn { background: var(--butter-soft); border-color: transparent; }
.doc-note--warn p, .doc-note--warn li { color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.doc-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.doc-table th, .doc-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table tr:last-child th, .doc-table tr:last-child td { border-bottom: 0; }
.doc-table th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.doc-table td { color: var(--ink-2); }

/* หัวเรื่องเล็กเหนือ H1 หน้าแรก (เป็นส่วนหนึ่งของ H1 เพื่อ SEO) */
.hero h1 .kicker {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .85rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  color: var(--brand-ink);
}
.hero h1 .kicker::before {
  content: "";
  flex: none;
  width: 26px; height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

/* --- 18. แท็บเล็ตขึ้นไป --------------------------------------------------- */
@media (min-width: 700px) {
  body { padding-bottom: 0; }          /* ไม่ต้องเผื่อแถบล่างแล้ว */
  .dock { display: none; }
  .channels { grid-template-columns: repeat(2, 1fr); }
  .why__grid { grid-template-columns: repeat(2, 1fr); }
  .grid-products { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
  .rail { grid-auto-columns: 40%; }
  .reels { grid-auto-columns: 30%; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero__actions { display: flex; flex-wrap: wrap; width: auto; }
  .hero__art { width: 100%; max-width: 560px; margin-inline: auto; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__note { grid-template-columns: 1fr auto; align-items: center; }
}

/* --- 19. เดสก์ท็อป ------------------------------------------------------- */
@media (min-width: 1000px) {
  .nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav a { border: 0; padding: .3rem 0; position: relative; font-size: .97rem; }
  .nav a::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -2px;
    height: 2px; background: var(--brand);
    transform: scaleX(0); transform-origin: left;
    transition: transform .2s ease;
  }
  .nav a:hover::after { transform: scaleX(1); }
  .nav .btn { margin: 0; min-height: 44px; padding: .45rem 1.2rem; }
  .nav .btn::after { display: none; }
  .nav__toggle { display: none; }
  .header__bar { min-height: 78px; }

  .hero__inner { grid-template-columns: 1.02fr .98fr; align-items: center; gap: 3.5rem; }
  .hero__art { order: 0; max-width: 460px; }
  .hero__art img { aspect-ratio: 4 / 5; }
  .hero__seal { width: 104px; height: 104px; right: -.4rem; bottom: -1.2rem; }
  .hero__seal b { font-size: 1.5rem; }
  .channels { grid-template-columns: repeat(4, 1fr); }
  .why__grid { grid-template-columns: repeat(4, 1fr); }
  .grid-products { grid-template-columns: repeat(4, 1fr); }
  .rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .rail-hint { display: none; }
  .reels {
    grid-auto-flow: row;
    grid-template-columns: repeat(6, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .cta-band { padding-block: 3.6rem; }
}
