:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1a1d23;
  --muted: #6b7280;
  --accent: #e8590c;
  --accent-ink: #fff;
  --line: #e5e7eb;
  --drop: #7048e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.search { display: flex; flex: 1; min-width: 220px; gap: 8px; }
.search input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}
.search button {
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

.tabs, .sort {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 1200px;
  margin: 10px auto 0;
  flex-wrap: wrap;
  font-size: 14px;
}
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}
.tab.active { background: #fff3ec; color: var(--accent); border-color: #ffd6bf; font-weight: 600; }
.sort { color: var(--muted); padding-bottom: 12px; }
.sort a { padding: 4px 10px; border-radius: 6px; }
.sort a.active { background: var(--ink); color: #fff; }

/* ── Grid ───────────────────────────────────────────── */
.container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.thumb .ph, .thumb.noimg::after { color: #cbd0d6; font-size: 13px; }
.thumb.noimg::after { content: "no image"; }

.badge {
  position: absolute;
  top: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
}
.badge.off { left: 8px; background: var(--accent); }
.badge.drop { right: 8px; background: var(--drop); }

.body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pricing { display: flex; align-items: baseline; gap: 8px; }
.price { font-size: 20px; font-weight: 800; color: var(--accent); }
.msrp { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.meta { display: flex; gap: 8px; font-size: 12px; color: var(--muted); margin-top: auto; }
.store { font-weight: 600; text-transform: capitalize; }
.cat { background: #f0f1f3; padding: 2px 8px; border-radius: 999px; }

.grab {
  margin-top: 6px;
  text-align: center;
  padding: 9px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.grab:hover { background: var(--accent); }

/* ── Empty + footer ─────────────────────────────────── */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); }
.empty a { color: var(--accent); text-decoration: underline; }

.site-footer {
  max-width: 1200px;
  margin: 40px auto 30px;
  padding: 0 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
