:root {
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e2e4e8;
  --accent: #e53238; /* eBay red */
  --accent2: #0064d2; /* eBay blue */
  --green: #16794f;
  --green-bg: #e6f6ee;
  --red: #b3261e;
  --red-bg: #fdecea;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0 16px 40px;
}

.topbar { max-width: 960px; margin: 0 auto; padding: 28px 0 8px; }
.topbar h1 { margin: 0 0 4px; font-size: 1.6rem; }
.subtitle { color: var(--muted); margin: 0; }

.demo-banner {
  max-width: 960px;
  margin: 12px auto;
  background: #fff7e0;
  border: 1px solid #f0d98c;
  color: #6b5300;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

main { max-width: 960px; margin: 0 auto; }

.search-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.field small { color: var(--muted); font-size: 0.75rem; }

button#searchBtn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  height: 44px;
}
button#searchBtn:hover { opacity: 0.9; }
button#searchBtn:disabled { opacity: 0.6; cursor: default; }

.filters {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.filters[hidden] { display: none; }

.status { min-height: 1.2em; color: var(--muted); }
.rate-note { margin: -8px 0 14px; font-size: 0.78rem; color: var(--muted); }
.rate-note[hidden] { display: none; }
.field-small { flex: 0 1 190px; }
.card-original { font-size: 0.78rem; color: var(--muted); }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0f0f0;
}

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.card-market { font-size: 0.75rem; font-weight: 700; color: var(--accent2); text-transform: uppercase; }
.card-title {
  font-size: 0.92rem;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price { font-size: 1.15rem; font-weight: 700; }
.card-shipping { font-size: 0.82rem; color: var(--muted); }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  width: fit-content;
}
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.no { background: var(--red-bg); color: var(--red); }

.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.btn-link {
  display: block;
  text-align: center;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.btn-primary { background: var(--accent2); color: white; }
.btn-secondary { background: #f1f1f3; color: #333; }

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

footer {
  max-width: 960px;
  margin: 32px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
footer a { color: var(--accent2); }
.footer-links { margin-top: 10px; }

/* Rechtsseiten (Impressum, Datenschutz) */
.legal { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.legal h1 { font-size: 1.6rem; margin-top: 28px; }
.legal h2 { font-size: 1.15rem; margin-top: 28px; }
.legal a { color: var(--accent2); }
.legal .back { display: inline-block; margin-top: 24px; }
mark.todo { background: #fff3a3; color: #4a3b00; padding: 0 4px; border-radius: 3px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --card-bg: #1f2226;
    --text: #eee;
    --muted: #9aa0a6;
    --border: #2c2f33;
    --green-bg: #123a2a;
    --red-bg: #3a1a17;
  }
  .demo-banner { background: #3a2f0f; color: #f0d98c; border-color: #5a4a1a; }
  .btn-secondary { background: #2a2d31; color: #ddd; }
  footer a, .legal a { color: #6aa9ff; }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --card-bg: #1f2226;
  --text: #eee;
  --muted: #9aa0a6;
  --border: #2c2f33;
  --green-bg: #123a2a;
  --red-bg: #3a1a17;
}
:root[data-theme="dark"] .demo-banner { background: #3a2f0f; color: #f0d98c; border-color: #5a4a1a; }
:root[data-theme="dark"] .btn-secondary { background: #2a2d31; color: #ddd; }
:root[data-theme="dark"] footer a, :root[data-theme="dark"] .legal a { color: #6aa9ff; }
