/* ============================================================
   denschOrder Customer-Frontend
   Mobile-first · Touch-optimiert · Brand-Akzent vom Restaurant
   ============================================================ */

* { box-sizing: border-box; }

:root {
    --bg-page: #fafafa;
    --bg-card: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text: #1d1d1f;
    --text-soft: #6b7280;
    --text-muted: #aeaeb2;
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
}
html[data-mode="dark"] {
    --bg-page: #0D0D0D;
    --bg-card: #1C1C1E;
    --border: rgba(255,255,255,0.08);
    --text: #F0F0F0;
    --text-soft: #8E8E93;
    --text-muted: #636366;
    --shadow: 0 4px 16px rgba(0,0,0,0.4);
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); }

img, svg { max-width: 100%; height: auto; }

.cust-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Nav ──────────────────────────────────────────────── */
.cust-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.cust-back {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
}
.cust-back:hover { background: var(--bg-page); color: var(--accent); }
.cust-restaurant {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-align: center;
    font-size: 15px;
    color: var(--text);
}
.cust-restaurant-logo {
    height: 32px; width: 32px;
    object-fit: contain;
    border-radius: 6px;
}
.cust-cart-icon {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px 6px 8px;
    text-decoration: none;
    border-radius: 12px;
    color: var(--text);
    transition: background 0.15s, transform 0.2s;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
}
.cust-cart-icon:hover { background: var(--bg-page); }
.cust-cart-icon.has-items {
    background: var(--accent);
    color: #fff;
}
.cust-cart-icon.has-items:hover { filter: brightness(1.08); }
.cust-cart-emoji { font-size: 20px; line-height: 1; }
.cust-cart-meta {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 1px;
    font-feature-settings: 'tnum';
}
.cust-cart-meta[hidden] { display: none; }
.cust-cart-count { font-size: 11px; opacity: 0.85; line-height: 1.1; }
.cust-cart-count::before { content: ''; }
.cust-cart-count::after { content: ' Stk'; opacity: 0.7; }
.cust-cart-sum { font-size: 13px; font-weight: 700; }
.cust-cart-bump { animation: cartBump 0.4s ease; }
@keyframes cartBump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Toast */
.cust-toast {
    position: fixed;
    top: 76px; left: 50%;
    transform: translate(-50%, -20px);
    background: #16A34A;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(22,163,74,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
    max-width: calc(100vw - 32px);
}
.cust-toast.cust-toast-error { background: #DC2626; box-shadow: 0 10px 30px rgba(220,38,38,0.35); }
.cust-toast.cust-toast-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Quick-Add-Button im Produkt-Liste-Card */
.cust-prod-card.cust-prod-quick {
    cursor: pointer;
    border: 0;
    background: var(--card-bg, #fff);
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.cust-prod-card.cust-prod-quick:hover { transform: translateY(-1px); }
.cust-prod-card.cust-prod-quick:active { transform: scale(0.98); }
.cust-prod-quick-plus {
    position: absolute;
    top: 50%; right: 14px;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.cust-prod-card.cust-prod-quick:hover .cust-prod-quick-plus { transform: translateY(-50%) scale(1.08); }
.cust-prod-card.is-loading .cust-prod-quick-plus { opacity: 0.5; }

.cust-main {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    padding: 16px;
}

.cust-foot {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 11px;
}

/* ── Page-Header ──────────────────────────────────────── */
.cust-page-h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 8px 0 6px;
    letter-spacing: -0.01em;
}
.cust-page-sub {
    color: var(--text-soft);
    font-size: 14px;
    margin: 0 0 18px;
}

/* ── Cards ────────────────────────────────────────────── */
.cust-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

/* ── Marken-Grid (Foodhall Picker) — quadratische Cards ─────── */
.cust-marken-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}
.cust-marke-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-top: 6px solid var(--m-color, var(--accent));
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    padding: 14px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cust-marke-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.cust-marke-logo {
    width: 60%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}
.cust-marke-icon {
    font-size: 44px;
    line-height: 1;
}
.cust-marke-name {
    font-weight: 700;
    color: var(--m-color, var(--accent));
    font-size: 16px;
    line-height: 1.2;
}
.cust-marke-desc {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.3;
}

/* ── Produkt-Liste ────────────────────────────────────── */
.cust-prod-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cust-prod-card {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.12s, box-shadow 0.15s, border-color 0.12s;
}
.cust-prod-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.cust-prod-img {
    width: 80px; height: 80px;
    background: var(--accent-tint);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 38px;
    flex-shrink: 0;
    overflow: hidden;
}
.cust-prod-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.cust-prod-img-fallback { line-height: 1; }
.cust-prod-info { flex: 1; min-width: 0; }
.cust-prod-name { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.cust-prod-desc { color: var(--text-soft); font-size: 13px; line-height: 1.4; }
.cust-prod-price { color: var(--accent); font-weight: 800; font-size: 16px; margin-top: 6px; }
.cust-prod-out { color: var(--text-muted); font-size: 12px; }

/* ── Konfigurator ────────────────────────────────────── */
.cust-konfig-hero {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.cust-konfig-img {
    width: 160px; height: 160px;
    background: var(--accent-tint);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 80px;
    margin: 0 auto 12px;
    overflow: hidden;
}
.cust-konfig-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.cust-konfig-title { text-align: center; font-size: 22px; font-weight: 800; }
.cust-konfig-sub { text-align: center; color: var(--text-soft); font-size: 14px; margin: 4px 0 0; }

.cust-konfig-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}
.cust-konfig-step-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px;
}
.cust-konfig-step-name { font-weight: 700; font-size: 16px; }
.cust-konfig-step-flag {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.cust-konfig-step-flag.optional { color: var(--text-muted); }

.cust-konfig-options {
    display: flex; flex-direction: column; gap: 8px;
}
.cust-konfig-opt {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-page);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.cust-konfig-opt:hover { border-color: var(--accent); }
.cust-konfig-opt.selected { background: var(--accent-tint); border-color: var(--accent); }
.cust-konfig-opt-input { display: none; }
.cust-konfig-opt-name { font-weight: 600; font-size: 14px; }
.cust-konfig-opt-flags {
    display: inline-flex; gap: 4px; margin-left: 6px;
}
.cust-konfig-opt-flag {
    font-size: 10px;
    background: var(--accent-tint);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 980px;
    font-weight: 600;
}
.cust-konfig-opt-delta {
    font-weight: 600;
    color: var(--accent);
    font-size: 13px;
    white-space: nowrap;
}
.cust-konfig-opt.selected .cust-konfig-opt-delta { color: var(--accent); }
.cust-konfig-allergene {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.cust-konfig-cta {
    position: sticky;
    bottom: 12px;
    z-index: 10;
    margin-top: 18px;
}
.cust-konfig-add {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 14px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: filter 0.15s, transform 0.1s;
}
.cust-konfig-add:hover { filter: brightness(1.08); }
.cust-konfig-add:active { transform: scale(0.98); }
.cust-konfig-add[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.cust-konfig-add-price { display: inline-block; margin-left: 8px; opacity: 0.9; }

.cust-qty {
    display: flex; align-items: center; gap: 14px;
    justify-content: center;
    margin: 14px 0;
    font-size: 18px; font-weight: 700;
}
.cust-qty-btn {
    width: 40px; height: 40px;
    background: var(--bg-page);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 20px; font-weight: 700;
    cursor: pointer;
    color: var(--text);
}
.cust-qty-btn:hover { border-color: var(--accent); color: var(--accent); }

.cust-notiz {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    min-height: 60px;
}

/* ── Warenkorb ────────────────────────────────────────── */
.cust-cart-item {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cust-cart-item:last-child { border-bottom: 0; }
.cust-cart-qty-badge {
    width: 32px; height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.cust-cart-info { flex: 1; min-width: 0; }
.cust-cart-name { font-weight: 700; font-size: 15px; }
.cust-cart-konfig {
    color: var(--text-soft);
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.4;
}
.cust-cart-marke {
    display: inline-block;
    font-size: 10px;
    background: var(--accent-tint);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 980px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-weight: 700;
}
.cust-cart-price { font-weight: 700; font-size: 15px; color: var(--accent); }
.cust-cart-remove {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
}
.cust-cart-remove:hover { color: #DC2626; }
.cust-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}
.cust-cart-empty-icon { font-size: 56px; margin-bottom: 14px; }

.cust-cart-total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}
.cust-cart-total-label { font-size: 14px; color: var(--text-soft); }
.cust-cart-total-value { font-size: 24px; font-weight: 800; color: var(--accent); }

/* ── Buttons (universal) ─────────────────────────────── */
.cust-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 14px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: block;
    transition: filter 0.15s, transform 0.1s;
}
.cust-btn:hover { filter: brightness(1.08); color: #fff; }
.cust-btn:active { transform: scale(0.98); }
.cust-btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}
.cust-btn-secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--bg-card); }
.cust-btn-block + .cust-btn-block { margin-top: 8px; }

/* ── Checkout ─────────────────────────────────────────── */
.cust-modus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.cust-modus-tile {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.cust-modus-tile.selected {
    background: var(--accent-tint);
    border-color: var(--accent);
}
.cust-modus-emoji { font-size: 28px; margin-bottom: 4px; }
.cust-modus-label { font-weight: 600; font-size: 13px; }

.cust-form input, .cust-form select, .cust-form textarea {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    margin-bottom: 10px;
}
.cust-form input:focus, .cust-form select:focus, .cust-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.cust-form label {
    font-size: 12px; font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    display: block;
}

/* ── Tracking ─────────────────────────────────────────── */
.cust-track-num-label { font-size: 12px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.1em; text-align: center; }
.cust-track-num {
    text-align: center;
    font-size: 64px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -0.04em;
    line-height: 1;
    font-feature-settings: 'tnum';
    margin: 8px 0 4px;
}
.cust-track-status { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.cust-track-bar {
    height: 8px;
    background: var(--bg-page);
    border-radius: 980px;
    overflow: hidden;
    margin-bottom: 8px;
}
.cust-track-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent));
    border-radius: 980px;
    transition: width 0.4s;
}
.cust-track-eta { text-align: center; color: var(--text-soft); font-size: 13px; }
.cust-track-steps {
    display: flex; flex-direction: column; gap: 6px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}
.cust-track-step {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-soft);
    font-size: 14px;
    padding: 4px 0;
}
.cust-track-step.done { color: var(--text); opacity: 0.75; }
.cust-track-step.active { color: var(--accent); font-weight: 700; }
html[data-mode="dark"] .cust-track-step { color: rgba(240,240,240,0.55); }
html[data-mode="dark"] .cust-track-step.done { color: rgba(240,240,240,0.85); opacity: 1; }

/* ── Filiale-Pill / Kontext-Banner ─────────────────────── */
.cust-context {
    background: var(--accent-tint);
    color: var(--accent);
    border-radius: 980px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Terminal-Modus (Big Buttons, Self-Order-Terminal) ── */
body.cust-terminal {
    background: #000;
    color: #fff;
}
body.cust-terminal .cust-card,
body.cust-terminal .cust-marke-card,
body.cust-terminal .cust-prod-card,
body.cust-terminal .cust-konfig-step,
body.cust-terminal .cust-konfig-hero {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.10);
    color: #fff;
}
body.cust-terminal .cust-page-h1 { font-size: 36px; }
body.cust-terminal .cust-prod-name { font-size: 20px; }

/* Terminal: gleiche quadratische Marken-Cards, nur größer (skalieren mit grid-min) */
body.cust-terminal .cust-marken-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
body.cust-terminal .cust-marke-icon { font-size: 56px; }
body.cust-terminal .cust-marke-name { font-size: 20px; }
body.cust-terminal .cust-marke-desc { font-size: 14px; }
body.cust-terminal .cust-prod-img { width: 120px; height: 120px; font-size: 56px; }
body.cust-terminal .cust-konfig-opt { padding: 18px 20px; font-size: 18px; }
body.cust-terminal .cust-btn, body.cust-terminal .cust-konfig-add { padding: 22px 28px; font-size: 20px; }
body.cust-terminal .cust-marke-card { padding: 36px 20px; }
body.cust-terminal .cust-marke-icon { font-size: 56px; }
