:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --brand: #ee4d2d;
  --brand-dark: #d73211;
  --chip: #f2f2f2;
  --max: 1080px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.nav-in {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 4px 10px rgba(255, 90, 31, 0.28);
}
.nav-links { display: flex; gap: 16px; font-size: 14px; }
.nav-links a { text-decoration: none; color: #444; }
.nav-links a.on { color: var(--brand); font-weight: 700; }
.nav-search { margin-left: auto; }
.nav-search input {
  width: min(260px, 32vw);
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  outline: 0;
  background: #fafafa;
}

.hero {
  background: #fff;
  padding: 36px 0 28px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.hero h1 { margin: 0 0 18px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.finder {
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.finder input {
  flex: 1;
  border: 0;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  outline: 0;
  min-width: 0;
}
.finder button {
  border: 0;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
}
.finder button:hover { background: var(--brand-dark); }
.finder #paste {
  background: #fff1ea;
  color: var(--brand);
  padding: 0 16px;
}

.product {
  max-width: 720px;
  margin: 18px auto 0;
  text-align: left;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}
.product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  align-items: center;
}
.product-card img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f3f3;
}
.product-card .name {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.product-card .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 14px;
}
.product-card .facts span { color: var(--muted); }
.product-card .facts b { color: var(--text); }
.product-card .facts .cash { color: #16a34a; font-size: 18px; }
.product-card .go {
  display: inline-flex;
  margin-top: 12px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
}
.product-card .go:hover { background: var(--brand-dark); }
.product-card .hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.product.err {
  padding: 14px 16px;
  color: #b42318;
  text-align: center;
}

.page { padding: 28px 0 56px; }
.list-title { margin: 0 0 8px; font-size: 22px; text-align: center; }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px 0 16px;
  border-bottom: 2px solid #ececec;
  margin-bottom: 18px;
}
.chip {
  border: 0;
  background: var(--chip);
  color: #333;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip.on {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 800px;
  margin-inline: auto;
}
.row {
  display: flex;
  align-items: stretch;
  background: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0 8px 8px 0;
  color: #000;
}
.row + .row { margin-top: 1rem; }

.badge {
  flex: 0 0 106px;
  width: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: var(--brand);
  border-radius: 4px 0 0 4px;
  padding: 16px 8px;
  position: relative;
}
.badge::after {
  content: "";
  width: 10px;
  height: 20px;
  border-radius: 0 20px 20px 0;
  position: absolute;
  left: 0;
  top: calc(50% - 10px);
  background: var(--bg);
}
.badge .pct { font-size: 22px; font-weight: 800; line-height: 1; }
.badge .shop {
  font-size: 11px;
  line-height: 16px;
  margin-top: 4px;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.body {
  flex: 1;
  display: flex;
  gap: 10px;
  min-width: 0;
  border: 1px solid #ddd;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  padding: 10px 22px 10px 12px;
  position: relative;
}
.body::after {
  content: "";
  width: 10px;
  height: 20px;
  background: var(--bg);
  position: absolute;
  border: 1px solid #ddd;
  border-right-color: var(--bg);
  border-radius: 20px 0 0 20px;
  right: -1px;
  top: calc(50% - 10px);
}
.main { flex: 1; min-width: 0; }
.kind {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 6px;
  background: #ffe89b;
  color: #eb3600;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.offer { font-size: 15px; font-weight: 700; line-height: 1.35; }
.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.meta .code { color: var(--brand); font-weight: 800; }
.bar {
  width: min(202px, 100%);
  height: 7px;
  background: #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.bar i {
  display: block;
  height: 100%;
  background-image: linear-gradient(to right, #ffe14d, #ee4d2d);
}
.used {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  line-height: 20px;
}
.used .left { color: var(--brand); }
.used .more {
  border: 0;
  background: none;
  color: #1876f2;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.detail {
  display: none;
  margin-top: 8px;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
}
.row.open .detail { display: block; }

.acts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  min-width: 92px;
}
.acts .copy,
.acts .use {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 3px;
  font-size: 14px;
  padding: 0 14px;
  text-decoration: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.acts .copy:hover,
.acts .use:hover { background: var(--brand-dark); }
.acts .use { background: #fff; color: var(--brand); border: 1px solid var(--brand); }

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

.foot {
  border-top: 1px solid #eee;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0 28px;
  text-align: center;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-search input { width: 140px; }
  .hero { padding: 22px 0 18px; }
  .hero h1 { font-size: 22px; }
  .product-card { grid-template-columns: 84px minmax(0, 1fr); }
  .product-card img { width: 84px; height: 84px; }
  .finder #paste { display: none; }
  .badge { width: 80px; flex-basis: 80px; min-height: 114px; }
  .badge .pct { font-size: 18px; }
  .body { flex-direction: column; padding: 8px 12px; }
  .acts { flex-direction: row; justify-content: flex-end; }
  .offer { font-size: 13px; }
  .bar { width: 100%; }
}
