/* Storefront pages after the menu: checkout, tracking, receipt, payment return
   and offline. Builds on sf.css (same variables); colours only through theme
   variables so the business's brand colours and dark mode both apply. */

.sf-page { padding-top: 8px; }
.sf-page-head { padding: 16px 0 12px; }
.sf-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--sf-muted); }
.sf-back:hover { color: var(--color-base-content); }
.sf-page-title { font-family: var(--sf-display); font-weight: 700; letter-spacing: -.02em; font-size: 30px; line-height: 36px; margin-top: 6px; }
@media (min-width: 1024px) { .sf-page-title { font-size: 38px; line-height: 44px; } }
.sf-card { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: var(--sf-r-lg); padding: 20px; box-shadow: var(--sf-shadow); }
@media (min-width: 768px) { .sf-card { padding: 24px; } }
.sf-card-title { font-family: var(--sf-display); font-weight: 700; font-size: 20px; line-height: 26px; letter-spacing: -.01em; }

/* Fields */
.sf-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; min-width: 0; }
.sf-label { font-size: 14px; font-weight: 600; }
.sf-input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; font-size: 16px; line-height: 22px;
  background: var(--sf-card); color: var(--color-base-content); border: 1px solid color-mix(in oklab, var(--color-base-content) 22%, var(--sf-line));
  transition: border-color 120ms, box-shadow 120ms; }
.sf-input::placeholder { color: var(--sf-muted); opacity: .8; }
.sf-input:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-secondary) 22%, transparent); }
textarea.sf-input { resize: vertical; }
.sf-fields-2 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .sf-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sf-code-input { max-width: 240px; text-align: center; font-size: 26px; letter-spacing: .4em; font-weight: 700; padding-left: 20px; }

/* Checkout layout: steps on the left, the order summary sticks on the right */
.sf-checkout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .sf-checkout { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; } }
.sf-checkout-main { display: grid; gap: 16px; min-width: 0; }
.sf-checkout-main > .sf-callout { margin-top: 0; }
.sf-checkout-side { min-width: 0; }
@media (min-width: 1024px) { .sf-checkout-side { position: sticky; top: calc(var(--sf-top-h) + 16px); } }
.sf-step { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: var(--sf-r-lg); padding: 20px; box-shadow: var(--sf-shadow); }
@media (min-width: 768px) { .sf-step { padding: 24px; } }
.sf-step-quiet { box-shadow: none; }
.sf-step-title { display: flex; align-items: center; gap: 12px; font-family: var(--sf-display); font-weight: 700; font-size: 20px; line-height: 26px; letter-spacing: -.01em; margin-bottom: 4px; }
.sf-step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 999px;
  background: var(--color-secondary); color: var(--color-secondary-content); font-family: var(--sf-font); font-size: 15px; font-weight: 700; }

/* Choice tiles: delivery or pickup, and how to pay */
.sf-tiles { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .sf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sf-tile { position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; cursor: pointer;
  border-radius: var(--sf-r); border: 1.5px solid var(--sf-line); background: var(--sf-card); transition: border-color 120ms, background-color 120ms, box-shadow 120ms; }
.sf-tile:hover { border-color: color-mix(in oklab, var(--color-base-content) 40%, var(--sf-line)); }
.sf-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-tile-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--sf-tint); color: var(--color-primary); }
.sf-tile-text { display: flex; flex-direction: column; min-width: 0; }
.sf-tile-text strong { font-weight: 700; font-size: 16px; }
.sf-tile-text span { font-size: 14px; line-height: 19px; color: var(--sf-muted); }
.sf-tile:has(input:checked) { border-color: var(--color-primary); background: var(--sf-tint); box-shadow: 0 0 0 1px var(--color-primary); }
.sf-tile:has(input:checked) .sf-tile-icon { background: var(--color-primary); color: var(--color-primary-content); }
.sf-tile:has(input:checked)::after { content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; }
.sf-tile:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Delivery pin */
.sf-delivery { margin-top: 18px; }
.sf-mapbox { position: relative; border-radius: var(--sf-r); overflow: hidden; border: 1px solid var(--sf-line); background: var(--sf-tint); }
.sf-map { width: 100%; height: 280px; background: var(--color-base-200); }
@media (min-width: 768px) { .sf-map { height: 340px; } }
.sf-map-tall { height: 320px; border-radius: var(--sf-r); overflow: hidden; margin-top: 14px; }
@media (min-width: 768px) { .sf-map-tall { height: 380px; } }
.sf-map-cover { padding: 28px 20px; text-align: center;
  background: radial-gradient(color-mix(in oklab, var(--color-secondary) 16%, transparent) 1.2px, transparent 1.4px) 0 0 / 18px 18px; }
.sf-map-cover-pin { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; margin-bottom: 8px;
  background: var(--color-primary); color: var(--color-primary-content); box-shadow: 0 2px 0 var(--color-secondary), 0 10px 24px rgba(14, 59, 46, .18); }
.sf-pin-status { font-size: 14px; color: var(--sf-muted); margin-top: 8px; }
.sf-mapbox.has-pin + .sf-pin-status { color: var(--color-success); font-weight: 600; }

/* Phone code */
.sf-otp { margin-top: 16px; padding: 14px; border-radius: var(--sf-r); border: 1px solid var(--sf-line); background: var(--color-base-200); }
.sf-otp .otp-band { margin: -2px -2px 14px; }
.sf-otp-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sf-otp-send .sf-help { margin-top: 0; }
.sf-confirmed { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; font-weight: 600;
  color: var(--color-success); background: color-mix(in oklab, var(--color-success) 12%, var(--sf-card)); }

/* Order summary */
.sf-summary { background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: var(--sf-r-lg); padding: 20px; box-shadow: var(--sf-shadow); }
.sf-summary-title { font-family: var(--sf-display); font-weight: 700; font-size: 20px; margin-bottom: 4px; }
.sf-lines-box { max-height: 360px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sf-totals { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.sf-totals th, .sf-totals td { padding: 7px 0; text-align: left; font-weight: 500; vertical-align: top; }
.sf-totals th { color: var(--sf-muted); }
.sf-totals .num { text-align: right; white-space: nowrap; padding-left: 12px; }
.sf-totals tr.is-pending td { color: var(--sf-muted); font-size: 14px; }
.sf-totals tr.is-total th, .sf-totals tr.is-total td, .sf-totals .sf-total { color: var(--color-base-content); font-weight: 800; font-size: 18px;
  border-top: 1px solid var(--sf-line); padding-top: 12px; }
.sf-problems { margin-top: 10px; display: grid; gap: 6px; }
.sf-problems li { padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 20px;
  background: color-mix(in oklab, var(--color-warning) 12%, var(--sf-card)); border: 1px solid color-mix(in oklab, var(--color-warning) 30%, var(--sf-line)); }
.sf-problems li.is-tip { background: color-mix(in oklab, var(--color-success) 10%, var(--sf-card)); border-color: color-mix(in oklab, var(--color-success) 28%, var(--sf-line)); }
.sf-place { margin-top: 14px; }
.sf-place-total { display: none; }
.sf-place-btn { width: 100%; }
.sf-spin { display: none; width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid currentColor; border-right-color: transparent; animation: sf-turn 700ms linear infinite; }
.is-busy .sf-spin { display: inline-block; }
@keyframes sf-turn { to { transform: rotate(360deg); } }
/* Phones: the place-order button rides along the bottom of the screen with the total. */
@media (max-width: 1023px) {
  .sf-place { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; margin: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--sf-card); border-top: 1px solid var(--sf-line);
    box-shadow: 0 -8px 24px rgba(14, 59, 46, .1); }
  .sf-place-total { display: flex; flex-direction: column; line-height: 1.2; }
  .sf-place-total strong { font-size: 19px; }
  .sf-place-btn { flex: 1 1 auto; width: auto; }
  .sf-place-error { flex-basis: 100%; margin: 0; }
  [data-page="checkout"] .sf-footer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}

/* Moments: payment return, offline */
.sf-moment { max-width: 520px; margin: 32px auto 0; text-align: center; padding: 36px 24px; }
.sf-moment-title { font-family: var(--sf-display); font-weight: 700; font-size: 26px; line-height: 32px; letter-spacing: -.015em; margin: 8px 0 6px; }
.sf-moment-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--sf-tint); color: var(--color-primary);
  box-shadow: 0 2px 0 var(--color-secondary); }
.sf-moment-art { width: 180px; height: 135px; margin: 0 auto 4px; display: block; }
.sf-art-disc { fill: var(--sf-tint); }
.sf-art-cloud { fill: var(--sf-card); stroke: var(--color-secondary); stroke-width: 3; stroke-linejoin: round; }
.sf-art-slash { stroke: var(--color-primary); stroke-width: 6; stroke-linecap: round; }
.sf-dots { display: inline-flex; gap: 6px; margin-top: 18px; }
.sf-dots span { width: 9px; height: 9px; border-radius: 999px; background: var(--color-primary); animation: sf-dot 1s var(--sf-ease) infinite; }
.sf-dots span:nth-child(2) { animation-delay: .15s; } .sf-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes sf-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }

/* Tracking */
.sf-track-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) { .sf-track-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .sf-track-grid > .sf-rider { grid-column: 1; } .sf-track-grid > .sf-card:last-child { grid-column: 2; grid-row: 1 / span 2; } }
.sf-status-head { display: flex; gap: 14px; align-items: center; }
.sf-status-icon { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 18px; background: var(--color-primary); color: var(--color-primary-content);
  box-shadow: 0 2px 0 var(--color-secondary); }
.sf-status-icon.is-live { animation: sf-pulse 2s var(--sf-ease) infinite; }
.sf-status-icon.is-done { background: #1c7c4a; color: #ffffff; }
@keyframes sf-pulse { 0% { box-shadow: 0 2px 0 var(--color-secondary), 0 0 0 0 color-mix(in oklab, var(--color-primary) 45%, transparent); }
  70% { box-shadow: 0 2px 0 var(--color-secondary), 0 0 0 14px transparent; } 100% { box-shadow: 0 2px 0 var(--color-secondary), 0 0 0 0 transparent; } }
.sf-status-title { font-family: var(--sf-display); font-weight: 700; font-size: 26px; line-height: 30px; letter-spacing: -.015em; }
.sf-eta { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: color-mix(in oklab, var(--color-accent) 22%, var(--sf-card)); }
.sf-steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 0; }
.sf-steps li { position: relative; padding: 0 0 18px 36px; color: var(--sf-muted); font-weight: 500; }
.sf-steps li:last-child { padding-bottom: 0; }
.sf-steps li::before { content: ""; position: absolute; left: 4px; top: 3px; width: 18px; height: 18px; border-radius: 999px; background: var(--sf-card);
  border: 2px solid color-mix(in oklab, var(--color-base-content) 22%, transparent); box-sizing: border-box; z-index: 1; }
.sf-steps li::after { content: ""; position: absolute; left: 12px; top: 22px; bottom: 0; width: 2px; background: var(--sf-line); }
.sf-steps li:last-child::after { display: none; }
.sf-steps li.done { color: var(--color-base-content); }
.sf-steps li.done::before { background: var(--color-success); border-color: var(--color-success); }
.sf-steps li.done::after { background: var(--color-success); }
.sf-steps li.now { color: var(--color-base-content); font-weight: 700; }
.sf-steps li.now::before { border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 5px color-mix(in oklab, var(--color-primary) 22%, transparent); }
.sf-rider-head { display: flex; gap: 12px; align-items: center; }
.sf-rider-badge { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 999px; background: var(--color-secondary); color: var(--color-secondary-content); }
.sf-rider-pin { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--color-primary); color: var(--color-primary-content);
  border: 3px solid var(--sf-card); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.sf-shop-pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--color-secondary); color: var(--color-secondary-content);
  border: 2px solid var(--sf-card); box-shadow: 0 4px 10px rgba(0, 0, 0, .25); }
.sf-totals-lines { margin-top: 8px; }
.sf-find { max-width: 520px; margin: 8px auto 0; text-align: center; }
.sf-find-form { text-align: left; margin-top: 8px; display: grid; gap: 12px; }
.sf-find-form .sf-btn { width: 100%; }

/* Receipt: a paper slip on the page, and plain black on white when printed */
.sf-receipt { position: relative; max-width: 520px; margin: 24px auto 0; background: var(--sf-card); border: 1px solid var(--sf-line); border-radius: var(--sf-r-lg) var(--sf-r-lg) 0 0;
  padding: 28px 24px 32px; box-shadow: var(--sf-shadow); }
.sf-receipt::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--sf-card) 0) 0 0 / 16px 12px, linear-gradient(45deg, transparent 8px, var(--sf-card) 0) 0 0 / 16px 12px; }
.sf-receipt-head { text-align: center; padding-bottom: 18px; border-bottom: 1px dashed var(--sf-line); }
.sf-receipt-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; margin: 0 auto 8px; }
.sf-receipt-shop { font-family: var(--sf-display); font-weight: 700; font-size: 20px; }
.sf-receipt-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sf-muted); margin-top: 16px; }
.sf-receipt-total { font-family: var(--sf-display); font-weight: 700; font-size: 40px; line-height: 44px; letter-spacing: -.02em; margin: 4px 0 10px; }
.sf-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.sf-pill.is-ok { color: var(--color-success); background: color-mix(in oklab, var(--color-success) 13%, var(--sf-card)); }
.sf-pill.is-warn { color: var(--color-warning); background: color-mix(in oklab, var(--color-warning) 14%, var(--sf-card)); }
.sf-receipt-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px 0; border-bottom: 1px dashed var(--sf-line); font-size: 14px; }
.sf-receipt-meta dt { color: var(--sf-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sf-receipt-meta dd { font-weight: 600; }
.sf-receipt-lines thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--sf-line); }
.sf-receipt-lines tbody td { border-bottom: 1px solid color-mix(in oklab, var(--sf-line) 60%, transparent); }
.sf-receipt-lines tfoot th { font-weight: 500; }
.sf-line-detail { display: block; font-size: 13px; color: var(--sf-muted); }
.sf-receipt-thanks { text-align: center; margin-top: 20px; font-family: var(--sf-display); font-weight: 600; font-size: 17px; }
.sf-receipt-actions { margin-top: 18px; }

@media print {
  .sf-top, .sf-footer, .sf-cartbar, .sf-receipt-actions, .sf-toast, .sf-skip, dialog { display: none !important; }
  .sf-body, .sf-receipt { background: #ffffff !important; color: #000000 !important; box-shadow: none !important; border: 0 !important; }
  .sf-receipt::after { display: none; }
  .sf-body * { color: #000000 !important; }
}
/* Tracking: the order number reads as a label, not a headline; the delivery code stands out. */
.sf-track-title { font-size: 24px; line-height: 30px; }
@media (min-width: 1024px) { .sf-track-title { font-size: 28px; line-height: 34px; } }
.sf-track-number { display: block; font-family: var(--sf-body, inherit); font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--sf-muted); }
.sf-code-box { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding: 12px 16px; border-radius: var(--sf-r);
  background: var(--sf-tint); border: 1px dashed var(--sf-line); width: fit-content; }
.sf-code-value { font-size: 32px; line-height: 38px; font-weight: 800; letter-spacing: .18em; }
.sf-drop-pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--sf-card); color: var(--color-primary);
  border: 2px solid var(--color-primary); box-shadow: var(--sf-shadow-pop); }

.sf-line-options { display: block; font-size: 13px; color: var(--sf-muted, currentColor); opacity: .85; }
.sf-drop { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; line-height: 1.4; }
.sf-drop > svg { flex: none; margin-top: 2px; color: var(--color-primary); }
.sf-status-card [data-finished], .sf-status-card [data-eta] { margin-top: 14px; padding-left: 74px; }
@media (max-width: 420px) { .sf-status-card [data-finished], .sf-status-card [data-eta] { padding-left: 0; } }
