/* Keepsake Builder — storefront wizard + configurable product page.
 *
 * The visual language follows the reference build (numbered accordion, uppercase titles, white
 * option cards with a ✓ badge, boxed "Your order" summary). Every colour/size is a --ksb-* token
 * from Settings → Look & feel (a preset such as the floral kit sets the brand palette). Fonts
 * inherit from the theme. The wizard is a CSS container: its layout follows the width it is
 * given, not the viewport.
 *
 * THEME GUARD. Themes and page-builder kits style native elements aggressively —
 * `.elementor-kit-7 button:hover`, `input[type="number"] { width: 100% }`, `.entry-content ul` —
 * and outrank plain class selectors. Every rule below therefore starts with
 * `:is(#ksb-theme-guard, .ksb-wizard)`: :is() takes the specificity of its most specific argument
 * (an id that never exists in the page), so our rules win over any theme rule that has no id or
 * !important, while staying overridable — no !important anywhere in this file. To override a rule
 * from a theme or companion, use the same prefix; to recolour, set the --ksb-* tokens.
 */

.ksb-wizard {
  --ksb-focus: 0 0 0 2px var(--ksb-bg), 0 0 0 4px var(--ksb-highlight);
  --ksb-shadow: 0 4px 14px color-mix(in srgb, var(--ksb-accent) 10%, transparent);
  container-type: inline-size;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ksb-text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  text-align: left;
}
.ksb-wizard[data-ksb-layout="shortcode"] { max-width: var(--ksb-max-width); margin: 0 auto; }
:is(#ksb-theme-guard, .ksb-wizard) *,
:is(#ksb-theme-guard, .ksb-wizard) *::before,
:is(#ksb-theme-guard, .ksb-wizard) *::after { box-sizing: border-box; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: calc(var(--ksb-gap) * 1.5);
  align-items: start;
}
/* Product page + narrow containers: steps first, the price summary right after them. */
.ksb-wizard[data-ksb-layout="page"] .ksb-wizard__layout { grid-template-columns: 1fr; gap: 10px; }
.ksb-wizard[data-ksb-layout="page"] .ksb-summary { position: static; }
@container (max-width: 700px) {
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__layout { grid-template-columns: 1fr; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-summary { position: static; }
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__main { min-width: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__title { margin: 0 0 var(--ksb-gap); padding: 0; font-size: 1.4em; line-height: 1.2; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__noscript { padding: 12px; border: 1px solid var(--ksb-error); border-radius: var(--ksb-radius); color: var(--ksb-error); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__config { display: none; }
:is(#ksb-theme-guard, .ksb-wizard) .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
:is(#ksb-theme-guard, .ksb-wizard) p { margin: 0; padding: 0; }
:is(#ksb-theme-guard, .ksb-wizard) ul,
:is(#ksb-theme-guard, .ksb-wizard) ol { margin: 0; padding: 0; list-style: none; }
:is(#ksb-theme-guard, .ksb-wizard) li { margin: 0; padding: 0; list-style: none; }
:is(#ksb-theme-guard, .ksb-wizard) li::before,
:is(#ksb-theme-guard, .ksb-wizard) li::marker { content: none; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 28px;
  border: 1.5px solid var(--ksb-border);
  border-radius: 4px;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  box-shadow: none;
  font: inherit;
  font-size: .88em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, opacity .15s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button:focus { border-color: var(--ksb-highlight); background: var(--ksb-surface); color: var(--ksb-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button--primary,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button--primary:focus { background: var(--ksb-accent); border-color: var(--ksb-accent); color: var(--ksb-accent-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button--primary:hover { background: var(--ksb-accent-soft); border-color: var(--ksb-accent-soft); color: var(--ksb-accent-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button--large { width: 100%; min-height: 54px; padding: 16px; border-radius: 5px; font-size: 1em; letter-spacing: .06em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button:disabled,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-button:disabled:hover { background: var(--ksb-muted); border-color: var(--ksb-muted); color: var(--ksb-accent-text); opacity: .7; cursor: not-allowed; }
:is(#ksb-theme-guard, .ksb-wizard) button:focus,
:is(#ksb-theme-guard, .ksb-wizard) input:focus,
:is(#ksb-theme-guard, .ksb-wizard) select:focus,
:is(#ksb-theme-guard, .ksb-wizard) textarea:focus { outline: none; }
:is(#ksb-theme-guard, .ksb-wizard) button:focus-visible,
:is(#ksb-theme-guard, .ksb-wizard) input:focus-visible,
:is(#ksb-theme-guard, .ksb-wizard) select:focus-visible,
:is(#ksb-theme-guard, .ksb-wizard) textarea:focus-visible { outline: none; box-shadow: var(--ksb-focus); }

/* ── steps (accordion) ───────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step {
  margin: 0 0 12px;
  padding: 0;
  border: 2px solid var(--ksb-border);
  border-radius: var(--ksb-radius);
  background: var(--ksb-bg);
  overflow: hidden;
  transition: border-color .2s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-active { border-color: var(--ksb-accent); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-done { border-color: var(--ksb-accent-soft); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-locked { opacity: .55; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.has-error { border-color: var(--ksb-error); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__header { margin: 0; padding: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__toggle,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__toggle:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__toggle:focus {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, auto) 14px;
  grid-template-areas: "num title value chevron";
  align-items: center;
  column-gap: 12px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  background: var(--ksb-surface);
  color: var(--ksb-text);
  box-shadow: none;
  font: inherit;
  line-height: 1.3;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal; /* themes often set nowrap on buttons; the title must wrap */
  cursor: pointer;
  transition: background-color .2s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-active .ksb-step__toggle,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-done .ksb-step__toggle:hover { background: var(--ksb-surface-active); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-locked .ksb-step__toggle { cursor: default; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__num {
  grid-area: num;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ksb-border);
  color: var(--ksb-text);
  font-size: .82em;
  font-weight: 700;
  font-style: normal;
  transition: background-color .2s, color .2s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-active .ksb-step__num,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-done .ksb-step__num { background: var(--ksb-accent); color: var(--ksb-accent-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-done .ksb-step__num { font-size: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-done .ksb-step__num::before { content: "✓"; font-size: 13px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__title {
  grid-area: title;
  margin: 0;
  color: var(--ksb-text);
  font-size: .95em;
  font-weight: 600;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: .04em;
  text-transform: var(--ksb-title-transform, uppercase);
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__optional { margin-left: 4px; font-weight: 400; font-size: .8em; color: var(--ksb-muted); text-transform: none; letter-spacing: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__value {
  grid-area: value;
  max-width: 220px;
  color: var(--ksb-accent-soft);
  font-size: .8em;
  font-weight: 600;
  font-style: italic;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__value:empty { display: none; }
/* Chevron drawn with borders: the same in every theme font. */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__chevron { grid-area: chevron; justify-self: center; width: 9px; height: 9px; margin-top: -5px; border-right: 2px solid var(--ksb-muted); border-bottom: 2px solid var(--ksb-muted); transform: rotate(45deg); transition: transform .2s; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step.is-active .ksb-step__chevron { margin-top: 5px; transform: rotate(-135deg); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__body { padding: 20px 18px 18px; border-top: 1px solid var(--ksb-border); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__help { margin: 0 0 16px; color: var(--ksb-muted); font-size: .85em; font-style: italic; line-height: 1.5; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__error { margin: 12px 0 0; color: var(--ksb-error); font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-step__actions { margin-top: 18px; }

/* ── choice options ──────────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options { display: grid; gap: 10px; margin: 0; padding: 0; min-width: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--cards { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles { grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches { grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr)); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--buttons { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--list,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--font_sample { grid-template-columns: 1fr; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 14px 12px;
  border: 1.5px solid var(--ksb-border-soft);
  border-radius: 8px;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  font-size: 1em;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option:hover { border-color: var(--ksb-accent-soft); background: var(--ksb-surface); box-shadow: var(--ksb-shadow); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; pointer-events: none; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option:has(.ksb-option__input:checked) { border-color: var(--ksb-accent); background: var(--ksb-surface); box-shadow: 0 4px 16px color-mix(in srgb, var(--ksb-accent) 15%, transparent); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option:has(.ksb-option__input:checked)::after { content: "✓"; position: absolute; top: 8px; right: 10px; color: var(--ksb-accent); font-size: .75em; font-weight: 700; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option:has(.ksb-option__input:focus-visible) { box-shadow: var(--ksb-focus); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option:has(.ksb-option__input:disabled) { cursor: not-allowed; opacity: .5; box-shadow: none; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option.is-unavailable { opacity: .6; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option[hidden] { display: none; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__image { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0; border: 0; border-radius: 6px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__swatch { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: 6px; background: var(--ksb-surface); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__icon { font-size: 1.6em; line-height: 1; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__text { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__label { font-size: .9em; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__group { color: var(--ksb-muted); font-size: .72em; text-transform: uppercase; letter-spacing: .06em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__desc { color: var(--ksb-muted); font-size: .82em; line-height: 1.45; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__price { margin-top: 2px; color: var(--ksb-accent-soft); font-size: .82em; font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option__note { color: var(--ksb-error); font-size: .8em; font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-option.is-low .ksb-option__note { color: var(--ksb-accent-soft); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles .ksb-option,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option { align-items: stretch; padding: 0 0 10px; text-align: left; overflow: hidden; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles .ksb-option__text,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option__text { align-items: flex-start; padding: 0 10px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles .ksb-option__image,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option__image,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option__swatch { border-radius: 0; margin-bottom: 6px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles .ksb-option__price,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option__price,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--tiles .ksb-option__note,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--swatches .ksb-option__note { padding: 0 10px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--list .ksb-option,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--buttons .ksb-option { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--list .ksb-option__text { align-items: flex-start; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--buttons .ksb-option { justify-content: center; text-align: center; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options--font_sample .ksb-option__label { font-size: 1.4em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-options__empty { margin: 8px 0 0; color: var(--ksb-muted); font-style: italic; }

/* ── multi_count ─────────────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1.5px solid var(--ksb-border-soft);
  border-radius: 8px;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  font-size: 1em;
  font-weight: 400;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count:hover { border-color: var(--ksb-accent-soft); box-shadow: var(--ksb-shadow); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count.is-selected { border-color: var(--ksb-accent); background: var(--ksb-surface); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0; border-radius: 6px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__label { font-weight: 700; font-size: .9em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__desc { color: var(--ksb-muted); font-size: .82em; }
/* −  [qty]  + : the buttons keep their size whatever the theme does to the input */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__controls { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; align-items: center; margin-top: auto; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__minus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__plus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__minus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--ksb-border);
  border-radius: 50%;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  box-shadow: none;
  font: inherit;
  font-size: 1.2em;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__minus:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__plus:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__minus:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__plus:hover { border-color: var(--ksb-accent-soft); background: var(--ksb-surface); color: var(--ksb-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__minus:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__plus:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__minus:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__plus:focus { background: var(--ksb-bg); color: var(--ksb-text); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__qty,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 4px;
  border: 1.5px solid var(--ksb-border);
  border-radius: 4px;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  box-shadow: none;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__input { width: 64px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__qty::-webkit-inner-spin-button,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__qty::-webkit-outer-spin-button,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__input::-webkit-inner-spin-button,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count--other { grid-column: 1 / -1; cursor: default; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-label { color: var(--ksb-muted); font-size: .85em; font-style: italic; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-row { display: flex; gap: 8px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-input { flex: 1; width: auto; min-width: 0; min-height: 44px; margin: 0; padding: 0 12px; border: 1.5px solid var(--ksb-border); border-radius: 4px; background: var(--ksb-bg); color: var(--ksb-text); box-shadow: none; font: inherit; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-list:empty { display: none; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-item { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--ksb-surface); border: 1px solid var(--ksb-border); font-size: .85em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-remove,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-remove:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-count__other-remove:focus { width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ksb-muted); box-shadow: none; font: inherit; font-size: 1.1em; line-height: 1; cursor: pointer; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-counts__summary { margin: 12px 0 0; color: var(--ksb-accent-soft); font-weight: 600; font-size: .9em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-counts__summary:empty { display: none; }

/* ── quantity ────────────────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity { display: flex; align-items: center; gap: 8px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-quantity__each { margin-left: 8px; color: var(--ksb-muted); font-size: .9em; }

/* ── form + notes ────────────────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field--textarea { grid-column: 1 / -1; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field__label { display: block; margin: 0; color: var(--ksb-text); font-size: .78em; font-weight: 700; letter-spacing: .05em; text-transform: var(--ksb-title-transform, uppercase); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field__required { color: var(--ksb-error); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field input,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field select,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field textarea,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-notes__input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--ksb-border);
  border-radius: 4px;
  background: var(--ksb-bg);
  color: var(--ksb-text);
  box-shadow: none;
  font: inherit;
  line-height: 1.4;
  transition: border-color .15s;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field textarea,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-notes__input { min-height: 96px; resize: vertical; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field input:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field select:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field textarea:focus,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-notes__input:focus { border-color: var(--ksb-accent-soft); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field.has-error input,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field.has-error select,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field.has-error textarea { border-color: var(--ksb-error); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field__error { margin: 0; color: var(--ksb-error); font-size: .85em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field__check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-weight: 400; cursor: pointer; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-field__check input { display: inline-block; width: 20px; min-width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; accent-color: var(--ksb-accent); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-notes { display: flex; flex-direction: column; gap: 6px; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-notes__count { align-self: flex-end; color: var(--ksb-muted); font-size: .8em; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-info__list { margin: 0; padding-left: 1.2em; list-style: disc; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-info__list li { list-style: disc; }

/* ── summary ("Your order") ──────────────────────────────────────────────── */
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary {
  position: sticky;
  top: 24px;
  min-width: 0;
  margin: 0;
  padding: 24px 22px;
  border: 2px solid var(--ksb-accent);
  border-radius: 8px;
  background: var(--ksb-surface);
  color: var(--ksb-text);
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary.is-review { box-shadow: 0 4px 16px color-mix(in srgb, var(--ksb-accent) 15%, transparent); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ksb-accent); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__title { margin: 0; padding: 0; color: var(--ksb-accent); font-size: .75em; font-weight: 700; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__toggle,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__toggle:hover,
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__toggle:focus { display: none; width: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--ksb-accent); box-shadow: none; font: inherit; font-size: .8em; font-weight: 700; text-decoration: underline; text-transform: none; cursor: pointer; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__lines { list-style: none; margin: 0 0 12px; padding: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line {
  display: grid;
  grid-template-columns: 36% minmax(0, 1fr) auto; /* a fixed label column keeps the values aligned across rows */
  gap: 4px 12px;
  align-items: baseline;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--ksb-border);
  font-size: .83em;
  line-height: 1.4;
}
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line:last-child { border-bottom: 0; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-label { min-width: 0; color: var(--ksb-muted); font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-value { min-width: 0; color: var(--ksb-text); overflow-wrap: anywhere; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-value:empty { display: none; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-value:empty + .ksb-summary__line-amount { grid-column: 2 / -1; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-amount { text-align: right; white-space: nowrap; font-weight: 700; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-amount:empty::before { content: "—"; color: var(--ksb-border); }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__hint { margin: 0 0 14px; color: var(--ksb-muted); font-size: .8em; font-style: italic; text-align: center; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__total { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 14px; padding-top: 12px; border-top: 2px solid var(--ksb-accent); color: var(--ksb-accent); font-size: 1.15em; font-weight: 700; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__total-amount { font-size: 1.25em; }
:is(#ksb-theme-guard, .ksb-wizard.is-pricing) .ksb-summary__total-amount { opacity: .55; transition: opacity .15s; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__status { margin: 10px 0 0; min-height: 1.2em; font-size: .88em; text-align: center; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__status.is-error { color: var(--ksb-error); font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__status.is-success { color: var(--ksb-success); font-weight: 600; }
:is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__notice { margin: 10px 0 0; color: var(--ksb-muted); font-size: .85em; font-style: italic; text-align: center; }
.ksb-price-from { font-weight: inherit; }
.ksb-cart-edit { margin-left: 8px; font-size: .85em; }
.ksb-admin-hint { padding: 8px 12px; border-left: 3px solid var(--ksb-border, #ddd); color: #666; }

/* ── small viewports (inline layouts): the summary becomes a sticky bottom bar ── */
@media (max-width: 700px) {
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-wizard__layout { grid-template-columns: 1fr; }
  :is(#ksb-theme-guard, .ksb-wizard:not([data-ksb-layout="page"])) .ksb-summary {
    position: sticky;
    top: auto;
    bottom: 0;
    z-index: 20;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  }
  :is(#ksb-theme-guard, .ksb-wizard:not([data-ksb-layout="page"])) .ksb-summary__toggle { display: inline-block; }
  :is(#ksb-theme-guard, .ksb-wizard:not([data-ksb-layout="page"])) .ksb-summary__details { display: none; }
  :is(#ksb-theme-guard, .ksb-wizard:not([data-ksb-layout="page"])) .ksb-summary.is-open .ksb-summary__details { display: block; max-height: 40vh; overflow: auto; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-step__toggle { padding: 12px 14px; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-step__value { max-width: 120px; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-step__body { padding: 16px 14px 14px; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line { grid-template-columns: minmax(0, 1fr) auto; }
  :is(#ksb-theme-guard, .ksb-wizard) .ksb-summary__line-value { grid-column: 1 / -1; order: 3; }
}

/* ── the plugin's own product page (render mode "page") ──────────────────── */
.ksb-product {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  color: var(--ksb-text);
}
:is(#ksb-theme-guard, .ksb-product) *,
:is(#ksb-theme-guard, .ksb-product) *::before,
:is(#ksb-theme-guard, .ksb-product) *::after { box-sizing: border-box; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__columns {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 40px;
  align-items: start;
}
:is(#ksb-theme-guard, .ksb-product) .ksb-product__columns--no-gallery { grid-template-columns: minmax(0, 780px); justify-content: center; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__gallery { position: sticky; top: 24px; min-width: 0; }
/* WooCommerce's gallery markup (main image → thumbnails below), whatever the theme's own gallery CSS says. */
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery { position: relative; width: 100%; max-width: 100%; margin: 0; float: none; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__wrapper { margin: 0; padding: 0; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-viewport { border-radius: var(--ksb-radius); }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__image img,
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__image--placeholder img { display: block; width: 100%; height: auto; border-radius: var(--ksb-radius); }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__image:nth-child(n + 2) { width: 100%; display: block; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-control-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; overflow: visible; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-control-thumbs li { width: calc(20% - 7px); margin: 0; padding: 0; float: none; list-style: none; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-control-thumbs img { display: block; width: 100%; height: auto; margin: 0; border: 2px solid transparent; border-radius: 4px; opacity: .7; cursor: pointer; transition: opacity .15s, border-color .15s; }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-control-thumbs img:hover,
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery .flex-control-thumbs img.flex-active { opacity: 1; border-color: var(--ksb-accent); }
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 9;
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ksb-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  font-size: 1.1em;
  line-height: 36px;
  text-align: center;
  text-decoration: none;
  text-indent: 0;
}
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__trigger::before,
:is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery__trigger::after { display: none; }
/* Without JavaScript the gallery scripts never lift WooCommerce's inline opacity: show the images stacked. */
@media (scripting: none) {
  :is(#ksb-theme-guard, .ksb-product) .woocommerce-product-gallery { opacity: 1 !important; }
}
:is(#ksb-theme-guard, .ksb-product) .ksb-product__main { min-width: 0; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__title { margin: 0 0 6px; padding: 0; font-size: 1.9em; line-height: 1.15; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__price { margin: 0 0 14px; color: var(--ksb-accent-soft); font-size: 1.1em; font-weight: 700; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__excerpt { margin: 0 0 20px; color: var(--ksb-muted); }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__excerpt > :last-child { margin-bottom: 0; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__wizard { margin: 0; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__description { max-width: 780px; margin: 48px auto 0; }
:is(#ksb-theme-guard, .ksb-product) .ksb-product__description h2 { margin: 0 0 12px; font-size: 1.3em; }
.ksb-product-page .woocommerce-notices-wrapper { margin-bottom: 16px; }
@media (max-width: 900px) {
  :is(#ksb-theme-guard, .ksb-product) .ksb-product__columns { grid-template-columns: 1fr; gap: 24px; }
  :is(#ksb-theme-guard, .ksb-product) .ksb-product__gallery { position: static; }
}
@media (max-width: 700px) {
  .ksb-product { padding: 16px 12px 48px; }
  :is(#ksb-theme-guard, .ksb-product) .ksb-product__title { font-size: 1.5em; }
}

@media (prefers-reduced-motion: reduce) {
  :is(#ksb-theme-guard, .ksb-wizard) *,
  :is(#ksb-theme-guard, .ksb-wizard) *::before,
  :is(#ksb-theme-guard, .ksb-wizard) *::after { transition: none; }
}

/* The Builder's preview page (the wizard alone, theme styles, no header/footer). */
body.ksb-preview-page { margin: 0; background: #fff; }
.ksb-preview { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
.ksb-preview__ribbon { position: sticky; top: 0; z-index: 5; margin: 0 -16px 16px; padding: 8px 16px; background: #1d2327; color: #fff; font: 600 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.ksb-preview .ksb-product__title { margin: 8px 0 16px; }
.ksb-preview__empty { padding: 24px; border: 1px dashed #c3c4c7; border-radius: 6px; color: #646970; text-align: center; }
