/* ══ GLG Kiosk – Seiten ═══════════════════════════════════ */

.credits { margin-top: 28px; font-size: .85rem; color: var(--ink-mute); }
.credits a { color: var(--ink-soft); }
.page-narrow { max-width: 820px; }
.label { font-size: .9rem; font-weight: 600; color: var(--navy); }
.kpi-value--text { font-size: 1.55rem; overflow-wrap: anywhere; }

/* ── Terminal ─────────────────────────────────────── */
body[data-page="kiosk"] { padding-bottom: 0; }
.terminal {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 22px; max-width: 1280px; margin: 0 auto; padding: 22px 20px;
  min-height: calc(100vh - 62px);
}
.terminal-stock { display: flex; flex-direction: column; min-height: 0; }
.terminal-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 190px); }
.terminal-list .tbl td { padding: 14px 12px; font-size: 1.02rem; }
.terminal-pin {
  background: var(--brand); color: var(--on-brand); border-radius: var(--r-card);
  padding: 34px 28px 40px; display: flex; flex-direction: column; align-items: center; text-align: center;
  position: relative; overflow: hidden;
}
.terminal-pin::after { /* Markisen-Streifen als Abschluss oben */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 10px;
  background: repeating-linear-gradient(90deg, var(--red) 0 28px, var(--white) 28px 56px);
}
.terminal-pin h1 { color: var(--white); font-size: clamp(2.2rem, 4vw, 3.2rem); margin-top: 8px; }
.pin-lead { color: rgba(255,255,255,.75); margin-top: 6px; }
.pin-display { margin: 26px 0 18px; min-height: 64px; }
.pin-dots { display: flex; gap: 16px; justify-content: center; }
.pin-dot { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.55); transition: background .12s, border-color .12s, transform .12s; }
.pin-dot.filled { background: var(--white); border-color: var(--white); transform: scale(1.08); }
.pin-error { min-height: 1.4em; margin-top: 12px; font-weight: 600; color: #ffd2cd; }
.pin-display.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 330px); }
.key {
  aspect-ratio: 1.25; border-radius: 16px; border: none; cursor: pointer;
  background: var(--surface); color: var(--navy);
  font: 400 2rem/1 var(--font-display); touch-action: manipulation; user-select: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .06s, box-shadow .06s, background .1s;
  -webkit-tap-highlight-color: transparent;
}
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); background: var(--navy-50); }
.key-delete { background: rgba(255,255,255,.14); color: var(--white); box-shadow: none; font-family: var(--font-ui); font-size: 1.6rem; }
.key-delete:active { background: rgba(255,255,255,.24); }
.key-checking { display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; box-shadow: none; cursor: default; visibility: hidden; }
.key-checking.is-on { visibility: visible; }
.key-checking span { width: 9px; height: 9px; border-radius: 50%; background: var(--white); animation: blink 1s infinite; }
.key-checking span:nth-child(2) { animation-delay: .15s; }
.key-checking span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }

@media (max-width: 900px) {
  .terminal { grid-template-columns: 1fr; }
  .terminal-pin { order: -1; }
  .terminal-list { max-height: none; }
}

/* ── Einkaufen ────────────────────────────────────── */
.credit-chip { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 9px 16px; color: var(--ink-soft); }
.credit-chip strong { color: var(--navy); margin-left: 6px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.product {
  position: relative; display: grid; gap: 4px; align-content: start; text-align: left;
  min-height: 150px; padding: 18px; border-radius: var(--r-card); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--navy);
  font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, transform .08s, box-shadow .12s;
}
.product:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.product:active { transform: scale(.97); }
.product-name { font-weight: 600; font-size: 1.02rem; line-height: 1.3; padding-right: 36px; }
.product-price { font-family: var(--font-display); font-size: 1.9rem; margin-top: auto; padding-top: 14px; }
.product-stock { font-size: .83rem; color: var(--ink-mute); }
.product-stock.is-low { color: var(--red); font-weight: 600; }
.product-count {
  position: absolute; top: 12px; right: 12px; min-width: 34px; height: 34px; padding: 0 8px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--red); color: var(--on-brand); font-weight: 700; font-size: .9rem;
}
.product.is-hit { animation: hit .35s ease-out; }
.product.is-hit .product-count { animation: pop .35s ease-out; }
@keyframes hit { 40% { border-color: var(--red); box-shadow: 0 0 0 5px var(--red-50); } }
@keyframes pop { 40% { transform: scale(1.3); } }
.product.is-out { opacity: .45; cursor: not-allowed; }
.basket-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 20px; background: var(--surface); border-top: 1.5px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(23,50,99,.3); }
.basket-inner { max-width: calc(var(--wrap) - 40px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }

/* ── Bestellungen ─────────────────────────────────── */
.orders { display: grid; gap: 14px; margin-top: 18px; }
.order { position: relative; overflow: hidden; padding-left: 28px; }
.order::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--navy-100); }
.order.is-open::before { background: var(--red); }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.order-head .muted { font-size: .88rem; margin-top: 2px; }
.order-items { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.order-items li, .order-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.order-sum { margin: 0; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 4px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.order-sum dd { margin: 0; }
.order-total { color: var(--navy); font-weight: 700; font-size: 1.08rem; margin-top: 4px; }
.order-pay { margin-top: 16px; display: grid; gap: 14px; justify-items: start; }
.paypal-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: 100%; }
.paypal-qr a { display: block; }
.paypal-qr img { width: 260px; height: 260px; max-width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.order-pay .paypal-qr { justify-self: stretch; }
@media (max-width: 640px) { .paypal-qr img { width: 100%; height: auto; max-width: 320px; } }
.credit-form .segmented { justify-self: start; }

/* ── Balkenliste ──────────────────────────────────── */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; align-items: center; gap: 14px; }
.bars-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-track { height: 12px; background: var(--navy-50); border-radius: var(--r-pill); overflow: hidden; }
.bars-track span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.bars li:first-child .bars-track span { background: var(--red); }
.bars-val { font-variant-numeric: tabular-nums; color: var(--ink-soft); min-width: 3ch; text-align: right; }
.chart-box { position: relative; height: 280px; }

/* ── Guthaben ─────────────────────────────────────── */
.credit-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }
.credit-form { display: grid; gap: 20px; }
.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.chip-btn {
  min-height: 44px; padding: 8px 18px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--navy); font: 600 1rem var(--font-ui);
}
.chip-btn:hover { border-color: var(--navy); }
.chip-btn.is-on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

@media (max-width: 720px) {
  .credit-layout { grid-template-columns: 1fr; }
  .basket-bar { padding-right: 100px; }
  .bars li { grid-template-columns: 1fr auto; }
  .bars-track { grid-column: 1 / -1; order: 3; }
}

/* Terminal: rechte Spalte für Griesi freihalten, damit er nie Tasten verdeckt */
body[data-page="kiosk"] .appbar-inner { max-width: 1280px; }
body[data-page="kiosk"] .terminal { padding-right: 190px; max-width: 1450px; }
body[data-page="kiosk"] .appbar-inner { max-width: 1450px; padding-right: 190px; }
body[data-page="kiosk"] .griesi { right: 14px; }
/* Terminal: Blase über dem Kopf, Zipfel zeigt nach unten */
body[data-page="kiosk"] .griesi-bubble { right: 0; bottom: calc(100% + 12px); max-width: 170px; transform-origin: right bottom; }
body[data-page="kiosk"] .griesi-bubble::after { right: 40px; bottom: -9px; transform: rotate(135deg); }
body[data-page="kiosk"] .griesi-img { width: 120px; }
@media (max-width: 900px) {
  body[data-page="kiosk"] .terminal, body[data-page="kiosk"] .appbar-inner { padding-right: 20px; }
  body[data-page="kiosk"] .griesi-img { width: 70px; }
  body[data-page="kiosk"] .griesi-bubble { display: none; }
}
@media (max-width: 1400px) { .basket-bar { padding-right: 130px; } }
@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product { min-height: 128px; padding: 14px; }
  .product-name { font-size: .95rem; padding-right: 30px; }
  .product-price { font-size: 1.55rem; }
}

/* Angebote im Einkauf */
.product.is-sale { border-color: var(--red); background: var(--surface); }
.product-flag {
  justify-self: start; margin-top: 4px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--red); color: var(--on-brand); font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.product.is-sale .product-price { color: var(--red); }
.product-price s.was { font-family: var(--font-ui); font-size: .9rem; margin-left: 4px; }
@media (max-width: 640px) { .product-price s.was { display: block; margin: 2px 0 0; } }

/* Einkaufsleiste: Meldungen darüber anzeigen */
body.has-basket .toast-area { bottom: 92px; }
.basket-label { display: inline-block; margin-right: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--red-50); color: var(--red); font-size: .8rem; font-weight: 700; }

/* ══ Mobil: Seiten ═════════════════════════════════════ */
@media (max-width: 640px) {
  .basket-bar { padding: 10px 84px 10px 14px; }
  .basket-inner { max-width: none; gap: 8px; font-size: .92rem; }
  .basket-inner .btn { min-height: 40px; padding: 8px 14px; font-size: .88rem; }
  body.has-basket { padding-bottom: 150px; }
  body.has-basket .toast-area { bottom: 84px; }

  .order { padding-left: 20px; }
  .order-head { flex-wrap: wrap; }
  .order-head h3 { font-size: 1.2rem; }
  .order-pay { justify-items: stretch; }
  .order-pay .segmented { justify-self: start; }

  .credit-layout { gap: 12px; }
  .amount-chips { display: grid; grid-template-columns: repeat(4, 1fr); }
  .chip-btn { padding: 8px 0; }

  .terminal { padding: 14px; gap: 14px; min-height: 0; }
  .terminal-pin { padding: 26px 18px 24px; }
  .keypad { gap: 10px; }
  .key { font-size: 1.8rem; }
  .terminal-list .tbl td { padding: 11px 8px; font-size: .95rem; }

  .chart-box { height: 220px; }
  .credits { font-size: .8rem; }
}

/* ══ Einstellungen: Theme-Auswahl ═══════════════════════ */
.theme-form { display: grid; gap: 20px; justify-items: start; }
.theme-grid { border: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.theme-grid legend { margin-bottom: 10px; }
.theme-card {
  position: relative; display: grid; gap: 6px; padding: 12px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-card);
  font-weight: 400; transition: border-color .15s, transform .1s, box-shadow .15s;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-50); }
.theme-card:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.theme-preview { display: grid; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--mist); }
.tp-bar { height: 22px; background: var(--brand); }
.tp-body { display: grid; gap: 8px; padding: 10px; }
.tp-title { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--navy); }
.tp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp-card { height: 34px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.tp-card.tp-hero { background: var(--brand); border-color: var(--brand); }
.tp-btn { height: 16px; width: 60%; border-radius: 999px; background: var(--red); }
.theme-name { font-family: var(--font-display); font-size: 1.25rem; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.theme-desc { font-size: .85rem; color: var(--ink-soft); line-height: 1.4; }
@media (max-width: 640px) { .theme-grid { grid-template-columns: 1fr; } .theme-form .btn { width: 100%; } }

/* Angebote verändern die Kachelgröße nicht: Etikett sitzt auf der Kante, alle Kacheln gleich hoch */
.product-grid { grid-auto-rows: 1fr; }
.product { overflow: visible; }
.product-flag {
  position: absolute; top: -11px; left: 14px; margin: 0;
  box-shadow: 0 0 0 3px var(--mist);
}
.product-grid { padding-top: 10px; }

/* ══ Terminal schmal/hochkant/Handy: nur das Nummernfeld, groß ══ */
@media (max-width: 900px), (orientation: portrait) {
  body[data-page="kiosk"] .terminal-stock { display: none; }
  body[data-page="kiosk"] .terminal {
    grid-template-columns: 1fr; padding: 16px; max-width: none;
    min-height: calc(100dvh - 62px);
  }
  body[data-page="kiosk"] .appbar-inner { padding-right: 20px; max-width: none; }
  body[data-page="kiosk"] .terminal-pin {
    justify-content: center; padding: 32px 20px; min-height: 100%;
  }
  body[data-page="kiosk"] .terminal-pin h1 { font-size: clamp(2.4rem, 9vw, 4.2rem); }
  body[data-page="kiosk"] .pin-lead { font-size: clamp(1rem, 3.6vw, 1.35rem); }
  body[data-page="kiosk"] .pin-dots { gap: clamp(16px, 4.5vw, 30px); }
  body[data-page="kiosk"] .pin-dot { width: clamp(20px, 5vw, 34px); height: clamp(20px, 5vw, 34px); border-width: 3px; }
  body[data-page="kiosk"] .keypad { width: min(100%, 560px, 62dvh); gap: clamp(10px, 2.6vw, 18px); }
  body[data-page="kiosk"] .key { font-size: clamp(2rem, 8vw, 3.4rem); border-radius: clamp(14px, 3vw, 22px); }
  body[data-page="kiosk"] .key-delete { font-size: clamp(1.6rem, 6vw, 2.6rem); }
  body[data-page="kiosk"] .griesi { display: none; }
}
