/* ============================================================
   Screen 1 — Start your order (delivery / collection dialog)
   ============================================================ */

.start-shell {
  position: relative; z-index: 1;
  /* Fill the viewport minus the app bar so the card centres without overflowing. */
  min-height: calc(100dvh - var(--app-bar-h, 62px));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

/* Branded ambient background */
.start-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(1100px 560px at 12% -8%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 60%),
    radial-gradient(900px 520px at 108% 6%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    var(--bg);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  background: var(--brand);
  animation: float 14s ease-in-out infinite;
}
.blob-1 { width: 360px; height: 360px; left: -80px; bottom: -120px; opacity: .35; }
.blob-2 { width: 300px; height: 300px; right: -60px; top: 8%; opacity: .25; animation-delay: -6s; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-26px) scale(1.06); }
}

/* Floating theme toggle */
.theme-toggle.start-toggle {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); right: 16px; z-index: 5;
}

/* The card */
.start-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 468px;
  /* Cap to the space under the app bar (minus the shell's top/bottom padding) so
     the card scrolls internally instead of scrolling the whole page. */
  max-height: min(calc(100dvh - var(--app-bar-h, 62px) - 48px), 780px); overflow-y: auto;
  border-radius: var(--r-xl);
  padding: 30px 26px 22px;
  box-shadow: var(--shadow-lg);
  animation: card-in .5s var(--ease) both;
  overscroll-behavior: contain;
  /* Thin, themed, inset scrollbar — matches the product/welcome modals. */
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.start-card::-webkit-scrollbar { width: 10px; }
.start-card::-webkit-scrollbar-track { background: transparent; }
.start-card::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.start-card::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.start-head { text-align: center; margin-bottom: 22px; }
/* Full logo — no cropping container; show it at its natural aspect, just capped. */
.start-logo-img {
  display: block; margin: 0 auto 16px;
  max-height: 56px; max-width: min(180px, 64%);
  width: auto; height: auto; object-fit: contain;
}
/* Monogram fallback (only when no logo is uploaded) keeps a tidy square. */
.start-logo {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow-sm); background: var(--surface);
  display: grid; place-items: center;
}
.start-logo--mono {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, white), var(--brand));
  color: var(--on-brand); font-size: 32px; font-weight: 800; text-transform: uppercase;
}
.start-title { margin: 0 0 6px; font-size: var(--fz-2xl); font-weight: 800; letter-spacing: -.02em; }
.start-sub { margin: 0; color: var(--text-muted); font-size: var(--fz-md); }
.start-sub strong { color: var(--text); }

/* Order-type choice cards */
.ot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.ot-grid[data-count="1"] { grid-template-columns: 1fr; }
.ot-grid[data-count="3"] { grid-template-columns: 1fr 1fr 1fr; }
.ot-grid[data-count="3"] .ot-st { display: none; }   /* keep 3-up compact on mobile */
@media (min-width: 480px) { .ot-grid[data-count="3"] .ot-st { display: block; } }
.ot-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px solid var(--border); text-align: left;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (hover: hover) {
  .ot-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
}
.ot-card:active { transform: scale(.99); }
.ot-card.selected { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 3px var(--ring); }
/* Keep the selected ring from being cancelled by an active press on touch. */
.ot-card.selected:active { transform: scale(.99); border-color: var(--brand); }
.ot-card.is-disabled { opacity: .45; pointer-events: none; }
.ot-card.is-disabled .ot-ic { background: var(--surface-2); color: var(--text-muted); }

/* Notices + delivery confirmation header */
.start-notice {
  margin-bottom: 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: var(--fz-sm); text-align: center;
}
/* Session-expired info notice */
.start-notice.start-notice--info {
  background: var(--brand-soft, color-mix(in srgb, var(--brand) 12%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--text);
}

.deliver-head { margin: 2px 0 10px; font-size: var(--fz-sm); color: var(--text-muted); }
.deliver-head strong { color: var(--text); }

/* Postcode found nothing — one compact row, not a card. Sized like .deliver-head
   (its success-path counterpart) so the step doesn't lurch when a search fails.
   The action rides inline in the sentence and wraps with it. */
.pc-none {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.pc-none-ic { flex: none; display: grid; place-items: center; height: 20px; color: var(--text-muted); }
.pc-none-ic svg { width: 17px; height: 17px; }
.pc-none--closed .pc-none-ic { color: color-mix(in srgb, #f5a524 55%, black); }
[data-theme="dark"] .pc-none--closed .pc-none-ic { color: color-mix(in srgb, #f5a524 78%, white); }
.pc-none-tx { margin: 0; min-width: 0; font-size: var(--fz-sm); line-height: 1.45; color: var(--text-muted); }
.pc-none-tx strong { color: var(--text); font-weight: 700; }
.pc-none-sw {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 700; color: var(--on-brand-soft);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.pc-none-sw:hover { color: var(--brand); }

/* theme.css floats the label off :placeholder-shown, so the label sits OVER the
   input while it's empty — a real placeholder would print straight through it.
   Reveal the hint on focus, by which point the label has floated clear. */
#pcInput:not(:focus)::placeholder { color: transparent; }

/* Closed-but-pre-orderable notice (advance_order) — must read clearly */
.start-notice.notice-warn {
  display: flex; gap: 8px; text-align: left; margin: 0 0 14px;
  background: color-mix(in srgb, #f5a524 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #f5a524 45%, var(--border));
  color: var(--text);
}
.start-notice.notice-warn strong { color: var(--on-brand-soft); }
[data-theme="dark"] .start-notice.notice-warn { background: color-mix(in srgb, #f5a524 16%, var(--surface)); }
.ot-ic {
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 8px;
  display: grid; place-items: center; color: var(--on-brand-soft);
  background: var(--brand-soft); transition: all var(--dur) var(--ease);
}
.ot-card.selected .ot-ic { background: var(--brand); color: var(--on-brand); }
.ot-ic svg { width: 24px; height: 24px; }
.ot-tt { font-weight: 700; font-size: var(--fz-md); }
.ot-st { font-size: var(--fz-xs); color: var(--text-muted); }
.ot-check {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  opacity: 0; transform: scale(.5); transition: all var(--dur) var(--ease);
}
.ot-card.selected .ot-check { opacity: 1; transform: scale(1); }

/* Conditional steps */
.step { animation: step-in .32s var(--ease) both; margin-bottom: 16px; }
.step[hidden] { display: none; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.step-label { margin: 0 0 10px; font-size: var(--fz-sm); font-weight: 700; color: var(--text-muted); }
h2.step-label:focus { outline: none; }
h2.step-label:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
.pc-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.btn-find { flex-shrink: 0; --bh: 56px; padding: 0 18px; }
/* Compact spinner for the Find button's busy state (base .os-ring is 48px). */
.btn-find .os-ring--sm { width: 20px; height: 20px; }
.btn-find[aria-busy="true"] { display: inline-grid; place-items: center; }
#pcResults { margin-top: 4px; }

/* Sticky CTA */
.btn-start {
  position: sticky; bottom: 0; margin-top: 6px; --bh: 56px;
}
.start-foot { text-align: center; margin: 16px 0 0; font-size: var(--fz-xs); color: var(--text-muted); }
.start-foot strong { color: var(--on-brand-soft); font-weight: 700; }

/* Small screens → near full-height sheet */
@media (max-width: 520px) {
  .start-shell { padding: 0; }
  .start-card {
    max-width: 100%; min-height: calc(100dvh - var(--app-bar-h)); max-height: calc(100dvh - var(--app-bar-h));
    border-radius: 0; padding: 32px 20px 20px;
  }
  .start-foot { margin-top: auto; padding-top: 16px; }
}
