* { box-sizing: border-box; font-family: -apple-system, Segoe UI, Roboto, sans-serif; }
body { margin: 0; background: #f4f4f6; color: #222; -webkit-tap-highlight-color: transparent; }
.container { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
h1 { text-align: center; }
.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.hidden { display: none !important; }
select, input[type=text], input[type=number] {
  width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 8px; margin-bottom: 12px;
}
button {
  padding: 12px 20px; font-size: 16px; border: none; border-radius: 8px; cursor: pointer; margin: 4px 0;
}
.btn-primary { background: #2563eb; color: #fff; width: 100%; }
.btn-secondary { background: #e5e7eb; color: #222; width: 100%; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-direction: column; gap: 8px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #1f2937; color: #fff; padding: 12px 20px;
}
.topbar a { color: #93c5fd; text-decoration: none; }

.kachel-alkoholisch { background: #b91c1c; }
.kachel-alkoholfrei { background: #16a34a; }
.kachel-schnaps { background: #7e22ce; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-buttons { display: flex; gap: 8px; margin-top: 16px; }
.modal-buttons button { flex: 1; }
.modal-inhalt { width: 92%; max-width: 400px; padding: 18px; background: #fff; border-radius: 12px; max-height: 80vh; overflow-y: auto; }

/* Prominente Tischanzeige oben - mit Home-Icon rechts in der gleichen Zeile */
.tisch-banner {
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.tisch-banner-mitte {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.tisch-banner .label {
  font-size: 12px;
  font-weight: 400;
  display: block;
  opacity: 0.85;
}
.home-btn {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}
.home-btn:active { background: rgba(255,255,255,0.2); }

/* ===== Mobile-first Bestellansicht ===== */
.warenkorb-bereich {
  background: #fff;
  border-bottom: 3px solid #2563eb;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.warenkorb-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.warenkorb-kopf h2 { margin: 0; font-size: 16px; }
.warenkorb-kopf .warenkorb-summe { font-size: 16px; font-weight: 700; }

.warenkorb-liste {
  max-height: 22vh;
  overflow-y: auto;
  margin-bottom: 10px;
}
.warenkorb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.warenkorb-item-name { flex: 1; }
.warenkorb-item-preis { min-width: 60px; text-align: right; font-weight: 600; }

.menge-steuerung {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.menge-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menge-minus { background: #fee2e2; color: #b91c1c; }
.menge-minus:active { background: #fecaca; }
.menge-plus { background: #dcfce7; color: #16a34a; }
.menge-plus:active { background: #bbf7d0; }
.menge-anzeige {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.artikel-bereich {
  padding: 12px 10px 90px 10px;
}

.kategorie-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.kategorie-filter button {
  flex-shrink: 0;
  background: #e5e7eb;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}
.kategorie-filter button.active { background: #2563eb; color: #fff; }

.artikel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.artikel-kachel {
  border-radius: 10px;
  padding: 18px 8px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  user-select: none;
}
.artikel-kachel:active { transform: scale(0.96); }
.artikel-kachel .preis { display: block; font-weight: 400; font-size: 13px; margin-top: 6px; }

@media (min-width: 480px) {
  .artikel-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) {
  .artikel-grid { grid-template-columns: repeat(4, 1fr); }
  .warenkorb-liste { max-height: 30vh; }
}

/* Ladeanzeige & Erfolgszustand beim Absenden */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-primary:disabled { opacity: 0.85; cursor: not-allowed; }
.btn-erfolg { background: #16a34a !important; }

/* ===== Kassenansicht - dynamisch, Button immer sichtbar auf jedem Display ===== */
.kasse-body {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kasse-inhalt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
}

/* Positionen-Box darf schrumpfen (flex-basis 0), damit die Zahlungs-Box unten IMMER vollstaendig sichtbar bleibt */
.kasse-positionen-box {
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.positionen-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.positionen-kopf h2 { margin: 0; font-size: 14px; }

.mini-btn {
  background: #e5e7eb;
  color: #222;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  margin: 0 0 0 4px;
}

.positionen-liste {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 40px;
}
.keine-positionen {
  text-align: center;
  color: #999;
  padding: 14px 0;
  font-size: 13px;
}

.position-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.position-item.selected { background: #eff6ff; }
.position-name { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.position-offen-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.position-offen-badge.badge-leer {
  background: #16a34a;
}
.position-preis { font-weight: 600; min-width: 50px; text-align: right; font-size: 13px; }

/* Zahlungs-Box: feste, kompakte Groesse, schrumpft nie - Button bleibt immer sichtbar */
.kasse-zahlung-box {
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.zahlung-summenreihe { margin-bottom: 6px; }
.summen-feld {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eff6ff;
  border-radius: 8px;
  padding: 6px 10px;
}
.summen-label { font-size: 12px; color: #555; }
.summen-wert { font-size: 17px; font-weight: 700; color: #1e40af; }

.eingabe-reihe {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.eingabe-feld { flex: 1; }
.eingabe-feld label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
}
.eingabe-feld input {
  margin-bottom: 0;
  padding: 7px 9px;
  font-size: 16px; /* mind. 16px verhindert Auto-Zoom von iOS Safari beim Fokussieren */
}

.ergebnis-reihe {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.ergebnis-feld {
  flex: 1;
  border-radius: 8px;
  padding: 5px 8px;
  text-align: center;
}
.ergebnis-trinkgeld { background: #f0fdf4; }
.ergebnis-rueckgeld { background: #fef9e7; }
.ergebnis-label { display: block; font-size: 10px; color: #666; margin-bottom: 1px; }
.ergebnis-wert { font-size: 15px; font-weight: 700; }
.ergebnis-trinkgeld .ergebnis-wert { color: #16a34a; }
.ergebnis-rueckgeld .ergebnis-wert { color: #b45309; }

#zahlenButton { margin: 0; padding: 10px 20px; }