/* ============================================================
   Heimservice PWA — app.css
   Kein Tailwind, kein Build-Step. Vanilla CSS.
   ============================================================ */

:root {
  /* Modern Token-Set (Heimservice v0.3+) */
  --c-bg:        #f6f5f1;
  --c-surface:   #ffffff;
  --c-surface-2: #faf9f5;
  --c-ink:       #1a1f1a;
  --c-ink-soft:  #5a605a;
  --c-line:      #e6e3dc;

  /* Akzentfarbe — pro Partner via inline-style überschreibbar */
  --c-accent:        #9bb487;
  --c-accent-soft:   #c8d8b8;
  --c-accent-glow:   #e3edd5;

  --c-success: #5b9a6b;
  --c-warning: #d4a574;
  --c-danger:  #c47a8a;

  --font-display: 'Fraunces', Georgia, serif;

  --r-sm: 8px;  --r-md: 14px;  --r-lg: 22px;  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26,31,26,.04), 0 2px 8px rgba(26,31,26,.04);
  --shadow-md: 0 4px 16px rgba(26,31,26,.06), 0 16px 40px rgba(26,31,26,.05);

  /* Legacy-Aliasse (alte Selektoren weiter funktionsfähig halten) */
  --red:     var(--c-accent);
  --red-dk:  var(--c-ink);
  --dark:    var(--c-ink);
  --gray-50: var(--c-bg);
  --gray-100:var(--c-surface-2);
  --gray-200:var(--c-line);
  --gray-400:#a8aea4;
  --gray-500:var(--c-ink-soft);
  --gray-600:#3f4640;
  --gray-700:#2a2f2a;
  --white:   var(--c-surface);
  --nav-h:   64px;
  --topnav-h: 64px;
  --safe-b:  env(safe-area-inset-bottom, 0px);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--c-ink); background: var(--c-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: transparent; font: inherit; }
input, textarea, select { font: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}

/* ── Pages ──────────────────────────────────────────────── */
.page {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - var(--nav-h) - var(--safe-b));
  overflow-y: auto;
}
.page.active {
  display: flex;
}

/* ── Menu-Search ─────────────────────────────────────────── */
.menu-search {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 16px 8px;
  padding: 10px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.menu-search:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.menu-search__icon { color: var(--c-ink-soft); flex-shrink: 0; }
.menu-search input {
  flex: 1; border: none; background: transparent;
  font: inherit; color: var(--c-ink);
  outline: none;
}
.menu-search input::placeholder { color: var(--c-ink-soft); }
.menu-search__clear {
  background: var(--c-surface-2);
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 1rem; line-height: 1;
  color: var(--c-ink-soft);
  cursor: pointer;
}

/* Desktop-Layout (Top-Nav, zentrierter Inhalt, Raster) steht als
   mobile-first-Override am DATEIENDE — sonst überschreiben spätere
   Basis-Regeln (.product-grid, .nav-item …) die Media-Query-Regeln. */

/* ── App Header (modern, mit dezentem Glow) ─────────────── */
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  color: var(--c-ink);
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--c-line);
  overflow: hidden;
}
.app-header__glow {
  position: absolute; pointer-events: none;
  inset: -40% -20% auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--c-accent) 0%, transparent 65%);
  opacity: .25;
  filter: blur(40px);
  animation: app-header-glow 14s ease-in-out infinite alternate;
}
@keyframes app-header-glow {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-30px, 20px) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .app-header__glow { animation: none; } }
.app-header__inner { position: relative; z-index: 1; }
.app-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
.app-header p {
  font-size: .82rem;
  color: var(--c-ink-soft);
  margin-top: 2px;
}

/* ── App-Header Branding (Icon + Wortmarke links, Status rechts) ── */
.app-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-brand__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.app-brand__icon {
  width: 44px; height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}
.app-brand__text { min-width: 0; }
.app-brand__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-pill, 999px);
  white-space: nowrap;
  line-height: 1;
}
.app-brand__status.is-open   { background: rgba(22,163,74,.12);  color: #15803d; }
.app-brand__status.is-closed { background: rgba(120,120,120,.14); color: var(--c-ink-soft); }
.app-brand__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
/* Desktop-Top-Nav: kleines Icon vor der Wortmarke */
.nav-brand__icon {
  width: 26px; height: 26px;
  object-fit: contain;
  margin-right: 8px;
  flex: 0 0 auto;
}

/* ── Bottom Nav ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--gray-400);
  font-size: .65rem;
  font-weight: 500;
  transition: color .15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover, .nav-item.active {
  color: var(--red);
}
.nav-item .nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--red);
  border-radius: 0 0 2px 2px;
}

/* ── Cart Badge ─────────────────────────────────────────── */
.cart-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--red);
  color: var(--white);
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  display: none;
}
.cart-badge.visible { display: flex; }

/* ── Category Tabs ──────────────────────────────────────── */
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 57px;
  z-index: 9;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--white);
  transition: all .15s;
  white-space: nowrap;
}
.cat-tab.active, .cat-tab:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* ── Product Grid ───────────────────────────────────────── */
.menu-section {
  padding: 0 16px;
}
.menu-section h2 {
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 0 8px;
  color: var(--dark);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding-bottom: 16px;
}

/* ── Product Card ───────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}
.product-card:active { transform: scale(.97); }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.product-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--gray-400);
}
.product-card__body {
  padding: 10px 10px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card__name {
  font-weight: 600;
  font-size: .85rem;
  line-height: 1.3;
  color: var(--dark);
}
.product-card__desc {
  font-size: .72rem;
  color: var(--gray-500);
  margin-top: 3px;
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.product-card__price {
  font-weight: 700;
  font-size: .9rem;
  color: var(--red);
}
.product-card__add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
/* Echtes Produktbild (falls image_url gesetzt) — sonst Emoji-Platzhalter */
.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Bild/Kompakt-Umschalter ────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding: 8px 16px 0;
}
.view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-ink-soft);
  transition: background .15s, color .15s, border-color .15s;
}
.view-toggle__btn[aria-pressed="true"] {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* ── Kompakt-Ansicht (dichte Preisliste ohne Bilder) ────── */
#menu-container[data-view="compact"] .product-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
#menu-container[data-view="compact"] .product-card {
  flex-direction: row;
  align-items: center;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--c-line);
}
#menu-container[data-view="compact"] .product-card:active { transform: none; }
#menu-container[data-view="compact"] .product-card:hover { box-shadow: none; }
#menu-container[data-view="compact"] .product-card__img { display: none; }
/* Kompakt: Name + Beschreibung links gestapelt, Preis/Add rechts.
   Grid statt Flex, damit die Beschreibungszeile (gerade ohne Foto der
   wertvollste Ort) unter dem Namen erscheint. */
#menu-container[data-view="compact"] .product-card__body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding: 11px 6px;
}
#menu-container[data-view="compact"] .product-card__name { grid-column: 1; font-size: .9rem; }
#menu-container[data-view="compact"] .product-card__desc {
  grid-column: 1;
  margin-top: 2px;
  -webkit-line-clamp: 1;   /* in der dichten Liste nur eine Zeile */
}
#menu-container[data-view="compact"] .product-card__footer {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
  gap: 12px;
  flex-shrink: 0;
}

/* Nav-Brand nur auf Desktop sichtbar (im mobilen Footer verborgen) */
.nav-brand { display: none; }

/* ── Modal Overlay ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  display: none;
}
.modal-overlay.open { display: flex; }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal-sheet {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .25s ease;
}
@media (min-width: 600px) {
  .modal-sheet {
    border-radius: 16px;
    max-width: 480px;
    max-height: 85vh;
  }
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
}
.qty-btn:hover { background: var(--gray-200); }
.qty-val { font-weight: 700; min-width: 24px; text-align: center; }

/* ── Option rows ────────────────────────────────────────── */
.option-group h4 {
  font-weight: 600;
  font-size: .85rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.option-group + .option-group { margin-top: 16px; }
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.option-row:last-child { border-bottom: none; }
.option-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; font-size: .88rem; }
.option-row input { accent-color: var(--red); width: 16px; height: 16px; }
.option-surcharge { font-size: .8rem; color: var(--gray-600); white-space: nowrap; }

/* ── Cart Page ──────────────────────────────────────────── */
.cart-page {
  padding: 16px;
}
.cart-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--gray-400);
}
.cart-empty .cart-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.cart-item {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-weight: 600; font-size: .9rem; }
.cart-item__sub { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }
.cart-item__remove { font-size: .7rem; color: var(--red); margin-top: 4px; display: inline-block; }
.cart-item__price { font-weight: 700; white-space: nowrap; font-size: .9rem; }
.cart-summary {
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--gray-600);
  padding: 3px 0;
}
.cart-summary-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--gray-100);
}

/* ── Forms ──────────────────────────────────────────────── */
.form-section { margin-bottom: 20px; }
.form-section h3 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}
.form-input:focus { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  font-size: .88rem;
  transition: border-color .15s, background .15s;
}
.radio-label:has(input:checked) {
  border-color: var(--red);
  background: #fdf2f2;
}
.radio-label input { accent-color: var(--red); }
.radio-label.disabled { opacity: .5; cursor: default; }
.error-box {
  background: #fde8e8;
  color: #9b1c1c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .85rem;
  margin-bottom: 12px;
  display: none;
}
.error-box.visible { display: block; }
.form-hint { display: block; font-size: .78rem; color: var(--gray-500); margin-top: 4px; }

/* ── WhatsApp-Opt-in ─────────────────────────────────────────
   DSGVO: Checkbox NIE vorausgewählt (kein checked, kein JS das
   sie in der Registrierung/Checkout setzt). EuGH C-673/17. */
.wa-optin {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1.5px solid #25d366;
  border-radius: 12px;
  background: rgba(37, 211, 102, .06);
  cursor: pointer;
}
.wa-optin input {
  margin-top: 1px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: #25d366;
  cursor: pointer;
}
.wa-optin__text { font-size: .85rem; line-height: 1.4; color: var(--dark); }
.wa-optin__title { display: block; font-weight: 700; margin-bottom: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: var(--red);
  color: var(--white);
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 20px;
  border-radius: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, opacity .15s;
}
.btn-primary:hover { background: var(--red-dk); }
.btn-primary:disabled { background: var(--gray-400); cursor: not-allowed; }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  font-size: .9rem;
  padding: 11px 20px;
  border-radius: 10px;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-link {
  color: var(--red);
  font-size: .85rem;
  text-decoration: underline;
  background: transparent;
}

/* ── Orders Page ─────────────────────────────────────────── */
.orders-page { padding: 16px; }
.orders-empty { text-align: center; padding: 48px 16px; color: var(--gray-400); }
.order-card {
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.order-card__num { font-family: monospace; font-weight: 700; font-size: .9rem; }
.order-card__time { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }
.order-card__status { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 600; }
.status-placed      { background: #e6f4ea; color: #1e7e34; }
.status-preparing   { background: #fff3cd; color: #856404; }
.status-ready       { background: #fff3cd; color: #856404; }
.status-out_for_delivery { background: #d1ecf1; color: #0c5460; }
.status-delivered   { background: #e6f4ea; color: #1e7e34; }
.status-cancelled   { background: #fde8e8; color: #9b1c1c; }

/* ── Track Page ──────────────────────────────────────────── */
.track-page { padding: 16px; }
.track-header { background: var(--white); border-radius: 10px; padding: 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.track-status-banner {
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 16px;
}
.track-timeline { background: var(--white); border-radius: 10px; padding: 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.timeline-step + .timeline-step::before {
  content: '';
  position: absolute;
  left: 11px;
  top: -8px;
  width: 2px;
  height: 16px;
  background: var(--gray-200);
}
.timeline-step.done + .timeline-step::before { background: var(--red); }
.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}
.timeline-step.done .timeline-dot { border-color: var(--red); background: var(--red); color: var(--white); }
.timeline-step.active .timeline-dot { border-color: var(--red); animation: pulse 1.2s infinite; }
.timeline-label { font-size: .85rem; padding-top: 2px; }
.timeline-step.done .timeline-label { color: var(--dark); font-weight: 500; }
.timeline-step.active .timeline-label { color: var(--red); font-weight: 600; }
.timeline-step .timeline-label { color: var(--gray-400); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193,39,45,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(193,39,45,0); }
}
.delivery-animation {
  text-align: center;
  font-size: 2.5rem;
  animation: driveAcross 2s ease-in-out infinite alternate;
  margin: 8px 0;
}
@keyframes driveAcross {
  from { transform: translateX(-20px); }
  to   { transform: translateX(20px); }
}
.track-items { background: var(--white); border-radius: 10px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.track-item-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-100);
}
.track-item-row:last-of-type { border-bottom: none; }
.track-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--gray-200);
}

/* ── Account Page ─────────────────────────────────────────── */
.account-page { padding: 16px; }
.account-page h2 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.push-status-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 16px;
}
.push-status-card h3 { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.push-status-text { font-size: .8rem; color: var(--gray-500); margin-bottom: 12px; }
.push-active { color: #1e7e34; font-weight: 600; font-size: .85rem; }

/* ── Success Banner ───────────────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  display: none;
}
.success-overlay.open { display: flex; }
.success-card {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: fadeInUp .3s ease;
}
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.success-icon { font-size: 3.5rem; margin-bottom: 12px; }
.success-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.success-card p { font-size: .88rem; color: var(--gray-600); margin-bottom: 4px; }

/* ── Loading Spinner ──────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ─────────────────────────────────────────────────── */
.text-muted { color: var(--gray-500); font-size: .85rem; }
.text-red   { color: var(--red); }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }

/* ── Slot-Picker (Abholung) ───────────────────────────────── */
.slot-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.slot-tab {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-pill);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--white);
  transition: background .15s, color .15s, border-color .15s;
}
.slot-tab.active { background: var(--red); color: var(--white); border-color: var(--red); }
.slot-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  min-height: 44px;
}
.slot-chip {
  padding: 10px 4px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  font-size: .9rem;
  font-weight: 600;
  color: var(--dark);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.slot-chip:hover:not(:disabled) { border-color: var(--red); }
.slot-chip.is-selected { background: var(--red); color: var(--white); border-color: var(--red); }
.slot-chip.is-full, .slot-chip:disabled {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}
.slot-selected {
  margin-top: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-success);
}

/* ── Abholpass (Wallet-Ticket-Optik, Track-Ansicht bei Pickup) ── */
.pickup-pass {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 18px 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(26,31,26,.08));
  border: 1px solid var(--c-line);
  text-align: center;
  overflow: hidden;
}
.pickup-pass__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pickup-pass__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--dark);
}
.pickup-pass__status {
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(120,120,120,.14);
  color: var(--gray-600);
  white-space: nowrap;
}
.pickup-pass.is-ready .pickup-pass__status {
  background: rgba(22,163,74,.14);
  color: #15803d;
  animation: pass-pulse 1.6s ease-in-out infinite;
}
@keyframes pass-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
  50%      { box-shadow: 0 0 0 7px rgba(22,163,74,0); }
}
@media (prefers-reduced-motion: reduce) { .pickup-pass.is-ready .pickup-pass__status { animation: none; } }
/* Perforationskante */
.pickup-pass__perf {
  position: relative;
  height: 1px;
  margin: 4px -16px 16px;
  border-top: 2px dashed var(--c-line);
}
.pickup-pass__perf::before,
.pickup-pass__perf::after {
  content: '';
  position: absolute;
  top: -11px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
}
.pickup-pass__perf::before { left: -11px; }
.pickup-pass__perf::after  { right: -11px; }
.pickup-pass__qr {
  display: flex;
  justify-content: center;
  padding: 8px;
}
.pickup-pass__qr img, .pickup-pass__qr canvas, .pickup-pass__qr svg {
  width: 200px; height: 200px;
  display: block;
}
.pickup-pass__num {
  margin-top: 12px;
  font-family: monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--dark);
}
.pickup-pass__slot {
  margin-top: 4px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--red);
}
.pickup-pass__hint {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--gray-500);
}

/* ══════════════════════════════════════════════════════════
   DESKTOP-LAYOUT (ab 768px) — mobile-first-Override, MUSS am
   Dateiende stehen, damit es die Basis-Regeln gewinnt:
   – untere Tab-Leiste wird zur OBEREN Navigationsleiste
   – zentrierter Inhalt mit max-width, mehrspaltiges Produktraster
   Dieselben .nav-item-Buttons, nur per CSS umpositioniert → die
   bestehende JS-Tab-Logik greift unverändert.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  #app {
    padding-bottom: 0;
    padding-top: var(--topnav-h);
  }

  /* ── Bottom-Nav → Top-Nav ── */
  .bottom-nav {
    top: 0;
    bottom: auto;
    height: var(--topnav-h);
    padding: 0 clamp(16px, 4vw, 40px);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border-top: none;
    border-bottom: 1px solid var(--c-line);
    box-shadow: 0 1px 3px rgba(26, 31, 26, .05);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
  }

  .nav-brand {
    display: flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -.01em;
    color: var(--c-ink);
    margin-right: auto;
    padding-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45vw;
  }

  .nav-item {
    flex: 0 0 auto;
    flex-direction: row;
    width: auto;
    gap: 8px;
    padding: 8px 16px;
    font-size: .92rem;
    font-weight: 600;
    border-radius: var(--r-pill);
    color: var(--c-ink-soft);
  }
  .nav-item .nav-icon { font-size: 1.15rem; }
  .nav-item:hover { color: var(--red); }
  .nav-item.active { background: var(--c-accent-glow); color: var(--red); }
  .nav-item.active::after { display: none; }   /* Unterstrich-Indikator entfällt */

  /* Warenkorb-Badge für Zeilen-Layout neu positionieren */
  .nav-item[data-page="cart"] { position: relative; }
  .nav-item[data-page="cart"] .cart-badge {
    top: 0;
    right: 2px;
  }

  /* ── Inhalt zentrieren mit max-width + Gutter ── */
  .menu-search,
  .view-toggle,
  #cat-tabs,
  .menu-section,
  .cart-page,
  .orders-page,
  .account-page,
  .track-page {
    width: min(1080px, 100% - 48px);
    margin-inline: auto;
  }
  .menu-section { padding-inline: 0; }

  /* ── Mehrspaltiges Produktraster ── */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  /* Kompakt-Modus bleibt einspaltig, auch auf Desktop */
  #menu-container[data-view="compact"] .product-grid {
    grid-template-columns: 1fr;
  }

  /* Etwas großzügigere Kopf-Abstände */
  .app-header { padding: 20px 22px 16px; }
}
