/* Takeaway demo: the third choice in the order pop-up, the ordering panel and the floating button.
   Kept apart from style.css so the rest of the site is untouched. */

/* third choice in the order pop-up */
.opt-takeaway {
  width: 100%; background: var(--yellow); color: var(--black); cursor: pointer; text-align: left;
  font-size: clamp(28px, 8vw, 38px);
}
.opt-takeaway.is-paused { background: #ddd5c6; color: #5c5147; }

/* ---------- the panel ---------- */
.tw { width: min(640px, calc(100vw - 24px)); padding: 0; }
.tw .chooser-close { z-index: 3; background: var(--cream); border: 3px solid var(--black); border-radius: 8px; top: 10px; right: 10px; }
#twBody { padding: 22px 22px 0; }
#twBody > :last-child { margin-bottom: 22px; }
.tw p:not(.kicker) { margin: 0; font-weight: 400; }
.tw-head { padding-right: 52px; }
.tw-head h2 { font-size: min(64px, 15vw); line-height: .9; }
.tw-head h2:focus { outline: none; }
.tw .tw-lede { margin-top: 10px; font-weight: 600; }
.tw .tw-fine { margin-top: 8px; font-size: 14px; color: #5c5147; }
.tw .tw-note, .tw .tw-alert { margin-top: 14px; padding: 10px 12px; border: 2px solid var(--black); border-radius: 8px; font-weight: 700; font-size: 15px; line-height: 1.35; }
.tw .tw-note { background: var(--blue); }
.tw .tw-alert { background: #ffd9d9; border-color: #a80000; color: #6b0000; }

.tw-back {
  display: inline-block; margin: 0 0 12px; padding: 8px 0; min-height: 44px;
  background: none; border: 0; cursor: pointer; color: var(--black);
  font: 800 19px/1 "Display", sans-serif; text-transform: uppercase; letter-spacing: .03em;
}
.tw-back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* menu */
.tw-tools { position: sticky; top: 0; z-index: 2; margin: 16px -22px 0; padding: 10px 22px 12px; background: var(--cream); border-bottom: 3px solid var(--black); }
.tw-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tw-tab {
  flex: 1 1 auto; min-height: 44px; padding: 6px 12px; cursor: pointer;
  font: 800 22px/1 "Display", sans-serif; text-transform: uppercase; letter-spacing: .02em;
  color: var(--black); background: transparent; border: 2px solid var(--black); border-radius: 22px;
}
.tw-tab:hover { background: rgba(0,0,0,.08); }
.tw-tab[aria-pressed="true"] { background: var(--black); color: #fff; }
.tw-search {
  display: block; width: 100%; min-height: 48px; margin: 0; padding: 8px 12px;
  font: 600 17px/1.2 "Sofia Sans", sans-serif; color: var(--black);
  background: #fff; border: 3px solid var(--black); border-radius: 6px;
}
.tw-search::placeholder { color: #5c5147; opacity: 1; }
.tw-group { margin: 18px 0 6px; padding: 7px 12px 5px; background: var(--black); color: #fff; font: 900 22px/1 "Display", sans-serif; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; }
.tw-items, .tw-lines, .tw-sum { list-style: none; margin: 0; padding: 0; }
.tw-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.25); }
.tw-row:last-child { border-bottom: 0; }
.tw-thumb { flex: none; width: 56px; height: 56px; object-fit: cover; border: 2px solid var(--black); border-radius: 6px; background: var(--black); }
.tw-thumb-none { background: repeating-linear-gradient(45deg, var(--pink), var(--pink) 6px, #f7cfd8 6px, #f7cfd8 12px); }
.tw-row-text, .tw-line-text { flex: 1 1 auto; min-width: 0; }
.tw-name { display: block; font: 900 23px/1.02 "Display", sans-serif; text-transform: uppercase; }
.tw-desc { display: block; margin-top: 2px; font-size: 14px; line-height: 1.3; color: #3b332c; }
.tw-row-end, .tw-line-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tw-price { font-weight: 800; font-size: 16px; white-space: nowrap; }
.tw-add {
  min-width: 44px; min-height: 40px; padding: 4px 12px; cursor: pointer;
  font: 900 20px/1 "Display", sans-serif; text-transform: uppercase;
  color: var(--black); background: var(--yellow); border: 2px solid var(--black); border-radius: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tw-add:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--black); }
.tw-add.pop { animation: tw-pop .35s var(--out, ease); }
@keyframes tw-pop { 40% { transform: scale(1.18); background: #fff36b; } }
.tw-out { display: inline-block; padding: 3px 7px; font-size: 12px; font-weight: 800; color: #fff; background: #6b6158; border-radius: 4px; }
.tw-row.is-out .tw-name, .tw-row.is-out .tw-thumb { opacity: .5; }
.tw-empty { padding: 24px 0; text-align: center; font-weight: 700; }

/* sticky "view basket" bar at the bottom of the menu */
.tw-cartbar {
  position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: calc(100% + 44px); margin: 18px -22px 0 !important; padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  background: var(--black); color: #fff; border: 0; border-top: 3px solid var(--black); cursor: pointer;
  font: 900 26px/1 "Display", sans-serif; text-transform: uppercase;
}
.tw-cartbar:hover { background: #2a2420; }
.tw-count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; margin-left: 4px; border-radius: 14px; background: var(--yellow); color: var(--black); font: 900 18px/1 "Sofia Sans", sans-serif; }

/* one dish */
.tw-hero { display: block; width: calc(100% + 44px); max-width: none; margin: 0 -22px 16px; height: auto; max-height: 300px; object-fit: cover; border-top: 3px solid var(--black); border-bottom: 3px solid var(--black); }
.tw-opt { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.tw-opt legend { padding: 0; margin-bottom: 8px; font: 900 24px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-hint { font: 700 13px/1 "Sofia Sans", sans-serif; text-transform: none; color: #5c5147; vertical-align: middle; }
.tw-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.tw-choice {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; cursor: pointer;
  border: 2px solid rgba(0,0,0,.35); border-radius: 8px; background: #fff; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.tw-choice:hover { border-color: var(--black); }
.tw-choice:has(input:checked) { border-color: var(--black); background: var(--yellow); box-shadow: inset 0 0 0 1px var(--black); }
.tw-choice input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--black); }
.tw-choice span:first-of-type { flex: 1 1 auto; }
.tw-plus { flex: 0 1 auto; font-size: 13px; font-weight: 800; color: #3b332c; text-align: right; }
.tw-pay .tw-choices { grid-template-columns: 1fr !important; }
.tw-payinfo { margin-top: 16px; }
.tw-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tw .tw-fine a { color: #0b4f6c; font-weight: 700; }
.tw-field-lab { display: block; margin-bottom: 6px; font: 900 22px/1 "Display", sans-serif; text-transform: uppercase; }
.tw .tw-payinfo p { padding: 10px 12px; font-weight: 700; background: var(--mint); border: 2px solid var(--black); border-radius: 8px; }
.tw-field { display: block; margin-top: 16px; }
.tw-field > span { display: block; margin-bottom: 6px; font: 900 22px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-field input, .tw-field select, .tw-field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 600 17px/1.3 "Sofia Sans", sans-serif; color: var(--black);
  background: #fff; border: 3px solid var(--black); border-radius: 6px;
}
.tw-field textarea { resize: vertical; }
.tw-field small { display: block; margin-top: 5px; font-size: 13px; color: #5c5147; }
.tw-field [aria-invalid="true"] { border-color: #a80000; background: #fff3f3; }
.tw-ferr, .tw-err { display: block; margin-top: 6px; color: #a80000; font-weight: 800; font-size: 14px; }
.tw-err:empty { display: none; }
.tw-addbar { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; align-items: stretch; margin: 18px -22px 0 !important; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); background: var(--cream); border-top: 3px solid var(--black); }
.tw-addbtn { flex: 1 1 auto; font-size: 26px; min-height: 54px; }
.tw-stepper { display: inline-flex; align-items: center; border: 3px solid var(--black); border-radius: 8px; background: #fff; flex: none; }
.tw-stepper button { width: 44px; height: 48px; font: 900 24px/1 "Sofia Sans", sans-serif; background: none; border: 0; cursor: pointer; color: var(--black); }
.tw-stepper button:hover { background: rgba(0,0,0,.08); }
.tw-stepper output { min-width: 28px; text-align: center; font-weight: 900; font-size: 18px; }
.tw-stepper-sm { border-width: 2px; }
.tw-stepper-sm button { width: 38px; height: 36px; font-size: 20px; }

/* basket */
.tw-lines { margin-top: 14px; border-top: 3px solid var(--black); }
.tw-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.25); }
.tw-line.is-out { background: #ffe9e9; }
.tw-linenote { font-style: italic; }
.tw .tw-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 12px; border-top: 3px solid var(--black); font: 900 28px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-total b { font-size: 34px; }
.tw .block { margin-top: 16px; }
.tw .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tw-ghost { color: var(--black) !important; }

/* demo card payment */
.tw-paycard { margin-top: 16px; padding: 18px; border: 3px solid var(--black); border-radius: 10px; background: linear-gradient(135deg, #fff 0%, #f1ece2 100%); }
.tw .tw-paytotal { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 800; }
.tw-paytotal b { font: 900 40px/1 "Display", sans-serif; }
.tw .tw-lock { margin: 12px 0 6px; font-size: 28px; }
.tw-paycard p:last-child { font-size: 15px; line-height: 1.4; }

/* order status */
.tw-status { margin-top: 16px; padding: 14px 16px; border: 3px solid var(--black); border-radius: 10px; background: var(--blue); }
.tw-status-accepted { background: var(--mint); }
.tw-status-ready { background: var(--yellow); animation: tw-glow 1.6s ease-in-out infinite alternate; }
.tw-status-collected { background: #e9e2d6; }
.tw-status-declined, .tw-status-cancelled { background: #ffd9d9; }
.tw .tw-status-msg { font: 900 30px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-status p + p { margin-top: 8px; font-weight: 600; }
@keyframes tw-glow { to { box-shadow: 0 0 0 6px rgba(248, 228, 71, .55); } }
.tw-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; margin: 16px 0 0; padding: 0; counter-reset: s; }
.tw-steps li { counter-increment: s; position: relative; padding-top: 30px; text-align: center; font-size: 13px; font-weight: 700; color: #6b6158; }
.tw-steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #6b6158; background: #fff; font-weight: 900; }
.tw-steps li.done { color: var(--black); }
.tw-steps li.done::before { content: "✓"; background: var(--black); border-color: var(--black); color: #fff; }
.tw-steps li.now { color: var(--black); }
.tw-steps li.now::before { background: var(--yellow); border-color: var(--black); }
.tw-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; }
.tw-facts dt { font: 900 19px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-facts dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.tw-sum { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,.25); }
.tw-sum li { padding: 4px 0; font-size: 15px; }
.tw-sum .tw-desc { display: inline; }

/* "same as last time" */
.tw-again { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; background: var(--mint); border: 2px solid var(--black); border-radius: 10px; }
.tw-again-thumbs { display: flex; flex: none; }
.tw-again-thumbs .tw-thumb { width: 40px; height: 40px; margin-left: -10px; border-radius: 50%; }
.tw-again-thumbs .tw-thumb:first-child { margin-left: 0; }
.tw-again-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.3; }
.tw-again-text b { display: block; font: 900 20px/1 "Display", sans-serif; text-transform: uppercase; margin-bottom: 3px; }
.tw-again-btn { flex: none; font-size: 19px; min-height: 44px; padding: 8px 12px; }

/* basket lines with photos */
.tw-line { align-items: center; }
.tw-line .tw-thumb { width: 56px; height: 56px; }

/* the order's own link */
.tw-link { display: grid; gap: 4px; margin-top: 14px; padding: 12px; background: #fff; border: 2px solid var(--black); border-radius: 8px; }
.tw-link b { font: 900 19px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-link-url { font: 700 15px/1.3 ui-monospace, Consolas, monospace; word-break: break-all; color: #0b4f6c; }
.tw-link small { font-size: 13px; color: #5c5147; }
.tw-link .btn { justify-self: start; margin-top: 4px; font-size: 20px; min-height: 44px; }

/* notifications line on the status page */
.tw .tw-notify { margin-top: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; background: #fff; border: 2px dashed var(--black); border-radius: 8px; }

/* review after pickup */
.tw-rate { margin-top: 18px; padding: 16px; background: #fff; border: 3px solid var(--black); border-radius: 10px; }
.tw-rate h3 { margin: 0; font: 900 34px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-stars { display: flex; gap: 4px; margin: 10px 0 0; padding: 0; border: 0; }
.tw-stars legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tw-star { position: relative; cursor: pointer; font-size: 40px; line-height: 1; color: #d8d0c2; }
.tw-star input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tw-star.on { color: #f0b400; }
.tw-star:has(input:focus-visible) { outline: 3px solid var(--black); outline-offset: 2px; border-radius: 4px; }
.tw .tw-rate-lab { margin-top: 14px; font: 900 20px/1 "Display", sans-serif; text-transform: uppercase; }
.tw-rate-dishes { list-style: none; margin: 8px 0 0; padding: 0; }
.tw-rate-dish { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.15); }
.tw-rate-dish .tw-thumb { width: 40px; height: 40px; }
.tw-rate-dish span { flex: 1 1 auto; font-weight: 700; }
.tw-thumbbtn { width: 46px; height: 44px; font-size: 22px; background: #fff; border: 2px solid rgba(0,0,0,.3); border-radius: 8px; cursor: pointer; filter: grayscale(1); opacity: .6; }
.tw-thumbbtn[aria-pressed="true"] { filter: none; opacity: 1; border-color: var(--black); background: var(--yellow); }
.tw-thanks { background: var(--mint) !important; }

/* ---------- floating basket / order button ---------- */
.tw-fab {
  position: fixed; z-index: 27; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 10px 18px; cursor: pointer;
  font: 900 24px/1 "Display", sans-serif; text-transform: uppercase;
  color: #fff; background: var(--black); border: 3px solid var(--black); border-radius: 30px;
  box-shadow: 0 10px 26px rgba(0,0,0,.35); animation: tw-in .45s var(--out, ease);
}
.tw-fab[hidden] { display: none; }
.tw-fab:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--yellow), 0 10px 26px rgba(0,0,0,.35); }
.tw-fab.is-order { background: var(--yellow); color: var(--black); }
.tw-fab.is-ready { animation: tw-in .45s var(--out, ease), tw-glow 1.4s ease-in-out infinite alternate; }
.tw-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid var(--black); animation: tw-blink 1.2s ease-in-out infinite; }
.tw-fab.is-accepted .tw-dot { background: #18a862; }
@keyframes tw-blink { 50% { opacity: .3; } }
@keyframes tw-in { from { opacity: 0; transform: translateY(16px); } }
.tw-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

@media (max-width: 900px) {
  .tw { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  #twBody { padding: 16px 16px 0; }
  .tw-tools, .tw-cartbar, .tw-addbar { margin-left: -16px !important; margin-right: -16px !important; padding-left: 16px; padding-right: 16px; }
  .tw-cartbar { width: calc(100% + 32px); }
  .tw-hero { width: calc(100% + 32px); margin: 0 -16px 14px; }
  .tw-choices { grid-template-columns: 1fr 1fr; }
  .tw-facts { grid-template-columns: 1fr; }
  /* above the yellow "order now" bar */
  .tw-fab { right: 12px; left: 12px; justify-content: center; bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .tw-choices { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-fab, .tw-fab.is-ready, .tw-status-ready, .tw-dot, .tw-add.pop { animation: none; }
}
@media print { .tw-fab { display: none; } }
