/* Mobile-first — telefoon is leidend */

@font-face {
  font-family: 'Tahu!';
  font-style: normal;
  font-weight: 400;
  src: url('../assets/fonts/Tahu.woff') format('woff');
  font-display: swap;
}

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --banner-bg: #6ec6e8;
  --ice-bar-bg: #ffffff;
  --ice-bar-border: #cbd5e1;
  --ice-bar-editing: #2563eb;
  --radius: 14px;
  --touch-min: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
}

.app {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
}

.site-banner {
  flex-shrink: 0;
  margin: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: var(--banner-bg);
  text-align: center;
}

.site-banner__logo {
  display: block;
  width: auto;
  height: clamp(52px, 15vw, 68px);
  max-width: min(92%, 300px);
  object-fit: contain;
}

.app-below-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-below-banner--builder-open .app-shell {
  visibility: hidden;
  pointer-events: none;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 0;
}

/* IJsje-kaarten + knop eronder */
.ice-stack {
  margin: 0 0 8px;
}

.ice-list {
  margin: 0;
  padding: 0;
}

.ice-card + .ice-card {
  margin-top: 14px;
}

.ice-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 6px;
}

.ice-card__label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.ice-card__price {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ice-card__bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 12px 10px 12px 14px;
  background: var(--ice-bar-bg);
  border: 2px solid var(--ice-bar-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ice-card__bar--editing {
  border-color: var(--ice-bar-editing);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.ice-card__composition {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.ice-card__placeholder {
  display: block;
  width: 100%;
  min-height: 1.4em;
  color: transparent;
}

.ice-card__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

.ice-card__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ice-card__icon-btn:active {
  background: #f1f5f9;
}

.ice-card__icon-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.ice-card__icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ice-card__icon-btn--danger {
  color: #334155;
}

.ice-card__icon {
  width: 22px;
  height: 22px;
}

/* Ronde + knop — gecentreerd onder de laatste balk */
.add-ice-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 0 8px;
}

.ice-stack--empty .add-ice-wrap {
  padding: 32px 0 24px;
}

.btn-add-ice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(60px, 16vw, 68px);
  height: clamp(60px, 16vw, 68px);
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-add-ice:active:not(:disabled) {
  transform: scale(0.94);
  background: #eff6ff;
}

.btn-add-ice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn-add-ice:disabled,
.btn-add-ice[hidden] {
  display: none;
}

.btn-add-ice__plus {
  font-size: clamp(2rem, 5.5vw, 2.25rem);
  font-weight: 300;
  line-height: 1;
  margin-top: -2px;
}

/* Fullscreen ijsje-builder (onder banner) */
.ice-builder {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  left: 0;
  right: 0;
  overflow: hidden;
}

.ice-builder[hidden] {
  display: none !important;
}

.body--builder-open {
  overflow: hidden;
}

body.body--builder-open .ice-builder {
  position: fixed;
  inset: 0;
  z-index: 30;
}

body.body--builder-open.body--builder-extras .ice-builder {
  position: absolute;
}

/* Tijdens ijsje bouwen: banner verbergen, behalve op de extras-stap */
body.body--builder-open:not(.body--builder-extras) .site-banner {
  display: none !important;
}

.builder-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.builder-step[hidden] {
  display: none !important;
}

.builder-step__topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid #e2e8f0;
}

.builder-btn-text {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.builder-btn-text--muted {
  color: var(--muted);
}

/* Verpakking kiezen — scherm in tweeën */
.pack-split {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pack-choice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 20px;
  border: none;
  font-size: clamp(1.5rem, 7vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: filter 0.12s ease;
}

.pack-choice:active {
  filter: brightness(0.96);
}

.pack-choice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  z-index: 1;
}

/* Zelfde kader voor hoorntje en bakje op de keuzepagina */
.pack-choice__img {
  display: block;
  width: min(46vw, 200px);
  height: min(30vh, 210px);
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
}

.pack-choice--hoorntje {
  background: var(--bg);
  border-bottom: 2px solid #e2e8f0;
}

.pack-choice--bakje {
  background: var(--bg);
}

/* Bouwscherm — verpakking onderaan, smaken als bollen */
.builder-step--build {
  background: var(--bg);
}

.builder-compose-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px 8px;
  font-size: clamp(0.82rem, 3.6vw, 0.95rem);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
}

.builder-build__controls .builder-compose-hint {
  grid-column: 1 / -1;
}

.builder-compose-hint[hidden] {
  display: none !important;
}

.builder-step--build-preview .builder-build__workspace {
  flex: 1;
  min-height: 0;
}

.builder-build__workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.builder-scoop-picker {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.builder-compose {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.builder-compose[hidden] {
  display: none !important;
}

.builder-step--compose .builder-build__workspace {
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.scoop-stack-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr repeat(5, auto);
  --scoop-overlap-y: clamp(34px, 10vw, 52px);
  --scoop-overlap-y-stack: clamp(52px, 16vw, 80px);
  --scoop-overlap-y-hoorntje-2: clamp(68px, 20vw, 100px);
  --scoop-overlap-x-stack: clamp(18px, 5.5vw, 30px);
  --scoop-overlap-whipped: clamp(22px, 6vw, 34px);
  --whipped-size: min(34vw, 132px);
  --whipped-h: calc(var(--whipped-size) * 519 / 640);
  --scoop-overlap-pack: clamp(40px, 11.5vw, 58px);
  column-gap: 0;
  row-gap: calc(-1 * var(--scoop-overlap-y));
  padding: 12px 14px 0;
  margin-bottom: calc(-1 * var(--scoop-overlap-pack));
  align-content: end;
  align-items: center;
  justify-items: center;
  min-height: 0;
}

/* Hoorntje: 2 bollen onder elkaar — extra verticale overlap */
.scoop-stack-grid--stack {
  row-gap: calc(-1 * var(--scoop-overlap-y-hoorntje-2));
}

.scoop-stack-grid--stack .scoop-item--stack-upper {
  transform: translateY(22%);
}

.scoop-item--row-above:not(.scoop-item--pair-right) {
  transform: translateY(14%);
}

/*
 * Twee bollen naast elkaar:
 * linker bol (eerste keuze) blijft staan; rechter bol (tweede keuze) schuift
 * met linkerkant over rechterkant van de linker (iets minder dan verticale overlap).
 * (geen translateX: dat verschuift alleen visueel, grid-cell blijft op afstand)
 */
.scoop-stack-grid--pairs {
  grid-template-columns: auto auto;
  column-gap: 0;
  justify-content: center;
}

.scoop-stack-grid--pairs.scoop-stack-grid--stacked-rows {
  row-gap: calc(-1 * var(--scoop-overlap-y-stack));
}

.scoop-stack-grid--pairs .scoop-item--pair-right {
  margin-inline-start: calc(-1 * var(--scoop-overlap-x-stack));
}

.scoop-stack-grid--pairs .scoop-item--pair-right.scoop-item--row-above {
  transform: translateY(14%);
}

/* Oneven topbol: midden boven de twee eronder */
.scoop-item--nest-center {
  grid-column: 1 / -1;
  justify-self: center;
  transform: translateY(26%);
}

.scoop-display,
.scoop-add {
  width: min(40vw, 118px);
  height: min(40vw, 118px);
  margin: 0;
  padding: 10px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.scoop-item {
  position: relative;
  display: block;
  width: min(40vw, 118px);
  height: min(40vw, 118px);
  margin: 0;
}

.scoop-item .scoop-display {
  width: 100%;
  height: 100%;
}

.scoop-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--scoop-border, #cbd5e1);
  background: var(--scoop-bg, #fff);
  color: var(--scoop-fg, #111);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.scoop-display--photo {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  aspect-ratio: 1;
}

.scoop-display--photo .scoop-display__img {
  min-height: 100%;
}

.scoop-display__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  user-select: none;
}

.scoop-display__name {
  position: relative;
  z-index: 1;
  font-size: clamp(0.82rem, 3.55vw, 0.96rem);
  font-weight: 700;
  line-height: 1.08;
  white-space: pre-line;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
  pointer-events: none;
}

.scoop-display--photo .scoop-display__name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.scoop-display--photo .scoop-display__name--photo-light {
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.85);
}

.scoop-display--photo .scoop-display__name--photo-custom {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.9),
    0 0 8px rgba(255, 255, 255, 0.65);
}

.scoop-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed #94a3b8;
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

.scoop-add:active {
  transform: scale(0.96);
  background: #eff6ff;
  border-color: var(--accent);
}

.scoop-add:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.scoop-add__icon {
  font-size: clamp(2rem, 10vw, 2.75rem);
  font-weight: 300;
  line-height: 1;
}

.scoop-item__actions {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

.scoop-item__actions-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* 42px knopbreedte + ~2px ruimte tot de bol */
.scoop-item--actions-right .scoop-item__actions {
  right: -44px;
}

.scoop-item--actions-left .scoop-item__actions {
  left: -44px;
}

.scoop-item__actions[hidden] {
  display: none !important;
}

.scoop-action-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.scoop-action-btn .ice-card__icon {
  width: 20px;
  height: 20px;
}

.scoop-item__actions .scoop-action-btn .ice-card__icon {
  width: 22px;
  height: 22px;
}

.scoop-action-btn--danger,
.scoop-action-btn--danger .ice-card__icon {
  color: #334155;
}

.whipped-cream__actions .scoop-action-btn,
.whipped-cream__actions .scoop-action-btn .ice-card__icon {
  color: #334155;
}

.whipped-cream__actions .scoop-action-btn .ice-card__icon {
  width: 22px;
  height: 22px;
}

.scoop-action-btn--plus:disabled,
.scoop-action-btn--minus:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.builder-scoop-picker[hidden] {
  display: none !important;
}

@keyframes scoop-picker-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .builder-step--scoop-pick .builder-compose {
    transform: none;
  }
}

.builder-step--scoop-pick .builder-build__workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Bollen blijven in DOM (geen flicker), maar niet zichtbaar tijdens smaak kiezen */
.builder-step--scoop-pick .builder-compose {
  flex: 0 0 0;
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.builder-step--scoop-pick .builder-packaging-row {
  flex: 0 0 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.builder-step--scoop-pick .builder-scoop-picker {
  flex: 1;
  min-height: 0;
  animation: none;
}

.builder-step--scoop-pick .flavor-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
  padding: 18px 18px calc(12px + var(--safe-bottom));
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: stretch;
}

@media (min-width: 380px) {
  .builder-step--scoop-pick .flavor-grid {
    gap: 12px;
  }
}

.flavor-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px calc(16px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}

.flavor-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--touch-min);
  padding: 14px 10px;
  margin: 0;
  border-radius: var(--radius);
  border: 2px solid var(--flavor-border, #bbb);
  background: var(--flavor-bg, #fff);
  color: var(--flavor-fg, #111);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.flavor-btn:active {
  transform: scale(0.98);
}

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

.flavor-btn.is-selected {
  box-shadow: 0 0 0 3px var(--accent);
}

.flavor-grid--scoop-edit .flavor-btn.is-selected {
  box-shadow: 0 0 0 4px #0f172a;
  border-color: #0f172a;
}

.flavor-btn--week {
  position: relative;
  overflow: visible;
  --flavor-fg: #0f172a;
  color: #0f172a;
}

.flavor-btn--week .flavor-btn__name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  text-align: center;
  line-height: 1.15;
}

.flavor-btn__week-sticker {
  position: absolute;
  top: -4px;
  right: -4px;
  width: clamp(40px, 11.5vw, 52px);
  height: auto;
  border-radius: 50%;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  transform: translate(16%, -8%);
  transform-origin: center center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.16));
}

.flavor-btn:has(.flavor-btn__sub) {
  position: relative;
}

.flavor-btn__name {
  display: block;
  line-height: 1.15;
}

.flavor-btn__sub {
  position: absolute;
  top: calc(50% + 0.78rem);
  left: 0;
  right: 0;
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  opacity: 0.88;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.builder-step--scoop-pick .flavor-btn__sub {
  top: calc(50% + 0.86rem);
}

.builder-step--scoop-pick .flavor-btn {
  min-height: 0;
  height: 100%;
  font-size: clamp(0.95rem, 4vw, 1.1rem);
}

.whipped-cream-stack {
  position: relative;
  z-index: 60;
  isolation: isolate;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-end;
  line-height: 0;
  transform: translateY(var(--scoop-overlap-whipped)) translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.whipped-cream-stack--over-nest {
  transform: translateY(calc(var(--scoop-overlap-whipped) + min(40vw, 118px) * 0.32)) translateZ(0);
}

.whipped-cream-stack--over-pair {
  transform: translateY(calc(var(--scoop-overlap-whipped) + min(40vw, 118px) * 0.2)) translateZ(0);
}

.whipped-cream-wrap {
  position: relative;
  line-height: 0;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.whipped-cream-wrap--stacked {
  margin-bottom: calc(-1 * var(--whipped-h) / 2);
}

.whipped-cream-top {
  width: var(--whipped-size);
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

.builder-build__packaging[hidden] {
  display: none !important;
}

.builder-packaging-row {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: var(--safe-bottom);
}

.builder-step--compose .builder-packaging-row {
  margin-top: -3px;
}

.builder-build__packaging {
  flex-shrink: 0;
  flex: 0 0 auto;
  width: auto;
  min-height: 112px;
  padding: 20px 16px calc(12px + var(--safe-bottom));
  background: var(--surface);
  border: none;
  border-top: none;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font: inherit;
  color: inherit;
}

.builder-packaging-row__side {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.builder-packaging-row__side--edit {
  display: flex;
  align-items: center;
  justify-content: center;
}

#builder-packaging-edit-btn[hidden] {
  display: none !important;
}

.builder-packaging-row .scoop-action-btn .ice-card__icon {
  width: 22px;
  height: 22px;
}

.builder-build__packaging--visual {
  background: var(--bg);
  padding-top: 4px;
  padding-bottom: calc(4px + var(--safe-bottom));
  min-height: 96px;
}

.builder-step--compose .builder-build__packaging--visual {
  align-items: center;
  min-height: 0;
  padding-top: 4px;
  padding-bottom: 8px;
}

.builder-build__packaging--visual:active:not(:disabled) {
  background: var(--bg);
}

.builder-build__packaging:active:not(:disabled) {
  background: #f8fafc;
}

.builder-build__packaging:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.builder-packaging__img {
  position: relative;
  z-index: 0;
  width: auto;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}

.builder-packaging__img[hidden] {
  display: none !important;
}

.builder-packaging__label {
  font-size: clamp(1.35rem, 6vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.builder-packaging__label[hidden] {
  display: none !important;
}

.builder-step--build-preview .builder-build__packaging--visual {
  flex: 1;
  min-height: 140px;
  align-items: flex-end;
}

.builder-step--build-preview .builder-packaging__img--hoorntje {
  max-height: min(48vh, 280px);
}

.builder-step--build-preview .builder-packaging__img--bakje {
  max-height: min(42vh, 240px);
  max-width: min(88vw, 320px);
}

.builder-packaging__img--bakje {
  max-height: min(40vw, 150px);
  max-width: min(78vw, 240px);
}

.builder-packaging__img--hoorntje {
  max-height: min(44vw, 168px);
}

.builder-build__controls {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  padding: 8px 14px calc(6px + var(--safe-bottom));
  background: var(--bg);
}

.builder-build__controls:has(#btn-add-scoop[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.builder-build__controls[hidden] {
  display: none !important;
}

.builder-build__control-btn {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  padding: 12px 10px;
  border: 2px solid #0f172a;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.builder-build__control-btn--on {
  background: #f8fafc;
}

.builder-whipped-control {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.builder-whipped-control .builder-build__control-btn--whipped {
  width: 100%;
}

.builder-build__control-label {
  display: block;
  text-align: center;
}

.whipped-cream__actions {
  position: absolute;
  top: 50%;
  right: -44px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 70;
}

.whipped-cream__actions[hidden] {
  display: none !important;
}

.builder-build__control-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.builder-build__control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.builder-extras {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 48px 0 16px;
  background: var(--bg);
}

.builder-extras__topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 6px 10px 0;
}

.builder-extras__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.builder-extras__back:active {
  background: #e2e8f0;
}

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

.builder-extras__back-icon {
  width: 28px;
  height: 28px;
}

.builder-extras[hidden] {
  display: none !important;
}

.builder-extras__inner {
  width: 100%;
  max-width: 420px;
  margin: -24px auto 0;
  padding: 0 14px;
}

.builder-extras__intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0 4px;
  text-align: center;
}

.builder-extras__intro p {
  margin: 0;
  font-size: clamp(0.88rem, 3.8vw, 1rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.builder-extras__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 10px;
}

.builder-extras__option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.builder-extras__option[data-extra-option="halfScoop"][hidden] {
  display: none !important;
}

.builder-extras__option--wide {
  grid-column: 1 / -1;
  max-width: calc(50% - 5px);
  justify-self: center;
}

.builder-extras__hint {
  margin: 0;
  padding: 0 2px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}

.builder-extras__option:has(.builder-extras__btn:disabled) .builder-extras__hint {
  opacity: 0.55;
}

.builder-extras__btn {
  width: 100%;
  min-height: 66px;
  padding: 12px 10px;
  border: 2px solid #0f172a;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.builder-extras__btn--on {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.builder-extras__btn:active:not(:disabled) {
  transform: scale(0.98);
}

.builder-extras__btn--on:active:not(:disabled) {
  background: #15803d;
  border-color: #15803d;
}

.builder-extras__btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.builder-extras__btn:focus-visible {
  outline: 3px solid #16a34a;
  outline-offset: 2px;
}

.builder-step--extras .builder-compose-hint,
.builder-step--extras .builder-build__workspace,
.builder-step--extras .builder-packaging-row,
.builder-step--extras .builder-build__controls {
  display: none !important;
}

.builder-build__footer {
  flex-shrink: 0;
  padding: 8px 14px calc(12px + var(--safe-bottom));
  background: var(--bg);
}

.builder-build__footer[hidden] {
  display: none !important;
}

.builder-btn-done {
  width: 100%;
  min-height: var(--touch-min);
  border: none;
  border-radius: var(--radius);
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.builder-btn-done:active {
  background: #15803d;
}

.builder-btn-done:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 2px;
}

.error-msg {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.9rem;
}

.menu-footer {
  flex-shrink: 0;
  padding: 0 0 calc(16px + var(--safe-bottom));
  background: var(--bg);
}

.menu-footer:not(:has(.order-total:not([hidden]), .menu-checkout:not([hidden]))) {
  padding: 0;
}

.order-total {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 14px 0;
  padding: 14px 16px;
  border: 2px solid var(--ice-bar-border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1.2rem;
}

.order-total[hidden] {
  display: none !important;
}

.order-total__label {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.order-total__amount {
  margin: 0;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.menu-checkout {
  flex-shrink: 0;
  margin: 12px 14px 0;
}

.menu-checkout[hidden] {
  display: none !important;
}

.menu-checkout__btn {
  width: 100%;
  min-height: var(--touch-min);
  border: none;
  border-radius: var(--radius);
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-checkout__btn:active {
  background: #15803d;
}

.menu-checkout__btn:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 2px;
}

.order-code-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px calc(10px + var(--safe-bottom));
}

.order-code-screen[hidden] {
  display: none !important;
}

.order-code-screen__inner {
  --order-code-qr-size: min(62vw, 236px);
  --order-code-qr-pad: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(6px, 2vw, 14px);
  gap: 8px;
  text-align: center;
}

.order-code-screen__bedankt {
  margin: 0;
  font-family: 'Tahu!', cursive;
  font-size: clamp(2.35rem, 13vw, 3.75rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}

.order-code-screen__text {
  margin: 0;
  max-width: 28rem;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(0.88rem, 3.8vw, 0.95rem);
  font-weight: 400;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0;
  letter-spacing: 0.015em;
  line-height: 1.32;
  text-rendering: geometricPrecision;
}

.order-code-screen__qr {
  padding: var(--order-code-qr-pad);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
}

.order-code-screen__qr img,
.order-code-screen__qr canvas {
  display: block;
  width: var(--order-code-qr-size) !important;
  height: auto !important;
}

.order-code-screen__summary {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.order-code-screen__back {
  width: calc(var(--order-code-qr-size) + 2 * var(--order-code-qr-pad));
  min-height: var(--touch-min);
  margin-top: 0;
  padding: 12px 20px;
  border: 2px solid var(--ice-bar-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-height: 720px) {
  .order-code-screen__inner {
    --order-code-qr-size: min(56vw, 200px);
    --order-code-qr-pad: 8px;
    gap: 6px;
    padding-top: 4px;
  }

  .order-code-screen__bedankt {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .order-code-screen__qr {
    padding: var(--order-code-qr-pad);
  }
}

.app-footer {
  margin-top: 20px;
  padding: 12px 14px 0;
  border-top: 1px solid #e2e8f0;
}

.footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* Vlieganimatie verpakking: keuzescherm → onderaan */
.pack-fly-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  overflow: visible;
}

.pack-fly-ghost {
  position: fixed;
  margin: 0;
  padding: 0;
  border: none;
  object-fit: contain;
  transform-origin: center center;
  transform: translate(0, 0) scale(1);
  will-change: transform;
  pointer-events: none;
  user-select: none;
  z-index: 501;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

.ice-builder--flying .builder-compose {
  visibility: visible;
}

.ice-builder--flying .builder-build__packaging {
  pointer-events: none;
}

.builder-packaging__img--hidden-during-fly {
  visibility: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
  .pack-fly-layer {
    display: none !important;
  }
}

.welcome-landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

.welcome-landing[hidden] {
  display: none !important;
}

.welcome-landing__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 20px calc(16px + var(--safe-bottom));
  width: 100%;
}

.welcome-landing__title {
  margin: 0 0 10px;
  font-family: 'Tahu!', cursive;
  font-size: clamp(3.25rem, 18vw, 4.75rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  text-align: center;
}

.welcome-landing__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 10px;
}

.welcome-landing__text p {
  margin: 0;
  font-size: clamp(0.95rem, 4.2vw, 1.08rem);
  font-weight: 500;
  line-height: 1.32;
  color: var(--text);
  text-align: center;
}

.welcome-landing__pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-landing__prices {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  padding-top: 0;
}

.welcome-landing__prices-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-landing__prices-title {
  margin: 0 0 12px;
  font-family: 'Tahu!', cursive;
  font-size: clamp(2.25rem, 12vw, 3.1rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  text-align: center;
}

.welcome-landing__price-list {
  margin: 0 0 0 1.6rem;
  padding: 0;
  list-style: none;
  width: fit-content;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.welcome-landing__price-list li {
  display: grid;
  grid-template-columns: 5.75rem 4.25rem;
  column-gap: 14px;
  align-items: baseline;
  font-size: clamp(0.88rem, 3.8vw, 0.98rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}

.welcome-landing__price-label {
  text-align: left;
}

.welcome-landing__price-value {
  text-align: left;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.welcome-landing__btn {
  width: 100%;
  min-height: var(--touch-min);
  border: none;
  border-radius: var(--radius);
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.welcome-landing__btn:active {
  background: #15803d;
}

.welcome-landing__btn:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 2px;
}

body.body--welcome-open .app-shell,
body.body--welcome-open #ice-builder {
  display: none !important;
}

body.body--order-code-open .app-main {
  display: none !important;
}

body.body--order-code-open .app-shell {
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .app {
    max-width: 520px;
  }
}
