:root {
  --brand: #72564b;
  --accent: #0f766e;
  --bg: #f7f5f2;
  --card: #ffffff;
  --text: #241d1a;
  --muted: #6f625d;
  --line: #e4ded8;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 1.25rem; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.topbar nav { display: flex; gap: 8px; align-items: center; }
a, button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}
button { font: inherit; }
main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 16px;
}
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
input, select {
  width: 100%;
  min-height: 40px;
  border: 1.5px solid #b7aca5;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.summary span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.item {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.photo {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: #fbfaf8;
  border-bottom: 1px solid var(--line);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.body { padding: 10px; }
.line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.brand {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .76rem;
  font-weight: 750;
  background: #e0f2fe;
  color: #075985;
}
.status.in_stock { background: #ccfbf1; color: var(--ok); }
.status.orderable { background: #fef3c7; color: var(--warn); }
.status.out_of_stock { background: #fee2e2; color: var(--danger); }
.model {
  margin: 6px 0 2px;
  font-size: 1rem;
  line-height: 1.25;
}
.color {
  min-height: 38px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0;
}
dl div { min-width: 0; }
dt {
  color: var(--muted);
  font-size: .72rem;
}
dd {
  margin: 0;
  font-size: .88rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  main { padding: 10px; }
  .filters { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
