/* Crumbel koekjesverkoop: zelfde wereld als de affiche (crème, bruin, beige, roze, geel) */
@font-face { font-family: "Sriracha"; src: url("fonts/sriracha.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #FBF7F0;
  --kaart: #FFFFFF;
  --bruin: #5B2E17;
  --bruin-zacht: #8A5A3E;
  --beige: #E7D4AE;
  --roze: #F6DACC;
  --geel: #F9DE7C;
  --groen: #2F7A4A;
  --rood: #B3261E;
  --lijn: #EADFCB;
  --hand: "Sriracha", "Comic Sans MS", cursive;
  --tekst: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--bruin);
  font: 16px/1.45 var(--tekst);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2 { font-family: var(--hand); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
p { margin: 0; }
strong { font-weight: 650; }

.wrap, .kop {
  max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { display: grid; gap: 16px; padding-block: 4px 32px; }

.kop { display: flex; align-items: center; gap: 14px; padding-block: max(18px, env(safe-area-inset-top, 0px)) 14px; }
.logo { width: 72px; height: auto; flex: none; }
.eyebrow { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bruin-zacht); font-weight: 600; }
.meta { font-size: .9rem; color: var(--bruin-zacht); margin-top: 2px; }

.kaart {
  background: var(--kaart); border: 1px solid var(--lijn); border-radius: 18px;
  padding: 18px; display: grid; gap: 10px;
}
.stapel { display: grid; gap: 10px; margin-top: 4px; }
.klein { font-size: .88rem; color: var(--bruin-zacht); text-align: center; }
.sectietitel { margin-top: 4px; }
.optioneel { font-weight: 400; color: var(--bruin-zacht); }

label { font-weight: 600; font-size: .95rem; }
input[type=email], input[type=text], textarea, .codeveld {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1.5px solid var(--beige); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--geel); outline-offset: 2px; border-color: var(--bruin);
}
.codeveld { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

.knop {
  font: 600 1rem/1 var(--tekst); color: #fff; background: var(--bruin);
  border: 0; border-radius: 999px; min-height: 50px; padding: 0 22px; cursor: pointer;
}
.knop:active { transform: translateY(1px); }
.knop[aria-disabled=true] { background: #B9A291; }
.knop.gevaar { background: var(--rood); }
.link { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--bruin); text-decoration: underline; cursor: pointer; }
.rij-links { justify-self: start; }

.melding { padding: 12px 14px; border-radius: 12px; background: var(--roze); }
.melding.fout { background: #FBE3E0; color: var(--rood); }
.melding.ok { background: #E3F1E6; color: var(--groen); }

.ingelogd { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .88rem; color: var(--bruin-zacht); flex-wrap: wrap; }
.ingelogd span { min-width: 0; overflow-wrap: anywhere; }

/* Producten */
.producten { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.product {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
  background: var(--kaart); border: 1px solid var(--lijn); border-radius: 16px; padding: 10px 10px 10px 12px;
  transition: border-color .15s, background-color .15s;
}
.product.gekozen { border-color: var(--beige); background: #FFFBF2; }
.product img { width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 3px var(--beige); }
.pnaam { font-weight: 600; font-size: .95rem; line-height: 1.25; min-width: 0; }
.stepper { display: flex; align-items: center; background: var(--bg); border: 1.5px solid var(--beige); border-radius: 999px; }
.stepper button {
  width: 42px; height: 42px; border: 0; background: none; color: var(--bruin);
  font-size: 1.4rem; line-height: 1; border-radius: 50%; cursor: pointer; touch-action: manipulation;
}
.stepper button:active { background: var(--roze); }
.stepper input {
  width: 46px; height: 42px; border: 0; background: none; text-align: center; color: inherit;
  font: 650 1.1rem var(--tekst); font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Samenvatting na deadline */
.samenvatting { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.samenvatting li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--lijn); padding-bottom: 6px; }
.samenvatting .tot { border: 0; font-weight: 650; }

.verwijder { font-size: .92rem; padding: 0 4px; }
.verwijder summary { cursor: pointer; color: var(--bruin-zacht); padding: 6px 0; }
.verwijder p { margin: 6px 0 10px; }

/* Vaste balk onderaan met totaal */
.bestelform { display: grid; gap: 16px; padding-bottom: 130px; }
.balk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: rgba(251, 247, 240, .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--lijn);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.balk-in { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.teller { flex: 1; min-width: 0; display: grid; gap: 5px; }
.totaal { font-family: var(--hand); font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.bedrag { font-family: var(--tekst); font-size: .9rem; color: var(--bruin-zacht); margin-left: 4px; }
.voortgang { height: 6px; background: var(--lijn); border-radius: 99px; overflow: hidden; }
.voortgang span { display: block; height: 100%; width: 0; background: var(--geel); border-radius: 99px; transition: width .2s; }
.balk.ok .voortgang span { background: var(--groen); }
.hint { font-size: .8rem; color: var(--bruin-zacht); }
.balk.ok .hint { color: var(--groen); }
.balk .knop { flex: none; }
.schud { animation: schud .35s; }
@keyframes schud { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

@media (max-width: 380px) {
  .product { grid-template-columns: 44px 1fr; }
  .product img { width: 44px; height: 44px; }
  .stepper { grid-column: 1 / -1; justify-self: end; }
  .balk .knop { padding: 0 16px; }
}
@media (max-width: 480px) { .cijfer { padding: 12px 10px; } .cijfer b { font-size: 1.45rem; } .cijfer span { font-size: .78rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Beheer ---------- */
.beheer .wrap { max-width: 960px; }
.beheer .kop { max-width: 960px; }
.cijfers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cijfer { background: var(--kaart); border: 1px solid var(--lijn); border-radius: 16px; padding: 14px; }
.cijfer b { display: block; font-family: var(--hand); font-weight: 400; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cijfer span { font-size: .85rem; color: var(--bruin-zacht); }
.knoppen { display: flex; flex-wrap: wrap; gap: 8px; }
.knop.licht { background: var(--kaart); color: var(--bruin); border: 1.5px solid var(--beige); }
.tabel-scroll { overflow-x: auto; background: var(--kaart); border: 1px solid var(--lijn); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--lijn); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bruin-zacht); font-weight: 600; background: #FFFBF2; }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 650; background: #FFFBF2; }
.balkje { display: block; height: 6px; background: var(--geel); border-radius: 99px; margin-top: 5px; }
.mini { font-size: .8rem; color: var(--bruin-zacht); }
.verwijder-form { display: inline; }
.verwijder-form .link { color: var(--rood); padding: 0; font-size: .85rem; }
