/*
  Lara storefront. One engine, themed by tokens: a template sets the tokens and a few layout rules under
  body[data-template=...]; the shop's own colours arrive as --shop-primary / --shop-accent from /theme.css.
  Mobile first; no web fonts (system stack) and no framework, so pages stay small and fast.
*/

:root {
    --shop-primary: #E63946;
    --shop-accent: #FFB703;
    --ink: #1b1d22;
    --ink-soft: #5b6070;
    --paper: #ffffff;
    --surface: #f5f5f7;
    --line: #e3e4e8;
    --ok: #1e7d4f;
    --warn: #8a5a00;
    --danger: #b3261e;
    --radius: 14px;
    --radius-small: 8px;
    --shadow: 0 6px 20px rgb(0 0 0 / 0.08);
    --gap: 16px;
    --tile-min: 150px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---- Fast: fast food and takeaway. Bold tiles, round buttons, the brand colour everywhere. ---- */
body[data-template="fast"] {
    --radius: 18px;
    --tile-min: 160px;
    --surface: #fff7ef;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--surface);
    padding-bottom: 88px; /* room for the sticky cart */
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 800; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; border-radius: var(--radius-small); }
.skip-link:focus { left: 8px; }

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

/* ---- Buttons (touch targets at least 48px) ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
    transition: transform .15s var(--ease), background-color .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--shop-primary); color: #fff; }
.btn-quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn-wide { width: 100%; }
.btn-add {
    min-width: 48px; padding: 0 16px; background: var(--shop-primary); color: #fff; font-size: 1.25rem;
}
.btn-step { min-width: 44px; min-height: 44px; padding: 0; background: var(--paper); border: 1px solid var(--line); font-size: 1.2rem; }

/* ---- Header ---- */
.shop-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; background: var(--shop-primary); color: #fff;
}
.shop-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.shop-brand img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; }
.shop-search { flex: 1 1 160px; }
.shop-search input, .search-page input {
    width: 100%; min-height: 44px; border-radius: 999px; border: 0; padding: 0 16px; font: inherit;
}
.shop-languages { display: flex; gap: 4px; }
.shop-languages a {
    min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; font-weight: 700; border-radius: 999px; opacity: .8;
}
.shop-languages a[aria-current="true"] { background: rgb(255 255 255 / .2); opacity: 1; }

.shop-branch { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shop-branch select { min-height: 44px; border-radius: var(--radius-small); border: 1px solid var(--line); padding: 0 10px; font: inherit; }

.shop-main { max-width: 1100px; margin: 0 auto; padding: 16px; }

.shop-footer { display: flex; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 24px auto; padding: 0 16px; color: var(--ink-soft); font-size: .9rem; }

/* ---- Home ---- */
.hero {
    background: var(--paper); border-radius: var(--radius); padding: 20px; margin-bottom: var(--gap);
    box-shadow: var(--shadow); border-left: 8px solid var(--shop-accent);
}
.hero-tagline { color: var(--ink-soft); margin: 0 0 8px; }
.hero-pickup { margin: 0; font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--shop-accent); color: var(--ink); font-size: .8rem; font-weight: 800; }
.badge-warn { background: #fff1c2; color: var(--warn); }

.last-order { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--paper); border-radius: var(--radius); padding: 14px 18px; margin-bottom: var(--gap); }
.last-order h2 { margin: 0; font-size: 1.05rem; }
.last-order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chip {
    flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px;
    background: var(--paper); border: 2px solid var(--shop-primary); color: var(--ink); font-weight: 700; text-decoration: none;
}
.category { margin-bottom: 28px; scroll-margin-top: 80px; }

/* ---- Tiles: big pictures, the price and one tap to add ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: var(--gap); }
.tile {
    display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .2s var(--ease);
}
.tile:hover { transform: translateY(-2px); }
.tile-link { text-decoration: none; display: block; flex: 1; }
.tile-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.tile-name { font-size: 1.05rem; margin: 10px 12px 4px; }
.tile-description { margin: 0 12px; color: var(--ink-soft); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; }
.tile-price { font-weight: 800; font-size: 1.1rem; }
.tile-price small { font-weight: 600; color: var(--ink-soft); margin-right: 4px; }
.tile.added .btn-add { animation: pop .5s var(--ease); }

/* ---- Sticky cart ---- */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.cart-bar[hidden] { display: none; }
.cart-bar-link {
    max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px;
    background: var(--ink); color: #fff; border-radius: 999px; text-decoration: none; font-weight: 700; box-shadow: var(--shadow);
    animation: slide-up .35s var(--ease);
}
.cart-bar-link strong { margin-left: auto; }
.cart-bar-count { min-width: 28px; height: 28px; border-radius: 999px; background: var(--shop-accent); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.cart-bar.bump .cart-bar-count { animation: pop .5s var(--ease); }

/* ---- Product: the menu builder as a sheet ---- */
.sheet {
    background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; position: relative;
    margin: -16px -16px 0; box-shadow: var(--shadow); animation: sheet-in .4s var(--ease);
}
.sheet-close {
    position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border-radius: 999px; background: rgb(255 255 255 / .92);
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem; text-decoration: none; box-shadow: var(--shadow);
}
.sheet-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface); }
.sheet-body { padding: 18px 16px 24px; }
.sheet-description { color: var(--ink-soft); }
.builder-group { border: 0; padding: 0; margin: 0 0 18px; }
.builder-group legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }
.builder-group legend small { font-weight: 600; color: var(--ink-soft); margin-left: 6px; }
.builder-option {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; margin-bottom: 8px;
    border: 2px solid var(--line); border-radius: var(--radius-small); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.builder-option:has(input:checked) { border-color: var(--shop-primary); background: color-mix(in srgb, var(--shop-primary) 8%, white); }
.builder-option input { width: 22px; height: 22px; accent-color: var(--shop-primary); }
.builder-name { flex: 1; font-weight: 600; }
.builder-surcharge { font-weight: 700; color: var(--shop-primary); }
.builder-group.too-many legend::after { content: " ⚠"; color: var(--danger); }
.builder-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 4px; background: var(--paper); }
.quantity input { width: 72px; min-height: 48px; border-radius: 999px; border: 1px solid var(--line); text-align: center; font: inherit; font-weight: 700; }

/* ---- Notices ---- */
.notice { background: var(--paper); border-left: 6px solid var(--shop-accent); padding: 12px 14px; border-radius: var(--radius-small); }
.notice-error { border-left-color: var(--danger); color: var(--danger); font-weight: 600; }
.empty, .empty-state { text-align: center; color: var(--ink-soft); padding: 32px 0; }
.empty-state .btn { margin-top: 12px; }
.help { color: var(--ink-soft); font-size: .88rem; }

/* ---- Cart ---- */
.cart-lines { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.cart-line { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--radius); padding: 10px; }
.cart-line img { width: 72px; height: 72px; border-radius: var(--radius-small); object-fit: cover; }
.cart-line-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-line-text small { color: var(--ink-soft); }
.cart-line-price { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper form { margin: 0; }
.stepper-value { min-width: 24px; text-align: center; font-weight: 800; }
.cart-total, .checkout-total { display: flex; justify-content: space-between; font-size: 1.2rem; margin: 12px 0; }

/* ---- Checkout ---- */
.checkout-summary, .checkout-form fieldset, .status > div { background: var(--paper); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; border: 0; }
.checkout-summary ul, .status-lines ul { list-style: none; margin: 0; padding: 0; }
.checkout-summary li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.checkout-form legend { font-weight: 800; font-size: 1.1rem; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.checkout-form legend + * { clear: both; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; }
.slot span {
    display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--line);
    border-radius: var(--radius-small); font-weight: 700; background: var(--paper);
}
.slot input:checked + span { border-color: var(--shop-primary); background: var(--shop-primary); color: #fff; }
.slot input:focus-visible + span { outline: 3px solid var(--shop-accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; }
.field input { min-height: 48px; border-radius: var(--radius-small); border: 1px solid var(--line); padding: 0 12px; font: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--shop-primary); }

/* ---- Order status ---- */
.status-number { display: flex; flex-direction: column; align-items: center; margin: 0 0 8px; }
.status-number strong { font-size: 3.5rem; line-height: 1; color: var(--shop-primary); }
.status-title { display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; }
.status-help { text-align: center; color: var(--ink-soft); }
.status-steps { list-style: none; display: flex; justify-content: space-between; gap: 4px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.status-step { flex: 1 1 0; text-align: center; font-size: .82rem; padding: 8px 4px; border-radius: var(--radius-small); background: var(--paper); color: var(--ink-soft); }
.status-step-done { color: var(--ok); font-weight: 700; }
.status-step-current { background: var(--shop-primary); color: #fff; font-weight: 800; }
.status[data-phase="Preparing"] .status-icon { animation: pulse 1.6s ease-in-out infinite; }

.crumbs { color: var(--ink-soft); margin-bottom: 8px; }
.terms { background: var(--paper); border-radius: var(--radius); padding: 20px; white-space: pre-line; }

.shop-missing main { max-width: 560px; margin: 15vh auto; padding: 0 16px; text-align: center; }

@media (min-width: 720px) {
    .sheet { margin: 0 auto; max-width: 760px; border-radius: var(--radius); display: grid; grid-template-columns: 1fr 1fr; animation: fade-in .3s var(--ease); }
    .sheet-image { height: 100%; aspect-ratio: auto; }
    .tiles { --tile-min: 200px; }
}

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* Respect the customer's setting: no movement, only state. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* QR table ordering: the table in the header, the payment choice as two big options, the friendly dead end. */
.table-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--shop-accent); color: var(--ink); font-weight: 800; white-space: nowrap; }
.payment-choice { display: block; margin-bottom: 10px; }
.payment-choice span { display: block; text-align: left; line-height: 1.35; }
.payment-choice input:checked + span small { color: inherit; }
.table-unavailable { max-width: 32rem; margin: 0 auto; }
.table-unavailable-icon { font-size: 3rem; margin: 0; }

/* ---- TicketSystem: event cards, the event page, e-tickets and the marketplace ---- */
.event-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.event-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s var(--ease); }
.event-card:hover { transform: translateY(-2px); }
.event-card.is-sold-out { opacity: .75; }
.event-date { display: grid; justify-items: center; min-width: 58px; padding: 8px 6px; border-radius: var(--radius-small); background: var(--shop-primary); color: #fff; }
.event-date-month { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.event-date-day { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.event-card-body { display: grid; gap: 2px; min-width: 0; }
.event-card-name { font-size: 1.05rem; }
.event-card-meta { color: var(--ink-soft); font-size: .9rem; overflow-wrap: anywhere; }
.event-card-price { font-weight: 700; }
.event-hero { padding: 20px; margin-bottom: var(--gap); border-radius: var(--radius); background: linear-gradient(135deg, var(--shop-primary), #1b1d22); color: #fff; }
.event-hero h1 { margin: 4px 0 8px; }
.event-hero-date { margin: 0; text-transform: capitalize; opacity: .9; }
.event-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.event-hero-text { margin: 12px 0 0; max-width: 60ch; }
.breadcrumb { margin-bottom: 8px; }
.ticket-types { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticket-type { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--paper); }
.ticket-type.is-unavailable { opacity: .7; }
.ticket-type-info { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ticket-type-info .help, .ticket-type-includes { flex-basis: 100%; }
.ticket-type-includes { color: var(--ok); font-size: .9rem; }
.ticket-type-price { display: grid; justify-items: end; }
.ticket-type-price small { color: var(--ink-soft); }
.ticket-type-qty select { min-width: 64px; min-height: 44px; font-size: 1rem; border-radius: var(--radius-small); border: 1px solid var(--line); padding: 0 8px; }
.btn-block { width: 100%; }
.e-tickets { list-style: none; margin: var(--gap) 0; padding: 0; display: grid; gap: var(--gap); }
.e-ticket { border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.e-ticket.is-used { opacity: .6; }
.e-ticket-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--shop-primary); color: #fff; font-weight: 800; }
.e-ticket-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 14px; }
.e-ticket-qr { width: 200px; max-width: 100%; background: #fff; padding: 6px; border-radius: var(--radius-small); }
.e-ticket-qr svg { width: 100%; height: auto; display: block; }
.e-ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.e-ticket dt { color: var(--ink-soft); }
.e-ticket dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.market-hero { padding: 24px 0 16px; }
.market-hero form { display: flex; gap: 8px; max-width: 520px; }
.market-mark { font-size: 1.4rem; }
@media (max-width: 480px) {
    .ticket-type { grid-template-columns: 1fr auto; }
    .ticket-type-qty { grid-column: 1 / -1; justify-self: end; }
}
@media print {
    .shop-header, .shop-footer, .skip-link, .btn, .breadcrumb { display: none !important; }
    .e-ticket { border-color: #999; }
}

/* Customer account (TicketSystem E2) */
.account-orders { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.account-order a { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 14px; border-radius: var(--radius-small); background: var(--paper); color: inherit; text-decoration: none; min-height: 48px; }
.account-order.is-past a { opacity: .75; }
