@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ── Sunice kiosk tokens ─────────────────────────────────────────
   Every colour is sampled from logo.jpg or derived from it. --sky
   matches the logo's field exactly, so logo.jpg sits on a sky
   surface with no visible edge and needs no cut-out.

   The tile tints split the menu the way the name does: everything
   baked gets a sun tint, everything cold gets an ice tint.        */
:root {
  --sky:        #35B8FF;  /* sampled from logo.jpg — must stay exact */
  --sky-deep:   #1A8FD0;
  --brand:      #40719F;
  --ink:        #16405F;
  --ink-soft:   #4E7591;
  --sun:        #F9B93A;
  --sun-deep:   #E09A18;
  --frost:      #FFFFFF;
  --paper:      #FBF7F1;
  --paper-edge: #E8DFD2;
  --muted:      #9AA7B2;
  --decline:    #D6453C;

  --tint-brood:   #FBE8CB;
  --tint-hartig:  #F6D9AE;
  --tint-gebak:   #FBE3D2;
  --tint-taart:   #F7D3B4;
  --tint-ijs:     #D6EFFC;
  --tint-drinken: #C0E4FA;

  --r-card: 28px;
  --r-pill: 999px;
  --shadow-card: 0 6px 0 rgba(22, 64, 95, .07), 0 18px 40px rgba(22, 64, 95, .10);
  --shadow-lift: 0 10px 34px rgba(22, 64, 95, .22);
  --ease: cubic-bezier(.22, .8, .28, 1);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;          /* the kiosk never scrolls the document */
  background: #16405F;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }

/* ── Stage: a real 1080 x 1920 portrait kiosk ────────────────────
   Live, the stage fills the panel edge to edge. Add ?dev to the URL
   for the framed preview with the screen-jumping rig.             */
.frame {
  display: grid;
  place-items: center;
  height: 100%;
  background: #16405F;
}

.frame-fit {
  position: relative;
  overflow: hidden;
}

.frame-dev {
  align-content: center;
  height: auto;
  min-height: 100%;
  padding: 20px;
  background: #0C1A24;
}

.frame-dev .frame-fit {
  border-radius: 18px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
}

.stage {
  position: relative;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
  transform-origin: 0 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen-on { display: flex; }

/* ── Shared type ───────────────────────────────────────────────── */
.eyebrow {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* The logo's own treatment: solid letterform, white keyline. Used
   on identity moments only — never on running text.              */
.outlined {
  paint-order: stroke fill;
  -webkit-text-stroke: 11px var(--frost);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 112px;
  padding: 0 52px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--sun);
  box-shadow: 0 8px 0 var(--sun-deep);
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease);
}

.btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--sun-deep);
}

.btn:disabled {
  opacity: .4;
  box-shadow: none;
  cursor: default;
}

.btn:disabled:active { transform: none; }

.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 4px var(--paper-edge);
  color: var(--ink-soft);
  font-size: 36px;
}

.btn-ghost:active {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 4px var(--paper-edge);
}

.btn-wide { width: 100%; }

:where(.stage) :focus-visible {
  outline: 5px solid var(--ink);
  outline-offset: 5px;
}

.screen-sky :focus-visible,
.head :focus-visible {
  outline-color: var(--frost);
}

/* ── The frost edge ────────────────────────────────────────────────
   The drip from the logo, doing structural work: the horizon on the
   idle screen, the underside of the category bar, the torn edge of
   the pickup ticket. Path generated in app.js.                    */
.drip {
  display: block;
  width: 100%;
  overflow: visible;
}

/* White icing on near-white paper would vanish, so the band casts a
   soft shadow and keeps the logo's keyline.                        */
.drip { filter: drop-shadow(0 7px 9px rgba(22, 64, 95, .11)); }

.drip-fill { fill: var(--frost); }

.drip-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4;
  stroke-linecap: round;
}

/* Lobes bulge upward instead of hanging down — used where the frost
   is the top edge of a surface rather than the underside of one.  */
.drip-up { transform: scaleY(-1); }

/* ── 1. Idle ─────────────────────────────────────────────────────
   Flat sky, not a gradient: logo.jpg carries this exact blue, so a
   gradient would print a visible square around the mark.          */
.idle { background: var(--sky); }

/* logo.jpg is a 447px square whose artwork occupies 45,108 → 409,308.
   Both crops below are derived from that box, so the mark is sized by
   the artwork rather than by the file's padding.                    */
.idle-mark {
  width: 880px;
  height: 485px;
  margin: 420px auto 0;
  overflow: hidden;
}

.idle-mark img {
  display: block;
  width: 1078px;
  max-width: none;
  margin: -260px 0 0 -108px;
}

.idle-tag {
  margin-top: 34px;
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 48px;
  font-weight: 600;
  text-align: center;
}

.idle-horizon {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 520px;
}

/* Ambient: the icing settles and lifts. One transform, no JS loop —
   this runs twelve hours a day on the kiosk PC.                   */
.idle-horizon-inner {
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform-origin: 50% 100%;
  animation: settle 9s ease-in-out infinite alternate;
}

.idle-horizon .drip {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: -2px;
}

@keyframes settle {
  from { transform: scaleY(1); }
  to   { transform: scaleY(1.04); }
}

.idle-cta {
  position: absolute;
  right: 0;
  bottom: 180px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
}

.idle-cta .eyebrow { color: var(--ink-soft); }

.idle-cta .btn {
  min-height: 156px;
  padding: 0 92px;
  font-size: 62px;
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

/* ── Header, shared by menu / cart / payment ───────────────────── */
.head {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 220px;
  padding: 0 44px;
  background: var(--sky);
}

/* logo.jpg is a padded square; this crops to the artwork. The header
   colour equals the file's field, so the crop edge is invisible.  */
.head-mark {
  width: 344px;
  height: 192px;
  overflow: hidden;
}

.head-mark img {
  display: block;
  width: 416px;
  max-width: none;
  margin: -101px 0 0 -42px;
}

.head-center { justify-content: center; }

.head-title {
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 46px;
  font-weight: 700;
}

.head-back {
  min-height: 96px;
  padding: 0 42px;
  border: 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 34px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Category bar — the icing band ─────────────────────────────── */
.cats {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  background: var(--frost);
}

.cats-row {
  display: flex;
  gap: 12px;
  padding: 24px 34px 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cats-row::-webkit-scrollbar { display: none; }

.cats .drip {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: -2px;
}

.cat {
  flex: 0 0 auto;
  min-height: 96px;
  padding: 0 30px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper-edge);
  color: var(--ink-soft);
  font-family: 'Archivo', sans-serif;
  font-size: 33px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.cat-on {
  background: var(--ink);
  box-shadow: none;
  color: var(--frost);
}

/* ── Product grid ──────────────────────────────────────────────── */
.grid-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  padding: 86px 44px 260px; /* clears the cart bar, which floats */
}

.grid-head {
  grid-column: 1 / -1;
  margin: 26px 0 -6px;
  color: var(--ink-soft);
}

.grid-head:first-child { margin-top: 0; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 26px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--frost);
  box-shadow: var(--shadow-card);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 110ms var(--ease), box-shadow 110ms var(--ease);
}

.card:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(22, 64, 95, .07), 0 8px 18px rgba(22, 64, 95, .10);
}

.card-tile {
  position: relative;
  display: grid;
  place-items: center;
  height: 268px;
  border-radius: 20px;
  background: var(--tile, var(--tint-ijs));
}

.card-tile svg {
  width: 156px;
  height: 156px;
  color: var(--ink);
  opacity: .72;
}

.card-name {
  margin: 22px 4px 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}

.card-note {
  margin: 6px 4px 0;
  color: var(--ink-soft);
  font-size: 26px;
}

.card-price {
  margin: auto 4px 0;
  padding-top: 16px;
  color: var(--brand);
  font-family: 'Baloo 2', sans-serif;
  font-size: 42px;
  font-weight: 700;
}

.card-picked { box-shadow: 0 0 0 5px var(--sun), var(--shadow-card); }

/* The stepper floats over the tile, so adding an item never reflows
   the grid under the customer's finger.                           */
.step {
  position: absolute;
  bottom: 16px;
  left: 50%;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-pill);
  background: var(--sun);
  box-shadow: var(--shadow-lift);
  transform: translateX(-50%);
}

.card-picked .step { display: flex; }

.step-btn {
  width: 84px;
  height: 84px;
  border: 0;
  border-radius: 50%;
  background: var(--frost);
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.step-qty {
  min-width: 66px;
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 44px;
  font-weight: 800;
  text-align: center;
}

/* Sold out — the whole reason the cashier app exists, so it has to
   read at two metres. The tag stays outside the grey-out filter.  */
.card-out {
  cursor: not-allowed;
  background: #F3F0EA;
  box-shadow: none;
}

.card-out .card-tile { filter: grayscale(1); opacity: .45; }
.card-out .card-name,
.card-out .card-note { color: var(--muted); }
.card-out .card-price { color: var(--muted); text-decoration: line-through; }
.card-out:active { transform: none; }

.out-tag {
  position: absolute;
  top: 130px;
  left: 50%;
  z-index: 2;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--frost);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-4deg);
}

/* ── Cart bar ────────────────────────────────────────────────────
   Floats over the grid rather than sitting in flow, so an empty cart
   leaves no blank strip at the bottom of the screen.              */
.bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px 44px 44px;
  background: var(--frost);
  box-shadow: 0 -14px 34px rgba(22, 64, 95, .09);
  transition: transform 260ms var(--ease);
}

.bar-hidden { transform: translateY(100%); }

.bar-sum { flex: 1 1 auto; }

.bar-count {
  color: var(--ink-soft);
  font-size: 28px;
  font-weight: 600;
}

.bar-total {
  font-family: 'Baloo 2', sans-serif;
  font-size: 58px;
  font-weight: 800;
  line-height: 1.05;
}

/* ── Cart ──────────────────────────────────────────────────────── */
.lines {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 30px 44px 20px;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 30px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 3px solid var(--paper-edge);
}

.line-name {
  font-size: 38px;
  font-weight: 600;
}

.line-each {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 26px;
  font-weight: 400;
}

.line-price {
  min-width: 210px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 44px;
  font-weight: 700;
  text-align: right;
}

.line-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper-edge);
}

.totals {
  flex: 0 0 auto;
  padding: 30px 44px 44px;
  background: var(--frost);
  box-shadow: 0 -14px 34px rgba(22, 64, 95, .09);
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 30px;
}

.total-row-big {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 3px solid var(--paper-edge);
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 58px;
  font-weight: 800;
}

.totals .btn { margin-top: 28px; }
.totals .btn-ghost { margin-top: 16px; }

.empty {
  margin: auto;
  padding: 0 80px;
  color: var(--ink-soft);
  font-size: 40px;
  text-align: center;
}

/* ── Payment ───────────────────────────────────────────────────── */
.pay-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 80px;
  text-align: center;
}

.pay-amount {
  font-family: 'Baloo 2', sans-serif;
  font-size: 132px;
  font-weight: 800;
  line-height: 1;
}

.pay-label {
  margin-top: 26px;
  color: var(--ink-soft);
}

.pay-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 340px;
  height: 340px;
  margin: 96px 0 76px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 16px var(--frost), 0 0 0 20px rgba(64, 113, 159, .18);
}

.pay-disc::after {
  content: '';
  position: absolute;
  inset: -46px;
  border: 12px solid transparent;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1.15s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pay-disc svg { width: 150px; height: 150px; color: var(--ink); }

.pay-msg {
  max-width: 800px;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.25;
}

.pay-sub {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 32px;
}

.pay-body .btn-ghost { margin-top: 84px; }

.pay-fail .pay-disc { background: var(--decline); }
.pay-fail .pay-disc::after { display: none; }
.pay-fail .pay-disc svg { color: var(--frost); }

/* ── Pickup number ─────────────────────────────────────────────── */
.screen-sky {
  align-items: center;
  justify-content: center;
  background: var(--sky);
}

.done-head {
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 80px;
  font-weight: 800;
}

.ticket {
  position: relative;
  width: 860px;
  margin-top: 320px;   /* the badge overhangs 212px; this clears "Bedankt!" */
  padding: 258px 70px 92px;
  border-radius: 34px 34px 0 0;
  background: var(--frost);
  text-align: center;
}

.ticket .drip {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: -2px;
}

.ticket .drip .drip-line { stroke: var(--paper-edge); }

/* The sun disc arrives once, here, holding the number. */
.badge {
  position: absolute;
  top: -212px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 424px;
  height: 424px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 16px var(--frost);
  transform: translateX(-50%);
  animation: land 620ms var(--ease) both;
}

@keyframes land {
  from { transform: translateX(-50%) translateY(-46px) scale(.82); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.badge-num {
  color: var(--brand);
  font-family: 'Baloo 2', sans-serif;
  font-size: 236px;
  font-weight: 800;
  line-height: 1;
}

.ticket-label {
  color: var(--ink-soft);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ticket-msg {
  margin-top: 26px;
  font-size: 46px;
  font-weight: 600;
  line-height: 1.25;
}

.ticket-print {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  color: var(--ink-soft);
  font-size: 32px;
}

.ticket-print svg { width: 40px; height: 40px; }

.done-timer {
  margin-top: 124px; /* clears the ticket's drip, which is absolute */
  color: var(--ink);
  font-size: 32px;
  opacity: .7;
}

/* ── Service banner (printer / bridge / connection) ────────────── */
.alert {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 18px;
  padding: 26px 44px;
  background: var(--decline);
  color: var(--frost);
  font-size: 30px;
  font-weight: 600;
}

.alert-on { display: flex; }

/* ── Demo rig — development only, not part of the kiosk ────────── */
.rig {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 940px;
  margin: 16px auto 0;
  font-family: 'Archivo', system-ui, sans-serif;
}

.frame-dev .rig { display: flex; }

.rig button {
  padding: 9px 16px;
  border: 1px solid #2A4657;
  border-radius: 999px;
  background: #16303F;
  color: #B9D6E6;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.rig button:hover { background: #1E4054; }

.rig-note {
  width: 100%;
  margin-top: 4px;
  color: #6E93A8;
  font-size: 12px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .idle-horizon-inner,
  .idle-cta .btn,
  .pay-disc::after,
  .badge {
    animation: none;
  }
  .stage * { transition-duration: 1ms !important; }
}
