:root {
  --cream: #f4eedf;
  --cream-2: #fff8eb;
  --ink: #302619;
  --muted: #786b5b;
  --gold: #9f7b3f;
  --dark: #191511;
  --line: rgba(48, 38, 25, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 12px clamp(18px, 4vw, 58px);
  background: rgba(244, 238, 223, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: grid; gap: 1px; }
.brand-name { font: 700 24px/1 "Playfair Display", serif; }
.brand-sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.catalog-nav { display: flex; align-items: center; gap: 22px; color: #4d4134; font-size: 14px; font-weight: 800; }
.catalog-nav a { white-space: nowrap; }
.catalog-nav [aria-current="page"] { color: var(--gold); }
.catalog-menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, .72);
  cursor: pointer;
}
.catalog-menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}
.catalog-header.is-menu-open .catalog-menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.catalog-header.is-menu-open .catalog-menu-toggle span:nth-child(2) {
  opacity: 0;
}
.catalog-header.is-menu-open .catalog-menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.catalog-hero {
  padding: clamp(40px, 7vw, 86px) clamp(18px, 6vw, 88px) 28px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font: 700 clamp(48px, 8vw, 92px) / .95 "Playfair Display", serif;
}
.catalog-hero > p {
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.catalog-stats, .category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.catalog-stats span, .category-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 235, .72);
  font-weight: 800;
}
.category-chips a span {
  margin-left: 8px;
  color: var(--gold);
}
.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.category-tile {
  min-height: 190px;
  display: grid;
  grid-template-rows: 118px 1fr;
  overflow: hidden;
  background: #fff8eb;
  border: 1px solid rgba(159, 123, 63, .28);
  box-shadow: 0 10px 24px rgba(48, 38, 25, .08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.category-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 123, 63, .72);
  box-shadow: 0 14px 32px rgba(48, 38, 25, .13);
}
.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eee3d0;
}
.category-tile span {
  display: grid;
  gap: 2px;
  padding: 12px;
}
.category-tile strong {
  font-size: 18px;
  line-height: 1.2;
}
.category-tile small {
  color: var(--muted);
  font-weight: 700;
}
.category-tile b {
  width: fit-content;
  margin-top: 4px;
  color: var(--gold);
  font-size: 13px;
}

.sheet-stack {
  display: grid;
  gap: 26px;
  padding: 0 clamp(12px, 4vw, 58px) 70px;
}
.sheet-stack.is-collapsed .catalog-extra-sheet {
  display: none;
}
.catalog-expand-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 6vw, 88px) 76px;
  margin-top: -36px;
}
.catalog-expand-panel[hidden] {
  display: none;
}
.catalog-expand-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}
.catalog-expand-button {
  width: min(100%, 460px);
  min-height: 64px;
  border: 0;
  background: #0f7a43;
  color: #fffaf0;
  box-shadow: 0 18px 38px rgba(15, 122, 67, .28);
  font: 900 20px/1.2 "Noto Sans Thai", system-ui, sans-serif;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.catalog-expand-button:hover {
  transform: translateY(-2px);
  background: #0b8f4b;
  box-shadow: 0 22px 44px rgba(15, 122, 67, .34);
}
.a4-sheet {
  width: min(100%, 980px);
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  padding: clamp(12px, 2.4vw, 24px);
  background: #fffaf0;
  border: 1px solid #d6c8ad;
  box-shadow: 0 18px 50px rgba(48, 38, 25, .12);
  overflow: hidden;
}
.sheet-head {
  height: 10%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d6c8ad;
  margin-bottom: 1.8%;
}
.sheet-head p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: clamp(10px, 1.1vw, 13px);
  font-weight: 900;
  text-transform: uppercase;
}
.sheet-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}
.sheet-head span {
  color: var(--muted);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}
.catalog-grid {
  height: 88%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 1.35%;
}
.catalog-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 46% 1fr;
  background: #f8f1e4;
  border: 1px solid rgba(159, 123, 63, .24);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.catalog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 123, 63, .7);
  box-shadow: 0 10px 24px rgba(48, 38, 25, .12);
}
.catalog-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eee3d0;
}
.card-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: clamp(6px, .9vw, 10px);
}
.product-code, .detail-code {
  width: fit-content;
  color: var(--gold);
  font-size: clamp(10px, .95vw, 12px);
  font-weight: 900;
}
.catalog-card strong {
  min-height: 2.7em;
  overflow: hidden;
  font-size: clamp(10px, 1vw, 14px);
  line-height: 1.35;
}
dl {
  margin: 0;
  display: grid;
  gap: 2px;
  font-size: clamp(9px, .9vw, 12px);
  line-height: 1.35;
}
dl div {
  min-width: 0;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  gap: 5px;
}
dt { color: var(--muted); }
dd {
  min-width: 0;
  margin: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-main {
  padding: clamp(24px, 5vw, 58px) clamp(18px, 6vw, 88px) 80px;
}
.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--gold);
  font-weight: 900;
}
.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(24px, 5vw, 58px);
  align-items: start;
}
.detail-image {
  background: #fffaf0;
  border: 1px solid #d6c8ad;
  padding: clamp(10px, 1.5vw, 16px);
}
.detail-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.detail-info {
  position: sticky;
  top: 96px;
}
.detail-info h1 {
  margin: 10px 0 16px;
  font-size: clamp(36px, 5vw, 62px);
}
.detail-info p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.detail-list {
  margin: 22px 0;
  border-top: 1px solid var(--line);
}
.detail-list div {
  grid-template-columns: 72px minmax(0, 1fr);
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.messenger-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--cream-2);
  font-size: 17px;
  font-weight: 900;
}
.hint { margin: 12px 0 0; font-size: 14px !important; }
.related-section {
  margin-top: 70px;
}
.section-title h2 {
  margin: 0 0 20px;
  font-size: clamp(28px, 4vw, 44px);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.related-grid .catalog-card {
  min-height: 310px;
}

@media (max-width: 920px) {
  .catalog-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  .catalog-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .catalog-nav {
    display: none;
    order: 3;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 248, 235, .98);
    box-shadow: 0 18px 36px rgba(48, 38, 25, .14);
    overflow: visible;
  }
  .catalog-header.is-menu-open .catalog-nav {
    display: flex;
  }
  .catalog-nav a {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(48, 38, 25, .1);
  }
  .catalog-nav a:last-child {
    border-bottom: 0;
  }
  .a4-sheet {
    aspect-ratio: auto;
    overflow: visible;
  }
  .sheet-head {
    height: auto;
    min-height: 76px;
  }
  .catalog-grid {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }
  .catalog-card {
    min-height: 315px;
  }
  .detail-shell {
    grid-template-columns: 1fr;
  }
  .detail-info {
    position: static;
  }
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-name { font-size: 21px; }
  .catalog-grid, .related-grid {
    grid-template-columns: 1fr;
  }
  .catalog-card {
    min-height: 390px;
  }
  .sheet-head {
    flex-direction: column;
  }
  .sheet-head span {
    text-align: left;
  }
}
