/* Lettlab Plukk customer pages.
   Order page: a white greaseproof baker's bag, pinked (zig-zag) top edge, faint gusset folds down both sides; batches are
   separated by a perforation like a tear-off line. Ticket: a narrow pickup ticket with a punched hole, torn from a counter roll.
   Plum is the one accent (deadlines, counts left, the order button, the ticket number). */
:root {
  --bg: #e9ece6;
  --ink: #182420;
  --muted: #5d6762;
  --paper: #fbfaf6;
  --fold: #e7e3d8;
  --rule: #d9d5ca;
  --plum: #70405f;
  --ok: #2e6b48;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.hide { display: none !important; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }

/* ---- the bag */
.bag-wrap { max-width: 560px; margin: 0 auto; padding: 30px 14px 110px; }
.bag {
  position: relative; background: var(--paper); padding: 30px 26px 24px; box-shadow: 0 14px 30px -22px #182420aa;
  background-image: linear-gradient(90deg, transparent 13px, var(--fold) 13px, var(--fold) 14px, transparent 14px,
                                    transparent calc(100% - 14px), var(--fold) calc(100% - 14px), var(--fold) calc(100% - 13px), transparent calc(100% - 13px));
}
.bag::before { /* pinked top edge */
  content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
  background: linear-gradient(135deg, transparent 50%, var(--paper) 50%) 0 0 / 14px 10px, linear-gradient(225deg, transparent 50%, var(--paper) 50%) 0 0 / 14px 10px;
}
.bag-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; }
.bag-head .intro { margin: 8px 0 0; color: var(--muted); white-space: pre-wrap; }
.bag-head .pickup { margin: 10px 0 0; font-weight: 600; }
.batch { margin-top: 26px; padding-top: 22px; border-top: 2px dashed var(--rule); }
.batch h2 { margin: 0; font-size: 22px; font-weight: 800; }
.b-when { margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; color: var(--muted); }
.b-deadline { color: var(--plum); font-weight: 700; }
.batch.locked { opacity: .45; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.i-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.i-name { font-weight: 700; font-size: 18px; }
.i-desc { font-size: 14.5px; color: var(--muted); }
.i-meta { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.i-price { font-weight: 600; white-space: nowrap; }
.i-left { color: var(--plum); font-weight: 600; }
.i-left.out { color: var(--muted); text-decoration: line-through; }
.item.out .i-name { color: var(--muted); }
.item.in .i-name { color: var(--plum); }
.item.in { box-shadow: inset 3px 0 0 var(--plum); padding-left: 10px; margin-left: -13px; }
.step { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.step button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1; }
.step button.plus { background: var(--ink); color: var(--paper); }
.step button:disabled { opacity: .3; cursor: default; }
.step output { min-width: 28px; text-align: center; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.nothing { color: var(--muted); margin-top: 24px; }

/* ---- the order form at the bottom of the bag */
.order-form { margin-top: 30px; padding-top: 22px; border-top: 2px dashed var(--rule); display: grid; gap: 12px; }
.order-form h2 { margin: 0; font-size: 22px; }
.cart { list-style: none; margin: 0; padding: 0; }
.cart li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.cart b, .cart-total b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-total { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1.5px solid var(--ink); font-size: 20px; font-weight: 800; }
.f { display: grid; gap: 4px; }
.f span { font-size: 14px; color: var(--muted); font-weight: 600; }
.f input, .f textarea { min-height: 50px; padding: 10px 12px; border: 1.5px solid var(--rule); border-radius: 6px; background: #fff; }
.f input:focus, .f textarea:focus { outline: none; border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 440px) { .two { grid-template-columns: 1fr; } }
.hint { margin: -4px 0 0; font-size: 14px; color: var(--muted); }
.err { color: #b5281e; font-weight: 600; margin: 0; min-height: 1em; }
.go { min-height: 58px; border: 0; border-radius: 8px; background: var(--plum); color: #fff; font-weight: 700; font-size: 18px; cursor: pointer; }
.go:disabled { opacity: .6; }
.pay { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
.bag-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--rule); display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.bag-foot b { color: var(--ink); }
.powered { margin-top: 6px; font-size: 12px; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper); font-size: 17px; }
.cartbar b { margin-right: auto; font-variant-numeric: tabular-nums; }
.bar-go { color: var(--ink); background: var(--paper); text-decoration: none; font-weight: 700; padding: 12px 18px; border-radius: 8px; }

/* ---- the pickup ticket */
.ticket-wrap { max-width: 400px; margin: 0 auto; padding: 34px 14px 60px; }
.ticket { position: relative; background: var(--paper); padding: 40px 24px 22px; text-align: center; box-shadow: 0 14px 30px -22px #182420aa;
  border-radius: 2px; }
.ticket::after { /* torn bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px;
  background: radial-gradient(circle at 6px 0, var(--paper) 5px, transparent 5.5px) 0 0 / 12px 8px; }
.punch { position: absolute; left: 50%; top: 12px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--bg);
  box-shadow: inset 0 1px 2px #18242040; }
.t-shop { margin: 0; font-weight: 600; color: var(--muted); }
.t-number { margin: 2px 0 0; font-size: 46px; font-weight: 800; letter-spacing: -0.02em; color: var(--plum); font-variant-numeric: tabular-nums; line-height: 1.05; }
.t-state { margin: 6px 0 0; font-size: 21px; font-weight: 800; }
.status-ready .t-state { color: var(--plum); }
.status-picked_up .t-state, .status-cancelled .t-state { color: var(--muted); }
.t-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: left; }
.t-steps li { font-size: 11.5px; color: var(--muted); padding-top: 10px; position: relative; line-height: 1.2; }
.t-steps li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 3px; background: var(--rule); }
.t-steps li.done::before { background: var(--ink); }
.t-steps li.now::before { background: var(--plum); }
.t-steps li.now { color: var(--ink); font-weight: 700; }
.flash { margin: 14px 0 0; padding: 10px; background: var(--fold); font-weight: 600; }
.t-block { margin: 20px -24px 0; padding: 14px 24px; border-top: 2px dashed var(--rule); border-bottom: 2px dashed var(--rule); }
.t-label { margin: 0; font-size: 13px; color: var(--muted); }
.t-pickup { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.t-batch, .t-place { margin: 2px 0 0; color: var(--muted); }
.t-lines { list-style: none; margin: 16px 0 0; padding: 0; text-align: left; }
.t-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 5px 0; }
.t-lines .q { font-variant-numeric: tabular-nums; color: var(--muted); }
.t-lines b { font-weight: 600; font-variant-numeric: tabular-nums; }
.t-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1.5px solid var(--ink); font-size: 21px; font-weight: 800; }
.t-total b { font-variant-numeric: tabular-nums; }
.t-paid { display: inline-block; margin: 10px 0 0; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 1.5px solid var(--muted); color: var(--muted); }
.t-paid.paid { border-color: var(--ok); color: var(--ok); }
.t-note { margin: 12px 0 0; text-align: left; font-size: 15px; } .t-note span { color: var(--muted); }
.t-customer { margin: 10px 0 0; color: var(--muted); }
.cancel { margin-top: 18px; display: grid; gap: 4px; }
.cancel button { min-height: 50px; border: 1.5px solid var(--rule); border-radius: 8px; background: transparent; font-weight: 600; cursor: pointer; }
.cancel small { color: var(--muted); }
.t-foot { margin-top: 20px; padding-top: 14px; border-top: 2px dashed var(--rule); font-size: 13.5px; color: var(--muted); }
.t-foot .qr svg { width: 120px; height: 120px; }
.t-foot p { margin: 6px 0 0; }
.t-foot .save a { color: inherit; font-weight: 600; }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.actions button { min-height: 52px; padding: 0 22px; border: 1.5px solid var(--ink); border-radius: 8px; background: transparent; font-weight: 600; cursor: pointer; }
@media print {
  body { background: #fff; }
  .no-print, .cartbar { display: none !important; }
  .ticket, .bag { box-shadow: none; border: 1px solid #999; }
}

.powered a { color: inherit; text-decoration: none; }
