/* Andrea's Tupper-Flohmarkt – Shop-Styles
   Farbwelt: Küchenregal – kühles Minzweiß, tiefes Petrol, Beeren-Akzent,
   Preis als gelber Flohmarkt-Aufkleber. Schrift: System-Rounded (kein Google-Fonts-Laden → DSGVO-freundlich). */

:root {
  --ground: #f3f7f5;
  --surface: #ffffff;
  --surface-2: #e8f1ed;
  --ink: #16323a;
  --ink-soft: #4d6870;
  --line: #d5e3dd;
  --accent: #c8305f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3ea;
  --sticker: #ffd84d;
  --sticker-ink: #2d2600;
  --ok: #1f7a55;
  --warn: #a15c00;
  --sold: #8a9a9e;
  --shadow: 0 1px 2px rgba(22, 50, 58, .06), 0 6px 20px rgba(22, 50, 58, .07);
  --radius: 14px;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
  /* Kategorie-Farben für Platzhalter */
  --c-backen: #f6d9c4; --c-mikrowelle: #d7e3fa; --c-unterwegs: #cfeede; --c-tiefkuehlen: #d4eef5;
  --c-vorrat: #efe4c6; --c-kueche: #e8d9f3; --c-backrohr: #f5d3cf; --c-frisch: #d6efc9; --c-putzen: #d9e6ea;
  --c-aufbewahren: #d6efc9; --c-rezepte: #f7dfc0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f1c20; --surface: #16272c; --surface-2: #1d3238; --ink: #e6f0ed; --ink-soft: #9db4b5;
    --line: #28424a; --accent: #f06a93; --accent-ink: #1a0710; --accent-soft: #3a1c27;
    --sticker: #ffd84d; --sticker-ink: #2d2600; --ok: #5fcf9c; --warn: #f0b35a; --sold: #6d8186;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
    --c-backen: #4a3a2e; --c-mikrowelle: #2e3a52; --c-unterwegs: #27463a; --c-tiefkuehlen: #264650;
    --c-vorrat: #4a432c; --c-kueche: #3e3150; --c-backrohr: #4d302d; --c-frisch: #30482a; --c-putzen: #2c3e44;
    --c-aufbewahren: #30482a; --c-rezepte: #4b3a26;
  }
}
:root[data-theme="dark"] {
  --ground: #0f1c20; --surface: #16272c; --surface-2: #1d3238; --ink: #e6f0ed; --ink-soft: #9db4b5;
  --line: #28424a; --accent: #f06a93; --accent-ink: #1a0710; --accent-soft: #3a1c27;
  --ok: #5fcf9c; --warn: #f0b35a; --sold: #6d8186; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  --c-backen: #4a3a2e; --c-mikrowelle: #2e3a52; --c-unterwegs: #27463a; --c-tiefkuehlen: #264650;
  --c-vorrat: #4a432c; --c-kueche: #3e3150; --c-backrohr: #4d302d; --c-frisch: #30482a; --c-putzen: #2c3e44;
  --c-aufbewahren: #30482a; --c-rezepte: #4b3a26;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 16px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Kopfzeile ─────────────────────────────── */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font: 700 1.05rem/1.1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-name small { display: block; font: 500 .72rem/1.2 var(--font-body); color: var(--ink-soft); letter-spacing: .02em; }
.search { flex: 1; min-width: 0; position: relative; max-width: 440px; margin-left: auto; }
.search input {
  width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 16px 0 40px; font-size: 16px;
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-soft); pointer-events: none; }
.cart-btn {
  position: relative; height: 42px; min-width: 42px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--ground); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; flex: none;
}
.cart-btn svg { width: 20px; height: 20px; }
.cart-count {
  min-width: 22px; height: 22px; border-radius: 999px; background: var(--sticker); color: var(--sticker-ink);
  font: 700 .78rem/22px var(--font-body); text-align: center; padding: 0 6px;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
@media (max-width: 640px) {
  .top .wrap { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .top .wrap { row-gap: 8px; }
  .brand { flex: 1; }
  .brand-name { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name small { display: none; }
  .cart-label { display: none; }
}

/* ── Intro ─────────────────────────────── */
.intro { padding-block: 28px 8px; display: grid; gap: 18px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 860px) { .intro { grid-template-columns: 1.3fr 1fr; padding-block: 44px 12px; } }
.intro h1 {
  margin: 0; font: 800 clamp(1.9rem, 5vw, 3.1rem)/1.05 var(--font-display); letter-spacing: -.025em; text-wrap: balance;
}
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p { margin: 10px 0 0; color: var(--ink-soft); max-width: 52ch; font-size: 1.05rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .86rem; line-height: 1.3; color: var(--ink-soft); }
.facts b { display: block; color: var(--ink); font: 700 .95rem/1.2 var(--font-display); margin-bottom: 2px; }
@media (max-width: 480px) { .facts li { padding: 8px 9px; font-size: .76rem; } .facts b { font-size: .86rem; } .intro p { font-size: .98rem; } }

.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: .95rem; }

/* ── Filter ─────────────────────────────── */
.filters { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 63px); z-index: 10; background: var(--ground); padding-block: 12px 10px; }
@media (max-width: 640px) { .filters { position: static; } }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: .9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip .n { color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }
.toolbar .count { margin-right: auto; }
.toolbar select { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }

/* ── Produktraster ─────────────────────────────── */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 6px 60px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.card .pic { position: relative; aspect-ratio: 1; max-width: 100%; border: 0; padding: 0; background: var(--surface-2); display: block; width: 100%; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.ph svg { width: 42%; height: auto; }
.ph span { font: 700 .95rem/1 var(--font-display); letter-spacing: .01em; }
.sticker {
  position: absolute; top: 8px; right: 8px; min-width: 52px; height: 52px; border-radius: 50%; padding: 0 6px;
  background: var(--sticker); color: var(--sticker-ink); display: grid; place-items: center;
  font: 800 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; transform: rotate(-8deg);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.sticker small { font-size: .7em; font-weight: 700; margin-right: 1px; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font: 600 .95rem/1.3 var(--font-body); overflow-wrap: anywhere; }
.names .size, .line .size { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; font-variant-numeric: tabular-nums; }
.detail .names .size { font-size: 1rem; margin-top: 4px; }
.tag.stock { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); font-weight: 600; }
.qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { width: 32px; height: 30px; border: 0; background: none; font-size: 1.1rem; font-weight: 700; color: var(--ink); border-radius: 999px; }
.qty button:disabled { color: var(--sold); cursor: default; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: .9rem; }
.card .meta { font-size: .78rem; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.add {
  margin-top: auto; height: 38px; border-radius: 10px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s;
}
.add:hover { background: var(--ink); color: var(--ground); }
.add.in { background: var(--ok); border-color: var(--ok); color: #fff; }
.card.sold .pic, .card.reserved .pic { filter: grayscale(.85); opacity: .6; }
.card.sold .sticker, .card.reserved .sticker { background: var(--sold); color: #fff; }
.stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  border: 3px solid currentColor; color: var(--accent); background: color-mix(in srgb, var(--surface) 80%, transparent);
  font: 800 1rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 6px;
}
.card.reserved .stamp { color: var(--warn); }
.add:disabled { border-color: var(--line); color: var(--sold); background: transparent; cursor: not-allowed; }

.empty { text-align: center; padding: 60px 16px; color: var(--ink-soft); grid-column: 1 / -1; }
.more { display: flex; justify-content: center; padding-bottom: 60px; }
.btn {
  height: 46px; padding: 0 22px; border-radius: 12px; border: 0; font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* ── Warenkorb ─────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(10, 25, 30, .45); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--ground);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer h2 { margin: 0; font: 800 1.3rem/1.1 var(--font-display); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; }
.drawer .scroll { flex: 1; overflow-y: auto; padding: 8px 16px 16px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .thumb .ph svg { width: 60%; }
.line .thumb .ph span { display: none; }
.line .name { font-size: .92rem; font-weight: 600; line-height: 1.3; }
.line .warn { color: var(--accent); font-size: .8rem; font-weight: 600; }
.line .right { text-align: right; display: grid; gap: 2px; justify-items: end; }
.line .rm { border: 0; background: none; color: var(--ink-soft); font-size: .8rem; text-decoration: underline; padding: 0; }

.section-title { font: 700 .78rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 20px 0 10px; }
.options { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt b { display: block; font-size: .95rem; }
.opt span { font-size: .84rem; color: var(--ink-soft); line-height: 1.35; display: block; }
.opt .price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.field { display: grid; gap: 6px; margin-top: 10px; }
.field label { font-size: .85rem; font-weight: 600; }
.field select { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; }
.ship-note { font-size: .84rem; color: var(--ink-soft); margin-top: 8px; }
.ship-note.err { color: var(--accent); font-weight: 600; }

.totals { border-top: 1px solid var(--line); padding: 14px 16px 16px; background: var(--surface); display: grid; gap: 6px; }
.totals .row { display: flex; justify-content: space-between; font-size: .95rem; }
.totals .row.sum { font: 800 1.2rem/1.3 var(--font-display); margin-top: 4px; }
.totals .fine { font-size: .75rem; color: var(--ink-soft); }
.pay-methods { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.pay-methods span { font-size: .72rem; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--ink-soft); }
.checkout { width: 100%; margin-top: 8px; height: 52px; font-size: 1.05rem; }
.error-box { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-top: 8px; }

/* ── Detail-Dialog ─────────────────────────────── */
dialog.detail { border: 0; padding: 0; border-radius: 18px; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.detail::backdrop { background: rgba(10, 25, 30, .55); }
.detail-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 700px) { .detail-grid { grid-template-columns: 1.1fr 1fr; } }
.detail .pic { aspect-ratio: 1; max-width: 100%; background: var(--surface-2); position: relative; }
.detail .pic img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.detail .info { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.detail h2 { margin: 0; font: 800 1.5rem/1.15 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.detail .price-big { font: 800 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .9rem; }
.detail dt { color: var(--ink-soft); }
.detail dd { margin: 0; }
.detail .close { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ── Fußzeile ─────────────────────────────── */
footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--ink-soft); font-size: .88rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer a { color: inherit; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; z-index: 60;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Textseiten (Impressum etc.) */
.page { max-width: 720px; padding-block: 32px 60px; }
.page h1 { font: 800 2rem/1.1 var(--font-display); margin: 0 0 16px; }
.page h2 { font: 700 1.15rem/1.3 var(--font-display); margin: 28px 0 8px; }
.page p, .page li { max-width: 65ch; }
.todo { background: var(--sticker); color: var(--sticker-ink); padding: 1px 6px; border-radius: 4px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
