:root {
  --brand: #c0453d;
  --brand-dark: #9e332c;
  --brand-soft: #fdf1f0;
  --ok: #3f8f5b;
  --title: #2e2e3e;
  --body: #5b5b6a;
  --muted: #8a8a99;
  --line: #e9e6e4;
  --surface: #ffffff;
  --bg: #faf8f7;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #e0645b;
    --brand-dark: #f08a82;
    --brand-soft: #3a2422;
    --ok: #6cc28b;
    --title: #f2f0ef;
    --body: #c9c6c4;
    --muted: #8f8b89;
    --line: #34302f;
    --surface: #1f1c1b;
    --bg: #161413;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--title);
  min-width: 0;
  flex: 1 1 220px;
}
.brand strong { display: block; font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.brand small { display: block; color: var(--muted); font-size: .85rem; }
.logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }

.search { flex: 1 1 260px; }
.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--title);
  font: inherit;
}
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 12px 0 8px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.thumb {
  aspect-ratio: 1;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 2rem;
  font-weight: 700;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card-name { color: var(--title); font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.price { color: var(--title); font-weight: 700; }
.oos { color: var(--muted); font-size: .8rem; }

.status { text-align: center; color: var(--muted); padding: 48px 0; }
.more { text-align: center; padding: 8px 0 32px; }
.more button {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.back { display: inline-block; margin: 16px 0 8px; text-decoration: none; }
.detail {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 32px;
}
@media (min-width: 720px) {
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 24px; }
}
.detail .thumb { border-radius: 10px; overflow: hidden; }
.detail h1 { color: var(--title); font-size: 1.5rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.detail .price { font-size: 1.35rem; margin: 8px 0; }
.detail .desc { white-space: pre-line; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--title); overflow-wrap: anywhere; }
.stock { font-weight: 600; font-size: .9rem; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--muted); }

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}
