/* =====================================================================
   Haspel-Kasse – Stylesheet
   Keine externen Bibliotheken, damit die Kasse auch ohne Internet
   im Gerätebrowser sauber aussieht.
   ===================================================================== */

:root {
    --papier:      #f2f6fa;
    --karte:       #ffffff;
    --tinte:       #16212b;
    --tinte-hell:  #5b6b7a;
    --rand:        #dce5ed;
    --rot:         #d7263d;
    --rot-dunkel:  #a81c2e;
    --rot-hauch:   #fdecee;
    --blau:        #12628f;
    --blau-hauch:  #e7f1f8;
    --gruen:       #167d4b;
    --gruen-hauch: #e6f4ec;
    --gelb-hauch:  #fdf4e0;

    --radius:      18px;
    --radius-s:    12px;
    --schatten:    0 2px 4px rgba(22, 33, 43, .06), 0 8px 24px rgba(22, 33, 43, .08);
    --schatten-xl: 0 12px 40px rgba(22, 33, 43, .18);
    --tempo:       .22s cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--papier);
    color: var(--tinte);
    font-size: 17px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
p  { margin: 0 0 1em; }
a  { color: var(--blau); }

:focus-visible {
    outline: 3px solid var(--blau);
    outline-offset: 2px;
}

/* --- Grundbausteine ------------------------------------------------- */

.huelle {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    font: inherit;
    font-weight: 600;
    padding: 14px 22px;
    min-height: 52px;
    border: 1px solid transparent;
    border-radius: var(--radius-s);
    background: var(--karte);
    color: var(--tinte);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--tempo), box-shadow var(--tempo), background var(--tempo);
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--schatten); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primaer { background: var(--rot); color: #fff; }
.btn-primaer:hover { background: var(--rot-dunkel); }
.btn-blau    { background: var(--blau); color: #fff; }
.btn-still   { border-color: var(--rand); }
.btn-gross   { width: 100%; font-size: 1.15rem; min-height: 64px; }
.btn-klein   { min-height: 40px; padding: 8px 14px; font-size: .92rem; }
.btn-gefahr  { background: var(--rot-hauch); color: var(--rot-dunkel); border-color: #f3c3c9; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }

input[type=text], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
    width: 100%;
    font: inherit;
    padding: 13px 14px;
    border: 1px solid var(--rand);
    border-radius: var(--radius-s);
    background: #fff;
    color: var(--tinte);
    transition: border-color var(--tempo), box-shadow var(--tempo);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--blau);
    box-shadow: 0 0 0 4px var(--blau-hauch);
    outline: none;
}

.feld { margin-bottom: 16px; }
.hilfe { font-size: .85rem; color: var(--tinte-hell); margin-top: 4px; }

.meldung {
    padding: 14px 16px;
    border-radius: var(--radius-s);
    margin-bottom: 16px;
    font-weight: 500;
}
.meldung-ok      { background: var(--gruen-hauch); color: var(--gruen); }
.meldung-fehler  { background: var(--rot-hauch);   color: var(--rot-dunkel); }
.meldung-hinweis { background: var(--gelb-hauch);  color: #8a5b00; }

.marke {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}
.marke-bar    { background: var(--gruen-hauch); color: var(--gruen); }
.marke-paypal { background: var(--blau-hauch);  color: var(--blau); }
.marke-aktiv  { background: var(--gruen-hauch); color: var(--gruen); }
.marke-aus    { background: #eef1f4; color: var(--tinte-hell); }
.marke-storno { background: var(--rot-hauch); color: var(--rot-dunkel); }

/* =====================================================================
   Terminal
   ===================================================================== */

.kopf {
    background: var(--karte);
    border-bottom: 1px solid var(--rand);
    position: sticky;
    top: 0;
    z-index: 20;
}
.kopf-inhalt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    max-width: 1180px;
    margin: 0 auto;
}
.kopf-titel { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.kopf-titel span { color: var(--rot); }
.kopf-person { font-size: .95rem; color: var(--tinte-hell); }

/* Seitenwechsel mit weicher Animation */
.seite { display: none; }
.seite.aktiv {
    display: block;
    animation: einblenden .32s cubic-bezier(.2, .7, .3, 1);
}
@keyframes einblenden {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* --- Startbildschirm ------------------------------------------------ */
.start {
    min-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}
.start-karte {
    width: 100%;
    max-width: 460px;
    padding: 32px;
}
.start-karte h1 { font-size: 1.7rem; }
.start-karte .vorspann { color: var(--tinte-hell); margin-bottom: 24px; }

/* --- Getränkeraster ------------------------------------------------- */
.raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    padding: 22px 0 160px;
}

.getraenk {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--tempo), box-shadow var(--tempo);
}
.getraenk:hover { transform: translateY(-3px); box-shadow: var(--schatten-xl); }
.getraenk.bestaetigt { animation: puls .45s ease; }
@keyframes puls {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.035); box-shadow: 0 0 0 4px var(--gruen-hauch); }
    100% { transform: scale(1); }
}

.getraenk-bild {
    height: 150px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--rand);
}
.getraenk-bild img { max-height: 130px; max-width: 80%; object-fit: contain; }

.getraenk-inhalt { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.getraenk-name { font-weight: 700; font-size: 1.08rem; }
.getraenk-kategorie { font-size: .8rem; color: var(--tinte-hell); text-transform: uppercase; letter-spacing: .06em; }
.getraenk-preis { font-size: 1.25rem; font-weight: 800; color: var(--rot); }

.mengenwahl {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--rand);
    border-radius: var(--radius-s);
    overflow: hidden;
}
.mengenwahl button {
    width: 52px;
    height: 48px;
    font-size: 1.5rem;
    font-weight: 700;
    border: 0;
    background: #f7fafc;
    color: var(--tinte);
    cursor: pointer;
    transition: background var(--tempo);
}
.mengenwahl button:hover  { background: var(--rot-hauch); color: var(--rot-dunkel); }
.mengenwahl button:active { transform: scale(.94); }
.mengenwahl .menge { font-weight: 800; font-size: 1.15rem; min-width: 40px; text-align: center; }

.leerhinweis {
    padding: 60px 20px;
    text-align: center;
    color: var(--tinte-hell);
}

/* --- Warenkorbleiste ------------------------------------------------ */
.korbleiste {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    background: var(--karte);
    border-top: 1px solid var(--rand);
    box-shadow: 0 -6px 24px rgba(22, 33, 43, .1);
    transform: translateY(110%);
    transition: transform var(--tempo);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.korbleiste.sichtbar { transform: none; }
.korbleiste-inhalt {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.korbleiste-info { flex: 1; }
.korbleiste-info .zeile1 { font-size: .9rem; color: var(--tinte-hell); }
.korbleiste-info .zeile2 { font-size: 1.4rem; font-weight: 800; }

/* --- Warenkorb (Schublade) ------------------------------------------ */
.schleier {
    position: fixed;
    inset: 0;
    background: rgba(22, 33, 43, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--tempo);
    z-index: 40;
}
.schleier.sichtbar { opacity: 1; pointer-events: auto; }

.schublade {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: var(--papier);
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2, .7, .3, 1);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.schublade.offen { transform: none; }
.schublade-inner { max-width: 720px; margin: 0 auto; padding: 20px 16px; }

.schublade-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.schliessen {
    border: 0;
    background: #eef2f6;
    width: 42px; height: 42px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.korbzeile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius-s);
    margin-bottom: 10px;
    animation: einblenden .25s ease;
}
.korbzeile.geht { animation: ausblenden .25s ease forwards; }
@keyframes ausblenden {
    to { opacity: 0; transform: translateX(24px); height: 0; margin: 0; padding: 0; }
}
.korbzeile img { width: 52px; height: 52px; object-fit: contain; }
.korbzeile-text { flex: 1; min-width: 0; }
.korbzeile-name { font-weight: 700; }
.korbzeile-preis { font-size: .88rem; color: var(--tinte-hell); }
.korbzeile-summe { font-weight: 800; white-space: nowrap; }
.korbzeile .mengenwahl button { width: 40px; height: 38px; font-size: 1.2rem; }
.entfernen {
    border: 0; background: none; cursor: pointer;
    color: var(--tinte-hell); font-size: 1.2rem; padding: 6px;
}
.entfernen:hover { color: var(--rot); }

.summenzeile {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 12px;
    font-size: 1.35rem;
    font-weight: 800;
    border-top: 2px solid var(--tinte);
    margin-top: 8px;
}

/* --- Zahlungsarten -------------------------------------------------- */
.zahlwahl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}
.zahlkachel {
    background: var(--karte);
    border: 2px solid var(--rand);
    border-radius: var(--radius);
    padding: 22px 14px;
    text-align: center;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform var(--tempo), border-color var(--tempo),
                box-shadow var(--tempo), background var(--tempo);
}
.zahlkachel .symbol { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.zahlkachel .beschriftung { font-weight: 700; }
.zahlkachel:hover { transform: translateY(-2px); box-shadow: var(--schatten); }
.zahlkachel[aria-pressed="true"] {
    border-color: var(--rot);
    background: var(--rot-hauch);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(215, 38, 61, .22);
}
.zahlkachel .paypal-wort { font-size: 1.6rem; font-weight: 800; color: #003087; letter-spacing: -.02em; }
.zahlkachel .paypal-wort em { color: #009cde; font-style: normal; }

/* --- Fester PayPal-QR-Code ------------------------------------------ */
.qr-block {
    background: var(--karte);
    border: 2px solid var(--blau);
    border-radius: var(--radius);
    padding: 20px 18px;
    margin: 4px 0 18px;
    text-align: center;
    animation: einblenden .3s cubic-bezier(.2, .7, .3, 1);
}

.qr-bild {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid var(--rand);
}
.qr-gross .qr-bild { max-width: 280px; }

.qr-empfaenger {
    font-weight: 700;
    margin-top: 10px;
}

.qr-betrag {
    margin-top: 14px;
    padding: 14px;
    background: var(--blau-hauch);
    border-radius: var(--radius-s);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.qr-betrag span   { font-size: .9rem; color: var(--blau); font-weight: 600;
                    text-transform: uppercase; letter-spacing: .08em; }
.qr-betrag strong { font-size: 2.1rem; line-height: 1.1; color: var(--tinte); }

.qr-verwendung {
    margin-top: 10px;
    font-size: .9rem;
    color: var(--tinte-hell);
    word-break: break-word;
}

.qr-hinweis {
    margin: 12px 0 0;
    font-size: .92rem;
    color: var(--tinte-hell);
}

/* --- Erfolgsseite --------------------------------------------------- */
.erfolg {
    min-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 0;
}
.erfolg-karte { max-width: 520px; width: 100%; padding: 36px 28px; }
.haken {
    width: 96px; height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--gruen-hauch);
    color: var(--gruen);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    animation: hakenrein .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes hakenrein {
    from { transform: scale(.4); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
.belegnr {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 10px 14px;
    display: inline-block;
    margin-bottom: 20px;
}

/* --- Toast ---------------------------------------------------------- */
.toast-bereich {
    position: fixed;
    top: 76px; left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--tinte);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--schatten-xl);
    animation: toastrein .25s ease, toastraus .3s ease 2.2s forwards;
    white-space: nowrap;
}
.toast.fehler { background: var(--rot-dunkel); }
@keyframes toastrein  { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastraus  { to   { opacity: 0; transform: translateY(-12px); } }

/* =====================================================================
   Adminbereich
   ===================================================================== */

.admin-kopf {
    background: var(--tinte);
    color: #fff;
    padding: 12px 0;
}
.admin-kopf a { color: #cfe0ec; text-decoration: none; }
.admin-kopf-inhalt {
    max-width: 1180px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.admin-marke { font-weight: 800; color: #fff; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-nav a {
    padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem;
    transition: background var(--tempo);
}
.admin-nav a:hover  { background: rgba(255, 255, 255, .12); }
.admin-nav a.hier   { background: var(--rot); color: #fff; }

.admin-inhalt { padding: 26px 0 60px; }
.abschnitt { margin-bottom: 26px; padding: 22px; }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kennzahl { padding: 18px; }
.kennzahl .wert { font-size: 1.8rem; font-weight: 800; }
.kennzahl .titel { color: var(--tinte-hell); font-size: .9rem; }

.tabellen-huelle { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.liste th, table.liste td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--rand);
    white-space: nowrap;
}
table.liste th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tinte-hell); }
table.liste tr:hover td { background: #f8fbfd; }
table.liste td.rechts, table.liste th.rechts { text-align: right; }

.filterreihe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

.aktionen { display: flex; gap: 6px; flex-wrap: wrap; }

.bildfeld {
    border: 2px dashed var(--rand);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--tempo), background var(--tempo);
}
.bildfeld.drueber { border-color: var(--rot); background: var(--rot-hauch); }
.bildfeld img { max-height: 150px; margin-top: 12px; }

.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =====================================================================
   Beleg (Bildschirm + Druck)
   ===================================================================== */

.beleg {
    background: #fff;
    max-width: 400px;
    margin: 24px auto;
    padding: 26px 24px;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
}
.beleg-kopf { text-align: center; margin-bottom: 14px; }
.beleg-kopf .name { font-weight: 800; font-size: 1rem; font-family: system-ui, sans-serif; }
.beleg-trenner { border-top: 1px dashed #9aa8b4; margin: 12px 0; }
.beleg-zeile { display: flex; justify-content: space-between; gap: 12px; }
.beleg-position { margin-bottom: 6px; }
.beleg-summe { font-size: 1.15rem; font-weight: 800; }
.beleg-fuss { text-align: center; margin-top: 16px; font-size: 12px; color: var(--tinte-hell); }
.beleg-storno-hinweis {
    background: var(--rot-hauch); color: var(--rot-dunkel);
    padding: 8px; text-align: center; border-radius: 8px; font-weight: 700;
}

@media print {
    body { background: #fff; }
    .kopf, .admin-kopf, .nicht-drucken, .korbleiste { display: none !important; }
    .beleg {
        border: 0; box-shadow: none; margin: 0 auto 24px;
        page-break-inside: avoid; break-inside: avoid;
    }
    .beleg + .beleg { page-break-before: always; }
}

/* --- Kleine Bildschirme --------------------------------------------- */
@media (max-width: 560px) {
    body { font-size: 16px; }
    .raster { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .getraenk-bild { height: 110px; }
    .getraenk-bild img { max-height: 95px; }
    .zwei-spalten { grid-template-columns: 1fr; }
    .start-karte { padding: 24px 20px; }
}

/* --- Rücksicht auf reduzierte Bewegung ------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
