/* ============================================================
   WAD OF WONDERS — mobile-first app
   Licht & warm (wit + zandtint), molen-centraal, tabbar-footer.
   ============================================================ */
:root {
  --ink:#1b2733; --ink-soft:#4a5663; --muted:#9aa5b1;
  --line:#e9eef3; --paper:#ffffff; --paper-2:#ffffff;
  --bg:#ffffff; --bg-tint:#ffffff;
  /* echte molen-kleuren — iets feller kobaltblauw */
  --cobalt:#2f7fcc; --cobalt-2:#2569ad; --cobalt-3:#1d5391;
  --bracket:#7fb0dd; --bracket-2:#5b97cf;
  --pocket:rgba(214,228,240,.55);
  --accent:#2f7fcc; --accent-2:#2569ad; --accent-soft:#dce8f3; --ok:#5aa37e;
  --shadow:rgba(40,60,85,.06); --shadow-md:rgba(40,60,85,.10); --shadow-lg:rgba(40,60,85,.16);
  --topbar-h:54px; --tabbar-h:64px; --radius:16px; --radius-sm:10px;
  color-scheme: light;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { -webkit-text-size-adjust:100%; }
html,body {
  margin:0; padding:0; height:100%;
  background:var(--bg-tint); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI","Helvetica Neue",system-ui,Arial,sans-serif;
  font-size:16px; line-height:1.5;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  overscroll-behavior:none;
}
h1,h2,h3,h4 { margin:0; font-weight:600; letter-spacing:-0.02em; line-height:1.15; }
a { color:inherit; text-decoration:none; }
img { display:block; max-width:100%; }
button { font-family:inherit; }

/* App is een vast frame; op desktop gecentreerd als telefoon */
body { display:flex; justify-content:center; }
.topbar, .app-main, .tabbar { width:100%; max-width:480px; }

/* ---------- Buttons ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-size:15px; font-weight:600; letter-spacing:-0.01em;
  padding:14px 22px; border-radius:999px; border:1px solid transparent;
  cursor:pointer; background:none; width:100%;
  transition:transform .12s ease, opacity .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform:scale(.98); opacity:.92; }
.btn-solid { background:var(--ink); color:#fff; }
.btn-accent { background:var(--accent); color:#fff; }
.btn-accent:hover { background:var(--accent-2); }
.btn-ghost { border-color:var(--line); color:var(--ink); background:#fff; }
.btn-ghost:hover { border-color:var(--ink); }
.btn:disabled,.btn[aria-disabled="true"] { opacity:.4; cursor:not-allowed; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position:fixed; top:0; left:50%; transform:translateX(-50%);
  height:calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-top:env(safe-area-inset-top);
  display:flex; align-items:center; justify-content:space-between;
  padding-left:18px; padding-right:14px; z-index:50;
  background:rgba(255,255,255,.88); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.brand-mark { font-size:15px; font-weight:700; letter-spacing:.06em; color:var(--ink); }
.brand-thin { font-weight:400; color:var(--muted); padding:0 2px; }
.lang-switch { display:flex; gap:1px; }
.lang-btn {
  font-size:12px; font-weight:600; background:none; border:none; cursor:pointer;
  color:var(--muted); padding:6px 8px; border-radius:7px; transition:all .2s ease;
}
.lang-btn.is-active { color:var(--ink); background:#fff; box-shadow:0 1px 3px var(--shadow); }

/* ============================================================
   APP MAIN / SCHERMEN
   ============================================================ */
.app-main {
  flex:1; min-height:100svh;
  padding-top:calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background:var(--bg-tint);
}
.screen { display:none; min-height:calc(100svh - var(--topbar-h) - var(--tabbar-h)); }
.screen.is-active { display:flex; flex-direction:column; }

/* scrollbare content-schermen */
.screen-order, .screen-kaartje, .screen-info { padding:24px 20px 30px; gap:14px; }
.screen-title { font-size:24px; font-weight:700; }
.screen-lead { color:var(--ink-soft); font-size:15.5px; }

/* ============================================================
   MOLEN SCHERM
   ============================================================ */
.screen-molen { padding:14px 0 0; align-items:center; }
.molen-head { text-align:center; padding:0 16px; width:100%; }
.type-toggle {
  display:inline-flex; gap:2px; background:#fff; border:1px solid var(--line);
  border-radius:999px; padding:4px; box-shadow:0 1px 4px var(--shadow);
}
.type-btn {
  font-size:13px; font-weight:600; padding:8px 16px; border:none; background:none;
  border-radius:999px; color:var(--muted); cursor:pointer; transition:all .2s ease;
}
.type-btn.is-active { background:var(--ink); color:#fff; }

/* Kant-knoppen (Kant A / Kant B / ...) — horizontaal scrollbaar */
.kant-tabs {
  display:flex; gap:8px; margin-top:14px; padding:2px 4px 4px;
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
  justify-content:flex-start; width:100%;
}
.kant-tabs::-webkit-scrollbar { display:none; }
.kant-btn {
  flex:0 0 auto; font-size:13px; font-weight:600; padding:8px 16px;
  border:1px solid var(--line); background:#fff; color:var(--ink-soft);
  border-radius:999px; cursor:pointer; transition:all .2s ease; white-space:nowrap;
}
.kant-btn.is-active { background:var(--ink); color:#fff; border-color:var(--ink); }

/* Het 3D-toneel waarin de molen draait */
.molen-stage {
  flex:1; width:100%; min-height:0;
  perspective:1100px; perspective-origin:50% 50%;
  touch-action:none; user-select:none; cursor:grab;
  overscroll-behavior:contain;
  display:flex; align-items:flex-start; justify-content:center;
  overflow:hidden; position:relative;
  padding-top:6px;
}
.molen-stage.dragging { cursor:grabbing; }
/* donkere kern in het hart van de molen — kaarten blokkeren het licht,
   dus binnenin is het natuurlijk donkerder (geeft diepte) */
.molen-core {
  position:absolute; top:6%; bottom:6%; left:50%; width:var(--panel-w,200px);
  transform:translateX(-50%);
  background:radial-gradient(ellipse 70% 60% at 50% 45%,
    rgba(18,30,46,.55) 0%, rgba(18,30,46,.32) 45%, rgba(18,30,46,0) 80%);
  z-index:0; pointer-events:none; filter:blur(8px);
}
.molen-drum {
  position:relative; width:var(--panel-w,200px); height:100%;
  transform-style:preserve-3d; will-change:transform; z-index:1;
}
/* Eén kant van de molen = een verticale kolom kaarten */
.molen-panel {
  position:absolute; top:0; left:0; height:100%;
  backface-visibility:hidden;
  display:flex; align-items:flex-start; justify-content:center;
  opacity:.62; filter:brightness(.82); transition:opacity .5s ease, filter .5s ease;
}
.molen-panel.active { opacity:1; filter:none; }
.molen-col {
  display:flex; flex-direction:column; gap:12px; padding:10px 0; width:100%;
  will-change:transform;
}

/* Elke kaart = alleen de foto, nette tegel met lichte afronding + schaduw */
.card-tile {
  flex:0 0 auto; padding:0; border:none; background:none; cursor:pointer; width:100%;
}
.card-tile-inner {
  display:block; width:100%; overflow:hidden;
  border-radius:7px; background:#fff;
  box-shadow:0 16px 30px -8px rgba(15,30,50,.42), 0 6px 14px -4px rgba(15,30,50,.30);
  transition:transform .15s ease;
}
.card-tile.postcard .card-tile-inner { aspect-ratio:15 / 10.5; }
.card-tile.greeting .card-tile-inner { aspect-ratio:16 / 9; }
.card-tile img { width:100%; height:100%; object-fit:cover; display:block; -webkit-user-drag:none; user-select:none; pointer-events:none; transform:scale(1.04); }
.molen-panel.active .card-tile:active .card-tile-inner { transform:scale(.97); }

.molen-foot { width:100%; padding:6px 20px calc(12px + env(safe-area-inset-bottom)); }
.molen-hint { text-align:center; font-size:12.5px; color:var(--muted); margin:0; }
.molen-cart-btn { width:100%; margin-bottom:10px; }
.back-link {
  align-self:flex-start; background:none; border:none; cursor:pointer;
  color:var(--accent-2); font-size:14px; font-weight:600; padding:0 0 6px;
}

/* ============================================================
   MANDJE (order scherm)
   ============================================================ */
.cart-items { display:flex; flex-direction:column; gap:12px; margin-top:6px; }
.cart-empty { color:var(--muted); font-size:14.5px; padding:20px 0; text-align:center; }
.cart-row { display:grid; grid-template-columns:46px 1fr auto auto; gap:12px; align-items:center; }
.cart-thumb { width:46px; height:31px; object-fit:cover; border-radius:8px; }
.cart-info { display:flex; flex-direction:column; line-height:1.3; min-width:0; }
.cart-sku { font-size:14px; font-weight:600; }
.cart-sub { font-size:11px; color:var(--muted); }
.cart-qty { display:flex; align-items:center; gap:8px; }
.qty-btn {
  width:28px; height:28px; border-radius:50%; border:1px solid var(--line);
  background:#fff; cursor:pointer; color:var(--ink); font-size:16px; line-height:1;
  display:flex; align-items:center; justify-content:center;
}
.qty-num { font-size:14px; min-width:14px; text-align:center; font-weight:600; }
.cart-line { font-size:14px; font-weight:600; white-space:nowrap; }
.cart-foot { margin-top:auto; border-top:1px solid var(--line); padding-top:16px; }
.cart-total-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; }
.cart-total-row span { color:var(--ink-soft); font-size:15px; }
.cart-total-row strong { font-size:22px; font-weight:700; }
.cart-remaining { font-size:13px; color:var(--accent); margin:0 0 14px; min-height:18px; font-weight:600; }

/* ---------- soon / info ---------- */
.soon-wrap { display:flex; flex-direction:column; gap:12px; align-items:flex-start; margin:auto 0; }
.badge-soon {
  font-size:11px; font-weight:600; letter-spacing:.12em; text-transform:uppercase;
  color:var(--accent); border:1px solid var(--accent); padding:4px 11px; border-radius:999px;
}
.info-links { display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.info-links a { color:var(--accent-2); font-weight:600; font-size:15px; }

/* ============================================================
   TABBAR (footer, 4 iconen)
   ============================================================ */
.tabbar {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  display:flex; z-index:50;
  background:rgba(255,255,255,.94); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
}
.tab {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; border:none; background:none; cursor:pointer; color:var(--muted);
  font-size:10.5px; font-weight:500; position:relative; padding:6px 0;
  transition:color .2s ease;
}
.tab.is-active { color:var(--ink); font-weight:600; }
.tab-icon { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; }
.tab.is-active .tab-icon { stroke:var(--accent); }
.tab-badge {
  position:absolute; top:2px; right:calc(50% - 22px);
  min-width:16px; height:16px; padding:0 4px; border-radius:999px;
  background:var(--accent); color:#fff; font-size:10px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}

/* ============================================================
   KAART-ACTIE SHEET (bottom sheet)
   ============================================================ */
.sheet-backdrop {
  position:fixed; inset:0; z-index:100;
  background:rgba(28,26,22,.5); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  display:flex; align-items:flex-end; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .3s ease;
}
.sheet-backdrop.open { opacity:1; pointer-events:auto; }
.sheet {
  width:100%; max-width:480px; background:var(--paper); border-radius:22px 22px 0 0;
  padding:18px 20px calc(24px + env(safe-area-inset-bottom));
  transform:translateY(100%); transition:transform .34s cubic-bezier(.2,.7,.2,1);
  position:relative; box-shadow:0 -10px 40px rgba(60,48,30,.3);
}
.sheet-backdrop.open .sheet { transform:none; }
.sheet-close {
  position:absolute; top:14px; right:14px; width:34px; height:34px; border-radius:50%;
  border:none; background:rgba(0,0,0,.06); color:var(--ink); font-size:19px; cursor:pointer;
}
.sheet-img { width:100%; aspect-ratio:15/10; border-radius:12px; overflow:hidden; background:var(--paper-2); margin-bottom:16px; }
.sheet-img img { width:100%; height:100%; object-fit:cover; }
.sheet-type { font-size:11.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.sheet-body h3 { font-size:22px; font-weight:700; margin:4px 0 16px; }
.sheet-actions { display:flex; flex-direction:column; gap:10px; }
.sheet-note { font-size:12.5px; color:var(--muted); margin:14px 0 0; text-align:center; }

/* ---------- toast ---------- */
.toast {
  position:fixed; left:50%; bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform:translate(-50%, 16px); z-index:120;
  background:var(--ink); color:#fff; font-size:14px; font-weight:500;
  padding:11px 20px; border-radius:999px; box-shadow:0 8px 26px rgba(0,0,0,.3);
  opacity:0; pointer-events:none; transition:opacity .25s ease, transform .25s ease;
}
.toast.show { opacity:1; transform:translate(-50%,0); }

@media (prefers-reduced-motion: reduce) {
  * { animation:none !important; transition-duration:.01ms !important; }
}
