/* =========================================================
   Wizzper Suche – Styles
   ========================================================= */

:root {
  --bg: #070a08;
  --bg-soft: #0b100d;
  --surface: #0f1512;
  --surface-2: #141c18;
  --surface-3: #19231e;
  --line: #1f2b25;
  --line-strong: #2b3a32;
  --text: #edf3ef;
  --muted: #93a49b;
  --muted-2: #71837a;
  --accent: #b6f24a;
  --accent-ink: #0a1006;
  --accent-soft: rgba(182, 242, 74, .12);
  --mint: #35e3aa;
  --amber: #ffc253;
  --danger: #ff7a7a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --maxw: 1220px;
  --font: "Segoe UI", system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(182, 242, 74, .07), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(53, 227, 170, .06), transparent 60%);
  z-index: 0;
}

main, .topbar, .footer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px max(18px, env(safe-area-inset-left)) 14px max(18px, env(safe-area-inset-right));
  max-width: var(--maxw);
  margin: 0 auto;
  background: linear-gradient(to bottom, rgba(7, 10, 8, .92), rgba(7, 10, 8, .55) 70%, transparent);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), #7fd83a);
  color: #0a1006;
  box-shadow: 0 6px 18px rgba(182, 242, 74, .22);
}
.brand-name {
  font-weight: 800; font-size: 1.16rem; letter-spacing: -.02em;
}
.brand-dot { color: var(--accent); }

.tag-pill {
  font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: rgba(20, 28, 24, .7);
  padding: 6px 12px; border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(26px, 6vw, 72px) 20px clamp(10px, 3vw, 26px);
  text-align: center;
  overflow: visible;
}

.hero-glow {
  position: absolute; left: 50%; top: -140px; transform: translateX(-50%);
  width: min(760px, 90vw); height: 380px;
  background: radial-gradient(closest-side, rgba(182, 242, 74, .14), transparent 72%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(182, 242, 74, .18);
  padding: 7px 14px; border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.1rem, 6.4vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -.035em;
  font-weight: 800;
  margin-bottom: 14px;
}

.hero h1 .hl {
  background: linear-gradient(100deg, var(--accent) 10%, var(--mint) 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.lede {
  max-width: 620px; margin: 0 auto clamp(20px, 4vw, 30px);
  color: var(--muted);
  font-size: clamp(.98rem, 1.6vw, 1.1rem);
}

/* ---------------- Suche ---------------- */

.search {
  display: flex; align-items: center; gap: 8px;
  max-width: 660px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 8px 7px 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.search:focus-within {
  border-color: rgba(182, 242, 74, .55);
  box-shadow: 0 0 0 4px rgba(182, 242, 74, .1), 0 18px 48px rgba(0, 0, 0, .5);
}

.search-icon { color: var(--muted-2); flex: 0 0 auto; }

.search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  font-size: 1rem; padding: 12px 4px;
  color: var(--text);
  text-align: left;
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.btn-search {
  flex: 0 0 auto;
  border: 0; border-radius: 999px;
  background: linear-gradient(150deg, var(--accent), #93e039);
  color: var(--accent-ink);
  font-weight: 800; font-size: .95rem;
  padding: 13px 24px;
  transition: transform .14s, filter .14s;
}
.btn-search:hover { filter: brightness(1.05); }
.btn-search:active { transform: scale(.97); }
.btn-search[disabled] { opacity: .55; cursor: progress; }

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

.chip {
  border: 1px solid var(--line);
  background: rgba(20, 28, 24, .55);
  color: var(--muted);
  font-size: .84rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
  transition: color .15s, border-color .15s, background .15s;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.chip.recent::before { content: "↺"; margin-right: 6px; opacity: .55; }
.quick-label {
  width: 100%; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-2); font-weight: 700; margin-top: 6px;
}

/* ---------------- Ergebnis-Kopf ---------------- */

.results-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 10px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}

.results-head h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  letter-spacing: -.02em;
  font-weight: 800;
}
.results-sub { color: var(--muted-2); font-size: .86rem; margin-top: 4px; }

.sort-wrap { display: flex; align-items: center; gap: 10px; }
.sort-wrap label { font-size: .8rem; color: var(--muted-2); font-weight: 600; }
.sort-wrap select {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
  font-size: .86rem; font-weight: 600;
  outline: none;
}
.sort-wrap select:hover { border-color: var(--line-strong); }

/* ---------------- Cards ---------------- */

.results {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 20px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  align-items: start;
  gap: 14px;
}
.results:empty { padding: 0; }

.card {
  position: relative;
  display: flex; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--surface), #0c1210);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.card.open { border-color: rgba(182, 242, 74, .34); }

.card-main {
  display: flex; gap: 14px;
  padding: 14px;
  width: 100%;
}

.thumb {
  position: relative;
  flex: 0 0 132px;
  width: 132px; height: 132px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 38%, #1d2822, #101613 75%);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
  align-self: flex-start;
}
.thumb img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 8px;
  transition: transform .25s ease;
}
.card:hover .thumb img { transform: scale(1.04); }

.thumb-ph {
  font-size: 2rem; font-weight: 800; color: var(--muted-2);
  letter-spacing: -.04em;
  user-select: none;
}

.save-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .72rem; font-weight: 800;
  padding: 3px 7px; border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  letter-spacing: -.01em;
}

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.card-title {
  font-size: .95rem; font-weight: 650; line-height: 1.35;
  letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}
.card-title:hover { color: var(--accent); }

.card-meta {
  font-size: .76rem; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 8px;
}
.card-meta .dot { padding: 0 4px; opacity: .6; }

.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price { font-size: 1.34rem; font-weight: 800; letter-spacing: -.03em; }
.price[data-na] { font-size: .95rem; font-weight: 600; color: var(--muted-2); }
.price-old { font-size: .82rem; color: var(--muted-2); text-decoration: line-through; }
.price-hint { font-size: .74rem; color: var(--mint); font-weight: 600; }

.card-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 11px;
  font-size: .82rem; font-weight: 700;
  padding: 9px 13px;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(150deg, var(--accent), #93e039);
  color: var(--accent-ink);
  padding-right: 11px;
  box-shadow: 0 6px 16px rgba(182, 242, 74, .14);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}
.btn-icon:hover { color: var(--text); border-color: var(--line-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  padding: 9px 11px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.btn-ghost .chev { transition: transform .25s ease; }
.card.open .btn-ghost .chev { transform: rotate(180deg); }
.card.open .btn-ghost { color: var(--accent); border-color: rgba(182, 242, 74, .3); }

/* ---------------- Drawer / Chart ---------------- */

.drawer {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows .32s cubic-bezier(.4, 0, .2, 1);
}
.card.open .drawer { grid-template-rows: 1fr; }

.drawer-inner {
  overflow: hidden;
  min-height: 0;
}

.drawer-body {
  padding: 2px 14px 16px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

.drawer-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 0 8px;
}
.drawer-title { font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }

.ranges {
  display: inline-flex; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.ranges button {
  border: 0; background: transparent;
  color: var(--muted-2); font-size: .74rem; font-weight: 700;
  padding: 5px 10px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.ranges button:hover { color: var(--text); }
.ranges button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.chart-shell {
  position: relative;
  width: 100%;
  min-height: 210px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 28, 24, .7), rgba(12, 18, 15, .35));
  border: 1px solid var(--line);
  padding: 10px 8px 4px;
  overflow: hidden;
  touch-action: pan-y;
}
.chart-shell svg { display: block; width: 100%; height: auto; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -120%);
  background: #0a0f0c;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: .74rem; line-height: 1.45;
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s;
  z-index: 3;
}
.chart-tooltip.show { opacity: 1; }
.chart-tooltip b { display: block; font-size: .8rem; margin-bottom: 2px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.chart-tooltip .tt-dot { width: 7px; height: 7px; border-radius: 50%; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 8px 4px 2px;
  font-size: .74rem; color: var(--muted-2); font-weight: 600;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

.chart-skeleton {
  height: 210px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite linear;
}

.chart-error {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 22px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: .84rem;
}
.chart-error button {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: .78rem;
}
.chart-error button:hover { border-color: var(--accent); color: var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.stat dt { font-size: .7rem; color: var(--muted-2); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.stat dd { margin: 3px 0 0; font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.stat dd.low { color: var(--accent); }

.drawer-note {
  margin-top: 10px;
  font-size: .72rem;
  color: var(--muted-2);
  line-height: 1.5;
}
.drawer-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.badge-low {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(182, 242, 74, .25);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------------- Skeleton ---------------- */

.skeleton { pointer-events: none; }
.skeleton .thumb,
.skeleton .sk-line,
.skeleton .sk-btn {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton .sk-line { height: 12px; border-radius: 6px; margin-bottom: 8px; }
.skeleton .sk-line.w-70 { width: 70%; }
.skeleton .sk-line.w-40 { width: 40%; }
.skeleton .sk-line.w-25 { width: 25%; height: 18px; }
.skeleton .sk-btn { height: 34px; width: 110px; border-radius: 11px; margin-top: 12px; }

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

/* ---------------- Notice / Empty / Toast / Footer ---------------- */

.notice {
  max-width: var(--maxw);
  margin: 8px auto 0;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(255, 194, 83, .08);
  border: 1px solid rgba(255, 194, 83, .28);
  color: #ffd89a;
  font-size: .85rem;
  display: flex; align-items: center; gap: 10px;
}
.notice[hidden] { display: none; }
.notice.error {
  background: rgba(255, 122, 122, .08);
  border-color: rgba(255, 122, 122, .3);
  color: #ffc0c0;
}

.empty {
  max-width: 520px;
  margin: 30px auto 0;
  padding: 30px 20px 10px;
  text-align: center;
  color: var(--muted);
}
.empty[hidden] { display: none; }
.empty-art { color: var(--line-strong); display: grid; place-items: center; margin-bottom: 12px; }
.empty h2 { color: var(--text); font-size: 1.15rem; margin-bottom: 6px; }
.empty p { font-size: .9rem; }

.more-wrap {
  max-width: var(--maxw);
  margin: 6px auto 0;
  padding: 12px 20px 6px;
  display: flex; justify-content: center;
}
.more-wrap[hidden] { display: none; }
.btn-more {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 700; font-size: .88rem;
  padding: 12px 26px; border-radius: 999px;
  transition: border-color .15s, background .15s;
}
.btn-more:hover { border-color: var(--accent); color: var(--accent); }
.btn-more[disabled] { opacity: .6; cursor: progress; }

.disclosure {
  max-width: 760px;
  margin: 34px auto 0;
  padding: 0 24px;
  text-align: center;
  font-size: .74rem;
  color: var(--muted-2);
  line-height: 1.6;
}

.footer {
  max-width: var(--maxw);
  margin: 30px auto 0;
  padding: 22px 20px calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .76rem;
  color: var(--muted-2);
}
.footer a:hover { color: var(--accent); }
.footer-sep { opacity: .5; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .85rem; font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 80;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Responsive ---------------- */

@media (max-width: 760px) {
  .results { grid-template-columns: 1fr; padding-inline: 14px; }
  .results-head { padding-inline: 14px; }
  .notice, .disclosure { margin-inline: 14px; padding-inline: 14px; }
  .footer { margin-inline: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .tag-pill { display: none; }
  .hero { padding-inline: 14px; }
  .search { padding-left: 14px; }
  .btn-search { padding: 12px 18px; }
  .thumb { flex-basis: 108px; width: 108px; height: 108px; }
  .card-main { gap: 12px; padding: 12px; }
  .drawer-body { padding-inline: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .search { flex-wrap: wrap; border-radius: 20px; padding: 8px; }
  .search-icon { margin-left: 8px; }
  .search input { flex: 1 1 calc(100% - 40px); padding: 10px 4px; }
  .btn-search { width: 100%; border-radius: 14px; padding: 11px; }
  .card-actions .btn-primary { flex: 1 1 auto; }
  .price { font-size: 1.2rem; }
}

@media (min-width: 1100px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
