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

.km-app { min-height: 100vh; 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: 14px 18px 10px; 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-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: 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; }

.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 span:last-child { font-family: var(--font-heavy); color: var(--red); font-size: 1.1rem; }
.km-change-row span:last-child { color: #8A5A00; }

.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-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)); }
}
