/* Schnapper: ruhige Fläche, laute Preisschilder. */
@font-face {
  font-family: 'Archivo';
  src: url('/static/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #eef1ee;
  --ink: #17201b;
  --muted: #59645e;
  --line: #d5dbd6;
  --field: #ffffff;
  --tag: #ffd60a;
  --tag-ink: #17201b;
  --ok: #0f6b4b;
  --ok-ink: #ffffff;
  --warn: #a8321f;
  --focus: #0f6b4b;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #121614;
    --ink: #e7ece8;
    --muted: #9aa59f;
    --line: #2b332f;
    --field: #1a201d;
    --ok: #3fb68b;
    --ok-ink: #0b130f;
    --warn: #f08a76;
    --focus: #3fb68b;
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.45;
  font-stretch: 100%;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem calc(6rem + env(safe-area-inset-bottom));
}

.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;
}
.is-hidden { display: none; }
.muted { color: var(--muted); }

/* Typografie */
.title {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: -0.01em;
  margin: 0.75rem 0 1rem;
}
.lead { margin: -0.5rem 0 1rem; color: var(--muted); }
.block { margin-top: 2rem; }
.block-title { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.5rem; }
.note { color: var(--muted); font-size: 0.9375rem; }
.note.good { color: var(--ok); }
.note.warn { color: var(--warn); }

.notice {
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  border-left: 4px solid var(--ok);
  background: var(--field);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.error {
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  border-left: 4px solid var(--warn);
  background: var(--field);
  color: var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Preisschild: das eine laute Element */
.tag {
  display: inline-flex;
  align-items: flex-start;
  flex: none;
  font-weight: 800;
  font-stretch: 62%;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  padding: 0.2em 0.35em 0.15em 0.4em;
  border-radius: 3px;
  color: var(--tag-ink);
}
.tag--angebot { background: var(--tag); }
.tag--normal { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.tag--klein { font-size: 1.5rem; }
.tag--gross { font-size: 2.75rem; }
.tag-c { font-size: 0.55em; margin-left: 0.06em; margin-top: 0.08em; text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }

/* Ladenmarke */
.store {
  display: inline-block;
  padding-left: 0.5rem;
  border-left: 4px solid var(--store, var(--line));
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1.2;
}

/* Suche */
.search input {
  width: 100%;
  font: inherit;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
}
.search input:focus { border-color: var(--focus); outline: none; }

.zettel-hint {
  display: block;
  margin-top: 0.75rem;
  font-weight: 650;
  color: var(--ok);
  text-decoration: none;
}

/* Produktliste */
.rows { list-style: none; margin: 1rem 0 0; padding: 0; }
.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}
.row-main { flex: 1; min-width: 0; text-decoration: none; display: grid; gap: 0.375rem; }
.row-name { font-weight: 650; font-size: 1.0625rem; }
.row-best { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.nothing { margin: 1rem 0; color: var(--muted); }

/* Korb-Knopf */
.cart-form { flex: none; }
.cart {
  width: 2.875rem;
  height: 2.875rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.cart .cart-check { opacity: 0; }
.cart[aria-pressed='true'] { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); }
.cart[aria-pressed='true'] .cart-check { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .cart { transition: background-color 120ms ease, color 120ms ease, transform 120ms ease; }
  .cart:active { transform: scale(0.92); }
}

/* Knöpfe */
.button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius);
  border: 0;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.button--wide { display: block; width: 100%; margin-top: 1.5rem; }
.button--danger { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1.5px currentColor; }
.link {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.inline { display: inline; }
.back { display: inline-block; margin-top: 0.25rem; color: var(--muted); font-size: 0.9375rem; }

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.empty { padding: 1rem 0; }
.empty p { max-width: 30rem; }

/* Formulare */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.3rem; }
.field > span { font-weight: 650; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: 0.875rem; }
.field input, .price-input {
  font: inherit;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
}
.field input:focus, .price-input:focus { border-color: var(--focus); outline: none; }
.fine summary { cursor: pointer; font-weight: 650; padding: 0.25rem 0; }
.fine[open] summary { margin-bottom: 1rem; }

/* Produktseite */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.best { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.prices table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.prices th, .prices td { padding: 0.5rem 0.25rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prices thead th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.prices td:last-child { width: 6.5rem; }
.price-input { text-align: right; padding: 0.5rem 0.6rem; }

/* Angebote */
.offers { list-style: none; margin: 0; padding: 0; }
.offer {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}
.offer-img { width: 3.5rem; height: 3.5rem; object-fit: contain; background: #fff; border-radius: 4px; display: block; }
.offer-body { min-width: 0; }
.offer-body p { margin: 0 0 0.2rem; }
.offer-title { font-weight: 650; }
.offer-desc { font-size: 0.9375rem; }
.for { font-size: 0.9375rem; }

/* Einkauf */
.route {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.875rem;
}
.route-stop {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.route-stop.is-on { color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--store); }
.route-street {
  padding: 0 0.375rem;
  color: var(--muted);
  border-left: 2px dashed var(--line);
  border-right: 2px dashed var(--line);
  font-size: 0.75rem;
}
.stop { margin-bottom: 1.75rem; }
.stop-name {
  font-size: 1.375rem;
  font-weight: 800;
  font-stretch: 80%;
  margin: 0 0 0.25rem;
  padding-left: 0.625rem;
  border-left: 6px solid var(--store, var(--line));
}
.checklist { list-style: none; margin: 0; padding: 0; }
.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.check-name { flex: 1; min-width: 0; text-decoration: none; font-weight: 600; display: grid; }
.check-name .note { font-weight: 400; }
.done-form { flex: none; }
.done {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.done:hover span, .done:focus-visible span {
  width: 0.5rem; height: 0.875rem;
  border: solid var(--ok); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Im Laden */
.picker {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  scrollbar-width: none;
}
.pick {
  flex: none;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.pick[aria-current='page'] { box-shadow: inset 0 0 0 2.5px var(--store); }
.row--static { align-items: center; }

/* Login */
.login { padding-top: 15vh; }

/* Untere Navigation */
.tabs {
  position: fixed;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  max-width: 11rem;
  display: grid;
  justify-items: center;
  gap: 0.125rem;
  padding: 0.5rem 0 0.625rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.tab[aria-current='page'] { color: var(--ink); }
.tab[aria-current='page'] svg { stroke-width: 2.4; }

@media (min-width: 40rem) {
  .title { font-size: 2.5rem; }
}

/* Hinweis auf ein günstigeres Angebot ab nächster Woche */
.soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ok);
}
.soon .store { font-size: inherit; color: var(--ink); }
