/* Shared storefront styles: the default look of the shared partials (templates/storefront/_shop/).
   Themes set the variables below in storefront/base.html's `theme_vars` block (on :root, which wins
   over these defaults on html). Templates with their own markup may drop this file (docs/storefront.md). */
html {
  --bg: #111;
  --ink: var(--accent, #f5f5f5);
  --surface: color-mix(in srgb, var(--bg) 90%, var(--ink));
  --muted: color-mix(in srgb, var(--ink) 65%, transparent);
  --line: color-mix(in srgb, var(--ink) 15%, transparent);
  --primary: #e10600;
  --on-primary: #fff;
  --danger: #ff6b5b;
  --ok: #4cc15f;
  --radius: 14px;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font-body); -webkit-text-size-adjust: 100%; }
body.shop-locked { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.shop-price { font-weight: 700; color: var(--primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-price.is-estimate { opacity: .6; }
.shop-small { font-size: .85rem; color: var(--muted); }
.shop-small a { color: var(--ink); }
.shop-icon { width: 20px; height: 20px; flex: none; }
.shop-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--line); color: var(--muted); white-space: nowrap; }

/* Buttons */
.btn, .shop-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer; }
.btn, .shop-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.shop-btn--wide { width: 100%; }
.shop-btn:disabled, .shop-btn.is-disabled { opacity: .5; }
.shop-btn:disabled { cursor: not-allowed; }
.shop-link { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; }
.shop-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; }
.shop-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: shop-spin .8s linear infinite; }
@keyframes shop-spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Header, closed banner, footer */
.shop-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.shop-header__brand { flex: 1; min-width: 0; font: 700 1.2rem/1.2 var(--font-display); text-decoration: none; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.shop-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; font-size: .8rem; white-space: nowrap; }
.shop-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.shop-chip.is-closed .shop-chip__dot { background: var(--danger); }
.shop-cart-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 14px; border: 0;
  border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; cursor: pointer; }
.shop-cart-btn__count { min-width: 28px; height: 28px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--on-primary); color: var(--primary); font-size: .85rem; }
.shop-closed { margin: 12px 16px 0; padding: 12px 16px; border: 1px solid var(--danger); border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 12%, transparent); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.shop-footer { margin-top: 48px; padding: 32px 16px 48px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.shop-footer p { margin: 4px 0; }
.shop-footer__name { font: 700 1.1rem var(--font-display); color: var(--ink); }
.shop-footer__small { font-size: .8rem; }
.shop-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 16px 0; padding: 0; list-style: none;
  font-size: .85rem; }
.lang-switch { display: inline-flex; gap: 4px; margin: 8px 0; }
.lang-switch__btn { min-width: 44px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: transparent;
  cursor: pointer; font-size: .8rem; font-weight: 700; }
.lang-switch__btn.is-active { background: var(--ink); color: var(--bg); }

/* Hero placeholders (template heroes) */
.hero { padding: 4rem 1rem; text-align: center; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 8vw, 4rem); margin: 0 0 .5rem; color: var(--primary); }

/* Menu */
.shop-main { display: block; }
.shop-app { display: contents; } /* the page behind the full-screen pages (inert while one is open) */
.shop-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.shop-menu { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.shop-menu__title { margin: 0 0 16px; font: 700 clamp(1.6rem, 5vw, 2.4rem)/1.1 var(--font-display); }
.shop-input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); }
textarea.shop-input { resize: vertical; }
.shop-input[aria-invalid="true"] { border-color: var(--danger); }
.shop-search { margin-bottom: 12px; }
.shop-cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.shop-cat { flex: none; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.shop-cat.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.shop-category { margin-top: 24px; }
.shop-category__title { margin: 0 0 12px; font: 700 1.3rem var(--font-display); }
.shop-items { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.shop-item { position: relative; }
.shop-item__open { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); text-align: left; cursor: pointer; }
.shop-item__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) - 4px); margin-bottom: 6px; }
.shop-item__name { font-weight: 700; }
.shop-item__desc { font-size: .9rem; color: var(--muted); }
.shop-item__foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-item__add { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--primary);
  color: var(--on-primary); font-weight: 700; }
.shop-item__qty { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: .8rem; font-weight: 700; pointer-events: none; }
.shop-item.is-sold-out .shop-item__open { opacity: .55; cursor: default; }
.shop-empty { padding: 24px 0; color: var(--muted); text-align: center; }

/* Full-screen pages (composer, cart / checkout) */
.shop-page { position: fixed; inset: 0; z-index: 50; background: var(--bg); }
.shop-page__inner { height: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; }
.shop-page__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.shop-page__title { flex: 1; margin: 0; font: 700 1.1rem var(--font-display); text-align: center; }
.shop-page:focus, .shop-page [tabindex="-1"]:focus { outline: none; } /* the page and step titles, focused by script */
.shop-page__count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.shop-page__body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.shop-page__foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg); }
.shop-composer__img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); }
.shop-composer__name { margin: 12px 0 4px; font: 700 1.6rem/1.15 var(--font-display); }
.shop-composer__desc { margin: 0 0 8px; color: var(--muted); }
.shop-composer__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 16px; font-size: 1.2rem; }
.shop-composer__price small { font-size: .85rem; color: var(--muted); }
.shop-composer__foot .shop-btn { flex: 1; }
.shop-composer__missing { margin: 0; padding: 0 16px 12px; color: var(--danger); font-size: .9rem; }
.shop-group { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.shop-group.is-invalid { border-color: var(--danger); }
.shop-group__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 0 4px; }
.shop-group__name { font-weight: 700; }
.shop-group__hint { color: var(--muted); font-size: .85rem; }
.shop-options { display: grid; gap: 8px; margin-top: 8px; }
.shop-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; }
.shop-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.shop-option__name, .shop-option__text { flex: 1; }
.shop-option__text { display: grid; }
.shop-option__text small { color: var(--muted); font-size: .85rem; }
.shop-option__price { color: var(--muted); font-size: .9rem; }
.shop-option.is-chosen { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
/* Card online: Stripe's Payment Element (shop.js) */
.shop-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.shop-card__element:empty { display: none; }
.shop-card__down { display: grid; gap: 8px; justify-items: start; }
.shop-option.is-disabled, .shop-option.is-maxed { opacity: .5; }
.shop-option.is-disabled { cursor: not-allowed; }
/* Pickup choice (_shop/pickup.html): as soon as possible / later, then the times as pills */
.shop-when { display: grid; gap: 8px; margin-top: 16px; }
.shop-slots { display: grid; gap: 12px; }
.shop-slots__days, .shop-slots__group { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.shop-slots__title { width: 100%; padding: 0 0 2px; font-weight: 700; font-size: .9rem; }
.shop-slot { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-variant-numeric: tabular-nums; cursor: pointer; }
.shop-slot:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.shop-slot.is-chosen { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.shop-slot.is-disabled { opacity: .5; cursor: not-allowed; }
.shop-qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.shop-qty__btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.2rem; cursor: pointer; }
.shop-qty__btn:disabled { opacity: .35; cursor: default; }
.shop-qty__value { min-width: 24px; text-align: center; font-weight: 700; }
.shop-qty--small .shop-qty__btn { width: 32px; height: 32px; }

/* Cart and checkout */
.shop-steps { display: flex; gap: 8px; margin: 0; padding: 12px 16px 0; list-style: none; counter-reset: step; }
.shop-step { flex: 1; padding-top: 8px; border-top: 3px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 600; }
.shop-step.is-done { border-color: var(--ok); }
.shop-step.is-active { border-color: var(--primary); color: var(--ink); }
.shop-alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 12%, transparent); }
.shop-alert p { margin: 0; }
.shop-alert p + p { margin-top: 6px; }
.shop-alert__link { display: inline-block; margin-top: 8px; font-weight: 700; }
.shop-lines { margin: 0 0 16px; padding: 0; list-style: none; }
.shop-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shop-line__img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 10px; }
.shop-line__main { flex: 1; min-width: 0; }
.shop-line__main p { margin: 0; }
.shop-line__name { font-weight: 700; overflow-wrap: anywhere; }
.shop-line__options { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.shop-line__problem { color: var(--danger); font-size: .85rem; }
.shop-line__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.shop-line.is-invalid .shop-line__name { opacity: .6; }
.shop-total { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 4px; font-size: 1.15rem; }
.shop-pickup { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: .9rem; }
.shop-form { display: grid; gap: 4px; }
.shop-field { margin-bottom: 12px; }
.shop-field__label { display: block; margin-bottom: 4px; font-weight: 600; }
.shop-field__label small { color: var(--muted); font-weight: 400; }
.shop-field__hint { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.shop-field__error { margin: 4px 0 0; color: var(--danger); font-size: .85rem; }
.shop-summary { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.shop-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.shop-summary dt { color: var(--muted); }
.shop-summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.shop-checkout.is-sending .shop-page__body { opacity: .7; pointer-events: none; }

/* Toasts */
.shop-toasts { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; display: grid;
  justify-items: center; gap: 8px; pointer-events: none; }
.shop-toast { max-width: 420px; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); animation: shop-toast .2s ease-out; }
body.shop-locked .shop-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
@keyframes shop-toast { from { opacity: 0; transform: translateY(8px); } }

/* Tracking page */
.shop-track { max-width: 640px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 20px; }
.shop-track header .shop-confirm__title { margin: 0; }
.shop-status { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.shop-status__title { margin: 0 0 6px; font: 700 1.5rem/1.2 var(--font-display); }
.shop-status__text { margin: 0; }
.shop-status__refund, .shop-status__action { margin: 8px 0 0; font-weight: 700; }
.shop-status__link { color: var(--primary); }
.shop-status__eta { margin: 8px 0 0; font-weight: 700; color: var(--primary); }
.shop-status--ready { border-color: var(--ok); }
.shop-status--ready .shop-status__title { color: var(--ok); }
.shop-status--cancelled, .shop-status--not_collected { border-color: var(--danger); }
.shop-progress { display: flex; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.shop-progress__step { flex: 1; padding-top: 8px; border-top: 4px solid var(--line); color: var(--muted); font-size: .8rem; }
.shop-progress__step.is-done { border-color: var(--ok); color: var(--ink); }
.shop-progress__step.is-active { border-color: var(--primary); color: var(--ink); font-weight: 700; }
.shop-confirm__kicker { margin: 0; color: var(--muted); }
.shop-confirm__title { margin: 0 0 12px; font: 700 2rem/1.1 var(--font-display); }
.shop-where h2 { margin: 0 0 8px; font: 700 1.2rem var(--font-display); }
.shop-where p { margin: 4px 0; }
.shop-where__name { font-weight: 700; }

/* Legal pages */
.shop-legal { max-width: 760px; margin: 0 auto; padding: 24px 16px; overflow-wrap: anywhere; }
.shop-legal h1 { font: 700 clamp(1.6rem, 5vw, 2.2rem)/1.15 var(--font-display); }
.shop-legal h2 { margin: 28px 0 8px; font: 700 1.15rem var(--font-display); }
.shop-legal__facts { margin: 0; }
.shop-legal__facts div { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.shop-legal__facts dt { color: var(--muted); }
.shop-legal__facts dd { margin: 0; }
.shop-legal__nav { margin-top: 32px; }
.shop-legal__nav .shop-legal-links { justify-content: flex-start; }

@media (min-width: 720px) {
  .shop-composer__body.has-image { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; align-items: start; }
  .shop-composer__img { position: sticky; top: 0; max-height: none; aspect-ratio: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-toast, .shop-spinner { animation: none; }
}

/* "Notify me when it's ready" (D48, _shop/push_ready.html) */
.shop-push { margin: 16px 0; }
.shop-push__text { margin: 0; font-size: .95rem; }
