:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --link: #0066cc;
  --sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Sukhumvit Set",
    "IBM Plex Sans Thai", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans); /* ชื่อเดิม ใช้ฟอนต์เดียวกันทั้งเว็บ */
  --pad: clamp(20px, 4vw, 44px);
  --max: 1240px;
  --radius: 28px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
[hidden] { display: none !important; }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- global nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  /* 3 คอลัมน์: ซ้ายกับขวากว้างเท่ากัน เมนูจึงอยู่กึ่งกลางหน้าจริง ไม่เอียงตามความยาวชื่อร้าน */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  height: 48px;
  padding: 0 max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wordmark { justify-self: start; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

.nav-links {
  grid-column: 2;
  min-width: 0;
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex: none; padding: 14px 0; font-size: 13px; color: rgba(0, 0, 0, 0.8); transition: color 0.2s; }
.nav-links a:hover { color: #000; }

.header-tel {
  grid-column: 3;
  justify-self: end;
  padding: 5px 13px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  border-radius: 980px;
  transition: background 0.2s;
}
.header-tel:hover { background: #0077ed; }

/* ---------- buttons ---------- */
.button {
  display: inline-block;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  text-align: center;
  border-radius: 980px;
  transition: background 0.2s;
}
.button:hover { background: #0077ed; }
.button-small { padding: 7px 16px; font-size: 14px; }
.button-line { background: #06c755; }
.button-line:hover { background: #05b54c; }
.text-link { color: var(--link); }
.text-link::after { content: " ›"; }
.text-link:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); text-align: center; }
.hero .eyebrow { font-size: 17px; color: #b64400; }
.hero h1 {
  margin-top: 8px;
  font-size: clamp(40px, 7.2vw, 80px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero-sub {
  max-width: 720px;
  margin: 18px auto 0;
  font-size: clamp(19px, 2.3vw, 26px);
  line-height: 1.45;
}
.hero-sub span { white-space: nowrap; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 28px; }

/* พาดหัวค่อย ๆ ขึ้นทีละส่วนตอนเปิดหน้า */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
.hero > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero > :nth-child(2) { animation-delay: 0.12s; }
.hero > :nth-child(3) { animation-delay: 0.26s; }
.hero > :nth-child(4) { animation-delay: 0.4s; }
.hero > :nth-child(5) { animation-delay: 0.55s; }

/* ---------- showcase (สไลด์สินค้าเด่น) ---------- */
.showcase { margin-top: clamp(32px, 5vw, 56px); }
.showcase-stage { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--surface); border-radius: var(--radius); }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.9s ease, visibility 0s 0.9s; }
.slide.is-active { opacity: 1; visibility: visible; transition: opacity 0.9s ease; z-index: 1; }
.slide img { transform: scale(1.001); }
.slide.is-active img { animation: drift 7s ease-out both; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1.001); } }
.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(48px, 9vw, 110px) clamp(20px, 3vw, 36px) clamp(18px, 2.6vw, 30px);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  color: #fff;
  text-align: left;
}
.slide-name { font-size: clamp(21px, 2.8vw, 34px); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.slide-price { margin-top: 2px; font-size: clamp(16px, 1.6vw, 20px); opacity: 0.92; }
.slide-caption .button { flex: none; }
.slide.is-cutout img { object-fit: contain; padding: 4% 8% 13%; }
.slide.is-cutout .slide-caption { background: none; color: var(--ink); }

.showcase-dots { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.showcase-dots button { width: 28px; height: 28px; padding: 0; background: none; border: 0; cursor: pointer; }
.showcase-dots button::before { content: ""; display: block; width: 8px; height: 8px; margin: auto; background: var(--line); border-radius: 50%; transition: background 0.3s, transform 0.3s; }
.showcase-dots button[aria-current="true"]::before { background: var(--ink); transform: scale(1.25); }

@media (prefers-reduced-motion: reduce) {
  .hero > *, .slide.is-active img { animation: none; }
  .slide, .slide.is-active { transition: none; }
}

/* ---------- section heading + filters ---------- */
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.section-title span { color: var(--muted); }

.filters { display: flex; gap: 8px; margin-top: 22px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  padding: 8px 18px;
  background: var(--surface);
  border: 0;
  border-radius: 980px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filters button:hover { background: #e8e8ed; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.filters sup { margin-left: 5px; font-size: 11px; opacity: 0.6; }

/* ---------- grid + card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 28px 0 clamp(64px, 9vw, 120px);
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}
.card:hover { transform: scale(1.012); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1); }

.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e8e8ed; }
.card-media.is-cutout { background: var(--surface); }
.card-media.is-cutout img { object-fit: contain; padding: 9% 9% 4%; }
.stage.is-cutout img { padding: 6%; }
.thumbs img[src$=".png"] { object-fit: contain; padding: 10%; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 22px 26px 26px; }
.card-name { margin-top: 4px; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.card-summary { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.card-price { font-size: 17px; font-weight: 600; }

.card.is-sold .card-media img,
.card.is-sold .card-media .placeholder { opacity: 0.45; }
.card.is-sold .card-price { color: var(--muted); text-decoration: line-through; }

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 12px;
  background: rgba(29, 29, 31, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 980px;
}
.badge-inline { position: static; margin-left: 12px; vertical-align: middle; }

.stock { display: inline-block; margin-left: 14px; padding: 4px 12px; font-size: 13px; font-weight: 600; border-radius: 980px; vertical-align: middle; }
.stock.is-live { background: #e7f6ec; color: #116329; }
.stock.is-live::before { content: "● "; font-size: 10px; vertical-align: 1px; }
.stock.is-sold { background: var(--ink); color: #fff; }

.placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  background: linear-gradient(160deg, #fafafc 0%, #ececf0 100%);
}
.placeholder span {
  font-size: clamp(24px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
  color: #c7c7cc;
}

/* ---------- why us ---------- */
.why { padding-bottom: clamp(64px, 9vw, 120px); }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.why-tile { padding: 30px 30px 34px; background: var(--surface); border-radius: var(--radius); }
.why-tile h3 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.why-tile p { margin-top: 8px; color: var(--muted); font-size: 16px; }

/* ---------- product page ---------- */
.back { display: inline-block; padding: 22px 0; color: var(--link); font-size: 14px; }
.back:hover { text-decoration: underline; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding-bottom: clamp(64px, 9vw, 120px);
}

.gallery { position: sticky; top: 72px; }
.stage { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); border-radius: var(--radius); }
.stage img { object-fit: contain; transition: transform 0.25s ease-out; will-change: transform; }
.stage.is-zoomable { cursor: zoom-in; }
.stage.is-zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- lightbox (รูปเต็มจอ) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
  animation: lightbox-in 0.2s ease-out;
}
@keyframes lightbox-in { from { opacity: 0; } }
.lightbox-frame { width: 100vw; height: 100vh; height: 100dvh; padding: clamp(12px, 3vw, 48px); }
.lightbox-frame img { object-fit: contain; }
.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lightbox-nav { top: 50%; margin-top: -22px; font-size: 28px !important; padding-bottom: 4px !important; }
.lightbox-nav.is-prev { left: 16px; }
.lightbox-nav.is-next { right: 16px; }
.lightbox-count {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 980px;
  color: #fff;
  font-size: 13px;
}
.stage .placeholder span { font-size: clamp(40px, 7vw, 88px); }

.thumbs { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 10px; margin-top: 12px; }
.thumbs button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  border-radius: 12px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  cursor: pointer;
  transition: outline-color 0.2s;
}
.thumbs button:hover { outline-color: var(--line); }
.thumbs button[aria-current="true"] { outline-color: var(--accent); }
.thumbs .placeholder span { font-size: 11px; }

.info .eyebrow { color: #b64400; }
.info h1 {
  margin-top: 6px;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.info-summary { margin-top: 10px; color: var(--muted); font-size: 19px; line-height: 1.45; }
.info-price { margin-top: 22px; font-size: 28px; font-weight: 600; line-height: 1.2; }

.info-desc { margin-top: 22px; font-size: 17px; line-height: 1.65; white-space: pre-line; }

.info h2 { margin-top: 36px; font-size: 21px; font-weight: 600; }
.specs { margin-top: 10px; border-top: 1px solid var(--line); }
.specs div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.specs dt { color: var(--muted); }

.condition p { margin-top: 10px; padding: 18px 22px; background: var(--surface); border-radius: 18px; font-size: 16px; white-space: pre-line; }

.includes ul { margin-top: 10px; padding: 18px 22px; background: var(--surface); border-radius: 18px; }
.includes li { position: relative; padding: 5px 0 5px 26px; font-size: 16px; }
.includes li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

.cta { margin-top: 32px; }
.cta-buttons { display: grid; gap: 10px; }
.cta .button { display: block; padding: 15px 28px; }
.callbar-actions { display: flex; gap: 8px; }
.cta-note { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }

.more { padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }

.notfound { grid-column: 1 / -1; padding: 80px 0; text-align: center; }
.notfound h1 { font-size: 40px; font-weight: 600; }
.notfound p { margin: 12px 0 28px; color: var(--muted); }

.callbar { display: none; }

/* ---------- LINE ---------- */
.line { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.line-qr { flex: none; width: 112px; height: 112px; object-fit: contain; background: #fff; border-radius: 14px; padding: 6px; }
.line-text { margin-top: 4px; font-size: 14px; color: var(--muted); }
.line-link { display: inline-block; margin-top: 4px; font-size: 14px; color: var(--link); }
.line-link:hover { text-decoration: underline; }
.cta .line { padding: 16px; background: var(--surface); border-radius: 18px; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) var(--pad);
}
.site-footer .eyebrow { font-size: 12px; color: var(--ink); }
.footer-tel { display: inline-block; margin-top: 8px; color: var(--ink); font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.footer-text { margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid, .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product { grid-template-columns: 1fr; }
  .gallery { position: static; }
  /* จอแคบ: ไม่ให้รูปกินจนชื่อและราคาตกจอ */
  .stage { aspect-ratio: auto; height: min(62vw, 52vh); }

  /* แถบราคา + ปุ่มโทรติดด้านล่าง (มือถือและแท็บเล็ต) */
  .cta-buttons { display: none; }
  .cta-note { text-align: left; }
  body[data-page="product"] { padding-bottom: 84px; }
  .callbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  .callbar-price { font-size: 21px; font-weight: 600; }
}

@media (max-width: 640px) {
  .grid, .why-grid { grid-template-columns: 1fr; gap: 16px; }
  .section-title span { display: block; }
  /* จอแคบ: เมนูใช้พื้นที่ที่เหลือและเลื่อนได้ */
  .site-header { gap: 14px; grid-template-columns: auto minmax(0, 1fr) auto; }
  /* เมนูเลื่อนได้ ขอบขวาค่อย ๆ จาง ไม่โดนปุ่มโทรตัดคำ */
  .nav-links { gap: 20px; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 24px; }
  .header-tel { padding: 7px 16px; }
  .hero { padding: 28px 0 28px; }
  .hero h1 { font-size: 36px; }
  .hero-sub { margin-top: 12px; font-size: 17px; }
  .hero-cta { gap: 20px; margin-top: 20px; }
  .showcase { margin-top: 24px; }
  .showcase-stage { aspect-ratio: 4 / 3.4; }
  .slide-caption .button { display: none; }
  .card-body { padding: 20px 22px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-tel { padding: 6px 0; }
  .back { padding: 16px 0; }
  .thumbs { grid-template-columns: repeat(5, 1fr); }
}
