/* engine.css: the sheet that booking and ordering live in. Every colour and face comes from the site's --e-* tokens. */
.eng-lock, .eng-lock body { overflow: hidden; }
.eng { position: fixed; inset: 0; z-index: 100; font-family: var(--e-body); color: var(--e-fg); }
.eng[hidden] { display: none !important; }
.eng .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eng-scrim { position: absolute; inset: 0; background: var(--e-scrim, rgba(0,0,0,.6)); opacity: 0; transition: opacity .65s ease; }
.eng-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--e-bg);
  transform: translateY(100%); transition: transform .7s cubic-bezier(.16,.84,.24,1);
  padding-top: env(safe-area-inset-top, 0px);
}
.eng.on .eng-scrim { opacity: 1; }
.eng.on .eng-panel { transform: none; }
@media (min-width: 900px) {
  .eng-panel { left: auto; width: min(500px, 100%); transform: translateX(100%); box-shadow: -1px 0 0 var(--e-line); }
}

.eng-top { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 4px;
  padding: 8px max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); }
.eng-ic { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; color: var(--e-fg); cursor: pointer; border-radius: 50%; }
.eng-ic:focus-visible, .eng button:focus-visible, .eng a:focus-visible, .eng input:focus-visible, .eng textarea:focus-visible { outline: 2px solid var(--e-accent); outline-offset: 2px; }
.eng-head { text-align: center; min-width: 0; }
.eng-kicker { margin: 0; font-size: 13px; letter-spacing: .04em; color: var(--e-muted); }
.eng-title { margin: 2px 0 0; font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 24px; line-height: 1.15; text-wrap: balance; outline: none; }
.eng-progress { height: 1px; background: var(--e-line); margin: 0 0 4px; }
.eng-progress i { display: block; height: 100%; background: var(--e-accent); transform-origin: left; transform: scaleX(0); transition: transform .8s cubic-bezier(.2,.7,.2,1); }

.eng-body { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.eng-screen { padding: 20px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px));
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.eng-screen.enter { opacity: 0; transform: translateY(16px); }
.eng-screen.enter.back { transform: translateY(-16px); }
.eng-screen.leave { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(-10px); transition-duration: .32s; pointer-events: none; }

.eng-foot { padding: 12px max(20px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--e-line); }
.eng-foot:empty { display: none; }
.eng-cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 0 20px; border: 0; border-radius: var(--e-radius, 0);
  background: var(--e-accent); color: var(--e-on-accent); font: 600 17px/1.2 var(--e-body); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: opacity .3s, background .4s; }
.eng-cta[disabled] { opacity: .35; cursor: default; }
.eng-cta.ghost { background: transparent; color: var(--e-fg); box-shadow: inset 0 0 0 1px var(--e-line-strong, var(--e-line)); }
.eng-cta.busy { position: relative; overflow: hidden; }
.eng-cta.busy::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--e-on-accent); transform-origin: left; animation: e-bar 1.3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes e-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* lists */
.e-list { display: grid; }
.e-row { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 14px 4px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--e-line); color: inherit; font: inherit; cursor: pointer; transition: background .3s, padding .4s; }
.e-row:first-child { border-top: 1px solid var(--e-line); }
.e-row.on { background: var(--e-raise); padding-left: 14px; }
.e-row-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.e-row-main { font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 24px; line-height: 1.1; }
.e-list.compact .e-row-main { font-size: 20px; }
.e-row-sub { font-size: 16px; color: var(--e-muted); line-height: 1.35; }
.e-row-end { font-variant-numeric: tabular-nums lining-nums; font-size: 17px; white-space: nowrap; }
.e-thumb { width: 56px; height: 70px; object-fit: cover; flex: none; border-radius: var(--e-thumb-radius, 0); }
.e-note { color: var(--e-muted); font-size: 16px; line-height: 1.5; margin: 18px 0 0; }
.e-lead { font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 20px; margin: 0 0 8px; }
.e-group { font: 500 14px/1 var(--e-body); color: var(--e-muted); letter-spacing: .02em; margin: 22px 0 10px; }

/* days */
.e-days { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 4px 20px 14px; scrollbar-width: none; }
.e-days::-webkit-scrollbar { display: none; }
.e-day { flex: none; scroll-snap-align: start; width: 88px; min-height: 150px; display: grid; justify-items: center; align-content: center; gap: 6px; background: none; color: inherit;
  border: 1px solid var(--e-line); border-radius: var(--e-radius, 0); font: inherit; cursor: pointer; transition: background .3s, border-color .3s; }
.e-day-top { font-size: 13px; color: var(--e-muted); }
.e-day-num { font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 48px; line-height: 1; font-variant-numeric: lining-nums; }
.e-day-sub { font-size: 12px; color: var(--e-muted); }
.e-day.on { background: var(--e-accent); color: var(--e-on-accent); border-color: var(--e-accent); }
.e-day.on .e-day-top, .e-day.on .e-day-sub { color: inherit; }
.e-day[disabled] { opacity: .32; cursor: default; }

/* slots */
.e-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.e-slot { min-height: 52px; display: flex; align-items: baseline; justify-content: center; gap: 4px; background: none; color: inherit; border: 1px solid var(--e-line); border-radius: var(--e-radius, 0);
  font: 500 18px/1 var(--e-body); font-variant-numeric: tabular-nums lining-nums; cursor: pointer; transition: background .3s; }
.e-slot small { font-size: 11px; color: var(--e-muted); }
.e-slot.on { background: var(--e-accent); color: var(--e-on-accent); border-color: var(--e-accent); }
.e-slot.on small { color: inherit; }
.e-slot[disabled] { opacity: .3; text-decoration: line-through; cursor: default; }

/* bag */
.e-bag { display: grid; }
.e-line { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--e-line); }
.e-line-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.e-line-name { font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 20px; line-height: 1.15; }
.e-line-price { color: var(--e-muted); font-variant-numeric: tabular-nums; font-size: 16px; }
.e-qty { display: flex; align-items: center; gap: 2px; }
.e-qbtn { width: 44px; height: 44px; display: grid; place-items: center; background: none; color: inherit; border: 1px solid var(--e-line); border-radius: 50%; cursor: pointer; }
.e-qn { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-size: 17px; }
.e-sum-line { display: flex; justify-content: space-between; padding: 16px 0 4px; font-size: 17px; font-variant-numeric: tabular-nums; }
.e-field { display: grid; gap: 8px; margin-top: 22px; font-size: 15px; color: var(--e-muted); }
.e-field input, .e-field textarea { width: 100%; box-sizing: border-box; font: 17px/1.4 var(--e-body); color: var(--e-fg); background: var(--e-raise); border: 1px solid var(--e-line); border-radius: var(--e-radius, 0); padding: 14px 14px; min-height: 52px; resize: vertical; }
.e-field input::placeholder, .e-field textarea::placeholder { color: var(--e-muted); opacity: .8; }

/* pickup strip and tips */
.e-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 4px 20px 14px; scrollbar-width: none; }
.e-strip::-webkit-scrollbar { display: none; }
.e-chip, .e-tipb { flex: none; scroll-snap-align: start; min-width: 86px; min-height: 88px; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 10px 14px;
  background: none; color: inherit; border: 1px solid var(--e-line); border-radius: var(--e-radius, 0); font: inherit; cursor: pointer; transition: background .3s; }
.e-chip.wide { min-width: 170px; }
.e-chip-big { font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 24px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; text-align: center; }
.e-chip-sub { font-size: 13px; color: var(--e-muted); }
.e-chip.on, .e-tipb.on { background: var(--e-accent); color: var(--e-on-accent); border-color: var(--e-accent); }
.e-chip.on .e-chip-sub, .e-tipb.on .e-chip-sub { color: inherit; }
.e-tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* receipt */
.e-receipt { border: 1px solid var(--e-line); border-radius: var(--e-radius, 0); padding: 22px 20px 18px; background: var(--e-raise); }
.e-r-shop { margin: 0; text-align: center; font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 26px; }
.e-r-addr { margin: 4px 0 14px; text-align: center; color: var(--e-muted); font-size: 14px; }
.e-receipt dl { margin: 0; display: grid; gap: 10px; }
.e-r-row { display: flex; align-items: baseline; gap: 8px; font-size: 16px; }
.e-r-row dt { flex: none; max-width: 60%; color: var(--e-muted); }
.e-r-row dd { margin: 0 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.e-r-row::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--e-line-strong, var(--e-line)); transform: translateY(-4px); min-width: 12px; }
.e-r-row dd { order: 2; }
.e-r-row.strong { font-size: 19px; }
.e-r-row.strong dt { color: var(--e-fg); }
.e-r-rule { border-top: 1px dashed var(--e-line-strong, var(--e-line)); margin: 4px 0; }

/* pay */
.e-opts { display: grid; gap: 8px; }
.e-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px; text-align: left; background: none; color: inherit; border: 1px solid var(--e-line); border-radius: var(--e-radius, 0); font: inherit; cursor: pointer; transition: border-color .3s, background .3s; }
.e-opt .e-row-main { font-size: 20px; }
.e-opt.on { border-color: var(--e-accent); background: var(--e-raise); }
.e-opt-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--e-line-strong, var(--e-muted)); flex: none; transition: box-shadow .3s; }
.e-opt.on .e-opt-dot { box-shadow: inset 0 0 0 6px var(--e-accent); }
.e-demo { margin-top: 26px; text-align: center; padding: 26px 16px 8px; border-top: 1px solid var(--e-line); }
.e-demo-amt { margin: 0; font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 64px; line-height: 1; font-variant-numeric: lining-nums; }
.e-demo-note { margin: 12px 0 0; font-size: 13px; color: var(--e-muted); letter-spacing: .02em; }
.e-stripe { margin-top: 22px; display: grid; gap: 14px; }
.e-err { color: var(--e-error, #e5484d); font-size: 15px; margin-top: 14px; }

/* done */
.e-done { text-align: center; padding: 22px 0 8px; }
.e-done-mark { color: var(--e-accent); display: grid; place-items: center; margin-bottom: 18px; }
.e-done-mark circle { stroke-dasharray: 190; stroke-dashoffset: 190; animation: e-draw 1.1s .15s cubic-bezier(.6,0,.2,1) forwards; }
.e-done-mark .e-tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: e-draw .6s 1.05s ease forwards; }
@keyframes e-draw { to { stroke-dashoffset: 0; } }
.e-done-label { margin: 0; color: var(--e-muted); font-size: 14px; }
.e-done-ref { margin: 6px 0 0; font-family: var(--e-display); font-weight: var(--e-display-weight, 400); font-size: 44px; line-height: 1.05; letter-spacing: .04em; font-variant-numeric: lining-nums; }
.e-done-when { margin: 18px 0 0; font-size: 19px; }
.e-done-paid { margin: 8px 0 0; color: var(--e-muted); font-size: 16px; }
.e-actions { display: grid; gap: 10px; margin-top: 28px; }
.e-sent { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .eng-panel, .eng-screen, .eng-progress i { transition-duration: .01s !important; transform: none !important; }
  .eng-panel { opacity: 0; transition: opacity .2s !important; }
  .eng.on .eng-panel { opacity: 1; }
  .e-done-mark circle, .e-done-mark .e-tick { animation: none; stroke-dashoffset: 0; }
}
