/* Swefood pizza builder – customer page. Uses the active Swefood theme tokens. */
.sf-pb {
  --sf-pb-accent: var(--sf-brand, #ea580c);
  --sf-pb-accent-text: var(--sf-brand-contrast, #000);
  --sf-pb-bg: var(--sf-bg, #060d19);
  --sf-pb-surface: var(--sf-surface, #0f172a);
  --sf-pb-surface-2: var(--sf-surface-alt, #0b1222);
  --sf-pb-text: var(--sf-text, #f8fafc);
  --sf-pb-muted: var(--sf-muted, #cbd5e1);
  --sf-pb-border: var(--sf-border, #334155);
  --sf-pb-bottom: 0px;
  --sf-pb-bar-height: 72px;
  --sf-pb-sticky-top: 0px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top, 0px)) 16px calc(var(--sf-pb-bar-height) + var(--sf-pb-bottom) + 24px);
  color: var(--sf-pb-text);
}
.sf-pb *, .sf-pb *::before, .sf-pb *::after { box-sizing: border-box; }
.sf-pb button { font: inherit; color: inherit; }
.sf-pb :focus-visible { outline: 3px solid var(--sf-focus-ring, var(--sf-pb-accent)); outline-offset: 2px; }

.sf-pb__preview {
  margin: 0 0 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--sf-warning-soft, #272326); color: var(--sf-pb-text);
  border: 1px solid var(--sf-warning, #d97706); font-size: .85rem;
}

.sf-pb__head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 8px; margin-bottom: 2px; }
.sf-pb__title { margin: 0; text-align: center; font-size: clamp(1.52rem, 6.075vw, 2.7rem); line-height: 1.1; letter-spacing: -.01em; font-weight: 800; }
.sf-pb__title em { font-style: italic; font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--sf-pb-accent); }
.sf-pb__icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--sf-pb-border); background: var(--sf-pb-surface); color: var(--sf-pb-text);
  cursor: pointer; text-decoration: none;
}
.sf-pb__icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sf-pb__icon-button:hover { border-color: var(--sf-pb-accent); }

/* Pizza stage: no plate or decoration, the pizza sits on the page background. */
.sf-pb__stage { position: relative; }
.sf-pb__scene { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1 / .78; }
.sf-pb__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.sf-pb__canvas[hidden] { display: none; }
.sf-pb__sizes {
  display: flex; flex-wrap: wrap; justify-content: center; width: max-content; max-width: 100%; margin: 4px auto 0; gap: 3px; padding: 3px;
  border-radius: 22px; border: 1px solid var(--sf-pb-border);
  background: color-mix(in srgb, var(--sf-pb-surface) 88%, transparent);
}
.sf-pb__size {
  display: grid; justify-items: center; min-width: 64px; max-width: 100%; min-height: 40px; padding: 3px 12px; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; line-height: 1.1;
}
.sf-pb__size-label { font-weight: 700; font-size: .84rem; overflow-wrap: anywhere; }
.sf-pb__size-price { display: block; font-size: .7rem; color: var(--sf-pb-muted); overflow-wrap: anywhere; }
.sf-pb__size[aria-checked="true"] { background: var(--sf-pb-text); color: var(--sf-pb-surface); }
.sf-pb__size[aria-checked="true"] .sf-pb__size-price { color: inherit; opacity: .75; }
.sf-pb__status { margin: 0; text-align: center; color: var(--sf-pb-muted); font-size: .9rem; min-height: 1.3em; }
.sf-pb__notice { margin: 4px auto 0; max-width: 520px; text-align: center; font-size: .8rem; color: var(--sf-pb-muted); }
.sf-pb__notice[hidden] { display: none; }

.sf-pb__section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 6px; }
.sf-pb__section-head h2 { margin: 0; font-size: 1.05rem; }
.sf-pb__count { font-size: .82rem; color: var(--sf-pb-muted); }
.sf-pb__rules { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.sf-pb__rules li, .sf-pb__rules-text { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--sf-pb-surface); border: 1px solid var(--sf-pb-border); color: var(--sf-pb-muted); }
.sf-pb__rules-text { display: inline-block; margin: 0 0 8px; }
.sf-pb__error { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--sf-error-soft, #28192a); border: 1px solid var(--sf-error, #dc2626); color: var(--sf-pb-text); font-size: .88rem; }
.sf-pb__error[hidden] { display: none; }

.sf-pb__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px 6px; }
.sf-pb__item { display: grid; gap: 4px; align-content: start; min-width: 0; }
.sf-pb__choice {
  position: relative; display: grid; justify-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 4px 2px 2px;
  border: 0; border-radius: 14px; background: transparent; cursor: pointer; text-align: center;
  transition: transform .15s ease;
}
.sf-pb__choice:active { transform: scale(.96); }
.sf-pb__choice:disabled { cursor: not-allowed; opacity: .45; }
.sf-pb__thumb {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--sf-pb-surface) 70%, #ffffff 8%), var(--sf-pb-surface-2));
  border: 2px solid var(--sf-pb-border); transition: border-color .2s ease, box-shadow .2s ease;
}
.sf-pb__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sf-pb__check {
  position: absolute; top: 0; left: calc(50% + 16px); width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sf-pb-accent); color: var(--sf-pb-accent-text);
  transform: scale(0); transition: transform .2s cubic-bezier(.3,1.6,.6,1); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.sf-pb__check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sf-pb__name { font-weight: 700; font-size: .8rem; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.sf-pb__price { font-size: .74rem; color: var(--sf-pb-muted); line-height: 1.15; }
.sf-pb__item.is-selected .sf-pb__thumb { border-color: var(--sf-pb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sf-pb-accent) 30%, transparent); }
.sf-pb__item.is-selected .sf-pb__check { transform: scale(1); }
.sf-pb__item.is-selected .sf-pb__price { color: var(--sf-pb-text); }
.sf-pb__item.is-flagged .sf-pb__thumb { border-color: var(--sf-error, #dc2626); }
.sf-pb__serving { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: 10px; background: var(--sf-pb-surface-2); border: 1px solid var(--sf-pb-border); }
.sf-pb__serving[hidden] { display: none; }
.sf-pb__serving button { min-height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: .7rem; font-weight: 700; cursor: pointer; padding: 2px; line-height: 1.1; }
.sf-pb__serving button[aria-checked="true"] { background: var(--sf-pb-accent); color: var(--sf-pb-accent-text); }

.sf-pb__extras { display: grid; gap: 12px; margin-top: 18px; }
.sf-pb__info { border: 1px solid var(--sf-pb-border); border-radius: 14px; background: var(--sf-pb-surface); padding: 0 14px; }
.sf-pb__info summary { cursor: pointer; padding: 11px 0; font-weight: 700; }
.sf-pb__info p { margin: 0 0 12px; color: var(--sf-pb-muted); font-size: .9rem; }
.sf-pb__note { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.sf-pb__note textarea { width: 100%; min-height: 60px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sf-pb-border); background: var(--sf-pb-surface); color: var(--sf-pb-text); font: inherit; resize: vertical; }

.sf-pb__bar {
  position: fixed; left: 50%; bottom: calc(var(--sf-pb-bottom) + 8px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
  transform: translateX(-50%); width: min(720px, calc(100% - 20px));
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  border-radius: 20px; border: 1px solid var(--sf-pb-border);
  background: color-mix(in srgb, var(--sf-pb-surface) 95%, transparent); backdrop-filter: blur(12px);
  box-shadow: 0 16px 38px rgba(2, 6, 23, .45);
  transition: opacity .2s ease, transform .2s ease;
}
.sf-pb.is-typing .sf-pb__bar, .sf-pb.has-dialog .sf-pb__bar { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
.sf-pb__summary { display: grid; min-width: 0; }
.sf-pb__total { font-size: 1.22rem; font-weight: 800; line-height: 1.1; }
.sf-pb__breakdown { font-size: .7rem; color: var(--sf-pb-muted); overflow-wrap: anywhere; line-height: 1.25; }
.sf-pb__qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--sf-pb-border); border-radius: 999px; padding: 2px; }
.sf-pb__qty button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 1.15rem; cursor: pointer; }
.sf-pb__qty button:disabled { opacity: .35; cursor: default; }
.sf-pb__qty output { min-width: 16px; text-align: center; font-weight: 700; }
.sf-pb__order {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 1rem;
  background: var(--sf-pb-accent); color: var(--sf-pb-accent-text);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--sf-pb-accent) 38%, transparent);
}
.sf-pb__order svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sf-pb__order:hover { background: var(--sf-brand-hover, var(--sf-pb-accent)); }
.sf-pb__order:disabled { opacity: .6; cursor: progress; }

/* One dialog, two steps (sauces, drinks), sharing header, total and actions. */
.sf-pb__dialog {
  width: min(560px, 100%); max-width: 100%; max-height: min(90dvh, 780px); margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--sf-pb-surface); color: var(--sf-pb-text);
  box-shadow: 0 -10px 40px rgba(2, 6, 23, .5);
}
.sf-pb__dialog::backdrop { background: rgba(2, 6, 23, .6); backdrop-filter: blur(2px); }
.sf-pb__dialog[open] { animation: sf-pb-sheet .26s ease-out; }
@keyframes sf-pb-sheet { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sf-pb__dialog-inner { display: flex; flex-direction: column; max-height: inherit; }
.sf-pb__dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.sf-pb__dialog-head h2 { margin: 0; font-size: 1.18rem; line-height: 1.25; outline: none; }
.sf-pb__step { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sf-pb-accent); }
.sf-pb__panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 8px; }
.sf-pb__panel[hidden] { display: none; }
.sf-pb__grid--sauces { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; }
.sf-pb__dialog > .sf-pb__dialog-inner > .sf-pb__error { margin: 0 16px 8px; }
.sf-pb__dialog-foot { border-top: 1px solid var(--sf-pb-border); padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.sf-pb__dialog-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.sf-pb__drinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sf-pb__drink { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; border: 1px solid var(--sf-pb-border); background: var(--sf-pb-surface-2); }
.sf-pb__drink.is-selected { border-color: var(--sf-pb-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sf-pb-accent) 25%, transparent); }
.sf-pb__drink-media img, .sf-pb__drink-ph { display: block; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--sf-pb-surface); }
.sf-pb__drink-text { display: grid; min-width: 0; }
.sf-pb__drink-name { font-weight: 700; overflow-wrap: anywhere; }
.sf-pb__drink-price { font-size: .85rem; color: var(--sf-pb-muted); }
.sf-pb__stepper { display: inline-flex; align-items: center; gap: 4px; }
.sf-pb__stepper button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--sf-pb-border); background: var(--sf-pb-surface); font-size: 1.15rem; cursor: pointer; }
.sf-pb__stepper button:disabled { opacity: .35; cursor: default; }
.sf-pb__stepper output { min-width: 20px; text-align: center; font-weight: 700; }
.sf-pb__receipt { margin-top: 12px; border-top: 1px solid var(--sf-pb-border); padding-top: 10px; font-size: .86rem; }
.sf-pb__receipt ul { list-style: none; margin: 4px 0 8px; padding: 0; color: var(--sf-pb-muted); }
.sf-pb__receipt li, .sf-pb__receipt p { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.sf-pb__receipt li span:first-child { overflow-wrap: anywhere; }
.sf-pb__receipt-head { margin-top: 6px !important; font-weight: 700; }
.sf-pb__receipt-tax { justify-content: flex-end !important; color: var(--sf-pb-muted); font-size: .78rem; }
.sf-pb__secondary { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--sf-pb-border); background: transparent; cursor: pointer; font-weight: 700; }

/* Topping tiles as cards with a +/✓ badge. */
.sf-pb__choice { border: 1px solid color-mix(in srgb, var(--sf-pb-border) 80%, transparent); background: color-mix(in srgb, var(--sf-pb-surface) 70%, transparent); padding: 6px 2px 5px; }
.sf-pb__item.is-selected .sf-pb__choice { border-color: var(--sf-pb-accent); background: color-mix(in srgb, var(--sf-pb-accent) 10%, var(--sf-pb-surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sf-pb-accent) 45%, transparent), 0 6px 18px -8px color-mix(in srgb, var(--sf-pb-accent) 70%, transparent); }
.sf-pb__item.is-selected .sf-pb__thumb { box-shadow: none; }
.sf-pb__item[hidden] { display: none; }
.sf-pb__check { top: 4px; left: auto; right: 4px; transform: none; background: color-mix(in srgb, var(--sf-pb-surface) 80%, transparent); color: var(--sf-pb-text); border: 1.5px solid color-mix(in srgb, var(--sf-pb-text) 70%, transparent); box-shadow: none; }
.sf-pb__check-on { display: none; }
.sf-pb__item.is-selected .sf-pb__check { background: var(--sf-pb-accent); color: var(--sf-pb-accent-text); border-color: var(--sf-pb-accent); }
.sf-pb__item.is-selected .sf-pb__check-on { display: block; }
.sf-pb__item.is-selected .sf-pb__check-off { display: none; }
.sf-pb__section-head { align-items: center; }
.sf-pb__section-head h2 { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.sf-pb__search { position: relative; display: flex; align-items: center; flex: 0 1 220px; min-width: 0; }
.sf-pb__search svg { position: absolute; left: 10px; width: 16px; height: 16px; fill: none; stroke: var(--sf-pb-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.sf-pb__search input { width: 100%; min-height: 36px; padding: 6px 12px 6px 32px; border-radius: 999px; border: 1px solid var(--sf-pb-border); background: var(--sf-pb-surface); color: var(--sf-pb-text); font: inherit; font-size: .85rem; }

/* Dialog: centred step header, pizza summary, actions. */
.sf-pb__dialog-head { position: relative; display: grid; justify-items: center; text-align: center; gap: 2px; padding: 16px 52px 8px; }
.sf-pb__dialog-head h2 { font-size: clamp(1.4rem, 6vw, 1.9rem); font-weight: 800; }
.sf-pb__step { margin: 0 0 4px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--sf-pb-border); background: color-mix(in srgb, var(--sf-pb-surface) 80%, transparent); color: var(--sf-pb-text); text-transform: none; letter-spacing: 0; font-size: .8rem; }
.sf-pb__dialog-hint { margin: 0; color: var(--sf-pb-muted); font-size: .9rem; }
.sf-pb__dialog-close { position: absolute; top: 12px; right: 12px; }
.sf-pb__grid--sauces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sf-pb__grid--sauces .sf-pb__choice { border-radius: 18px; padding: 10px 6px 8px; }
.sf-pb__grid--sauces .sf-pb__thumb { width: 76px; height: 76px; }
.sf-pb__summary-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; border: 1px solid var(--sf-pb-border); background: color-mix(in srgb, var(--sf-pb-surface-2) 85%, transparent); }
.sf-pb__summary-card img { width: 48px; height: 48px; object-fit: contain; }
.sf-pb__summary-text { display: grid; min-width: 0; font-size: .8rem; color: var(--sf-pb-muted); line-height: 1.3; }
.sf-pb__summary-text strong { color: var(--sf-pb-text); font-size: .95rem; }
.sf-pb__summary-total { display: grid; justify-items: end; padding-left: 10px; border-left: 1px solid var(--sf-pb-border); line-height: 1.2; }
.sf-pb__summary-total strong { font-size: 1.15rem; }
.sf-pb__summary-total small { font-size: .66rem; color: var(--sf-pb-muted); max-width: 120px; text-align: right; }
.sf-pb__secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sf-pb__secondary svg, .sf-pb__dialog-actions .sf-pb__order svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Isolate the shared page shell, including its footer. Isolating main alone
   puts its fixed negative-z video above later in-flow siblings such as footer. */
body.sf-page-pizza-builder .sf-frontend-shell { isolation:isolate; }
.sf-pb.sf-pb--photo { position:relative; isolation:auto; }
.sf-pb__oven {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none; opacity: 0; transition: opacity .45s ease;
}
.sf-pb.is-oven-background > .sf-pb__oven { opacity: 1; }
.sf-pb__oven video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 35%; pointer-events: none;
}
.sf-pb__oven-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,rgba(6,13,25,.55),rgba(6,13,25,.66) 45%,rgba(6,13,25,.82));
}
.sf-pb.is-oven-background :is(.sf-pb__title,.sf-pb__status,.sf-pb__section-head,.sf-pb__name,.sf-pb__price) {
  text-shadow: 0 1px 4px rgba(0,0,0,.95);
}
/* Native dialogs remain above the same document video; they own no video. */
.sf-pb__dialog.has-oven {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
  margin: 0; padding: 0; border-radius: 0; background: transparent;
  box-shadow: none; overflow: hidden;
}
.sf-pb__dialog.has-oven::backdrop { background: rgba(2,6,15,.24); backdrop-filter: none; }
.sf-pb__dialog.has-oven[open] { animation: none; }
.sf-pb__dialog.has-oven .sf-pb__dialog-inner {
  position: absolute; left: 50%; bottom: max(10px,env(safe-area-inset-bottom,0px));
  transform: translateX(-50%); width: min(560px,calc(100% - 20px));
  max-height: calc(100dvh - 120px); border-radius: 24px;
  background: color-mix(in srgb,var(--sf-pb-surface) 92%,transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border: 1px solid color-mix(in srgb,var(--sf-pb-accent) 45%,transparent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04),0 -6px 40px color-mix(in srgb,var(--sf-pb-accent) 28%,transparent);
  animation: sf-pb-oven-sheet .2s ease-out;
}
.sf-pb__dialog.has-oven .sf-pb__dialog-foot { border-top: 0; }
@keyframes sf-pb-oven-sheet {
  from { transform: translate(-50%,8px); opacity: 0; }
  to { transform: translate(-50%,0); opacity: 1; }
}
@media (max-width: 899px) {
  .sf-pb.is-oven-background .sf-pb__stage {
    background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none;
  }
  .sf-pb--photo.is-oven-background .sf-pb__ingredients {
    clip-path:inset(var(--sf-pb-ingredients-clip,0px) -12px -12px);
  }
}
@media (min-width: 900px) { .sf-pb__oven video { object-position: 50% 28%; } }
@media (prefers-reduced-motion: reduce) { .sf-pb__oven { display: none; } }

/* Mobile: compact header, pinned sizes + pizza, page-scrolled toppings. */
@media (max-width: 899px) {
  /* `hidden` makes <body> a scroll container that never scrolls, which disables
     sticky positioning; `clip` keeps the same containment without that. html keeps
     its own rule, and an open Swefood modal keeps its scroll lock. */
  body.swefood-frontend.sf-page-pizza-builder:not(.sf-location-modal-open) { overflow-x: clip; overflow-y: visible; }
  .sf-pb { padding-top: env(safe-area-inset-top, 0px); }
  .sf-pb__head { grid-template-columns: 34px 1fr 34px; gap: 6px; margin-bottom: 0; }
  .sf-pb__head .sf-pb__icon-button { width: 34px; height: 34px; }
  .sf-pb__title { font-size: clamp(1.35rem, 6.3vw, 1.6875rem); }
  .sf-pb__sizes { margin-top: 2px; padding: 2px; }
  .sf-pb__size { min-height: 36px; min-width: 0; padding: 2px 12px; }
  .sf-pb__section-head { margin: 6px 0 4px; }
  .sf-pb__section-head h2 { font-size: .98rem; }
  .sf-pb__grid { gap: 6px 4px; }
  .sf-pb__name { font-size: clamp(.7rem, 3.05vw, .8rem); overflow-wrap: normal; word-break: normal; hyphens: manual; }
  .sf-pb__stage {
    position: sticky; top: calc(var(--sf-pb-sticky-top) + env(safe-area-inset-top, 0px)); z-index: 20; margin: 0 -16px; padding: 0 16px 4px;
    background: var(--sf-pb-bg);
    box-shadow: 0 10px 14px -12px rgba(0, 0, 0, .6);
  }
  .sf-pb__scene { aspect-ratio: auto; height: var(--sf-pb-scene-h, 250px); max-width: none; }
  .sf-pb__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sf-pb__extras { margin-top: 14px; }
}

@media (min-width: 900px) {
  .sf-pb { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 40px; align-items: start; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .sf-pb__preview, .sf-pb__head { grid-column: 1 / -1; }
  .sf-pb__head { grid-template-columns: 44px 1fr 44px; margin-bottom: 6px; }
  .sf-pb__stage { grid-column: 1; grid-row: span 3; position: sticky; top: calc(var(--sf-pb-sticky-top) + 20px); }
  .sf-pb__ingredients, .sf-pb__extras { grid-column: 2; }
  .sf-pb__section-head { margin-top: 4px; }
  .sf-pb__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 8px; }
  .sf-pb__thumb { width: 68px; height: 68px; }
  .sf-pb__check { top: 6px; right: 6px; }
  .sf-pb__dialog { margin: auto; border-radius: 24px; }
}

/* Short phones: smaller tiles and controls so two rows still fit under the pizza. */
@media (max-width: 899px) and (max-height: 720px) {
  .sf-pb__thumb { width: 48px; height: 48px; }
  .sf-pb__check { top: 3px; right: 3px; width: 20px; height: 20px; }
  .sf-pb__choice { padding-top: 2px; gap: 1px; }
  .sf-pb__price { font-size: .7rem; }
  .sf-pb__size { min-height: 32px; }
  .sf-pb__head .sf-pb__icon-button { width: 32px; height: 32px; }
  .sf-pb__order { min-height: 44px; }
  .sf-pb__qty button { width: 30px; height: 30px; }
}

@media (max-width: 360px) {
  .sf-pb__bar { grid-template-columns: 1fr auto; }
  .sf-pb__qty { grid-row: 2; grid-column: 1; justify-self: start; }
  .sf-pb__order { grid-row: 1 / span 2; grid-column: 2; padding: 0 14px; }
  .sf-pb__size { min-width: 52px; padding: 3px 8px; }
  .sf-pb__grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .sf-pb *, .sf-pb__dialog[open] { transition: none !important; animation: none !important; }
}

/* Keep both dialog actions on one line on phones. */
.sf-pb__dialog-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.sf-pb__dialog-actions > button { white-space: nowrap; min-width: 0; padding: 0 14px; font-size: clamp(.86rem, 3.7vw, 1rem); }
.sf-pb__dialog-actions > button span { overflow: hidden; text-overflow: ellipsis; }

/* Swefood's frontend shell does not load the theme's screen-reader-text rule, so the
   search label would otherwise show as text and push the topping grid down. */
.sf-pb .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sf-pb__breakdown { overflow-wrap: normal; }
@media (max-width: 420px) {
  .sf-pb__bar { gap: 6px; padding-left: 12px; }
  .sf-pb__order { padding: 0 14px; }
  .sf-pb__qty button { width: 30px; height: 30px; }
}

/* Photographic builder; existing theme and purchase controls stay authoritative. */
.sf-pb.sf-pb--photo{max-width:1740px}
.sf-pb--photo [hidden]{display:none!important}
.sf-pb--photo .sf-pb__grid{gap:14px;grid-template-columns:repeat(auto-fit,minmax(118px,1fr))}
.sf-pb--photo .sf-pb__choice{border-radius:17px;padding:12px 8px;min-height:164px;gap:7px;height:100%}
.sf-pb--photo .sf-pb__thumb{width:88px;height:88px;border:0;background:transparent;border-radius:12px;overflow:visible}
.sf-pb--photo .sf-pb__thumb img{object-fit:contain;filter:drop-shadow(0 3px 3px #0002)}
.sf-pb--photo .sf-pb__name{font-size:.9rem;line-height:1.25;min-height:2.5em;display:grid;align-content:center}
.sf-pb--photo .sf-pb__check{top:8px;right:8px;left:auto}
.sf-pb--photo .sf-pb__photo-placeholder{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;gap:16px;padding:32px;text-align:center;border:1px solid var(--sf-pb-border);border-radius:24px;background:var(--sf-pb-surface);color:var(--sf-pb-text)}
.sf-pb--photo .sf-pb__photo-placeholder p{max-width:36em;overflow-wrap:anywhere}
.sf-pb--photo .sf-pb__photo-placeholder button{border:1px solid var(--sf-pb-border);border-radius:12px;padding:10px 16px;background:var(--sf-pb-surface-2)}
@media(min-width:900px){
.sf-pb.sf-pb--photo{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.1fr);gap:24px 36px;align-items:start}
.sf-pb--photo .sf-pb__head,.sf-pb--photo .sf-pb__preview{grid-column:1/-1}
.sf-pb--photo .sf-pb__stage{grid-column:1;grid-row:2;position:sticky;top:calc(var(--sf-pb-sticky-top) + 12px);align-self:start}
.sf-pb--photo .sf-pb__scene{width:100%;max-width:680px;height:auto;aspect-ratio:1;margin:0 auto}
.sf-pb--photo .sf-pb__ingredients{grid-column:2;grid-row:2;min-width:0}
.sf-pb--photo .sf-pb__extras{grid-column:2;min-width:0}
.sf-pb--photo .sf-pb__sizes{position:relative;inset:auto;justify-content:center;margin:0 auto 8px}
}
@media(min-width:1700px){.sf-pb--photo .sf-pb__ingredients>.sf-pb__grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:899px){
.sf-pb--photo .sf-pb__scene{height:var(--sf-pb-scene-h,240px);aspect-ratio:auto}
.sf-pb--photo .sf-pb__grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.sf-pb--photo .sf-pb__choice{min-height:146px;padding:8px 5px}
.sf-pb--photo .sf-pb__thumb{width:72px;height:72px}
.sf-pb--photo .sf-pb__section-head{flex-wrap:wrap;gap:6px}
.sf-pb--photo .sf-pb__search{max-width:none;width:100%}
.sf-pb--photo .sf-pb__name{font-size:.8rem}
}
@media(max-height:720px) and (max-width:899px){
.sf-pb--photo .sf-pb__choice{min-height:124px;padding:6px 4px;gap:3px}
.sf-pb--photo .sf-pb__thumb{width:56px;height:56px}
}

/* Compact phone cards leave ingredient rows visible below the sticky pizza. */
.sf-pb--photo [hidden]{display:none!important}
@media(min-width:900px){.sf-pb--photo .sf-pb__stage,.sf-pb--photo .sf-pb__ingredients{grid-row:auto}}
@media(max-width:899px){
.sf-pb--photo .sf-pb__choice{min-height:130px;padding:6px 5px;gap:3px}
.sf-pb--photo .sf-pb__thumb{width:64px;height:64px}
.sf-pb--photo .sf-pb__name{min-height:2em;line-height:1.2}
.sf-pb--photo .sf-pb__section-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,1.25fr);gap:6px;align-items:center;min-height:40px}
.sf-pb--photo .sf-pb__section-head h2{display:flex;align-items:baseline;gap:4px;margin:0;min-width:0;white-space:nowrap;font-size:.88rem}
.sf-pb--photo .sf-pb__count{font-size:.65rem;white-space:nowrap}
.sf-pb--photo .sf-pb__search{min-width:0;width:100%}
.sf-pb--photo .sf-pb__search input{min-width:0;width:100%;font-size:16px}
.sf-pb--photo .sf-pb__photo-placeholder{font-size:.8rem;gap:8px;padding:12px}
}
@media(max-height:720px) and (max-width:899px){
.sf-pb--photo .sf-pb__choice{min-height:110px;padding:4px;gap:2px}
.sf-pb--photo .sf-pb__thumb{width:48px;height:48px}
.sf-pb--photo .sf-pb__name{font-size:.72rem}
.sf-pb--photo .sf-pb__price{font-size:.7rem}
}

/* One pre-rendered round tile per ingredient on every screen size; no runtime image swap. */
.sf-pb--photo .sf-pb__ingredients .sf-pb__thumb {
  position:relative;border-radius:50%;overflow:hidden;
  border:1.5px solid var(--sf-pb-border);background:var(--sf-pb-surface-2);
}
.sf-pb--photo .sf-pb__ingredients .sf-pb__thumb > img {padding:5%;border-radius:50%}
.sf-pb--photo .sf-pb__ingredients .sf-pb__thumb.is-composed > img {
  padding:0;border-radius:0;filter:drop-shadow(0 1px 1px rgba(0,0,0,.22));
}
/* Open circular ingredient choices and a bounded phone preview. */
@media (max-width:599px) {
  .sf-pb--photo .sf-pb__ingredients > .sf-pb__grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px 2px;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__choice {
    min-height:120px;padding:1px 0;gap:1px;border-radius:16px;
    border:0;background:transparent;box-shadow:none;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__thumb {
    --sf-pb-choice-circle:clamp(72px,calc((100vw - 54px) / 4),82px);
    position:relative;width:var(--sf-pb-choice-circle);height:var(--sf-pb-choice-circle);
    max-width:100%;border-radius:50%;overflow:hidden;
    border:1.5px solid var(--sf-pb-border);background:var(--sf-pb-surface-2);
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__thumb > img {padding:5%;border-radius:50%}
  .sf-pb--photo.is-oven-background .sf-pb__ingredients :is(.sf-pb__name,.sf-pb__price,.sf-pb__section-head) {
    color:#f8fafc;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__name {
    width:100%;min-width:0;min-height:2.2em;font-size:.7rem;line-height:1.1;
    overflow-wrap:anywhere;word-break:normal;hyphens:auto;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__price {
    font-size:.68rem;line-height:1.1;white-space:nowrap;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__check {
    display:none;width:20px;height:20px;top:1px;right:auto;
    left:calc(50% + clamp(72px,calc((100vw - 54px) / 4),82px) * .29);
  }
  .sf-pb--photo .sf-pb__ingredients .is-selected .sf-pb__choice {
    border:0;background:transparent;box-shadow:none;
  }
  .sf-pb--photo .sf-pb__ingredients .is-selected .sf-pb__thumb {
    border-color:var(--sf-pb-accent);
    background:color-mix(in srgb,var(--sf-pb-accent) 12%,var(--sf-pb-surface));
    box-shadow:0 0 0 2px color-mix(in srgb,var(--sf-pb-accent) 25%,transparent),0 3px 14px color-mix(in srgb,var(--sf-pb-accent) 20%,transparent);
  }
  .sf-pb--photo .sf-pb__ingredients .is-selected .sf-pb__check {display:grid}
  .sf-pb--photo .sf-pb__ingredients .sf-pb__check svg {width:12px;height:12px}
  .sf-pb--photo .sf-pb__ingredients .sf-pb__choice:focus-visible {outline:none}
  .sf-pb--photo .sf-pb__ingredients .sf-pb__choice:focus-visible .sf-pb__thumb {
    outline:3px solid var(--sf-focus-ring,var(--sf-pb-accent));outline-offset:3px;
  }
}
@media (max-width:359px) {
  .sf-pb--photo .sf-pb__ingredients > .sf-pb__grid {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:899px) {
  .sf-pb--photo .sf-pb__section-head {
    display:block;min-height:0;margin:4px 0 6px;
  }
  .sf-pb--photo .sf-pb__section-head h2 {
    display:flex;align-items:baseline;gap:6px;height:auto;
    font-size:.88rem;line-height:1.15;white-space:normal;
  }
  .sf-pb--photo .sf-pb__count {
    display:inline;min-height:0;margin:0;font-size:.65rem;line-height:1.2;white-space:nowrap;
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__search {display:none}
}
@media (max-width:599px) and (orientation:portrait) {
  .sf-pb--photo {
    --sf-pb-mobile-pizza:clamp(210px,60vw,245px);
    --sf-pb-mobile-canvas:calc(var(--sf-pb-mobile-pizza) * 1.136364);
  }
  .sf-pb--photo .sf-pb__head {grid-template-columns:44px minmax(0,1fr) 44px;gap:4px;margin-inline:-8px;padding-block:3px}
  .sf-pb--photo .sf-pb__head .sf-pb__icon-button {width:44px;height:44px}
  .sf-pb--photo .sf-pb__head .sf-pb__icon-button svg {width:25px;height:25px}
  .sf-pb--photo .sf-pb__title {font-size:clamp(1.3rem,calc(8.2vw - 5.2px),1.875rem)}
  .sf-pb--photo .sf-pb__sizes {margin:0 auto;padding:2px}
  .sf-pb--photo .sf-pb__size {min-height:28px;padding:1px 10px}
  .sf-pb--photo .sf-pb__size-label {font-size:.75rem;line-height:1.1}
  .sf-pb--photo .sf-pb__size-price {font-size:.625rem;line-height:1.1}
  .sf-pb--photo .sf-pb__scene {
    width:100%;max-width:none;height:calc(var(--sf-pb-mobile-pizza) + 4px);
    margin:0 auto;overflow:hidden;
  }
  .sf-pb--photo .sf-pb__scene > .sf-pb__canvas {
    top:50%;right:auto;bottom:auto;left:50%;
    width:var(--sf-pb-mobile-canvas);height:var(--sf-pb-mobile-canvas);
    transform:translate(-50%,-50%);
  }
  .sf-pb--photo[data-size="S"] .sf-pb__scene > .sf-pb__canvas {
    width:calc(var(--sf-pb-mobile-canvas) * 1.282051);
    height:calc(var(--sf-pb-mobile-canvas) * 1.282051);
  }
  .sf-pb--photo[data-size="M"] .sf-pb__scene > .sf-pb__canvas {
    width:calc(var(--sf-pb-mobile-canvas) * 1.123596);
    height:calc(var(--sf-pb-mobile-canvas) * 1.123596);
  }
  .sf-pb--photo .sf-pb__ingredients .sf-pb__item {
    scroll-margin-block-start:calc(var(--sf-pb-sticky-top) + var(--sf-pb-mobile-pizza) + 48px);
    scroll-margin-block-end:calc(var(--sf-pb-bar-height) + var(--sf-pb-bottom) + 12px);
  }
}

/* The smallest phones need the last pixels for the title. */
@media (max-width:359px) and (orientation:portrait) {
  .sf-pb--photo .sf-pb__head {grid-template-columns:42px minmax(0,1fr) 42px}
  .sf-pb--photo .sf-pb__head .sf-pb__icon-button {width:42px;height:42px}
}
