:root {
  --fg: #1a1a1a;
  --muted: #666;
  --bg: #fafafa;
  --row: #fff;
  --row-alt: #f3f3f3;
  --accent: #b35900;
  --border: #ddd;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  padding: 1rem;
  line-height: 1.4;
}

header { margin-bottom: 1rem; }
header h1 { margin: 0; font-size: 1.4rem; }
header h1 a { color: var(--fg); text-decoration: none; }

.footnav { margin-top: 0.25rem; font-size: 0.8rem; }
.footnav a { color: var(--muted); text-decoration: none; }
.footnav a:hover { text-decoration: underline; }

.disclaimer {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 60rem;
  line-height: 1.5;
}

article.static { max-width: 720px; line-height: 1.55; }
article.static h3 { margin-top: 1.5rem; }
article.static pre {
  background: var(--row-alt);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.results { flex: 1; min-width: 0; }
.row-count { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.85rem; }

aside.filters {
  flex: 0 0 12rem;
  position: sticky;
  top: 0.5rem;
  font-size: 0.85rem;
}
aside.filters fieldset {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  background: var(--row);
}
aside.filters legend {
  font-weight: 600;
  padding: 0 0.25rem;
  cursor: pointer;
}
aside.filters legend input.toggle-all { margin-right: 0.4rem; }
aside.filters label {
  display: block;
  padding: 0.1rem 0;
  cursor: pointer;
}
aside.filters input[type="checkbox"] { margin-right: 0.4rem; }

@media (max-width: 700px) {
  .layout { flex-direction: column; }
  aside.filters { position: static; flex: none; width: 100%; }
}

table.prices {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.prices th, table.prices td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.prices th {
  background: var(--row-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
}
table.prices th.sortable { cursor: pointer; user-select: none; }
table.prices th.sortable:hover { background: #e8e8e8; }
table.prices th.sortable::after { content: ""; display: inline-block; width: 0.7em; margin-left: 0.25em; opacity: 0.4; }
table.prices th.sort-asc::after { content: "▲"; opacity: 1; }
table.prices th.sort-desc::after { content: "▼"; opacity: 1; }
table.prices tr:nth-child(even) td { background: var(--row-alt); }
table.prices td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.prices a { color: var(--fg); text-decoration: none; }
table.prices a:hover { text-decoration: underline; }

article.product { max-width: 720px; }
.product-image { max-width: 240px; height: auto; display: block; margin: 1rem 0; }

.buy-button {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}
.buy-button:hover { filter: brightness(1.05); }
.per-gb { margin-left: 0.75rem; color: var(--muted); }

dl.attrs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 1rem 0;
}
dl.attrs dt { color: var(--muted); }
dl.attrs dd { margin: 0; }

.disclosure { color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }
