/* Order page */
.order-head { padding: 28px 0 8px; }
.order-head .h2 .script, .loc-head .h2 .script { font-size: .6em; display: inline-block; transform: rotate(-5deg); margin-left: .12em; }
.order-sub { margin: 10px 0 0; color: var(--ink-soft); font: 500 .8rem/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.cat-bar { min-width: 0;
  position: sticky; top: var(--header-h); z-index: 30; margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter);
  background: var(--cream);
}
.bag-btn { gap: 8px; }
.bag-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.14); font-size: .85rem; }

.menu-sec { padding-top: 28px; }
.sec-head { margin: 8px 0 14px; }
.sec-head .h3 { font: 400 clamp(2.6rem, 6vw, 3.8rem)/.95 var(--font-display); text-transform: uppercase; color: var(--cocoa-deep); }
.sec-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: .95rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }
.item { display: flex; flex-direction: column; padding: 16px; scroll-margin-top: calc(var(--header-h) + 72px); }
.item-img { aspect-ratio: 1; display: grid; place-items: center; }
.item-img img { width: 90%; height: 90%; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow-cookie); }
.item-name { font: 400 1.35rem/1.05 var(--font-display); text-transform: uppercase; color: var(--cocoa-deep); margin: 14px 0 4px; flex: 1; }
.item-price { margin: 0 0 12px; color: var(--ink-soft); font: 500 .85rem/1.3 var(--font-mono); letter-spacing: .04em; }
.item-ctl { min-height: 44px; display: flex; }
.item-ctl .btn, .item-ctl .stepper { width: 100%; }
.item-ctl .stepper { justify-content: space-between; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .95rem; }

.menu-loading, .menu-error { padding: 48px 0; color: var(--ink-soft); display: flex; gap: 12px; align-items: center; }
.menu-error { display: block; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin 700ms linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* bag sheet */
.sheet-back { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--cream); cursor: pointer; font-size: 1.2rem; }
.empty { padding: 32px 0; text-align: center; color: var(--ink-soft); }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-img img { width: 56px; height: 56px; object-fit: contain; }
.line-name { margin: 0; font-weight: 650; line-height: 1.25; }
.line-sub { margin: 2px 0 0; font-size: .85rem; color: var(--ink-soft); }
.line-ctl { display: grid; justify-items: end; gap: 4px; }
.line-total { margin: 0; font-weight: 650; }
.stepper-sm button { width: 36px; height: 36px; font-size: 1.15rem; }
.stepper-sm output { min-width: 22px; }
.stepper button:disabled { opacity: .3; cursor: default; }
.nudge { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fdf3c4; font-size: .95rem; }
.nudge-ok { background: #d9f3e5; }
.addons { margin-top: 18px; }
.addons-title { font-weight: 650; margin: 0 0 6px; }
.addon { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.muted { color: var(--ink-soft); }
.totals { margin: 0 0 12px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .disc { color: var(--green-deep); font-weight: 600; }
.totals .grand { font-size: 1.15rem; font-weight: 700; }

/* checkout */
.field-group { border: 0; padding: 0; margin: 4px 0 22px; }
.field-group legend { font: 400 1.5rem/1.1 var(--font-display); text-transform: uppercase; color: var(--cocoa-deep); padding: 0; margin-bottom: 8px; }
.hint { margin: 0 0 10px; color: var(--ink-soft); font-size: .9rem; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot {
  min-height: 56px; border-radius: 14px; border: 0; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; align-content: center; justify-items: start; padding: 8px 14px; cursor: pointer; text-align: left;
  transition: transform 120ms var(--ease-out);
}
.slot span { font-size: .85rem; color: var(--ink-soft); }
.slot:active { transform: scale(0.97); }
.slot[aria-checked="true"] { background: var(--green); box-shadow: none; }
.slot[aria-checked="true"] span { color: var(--ink); }
.more-times { display: grid; gap: 6px; margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { font-weight: 600; font-size: .95rem; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea, .more-times select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid #cfc8bd; background: #fff;
  font: 400 1rem/1.4 var(--font-ui); color: var(--ink);
}
.field input:focus, .field textarea:focus, .more-times select:focus { outline: 3px solid var(--aqua); outline-offset: 0; border-color: transparent; }
.field input:disabled { background: var(--paper); }
.pay-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 8px; cursor: pointer; }
.pay-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-deep); }
.pay-opt span { display: grid; }
.pay-opt small { color: var(--ink-soft); }
.pay-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--green-deep); }
.pay-opt.is-off { opacity: .55; cursor: default; }
.gift-field { margin-top: 12px; }
.form-err { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fde4e1; color: #7a1d12; font-weight: 600; }

/* done */
.done { text-align: center; padding: 8px 0 12px; }
.check { width: 64px; height: 64px; margin: 4px auto 10px; display: block; }
.check circle { fill: var(--green); }
.check path { fill: none; stroke: #111; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 380ms var(--ease-out) 120ms forwards; }
.done { animation: rise 360ms var(--ease-out) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .check path { stroke-dashoffset: 0; animation: none; } .done { animation: none; } }
.order-no { margin: 6px 0; font-size: 1.05rem; }
.done-when { margin: 8px 0 14px; }
.done-lines { list-style: none; padding: 0; margin: 0 0 12px; text-align: left; }
.done-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.done-total { font-size: 1.1rem; }
.done-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* box builder */
.box-step { font: 400 1.35rem/1.1 var(--font-display); text-transform: uppercase; color: var(--cocoa-deep); margin: 16px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.box-count { font: 650 .95rem/1 var(--font-ui); color: var(--green-deep); }
.wrap-chips { flex-wrap: wrap; overflow: visible; }
.sizes { display: grid; gap: 8px; }
.size { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.size.on { background: var(--green); box-shadow: none; }
.flavours { list-style: none; padding: 0; margin: 0; }
.flavours li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.flavours img { width: 40px; height: 40px; object-fit: contain; }

.order-band .band-inner { padding-bottom: 8px; }
@media (hover: hover) and (pointer: fine) { .item .item-img img { transition: transform 400ms var(--ease-out); } .item:hover .item-img img { transform: rotate(-8deg) scale(1.04); } }

/* v5: cut-out photos fill the square; no hover spin (keeps scrolling light) */
.item-img img[src*="assets/cookies/"] { width: 100%; height: 100%; }
.item .item-img img { transition: none; }
.item:hover .item-img img { transform: none; }
.bag-count { background: rgba(255,255,255,.22); }
.slot[aria-checked="true"], .size.on { background: var(--green-deep); color: #fff; }
.slot[aria-checked="true"] span, .size.on * { color: #fff; }
/* v6: cookies turn slightly on hover again (mouse only, so phone scrolling stays light) */
@media (hover: hover) and (pointer: fine) {
  .item .item-img img { transition: transform 400ms var(--ease-out); }
  .item:hover .item-img img { transform: rotate(-8deg) scale(1.04); }
}

/* ---------- v13: "Another day" opens a calendar, then that day's times ---------- */
.other-day {
  margin-top: 10px; width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border: 0; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line);
  font: 650 .98rem/1.2 var(--font-ui); color: var(--ink); text-align: left; cursor: pointer;
  transition: transform 120ms var(--ease-out), box-shadow 160ms ease, background-color 160ms ease;
}
.other-day span { flex: 1; }
.other-day:active { transform: scale(0.985); }
.other-day .chev { transition: transform 260ms var(--ease-out); }
.other-day[aria-expanded="true"] .chev { transform: rotate(180deg); }
.other-day.has-pick { background: var(--green-deep); color: #fff; box-shadow: none; }
.cal-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 300ms var(--ease-out), opacity 200ms ease; }
.cal-panel.open { grid-template-rows: 1fr; opacity: 1; }
.cal-inner { overflow: hidden; min-height: 0; }
.cal-panel:not(.open) .cal-inner { visibility: hidden; transition: visibility 0s linear 300ms; }
.cal { margin-top: 10px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-month { margin: 0; font: 400 1.35rem/1 var(--font-display); text-transform: uppercase; color: var(--cocoa-deep); letter-spacing: .02em; }
.cal-nav { width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--cream); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform 120ms var(--ease-out); }
.cal-nav:active { transform: scale(0.92); }
.cal-nav:disabled { opacity: .3; cursor: default; transform: none; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-dow span { font: 700 .72rem/1 var(--font-ui); letter-spacing: .06em; color: var(--ink-soft); padding: 6px 0; }
.cal-day {
  aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 999px; background: var(--cream); cursor: pointer;
  font: 650 .98rem/1 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums;
  transition: transform 120ms var(--ease-out), background-color 140ms ease, color 140ms ease;
}
.cal-day:active { transform: scale(0.9); }
.cal-day:disabled { background: transparent; color: #c6bdb0; cursor: default; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.12); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.cal-day.is-on { background: var(--green-deep); color: #fff; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .cal-day:not(:disabled):not(.is-on):hover { background: #efe5d2; } .cal-nav:not(:disabled):hover { background: #efe5d2; } }
.day-times { margin-top: 12px; animation: dayIn 260ms var(--ease-out) both; }
.day-times-title { margin: 0 0 8px; font: 700 .92rem/1.3 var(--font-ui); color: var(--ink); }
#daySlots .slot { min-height: 52px; align-content: center; }
@keyframes dayIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- v13: Crumbs sign-up at checkout ---------- */
.crumbs-opt { display: flex; gap: 12px; align-items: flex-start; margin-top: 6px; padding: 14px; border-radius: 16px; background: #fff7d6; box-shadow: inset 0 0 0 1.5px var(--gold); cursor: pointer; }
.crumbs-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.crumbs-box { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 2px var(--ink); display: grid; place-items: center; transition: background-color 140ms ease, transform 120ms var(--ease-out); }
.crumbs-box svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 220ms var(--ease-out); }
.crumbs-opt input:checked + .crumbs-box { background: var(--green-deep); box-shadow: none; }
.crumbs-opt input:checked + .crumbs-box svg { stroke-dashoffset: 0; }
.crumbs-opt input:focus-visible + .crumbs-box { outline: 3px solid var(--aqua); outline-offset: 2px; }
.crumbs-opt:active .crumbs-box { transform: scale(0.92); }
.crumbs-text b { display: block; font: 700 1rem/1.3 var(--font-ui); color: var(--ink); }
.crumbs-text small { display: block; margin-top: 4px; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.crumbs-member, .done-crumbs { margin: 6px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff7d6; box-shadow: inset 0 0 0 1.5px var(--gold); font-size: .92rem; line-height: 1.45; }
.done-crumbs { margin-top: 14px; text-align: left; }
@media (prefers-reduced-motion: reduce) { .cal-panel, .other-day .chev, .crumbs-box svg { transition: none; } .day-times { animation: none; } }
.crumbs-opt[hidden], .other-day[hidden], .crumbs-member[hidden], .done-crumbs[hidden], .day-times[hidden] { display: none !important; }

/* v15: photo of the selected gift box */
.box-preview { margin: 4px 0 4px; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.box-preview img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; transition: opacity 220ms ease, transform 320ms var(--ease-out); }
.box-preview img.swap { opacity: 0; transform: scale(.98); }
.box-preview figcaption { padding: 10px 14px; font: 700 .92rem/1.3 var(--font-ui); color: var(--ink); border-top: 1px solid var(--line); }
.box-preview[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .box-preview img { transition: none; } }
.box-preview img { max-height: min(260px, 32vh); }

/* v16: gift box photos are cut out of their black backgrounds in the browser */
img[data-cutout] { border-radius: 0 !important; box-shadow: none !important; object-fit: contain !important; opacity: 0; transition: opacity 220ms ease; }
img[data-cutout].cut { opacity: 1; }
.item-img img[data-cutout] { width: 100%; height: 100%; filter: drop-shadow(0 10px 14px rgba(80,48,21,.18)); }
.line-img.is-box { background: transparent; }
.box-preview { background: var(--cream); }
.box-preview img { background: transparent; filter: drop-shadow(0 12px 18px rgba(80,48,21,.2)); }
@media (prefers-reduced-motion: reduce) { img[data-cutout] { transition: none; } }

/* v17: individual wrapping card */
.wrap-card { padding: 14px; border-radius: 16px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.wrap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wrap-head b { display: block; font: 700 1rem/1.3 var(--font-ui); }
.wrap-head small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: .88rem; }
.wrap-head small .num { font-weight: 700; color: var(--ink); }
.wrap-sum { flex: none; font-size: .88rem; color: var(--ink-soft); text-align: right; }
.wrap-sum b { color: var(--ink); }
.wrap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wrap-actions .btn { flex: 1 1 auto; min-height: 44px; }
.wrap-status { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 650; color: var(--green-deep); }
.wrap-status svg { flex: none; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--green-deep); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wrap-hint { margin: 10px 0 6px; font-size: .9rem; color: var(--ink-soft); }
.wrap-list { list-style: none; margin: 0; padding: 0; }
.wrap-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wrap-name { font-weight: 650; }
.wrap-name small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .82rem; }
.wrap-card .stepper { background: #fff; }
