/* ==========================================================================
   Kasse Mobile – Fanclub Trinkpause
   Eigenständiges, kompaktes Mobile-First-Layout. Baut auf den
   Grundfarben/Fonts aus css/style.css auf.
   ========================================================================== */

/* min-height 1px über 100vh: siehe Kommentar in css/style.css bei
   body { min-height } - erzwingt echten Scroll-Bedarf, damit der
   Scrollbalken nicht je nach Tab-Inhalt erscheint/verschwindet. */
.km-app { min-height: calc(100vh + 1px); background: var(--off-white); padding-bottom: 100px; }

/* ---------- Header ---------- */
.km-header { background: var(--red); position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-soft); }
.km-header-top { max-width: 560px; margin: 0 auto; padding: 10px 18px 4px; position: relative; box-sizing: border-box; }
.km-eyebrow { color: rgba(255,255,255,0.7); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.15em; display: block; }
.km-title { color: #fff; font-family: var(--font-display); font-size: 1.4rem; margin: 2px 0 0; line-height: 1; }
.km-subtitle { color: rgba(255,255,255,0.85); font-size: 0.76rem; margin: 3px 0 0; font-weight: 600; }
.km-header-links { position: absolute; top: 14px; right: 18px; display: flex; gap: 10px; align-items: center; }
.km-header-links a, .km-header-links button {
  color: rgba(255,255,255,0.85); font-size: 0.72rem; text-decoration: none; background: none; border: none;
  padding: 4px 0;
}
.km-header-links a:hover, .km-header-links button:hover { color: #fff; text-decoration: underline; }

/* ---------- Ausklappbares Menü (Kasse Mobile) ---------- */
.km-header-links .nav-menu-toggle {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.km-header-links .nav-menu-toggle:hover { background: rgba(255,255,255,0.25); }
.km-header-links .nav-menu-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  min-width: 180px;
  padding: 8px;
  z-index: 200;
}
.km-header-links .nav-menu-dropdown.open { display: flex; }
.km-header-links .nav-menu-dropdown a,
.km-header-links .nav-menu-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 6px; font-size: 0.86rem; font-weight: 600;
  color: var(--anthracite); text-decoration: none; background: none; border: none; cursor: pointer;
}
.km-header-links .nav-menu-dropdown a:hover,
.km-header-links .nav-menu-dropdown button:hover { background: var(--off-white); }
.km-header-links .nav-menu-dropdown a.active { background: rgba(237,28,36,0.1); color: var(--red); cursor: default; }
.km-header-links .nav-menu-divider { border: none; border-top: 1px solid var(--grey-line); margin: 6px 2px; }

.km-tabs { display: flex; max-width: 560px; margin: 0 auto; padding: 0 8px; gap: 4px; box-sizing: border-box; }
.km-tab-btn {
  flex: 1; background: transparent; border: none; color: rgba(255,255,255,0.8);
  padding: 10px 8px; font-size: 0.86rem; font-weight: 700; border-radius: 8px 8px 0 0;
}
.km-tab-btn.active { background: var(--off-white); color: var(--anthracite); }

.km-main { max-width: 560px; margin: 0 auto; padding: 8px 16px 16px; }
.km-panel { display: none; }
.km-panel.active { display: block; animation: panel-in 260ms ease; }

/* ---------- Karten / Felder ---------- */
.km-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 14px; }
.km-field-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }

/* ---------- Offene, zugewiesene Tickets dieser Person ---------- */
.km-assigned-ticket-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--grey-line);
  font-size: 0.84rem;
}
.km-assigned-ticket-row:last-child { border-bottom: none; }
.km-assigned-ticket-row .kat-name { font-weight: 600; }
.km-assigned-ticket-row .kat-meta { font-size: 0.72rem; color: var(--text-muted); }
.km-assigned-ticket-row .kat-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.km-assigned-ticket-row .kat-actions button {
  padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line);
  background: var(--white); font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.km-assigned-ticket-row .kat-actions button:hover { border-color: var(--red); }

.km-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.km-chip {
  padding: 7px 13px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  border: 1.5px solid var(--grey-line); background: var(--white); color: var(--anthracite);
}
.km-chip.selected { background: var(--red); border-color: var(--red); color: #fff; }
.km-add-chip {
  display: inline-block; margin-top: 8px; background: none; border: none; padding: 0;
  font-size: 0.76rem; font-weight: 600; color: var(--red); text-decoration: underline;
}
.km-search-input, .km-buyer-select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.86rem;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.km-search-input:focus, .km-buyer-select:focus { outline: none; border-color: var(--red); }
.km-buyer-select.has-selection { border-color: #1e8e3e; border-width: 2px; }
.km-search-results {
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  border-radius: 8px;
  margin: -4px 0 8px;
  max-height: 220px;
  overflow-y: auto;
}
.km-search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--grey-line);
  background: var(--white);
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
}
.km-search-results button:last-child { border-bottom: none; }
.km-search-results button:hover { background: var(--off-white); }
.km-search-results button .kci-meta { display: block; font-size: 0.72rem; color: var(--text-muted); }
.km-search-results .km-no-results { padding: 10px 12px; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }

/* ---------- Produktraster ---------- */
.km-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.km-product-card {
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-soft);
  padding: 10px; text-align: left; border: 2px solid transparent;
}
.km-product-card.sold-out { opacity: 0.45; }
.km-product-card img { width: 100%; height: 60px; object-fit: contain; margin-bottom: 6px; }
.km-product-card h4 { font-size: 0.8rem; margin: 0 0 3px; line-height: 1.2; }
.km-product-card .kmp-price { font-weight: 700; color: var(--red); font-size: 0.84rem; }
.km-product-card .kmp-stock { font-size: 0.66rem; color: var(--text-muted); }
.km-product-card .kmp-bulk { font-size: 0.62rem; font-weight: 700; color: var(--red); background: rgba(237,28,36,0.1); border-radius: 999px; padding: 1px 6px; display: inline-block; margin-top: 3px; }

/* ---------- Warenkorb ---------- */
.km-empty-hint { text-align: center; font-size: 0.82rem; color: var(--text-muted); font-style: italic; border: 1.5px dashed var(--grey-line); border-radius: 10px; padding: 20px; }
.km-cart-list { display: flex; flex-direction: column; gap: 8px; }
.km-cart-item {
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.km-cart-item .kci-name { font-weight: 700; font-size: 0.86rem; }
.km-cart-item .kci-meta { font-size: 0.7rem; color: var(--text-muted); }
.km-cart-item .kci-badge { font-size: 0.62rem; font-weight: 700; color: #8A5A00; background: #FBEFE0; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.km-cart-item .kci-price { font-weight: 700; font-size: 0.86rem; white-space: nowrap; }
.km-cart-item .kci-remove { color: var(--red); background: none; border: none; padding: 2px; }

.km-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 12px 16px; margin-top: 14px; font-weight: 700; font-size: 0.92rem;
}
.km-total-row[hidden] { display: none; }
.km-total-row span:last-child { font-family: var(--font-heavy); color: var(--red); font-size: 1.1rem; }
.km-change-row span:last-child { color: #8A5A00; }
.km-guthaben-toggle {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 12px 16px; margin-top: 14px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
}
.km-guthaben-toggle input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }

.km-hint-warn { font-size: 0.76rem; color: var(--text-muted); text-align: center; margin: 10px 0 0; }
.km-checkout-btn { margin-top: 14px; }

/* ---------- Verlauf ---------- */
.km-history-list { display: flex; flex-direction: column; gap: 10px; }
.km-history-item {
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 12px 14px; text-align: left; border: none; width: 100%;
}
.km-history-item .khi-top { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--text-muted); margin-bottom: 4px; }
.km-history-item .khi-people { font-size: 0.78rem; margin-bottom: 4px; }
.km-history-item .khi-items { font-size: 0.8rem; color: var(--anthracite); }

/* ---------- Artikel-Detail-Modal ---------- */
.km-item-kurzbeschreibung { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 8px; }
.km-item-price { font-weight: 700; color: var(--red); font-size: 1rem; margin-bottom: 4px; }
.km-item-bulkhint { font-size: 0.76rem; color: var(--text-muted); background: var(--off-white); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
#itemModalSizes, #itemModalColors { margin-top: 12px; }
.qty-stepper { display: flex; align-items: center; gap: 12px; }
.qty-stepper button { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--grey-line); background: var(--white); font-weight: 700; font-size: 1.1rem; }
.qty-stepper .qty-value { font-weight: 700; min-width: 20px; text-align: center; }
.km-bulk-tile-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.km-bulk-tile {
  flex: 1;
  min-width: 84px;
  background: var(--off-white);
  border: 1.5px solid var(--grey-line);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.km-bulk-tile:hover { border-color: var(--red); }
.km-bulk-tile.selected { border-color: var(--red); background: rgba(237,28,36,0.08); }
.km-bulk-tile .kbt-qty { display: block; font-weight: 700; font-size: 0.92rem; color: var(--anthracite); }
.km-bulk-tile .kbt-price { display: block; font-size: 0.72rem; color: var(--red); font-weight: 600; margin-top: 1px; }

/* ---------- Zahlungs-Modal ---------- */
.km-amount-input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-family: inherit; font-size: 1rem; margin-top: 6px; }

/* ---------- Quittung ---------- */
.km-receipt { font-family: var(--font-mono, monospace); font-size: 0.86rem; color: var(--anthracite); }
.km-receipt .kr-center { text-align: center; margin-bottom: 10px; }
.km-receipt .kr-club { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.km-receipt .kr-meta { font-size: 0.74rem; color: var(--text-muted); }
.km-receipt hr { border: none; border-top: 1px dashed var(--grey-line); margin: 8px 0; }
.km-receipt .kr-row { display: flex; justify-content: space-between; padding: 2px 0; }
.km-receipt .kr-row.kr-total { font-weight: 700; font-size: 1rem; }
.km-receipt .kr-row.kr-discount { color: #8A5A00; font-size: 0.78rem; }
.km-receipt-actions { display: flex; gap: 8px; margin-top: 14px; }
.km-receipt-actions .btn { flex: 1; }
.km-whatsapp-btn { background: #25D366; color: #fff; }
.km-whatsapp-btn:hover { background: #1fb955; }

@media (max-width: 480px) {
  .km-product-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- Ticket-QR-Code scannen ---------- */
.qr-scan-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.qr-scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-scan-status { font-size: 0.84rem; color: var(--text-muted); text-align: center; margin: 12px 0 0; }
#qrScanCandidates { margin-top: 10px; }

/* ---------- Konfigurierbare Artikel im Artikelfenster (Etappe 4, 23.11.2026) ----------
   Gilt für Kasse und Kasse Mobile (beide laden diese Datei). Knöpfe
   (.kf-opt, .kf-dot, .kf-chip) kommen aus css/style.css wie im Shop. */
.km-konfig { margin: 10px 0 12px; gap: 10px; }
.km-konfig .kf-label { font-size: 0.78rem; }
.km-konfig .kf-chip { padding: 7px 11px; font-size: 0.8rem; }
.km-konfig .kf-dot { width: 32px; height: 32px; }
.km-chip:disabled, .km-chip.disabled { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }
.km-chip.km-chip-bestellung:not(.selected) { border-style: dashed; }
/* Grössenauswahl mit Bestand (Variante B wie im Shop, 24.11.2026): 7 Felder
   auf einer Linie (mehr: seitlich verschiebbar), Strich je Feld, gewählt in
   Anthrazit wie im Shop (Strich bleibt sichtbar). */
.km-size-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(64px, calc((100% - 6 * 4px) / 7));
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.km-size-row { justify-content: center; } /* mittig (24.11.2026), bei mehr als 7 linksbündig */
.km-size-row.km-size-scroll { padding-bottom: 6px; justify-content: start; }
.km-chip.km-size {
  position: relative;
  min-width: 0;
  height: 44px;
  padding: 0 0 6px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.km-chip.km-size::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 6px;
  height: 3px;
  border-radius: 2px;
}
.km-chip.km-size.size-lager::after { background: #2e9e4f; }
.km-chip.km-size.size-bestellung::after { background: #e39b17; }
.km-chip.km-size.size-aus::after { background: var(--red); }
.km-chip.km-size.selected { background: var(--anthracite); border-color: var(--anthracite); color: #fff; }
.km-chip.km-size.size-aus, .km-chip.km-size:disabled {
  opacity: 1;
  text-decoration: none;
  background: var(--off-white);
  border-color: #ece9e6;
  color: #a5a5a5;
  cursor: not-allowed;
}
.km-size-legend { margin-top: 8px; }
.km-size-legend[hidden] { display: none; }
.km-item-stock { margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }
.km-item-stock.backorder { color: #8A5A00; font-weight: 600; }
.km-item-stock.out { color: var(--red); font-weight: 700; }
.kci-bestellung { display: block; color: #8A5A00; font-weight: 600; }

/* Etappe 4b (23.11.2026): Bezahlwahl für Shirt-Bestellungen im Warenkorb,
   Kennzeichnung bezahlter Bestellungen unter «Offene Bestellungen». */
.kasse-konfig-zahlung {
  margin: 10px 0 4px; padding: 10px 12px;
  border: 1.5px dashed #d9b36b; border-radius: 10px; background: #fffaf0;
}
.kkz-titel { font-size: 0.78rem; font-weight: 700; color: #8A5A00; margin-bottom: 6px; }
.kkz-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.kkz-toggle .payment-btn { flex: 1 1 auto; padding: 7px 10px; font-size: 0.78rem; }
.kkz-hinweis { margin-top: 6px; font-size: 0.74rem; color: var(--text-muted); }
.kkz-hinweis.kkz-fehler { color: var(--red); font-weight: 700; }
.kat-bezahlt {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: #e6f4ea; color: #1e7b34; font-size: 0.68rem; font-weight: 700; vertical-align: middle;
}

/* Etappe 5 (23.11.2026): Bilder der gewählten Kombination im Artikelfenster */
.km-konfig-bilder { display: flex; gap: 8px; margin-bottom: 4px; }
.km-konfig-bilder img {
  width: calc((100% - 16px) / 3); max-width: 130px; aspect-ratio: 1 / 1;
  object-fit: contain; background: #f4f4f4; border-radius: 10px;
}


/* Abstand zwischen Käufer:in-Karte ("Artikel scannen") und "Artikel
   wählen" verkleinert (Wunsch vom 23.11.2026): die allgemeine Shop-Regel
   für <section> (css/style.css, auf dem Handy 64px oben und unten) griff
   auch beim Verkaufs-Panel. Den Abstand oben gibt jetzt allein die
   Überschrift "Artikel wählen" bzw. die Karte darüber (je 18px).
   Auch seitlich zurückgesetzt: vorher stand alles im Panel (Artikel,
   Warenkorb, Notizfeld) rund 18px eingerückt gegenüber der Käufer:in-
   Karte darüber - jetzt bündig, und das Notizfeld hat mehr Platz. */
#km-panel-kasse { padding: 0; }
