:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --ink: #23261f;
  --muted: #6a6f60;
  --line: #e4e2d8;
  --olive: #4f5b35;
  --sage: #dfe3d4;
  --terracotta: #b85a2e;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

html, .tabs { scroll-behavior: smooth; }

body {
  margin: 0 auto;
  max-width: 640px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.4;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.brand {
  padding: 28px 16px 12px;
  text-align: center;
}

.brand__logo {
  display: block;
  margin: 0 auto;
  border-radius: 50%;
}

.brand h1 {
  margin: 8px 0 0;
  font: 400 30px/1.1 var(--serif);
}

.controls {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0 4px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.search {
  display: block;
  padding: 0 16px;
}

.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: 16px; /* di bawah 16px, iOS otomatis zoom saat fokus */
}

.search input:focus-visible,
.tabs button:focus-visible,
.footer a:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.tabs button[aria-current="true"] {
  background: var(--olive);
  color: #fff;
}

main { padding: 0 16px; }

.category { scroll-margin-top: 112px; padding-top: 22px; }

.category h2 {
  margin: 0 0 4px;
  color: var(--olive);
  font: 400 24px/1.2 var(--serif);
}

.item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child { border-bottom: 0; }

.item__body { flex: 1; min-width: 0; }

.item__name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.item__desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.item__price {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin: 6px 0 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.item__price small {
  color: var(--muted);
  font-size: 13px;
}

.item__photo {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--sage);
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--olive);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}

.tag--out {
  background: #f4e3da;
  color: var(--terracotta);
}

.item--out .item__name,
.item--out .item__desc,
.item--out .item__price { opacity: 0.55; }

.item--out .item__photo { filter: grayscale(1); opacity: 0.6; }

.status {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.footer {
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.footer p { margin: 0 0 12px; }

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.footer a { color: var(--olive); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html, .tabs { scroll-behavior: auto; }
}
