:root {
  --primary: #b06e43;
  --bg: #faf7f4;
  --card: #ffffff;
  --text: #2b2320;
  --muted: #8a7f78;
  --border: #ece5df;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(43, 35, 32, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── States (loading / error) ── */
.state {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 8px;
}
.state .emoji { color: var(--muted); }
.state .emoji svg { width: 46px; height: 46px; }
.state h2 { margin: 8px 0 0; font-size: 19px; }
.state p { margin: 0; color: var(--muted); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero ── */
.hero {
  background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 88%, black) 0%, var(--primary) 100%);
  color: #fff;
  padding: calc(36px + env(safe-area-inset-top)) 24px 28px;
  text-align: center;
}
.logo {
  width: 76px; height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
}
.logo--ph {
  display: flex; align-items: center; justify-content: center;
}
.logo--ph svg { width: 38px; height: 38px; color: rgba(255, 255, 255, 0.8); }
.hero h1 { margin: 14px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.hero-sub { margin: 0; font-size: 13px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.12em; }

/* ── Category nav (sticky chips) ── */
.catnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav a {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.catnav a:active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Menu ── */
.menu { padding: 8px 16px 0; }
.cat { padding: 16px 0 4px; scroll-margin-top: 64px; }
.cat-title {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cat-title::after {
  content: "";
  display: block;
  width: 32px; height: 3px;
  margin-top: 6px;
  background: var(--primary);
  border-radius: 3px;
}
.cat-desc { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* ── Item ── */
.item {
  display: flex;
  gap: 14px;
  padding: 14px;
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.item.is-out { opacity: 0.55; }
.thumb {
  flex: 0 0 auto;
  width: 76px; height: 76px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
}
.thumb--ph {
  display: flex; align-items: center; justify-content: center;
  color: color-mix(in srgb, var(--primary) 45%, var(--muted));
}
.thumb--ph svg { width: 30px; height: 30px; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line { display: flex; align-items: baseline; gap: 10px; }
.name { font-weight: 700; font-size: 15.5px; flex: 1; }
.price { color: var(--primary); font-weight: 800; font-size: 15px; white-space: nowrap; }
.desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.tag.out { background: #f3e2e0; color: #b4453a; }

/* ── Footer ── */
.foot {
  margin-top: 24px;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

@media (min-width: 620px) {
  #app { max-width: 560px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.05); min-height: 100vh; }
}
