/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 15px; color: #1a1a2e; background: #f5f5f5; min-height: 100vh; }

/* ── Layout ──────────────────────────────────────────────── */
.q-page { max-width: 480px; margin: 0 auto; padding: 0 0 100px; background: #fff; min-height: 100vh; position: relative; }
.q-header { background: #2E7D32; color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 10; }
.q-header-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.q-header-back { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }
.q-header-cart { background: rgba(255,255,255,.2); border: none; color: #fff; padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: .85rem; font-weight: 600; }

/* ── Loading / errors ────────────────────────────────────── */
.q-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: #888; gap: 12px; }
.q-spinner { width: 36px; height: 36px; border: 3px solid #eee; border-top-color: #2E7D32; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.q-error { text-align: center; padding: 40px 20px; }
.q-error-icon { font-size: 3rem; margin-bottom: 12px; }
.q-error-text { color: #888; }

/* ── Category chips ──────────────────────────────────────── */
.q-cats { display: flex; overflow-x: auto; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; scrollbar-width: none; }
.q-cats::-webkit-scrollbar { display: none; }
.q-cat-chip { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; font-size: .85rem; color: #555; transition: all .15s; }
.q-cat-chip.active { background: #2E7D32; color: #fff; border-color: #2E7D32; }

/* ── Products grid ───────────────────────────────────────── */
.q-products { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.q-product { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer; transition: transform .15s; }
.q-product:hover { transform: translateY(-2px); }
.q-product-img { width: 100%; height: 120px; object-fit: cover; display: block; }
.q-product-img-placeholder { width: 100%; height: 120px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.q-product-info { padding: 10px; }
.q-product-name { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.q-product-desc { font-size: .75rem; color: #888; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-product-price { font-weight: 700; color: #2E7D32; }
.q-product-add { background: #2E7D32; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 1.2rem; cursor: pointer; line-height: 28px; text-align: center; padding: 0; }
.q-product-add:hover { background: #1B5E20; }
.q-product-unavailable { opacity: .5; pointer-events: none; }

/* ── Cart page ───────────────────────────────────────────── */
.q-cart-items { padding: 12px; }
.q-cart-item { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.q-cart-item-info { flex: 1; }
.q-cart-item-name { font-weight: 600; font-size: .9rem; }
.q-cart-item-mods { font-size: .75rem; color: #888; margin-top: 2px; }
.q-cart-item-price { font-size: .8rem; color: #888; }
.q-qty { display: flex; align-items: center; gap: 8px; }
.q-qty-btn { background: none; border: 1px solid #e0e0e0; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; }
.q-qty-btn.danger { border-color: #F44336; color: #F44336; }
.q-cart-total { background: #fff; padding: 16px; border-top: 2px solid #f0f0f0; margin-top: 8px; }
.q-total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: .9rem; }
.q-total-row.grand { font-weight: 700; font-size: 1.1rem; border-top: 1px solid #e0e0e0; padding-top: 10px; margin-top: 6px; }
.q-checkout-btn { width: calc(100% - 24px); margin: 12px; padding: 16px; background: #2E7D32; color: #fff; border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.q-empty { text-align: center; padding: 60px 20px; color: #888; }
.q-empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Product configure — mobile-first (qcfg-) ──────────── */

/* Hero image */
.qcfg-hero {
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}
.qcfg-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product name + running price */
.qcfg-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.qcfg-product-name {
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
}
.qcfg-product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2E7D32;
    white-space: nowrap;
}

/* Modifier groups container */
.qcfg-groups {
    padding: 0 0 100px;
    display: flex;
    flex-direction: column;
}

/* Single modifier group */
.qcfg-group {
    border-bottom: 6px solid #f5f5f5;
}
.qcfg-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    background: #2E7D32;
    color: #fff;
}
.qcfg-group-name {
    font-size: .9rem;
    font-weight: 700;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.qcfg-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
}
.qcfg-badge-req { background: rgba(255,255,255,.25); color: #fff; }
.qcfg-badge-opt { background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }

/* Image tiles — 3 per row on mobile, touch-friendly */
.qcfg-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px 16px 16px;
}
.qcfg-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    position: relative;
    text-align: center;
    transition: border-color .12s, background .12s;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}
.qcfg-tile-sel { border-color: #2E7D32; background: #E8F5E9; }
.qcfg-tile img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}
.qcfg-tile-name {
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}
.qcfg-tile-price {
    font-size: .7rem;
    color: #2E7D32;
    font-weight: 600;
}
.qcfg-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: #2E7D32;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}

/* Chips — full-width column on mobile for large touch targets */
.qcfg-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px 16px;
}
.qcfg-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 400;
    background: #fff;
    color: #333;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}
.qcfg-chip-sel {
    border-color: #2E7D32;
    background: #E8F5E9;
    color: #1B5E20;
    font-weight: 500;
}
.qcfg-chip-check {
    font-size: .8rem;
    color: #2E7D32;
    flex-shrink: 0;
}
.qcfg-chip-price {
    margin-left: auto;
    font-size: .85em;
    color: #2E7D32;
    font-weight: 600;
    white-space: nowrap;
}

/* Validation error */
.qcfg-error {
    background: #FFEBEE;
    color: #C62828;
    padding: 12px 16px;
    margin: 0 16px 12px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
}

/* Sticky footer */
.qcfg-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -4px 12px rgba(0,0,0,.06);
    z-index: 5;
}
.qcfg-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}
.qcfg-qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.qcfg-qty-val {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}
.qcfg-add-btn {
    flex: 1;
    padding: 16px;
    background: #2E7D32;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}
.qcfg-add-btn:disabled { background: #9E9E9E; cursor: default; }

/* ── Payment page ────────────────────────────────────────── */
.q-payment { padding: 24px; text-align: center; }
.q-payment-amount { font-size: 2.5rem; font-weight: 700; color: #2E7D32; margin: 16px 0; }
.q-payment-label { color: #888; margin-bottom: 24px; }
.q-pay-btn { width: 100%; padding: 18px; background: #2E7D32; color: #fff; border: none; border-radius: 12px; font-size: 1.2rem; font-weight: 700; cursor: pointer; margin-bottom: 12px; }
.q-sim-btn { width: 100%; padding: 12px; background: #fff; color: #2E7D32; border: 2px solid #2E7D32; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; }

/* ── Confirmation page ───────────────────────────────────── */
.q-confirm { padding: 40px 24px; text-align: center; }
.q-confirm-icon { font-size: 5rem; margin-bottom: 16px; }
.q-confirm-title { font-size: 1.8rem; font-weight: 700; color: #2E7D32; margin-bottom: 8px; }
.q-confirm-sub { color: #888; margin-bottom: 24px; }
.q-confirm-num { font-size: 3rem; font-weight: 900; color: #1a1a2e; margin: 20px 0; }
.q-confirm-btn { padding: 14px 32px; background: #2E7D32; color: #fff; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; }

/* ── Powered by ──────────────────────────────────────────── */
.q-powered { text-align: center; padding: 14px 16px 18px; font-size: .78rem; color: #999; }
.q-powered a { color: #999; text-decoration: none; }
.q-powered a:active { color: #555; }

/* ── Added to the basket: a copy of the picture flies into the button ── */
.q-fly {
    position: fixed; z-index: 100; pointer-events: none;
    object-fit: cover; border-radius: 12px; opacity: .95;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .6s ease-in;
    will-change: transform, opacity;
}
.q-header-cart.q-bump { animation: q-bump .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes q-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); background: #F5A623; color: #1A1A1A; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .q-fly { transition: none; } .q-header-cart.q-bump { animation: none; } }

.q-checkout-error { margin: 0 12px 12px; padding: 10px 12px; border-radius: 8px; background: #FFEBEE; color: #C62828; font-size: .9rem; }

/* ── Language flags, as on the kiosk ── */
.q-lang { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.q-lang-btn { display: flex; align-items: center; gap: .45em; padding: 10px 16px; border-radius: 10px; border: 2px solid #e0e0e0; background: #fff; color: #333; font-size: .95rem; font-weight: 600; cursor: pointer; min-height: 44px; }
.q-lang-btn.active { background: #2E7D32; border-color: #2E7D32; color: #fff; }
.q-flag { width: 1.5em; height: 1em; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.q-lang-compact { gap: 4px; }
.q-lang-compact .q-lang-btn { padding: 4px 6px; min-height: 0; border-width: 1px; border-color: transparent; background: transparent; opacity: .6; }
.q-lang-compact .q-lang-btn.active { opacity: 1; background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.6); }
.q-lang-compact .q-flag { width: 1.7em; height: 1.15em; }

/* ── Payment: the way back to the basket ── */
.q-back-to-order { display: block; width: 100%; margin-top: 20px; padding: 14px; background: none; border: 2px solid #e0e0e0; border-radius: 12px; color: #444; font-size: 1rem; font-weight: 600; cursor: pointer; }
.q-back-to-order:disabled { opacity: .5; }

/* ── Paying at the counter: the number is the message ── */
.q-counter-btn { display: block; width: 100%; margin-top: 16px; padding: 16px; background: #fff; border: 2px solid #2E7D32; border-radius: 12px; color: #2E7D32; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.q-counter { margin-top: 8px; }
.q-counter-say { font-size: 1rem; color: #444; font-weight: 600; }
.q-counter-number { font-size: 4.2rem; font-weight: 800; letter-spacing: .06em; color: #1A1A1A; line-height: 1.1; margin: 10px 0; }
.q-counter-hint { color: #666; font-size: .9rem; max-width: 32ch; margin: 0 auto; }
.q-header-flag { width: 1.6em; height: 1.1em; vertical-align: -0.15em; margin-right: .4em; }
