/* ViennaCars Marktplatz v3 — Mobile-first Börse (Messdaten: willhaben, AutoScout24) */
:root {
  --vc-brand: #007a4d;
  --vc-brand-dunkel: #005c3a;
  --vc-brand-soft: #e8f5ef;
  --vc-akzent: #076fe6;
  --vc-inserat: #e85d04;
  --vc-inserat-dunkel: #c44d00;
  --vc-kopf: #ffffff;
  --vc-panel: #ffffff;
  --vc-bg: #f1f1f1;
  --vc-ink: #1a1a1a;
  --vc-muted: #6b7280;
  --vc-linie: #e3e3e3;
  --vc-gutter: 16px;
  --vc-max: 1200px;
  --vc-kopf-h: 52px;
  --vc-nav-h: 56px;
  --vc-radius: 12px;
  --vc-radius-sm: 8px;
  --vc-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --vc-safe-t: env(safe-area-inset-top, 0px);
  --vc-safe-b: env(safe-area-inset-bottom, 0px);
  --vc-safe-l: env(safe-area-inset-left, 0px);
  --vc-safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--vc-bg);
  color: var(--vc-ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.vc-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  background: var(--vc-bg);
  overflow: hidden;
}

/* ── Kopfzeile 52px (AS24-Messung) ── */
.vc-kopf {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--vc-kopf-h) + var(--vc-safe-t));
  padding: calc(6px + var(--vc-safe-t)) max(var(--vc-gutter), var(--vc-safe-l)) 6px max(var(--vc-gutter), var(--vc-safe-r));
  background: var(--vc-kopf);
  border-bottom: 1px solid var(--vc-linie);
  z-index: 40;
}

.vc-kopf-btn {
  width: 44px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--vc-radius-sm);
  background: transparent;
  color: var(--vc-ink);
  cursor: pointer;
}

.vc-kopf-btn:active { background: var(--vc-bg); }

.vc-logo {
  flex: 1;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--vc-ink);
  text-decoration: none;
}

.vc-logo span { color: var(--vc-brand); }

.vc-kopf-inserat {
  flex-shrink: 0;
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius-sm);
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--vc-panel);
  color: var(--vc-ink);
  cursor: pointer;
  white-space: nowrap;
}

.vc-kopf-inserat:active { background: var(--vc-bg); }

/* Hauptbereich */
.vc-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--vc-nav-h) + var(--vc-safe-b) + 8px);
}

.vc-inhalt {
  width: 100%;
  max-width: var(--vc-max);
  margin: 0 auto;
}

.vc-tab { display: none; }
.vc-tab.is-aktiv { display: block; }

.vc-tab[data-vc-tab="start"] { padding: 0 0 24px; }
.vc-tab[data-vc-tab="suchen"] { padding: 0 0 24px; }
.vc-tab[data-vc-tab="inserieren"],
.vc-tab[data-vc-tab="meins"] {
  padding: 16px max(var(--vc-gutter), var(--vc-safe-r)) 24px max(var(--vc-gutter), var(--vc-safe-l));
}

.vc-seiten-titel {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vc-seiten-unter {
  margin: 6px 0 16px;
  color: var(--vc-muted);
  font-size: 0.875rem;
}

/* ── Start: Such-Panel (willhaben-Stil) ── */
.vc-such-panel {
  background: var(--vc-panel);
  padding: 20px max(var(--vc-gutter), var(--vc-safe-r)) 16px max(var(--vc-gutter), var(--vc-safe-l));
  border-bottom: 1px solid var(--vc-linie);
}

.vc-such-kicker {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vc-muted);
}

.vc-such-titel {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.vc-such-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  margin-bottom: 10px;
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius-sm);
  background: #fafafa;
  color: var(--vc-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.vc-such-trigger:active { background: #f0f0f0; }

.vc-such-trigger-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%236b7280' stroke-width='2' stroke-linecap='round' d='M21 21l-4.3-4.3M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.vc-such-trigger-text { flex: 1; }
.vc-such-trigger-pfeil { font-size: 1.25rem; color: var(--vc-muted); line-height: 1; }

.vc-such-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--vc-radius-sm);
  background: var(--vc-akzent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.vc-such-cta:active { background: #0558b8; }

/* Typ-Chips Start */
.vc-typen {
  display: flex;
  gap: 8px;
  padding: 14px max(var(--vc-gutter), var(--vc-safe-r)) 0 max(var(--vc-gutter), var(--vc-safe-l));
  overflow-x: auto;
  scrollbar-width: none;
}

.vc-typen::-webkit-scrollbar { display: none; }

.vc-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.vc-chips::-webkit-scrollbar { display: none; }

.vc-chip {
  flex-shrink: 0;
  border: 1px solid var(--vc-linie);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--vc-panel);
  color: var(--vc-ink);
  cursor: pointer;
}

.vc-chip.is-aktiv {
  background: var(--vc-brand);
  border-color: var(--vc-brand);
  color: #fff;
}

/* Stats-Leiste */
.vc-stats-leiste {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 14px max(var(--vc-gutter), var(--vc-safe-r)) 18px max(var(--vc-gutter), var(--vc-safe-l));
  padding: 12px 8px;
  background: var(--vc-panel);
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius);
}

.vc-stat-item {
  flex: 1;
  text-align: center;
}

.vc-stat-item strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--vc-brand);
  line-height: 1.1;
}

.vc-stat-item span {
  display: block;
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--vc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vc-stat-trenner {
  width: 1px;
  height: 28px;
  background: var(--vc-linie);
  flex-shrink: 0;
}

/* Abschnitt Start */
.vc-abschnitt-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 max(var(--vc-gutter), var(--vc-safe-r)) 0 max(var(--vc-gutter), var(--vc-safe-l));
}

.vc-abschnitt-titel {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.vc-link-btn {
  border: none;
  background: none;
  color: var(--vc-akzent);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

/* ── Markt: Sticky-Leiste + Liste ── */
.vc-markt-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--vc-bg);
  padding: 12px max(var(--vc-gutter), var(--vc-safe-r)) 10px max(var(--vc-gutter), var(--vc-safe-l));
  border-bottom: 1px solid var(--vc-linie);
}

.vc-markt-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vc-treffer-info {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--vc-muted);
}

.vc-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--vc-radius-sm);
  background: #333;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.vc-filter-btn:active { background: #222; }

.vc-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.vc-filter-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--vc-brand-soft);
  color: var(--vc-brand-dunkel);
}

/* ── Raster Start (2 Spalten @390px) ── */
.vc-raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 max(var(--vc-gutter), var(--vc-safe-r)) 0 max(var(--vc-gutter), var(--vc-safe-l));
}

@media (min-width: 640px) {
  .vc-raster { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (min-width: 960px) {
  .vc-raster { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

/* ── Liste Markt (willhaben/AS24 horizontal) ── */
.vc-liste {
  display: flex;
  flex-direction: column;
  background: var(--vc-panel);
  border-top: 1px solid var(--vc-linie);
}

.vc-liste .vc-karte--liste {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  min-height: 120px;
  border: none;
  border-bottom: 1px solid var(--vc-linie);
  border-radius: 0;
  box-shadow: none;
  background: var(--vc-panel);
  cursor: pointer;
}

.vc-liste .vc-karte--liste:active { background: #fafafa; }

.vc-liste .vc-karte-bild {
  flex-shrink: 0;
  width: 132px;
  min-height: 99px;
  aspect-ratio: auto;
  background: #eaeaea;
}

.vc-liste .vc-karte-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-liste .vc-karte-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vc-liste .vc-karte-titel {
  order: 1;
  margin: 0 0 2px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vc-liste .vc-karte-preis {
  order: 2;
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.vc-liste .vc-pills { order: 3; margin-bottom: 4px; }
.vc-liste .vc-karte-ort { order: 4; }

/* ── Karten allgemein ── */
article.vc-karte:not(.vc-karte--liste) {
  background: var(--vc-panel);
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--vc-shadow);
}

article.vc-karte:not(.vc-karte--liste):active {
  transform: scale(0.99);
}

.vc-karte-bild {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eaeaea;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vc-karte-bild img { width: 100%; height: 100%; object-fit: cover; }

.vc-kein-bild {
  width: 40px;
  height: 40px;
  opacity: 0.2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23333' stroke-width='1.5' d='M5 17h14l-4.5-6-3 4-2-2.5L5 17Z'/%3E%3Crect x='3' y='5' width='18' height='14' rx='2' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.vc-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vc-badge-privat { background: #dbeafe; color: #1d4ed8; }
.vc-badge-haendler { background: #dcfce7; color: #15803d; }

.vc-karte-body { padding: 10px; }

.vc-karte-preis {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.vc-karte-titel {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.vc-pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

.vc-karte-ort {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--vc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Formular-Karten */
div.vc-karte,
.vc-hinweis-karte {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--vc-panel);
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius);
}

.vc-karte h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.vc-feld {
  display: block;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--vc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vc-feld input,
.vc-feld select,
.vc-feld textarea,
.vc-karte input,
.vc-karte select,
.vc-karte textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius-sm);
  font-size: 1rem;
  font-weight: 500;
  background: #fafafa;
  color: var(--vc-ink);
  text-transform: none;
  letter-spacing: normal;
}

.vc-feld input:focus,
.vc-karte input:focus,
.vc-karte select:focus,
.vc-karte textarea:focus {
  outline: none;
  border-color: var(--vc-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 77, 0.12);
}

.vc-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--vc-radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.vc-btn-prim { background: var(--vc-akzent); color: #fff; }
.vc-btn-prim:active { background: #0558b8; }
.vc-btn-ghost { background: var(--vc-panel); color: var(--vc-ink); border: 1px solid var(--vc-linie); }
.vc-btn-block { display: flex; width: 100%; margin-top: 8px; }

.vc-segment {
  display: flex;
  background: var(--vc-panel);
  border: 1px solid var(--vc-linie);
  border-radius: var(--vc-radius);
  padding: 4px;
  margin-bottom: 14px;
}

.vc-segment button {
  flex: 1;
  border: none;
  border-radius: var(--vc-radius-sm);
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  background: transparent;
  color: var(--vc-muted);
  cursor: pointer;
}

.vc-segment button.is-aktiv {
  background: var(--vc-brand);
  color: #fff;
}

.vc-konto-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.vc-meins-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--vc-linie);
}

.vc-meins-zeile:last-child { border-bottom: none; }

.vc-hinweis { margin: 0 0 8px; font-size: 0.875rem; color: var(--vc-muted); }

.vc-leer {
  text-align: center;
  padding: 32px 16px;
  color: var(--vc-muted);
  font-size: 0.875rem;
}

.vc-foto-vorschau {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.vc-foto-vorschau img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--vc-radius-sm);
}

/* ── Bottom-Nav 56px ── */
.vc-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: stretch;
  min-height: calc(var(--vc-nav-h) + var(--vc-safe-b));
  padding-bottom: var(--vc-safe-b);
  padding-left: var(--vc-safe-l);
  padding-right: var(--vc-safe-r);
  background: var(--vc-panel);
  border-top: 1px solid var(--vc-linie);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.04);
}

.vc-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--vc-muted);
  font-size: 0.625rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
  min-width: 0;
}

.vc-nav-ico { width: 22px; height: 22px; }
.vc-nav-btn.is-aktiv { color: var(--vc-brand); }

.vc-nav-inserat .vc-nav-inserat-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--vc-inserat);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(232, 93, 4, 0.3);
}

.vc-nav-inserat.is-aktiv .vc-nav-inserat-ico { background: var(--vc-inserat-dunkel); }
.vc-nav-inserat.is-aktiv span:last-child { color: var(--vc-inserat); }

/* ── Seitenpanel Suche (links) ── */
.vc-sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.vc-sheet-bg:not([hidden]) { display: block; }

.vc-sheet {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 56;
  width: min(100%, 400px);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--vc-panel);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(-102%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  padding-top: var(--vc-safe-t);
  padding-left: var(--vc-safe-l);
}

.vc-sheet[hidden] { display: none !important; }

.vc-sheet:not([hidden]) {
  display: flex;
  transform: translateX(0);
}

.vc-sheet-kopf {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--vc-gutter);
  border-bottom: 1px solid var(--vc-linie);
}

.vc-sheet-kopf h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
}

.vc-sheet-x {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--vc-radius-sm);
  background: var(--vc-bg);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  color: var(--vc-ink);
}

.vc-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--vc-gutter) 16px;
  -webkit-overflow-scrolling: touch;
}

.vc-sheet-foot {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px var(--vc-gutter) calc(12px + var(--vc-safe-b));
  border-top: 1px solid var(--vc-linie);
  background: #fafafa;
}

.vc-sheet-foot .vc-btn { flex: 1; min-height: 48px; }

.vc-sheet .as-fzg-host,
.vc-karte .as-fzg-host { margin-bottom: 12px; }

.as-fzg-chip {
  border: 1px solid var(--vc-linie);
  background: #fafafa;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.as-fzg-chip.is-aktiv {
  border-color: var(--vc-brand);
  background: var(--vc-brand-soft);
  color: var(--vc-brand-dunkel);
}

.as-fzg-marke-row { display: flex; flex-wrap: wrap; gap: 6px; }

@media (min-width: 768px) {
  .vc-nav {
    max-width: var(--vc-max);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
  }

  .vc-sheet { width: min(420px, 92vw); }
}

@media (prefers-reduced-motion: reduce) {
  .vc-sheet { transition: none; }
  article.vc-karte { transition: none; }
}
