
/*
 * modern-builder-combo.css — combo-builder detail + shared option tiles
 * (kicker/group headings, modifier & combo option cards). This is the
 * continuation of modern-builder.css; it lives in its own file only because the
 * token-lock block sits between the two in source order.
 *
 * Phase 6 split: peeled verbatim off the (post-tranche-4) end of modern-base.css
 * (was lines 7569-EOF). GLOBAL, loaded via index.html AFTER modern-tokenlock.css
 * and BEFORE modern-dialog-skins.css — source order is load-bearing.
 */

.scale-modern-builder-kicker,
.scale-modern-builder-group-head span {
  font-size: var(--scale-fs-9);
  font-weight: 700;
  letter-spacing: var(--scale-tracking-caps);
}

.scale-modern-builder-group-head strong {
  font-size: var(--scale-type-headline-size);
  font-weight: 600;
}

.scale-modern-builder-group-head em {
  font-size: var(--scale-type-caption-1-size);
  font-weight: 600;
}

.scale-modern-builder-option-grid {
  gap: 6px;
}

.scale-modern-builder--modifier .scale-modern-builder-option-grid,
.scale-modern-builder--combo-modifier .scale-modern-builder-option-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  padding: 0;
}

.scale-modern-builder-option,
.scale-modern-builder--modifier .scale-modern-builder-option,
.scale-modern-builder--combo-modifier .scale-modern-builder-option {
  min-height: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--scale-panel);
  box-shadow: 0 0 0 0.5px var(--scale-separator), 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scale-modern-builder--modifier .scale-modern-builder-option span,
.scale-modern-builder--combo-modifier .scale-modern-builder-option span,
.scale-modern-builder-option span {
  flex: 1 1 auto;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--scale-type-subheadline-size);
  font-weight: 600;
  line-height: 1.25;
  padding-right: 4px;
}

.scale-modern-builder--modifier .scale-modern-builder-option small,
.scale-modern-builder--combo-modifier .scale-modern-builder-option small,
.scale-modern-builder-option small {
  margin-top: 0;
  font-size: var(--scale-type-caption-1-size);
  font-weight: 700;
}

.scale-modern-builder--modifier .scale-modern-builder-option em,
.scale-modern-builder--combo-modifier .scale-modern-builder-option em {
  position: static;
  width: auto;
  min-width: 22px;
  height: 22px;
}

.scale-modern-builder-steps button {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
}

.scale-modern-builder-steps button strong {
  font-size: var(--scale-fs-13);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.scale-modern-builder-steps button small {
  font-size: var(--scale-fs-13);
  font-weight: 500;
}

/* Combo builder: lock typography/spacing to designV2 reference measurements. */
.scale-modern-builder--combo > .scale-modern-builder-titlebar {
  min-height: 50px;
  padding: 2px 16px 12px;
}

.scale-modern-builder--combo .scale-modern-builder-titlebar button,
.scale-modern-builder--combo .scale-modern-builder-title-action {
  font-size: var(--scale-fs-16) !important;
  font-weight: 400 !important;
  line-height: 1.3;
}

.scale-modern-builder--combo .scale-modern-builder-title-action.is-add {
  font-weight: 600 !important;
}

.scale-modern-builder--combo .scale-modern-builder-titlebar strong {
  font-size: var(--scale-fs-16) !important;
  font-weight: 600 !important;
  line-height: 1.3;
}

.scale-modern-builder--combo .scale-modern-builder-kicker {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--scale-fs-9) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.scale-modern-builder--combo > .scale-modern-builder-steps {
  gap: 6px;
  padding: 0 16px 12px;
}

.scale-modern-builder--combo .scale-modern-builder-steps button {
  min-height: 50px !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  gap: 10px;
}

.scale-modern-builder--combo .scale-modern-builder-steps button span {
  width: 22px;
  height: 22px;
  font-size: var(--scale-fs-11) !important;
  font-weight: 700 !important;
  line-height: 1;
}

.scale-modern-builder--combo .scale-modern-builder-steps button strong {
  font-size: var(--scale-fs-12) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.scale-modern-builder--combo .scale-modern-builder-steps button small {
  font-size: var(--scale-fs-12) !important;
  font-weight: 500 !important;
  line-height: 1.15;
}

.scale-modern-builder--combo > .scale-modern-builder-main,
.scale-modern-builder--combo > .scale-modern-builder-summary {
  margin: 0 16px 16px;
}

.scale-modern-builder--combo > .scale-modern-builder-main {
  padding: 0;
}

.scale-modern-builder--combo .scale-modern-builder-group-head {
  padding: 4px 4px 4px;
}

.scale-modern-builder--combo .scale-modern-builder-group-head strong {
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.scale-modern-builder--combo .scale-modern-builder-group-head em {
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
  line-height: 1.2;
}

.scale-modern-builder--combo .scale-modern-builder-option-grid {
  gap: 6px !important;
}

.scale-modern-builder--combo .scale-modern-builder-option {
  min-height: 50px !important;
  height: auto !important;
  padding: 9px 12px !important;
  border-radius: 11px !important;
  gap: 2px 10px !important;
}

.scale-modern-builder--combo .scale-modern-builder-option span {
  font-size: var(--scale-fs-14) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.scale-modern-builder--combo .scale-modern-builder-option small {
  font-size: var(--scale-fs-11) !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
}

.scale-modern-builder--combo .scale-modern-builder-option em {
  width: 22px !important;
  height: 22px !important;
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
  line-height: 1;
}

.scale-modern-builder--combo .scale-modern-builder-summary-list {
  padding: 8px !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line {
  min-height: 36px !important;
  padding: 7px 12px !important;
  border-radius: 10px !important;
  grid-template-columns: minmax(0, 70%) minmax(0, 10%) minmax(0, 20%) !important;
  gap: 0 !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent {
  min-height: 40px !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-child {
  min-height: 34px !important;
  padding: 7px 12px !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line span,
.scale-modern-builder--combo .scale-modern-builder-summary-line span strong {
  font-size: var(--scale-fs-13) !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-child span {
  font-size: var(--scale-fs-12) !important;
  font-weight: 400 !important;
  padding-left: 20px !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line em,
.scale-modern-builder--combo .scale-modern-builder-summary-line b {
  font-size: var(--scale-fs-13) !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-child b {
  font-size: var(--scale-fs-12) !important;
  font-weight: 400 !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line {
  align-items: flex-start !important;
  overflow: hidden;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line span {
  min-width: 0 !important;
  max-width: 100%;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  white-space: normal;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line span small {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 2px;
  color: var(--scale-text-mute);
  font-size: var(--scale-fs-11) !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line em,
.scale-modern-builder--combo .scale-modern-builder-summary-line b {
  align-self: flex-start;
}

.scale-modern-builder--combo .scale-modern-builder-total-card {
  padding: 10px 14px !important;
  border-radius: 13px !important;
}

.scale-modern-builder--combo .scale-modern-builder-total-card > span {
  font-size: var(--scale-fs-11) !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em;
}

.scale-modern-builder--combo .scale-modern-builder-total-card strong {
  font-size: var(--scale-fs-17) !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

.scale-modern-builder--combo .scale-modern-builder-total-card strong small {
  font-size: var(--scale-fs-12) !important;
  font-weight: 500 !important;
}

.scale-modern-builder--combo .scale-modern-builder-total-card > small {
  font-size: var(--scale-fs-12) !important;
  font-weight: 400 !important;
  line-height: 1.25;
}

.scale-modern-builder--combo .scale-modern-builder-actions button {
  min-height: 46px !important;
  border-radius: 13px !important;
  font-size: var(--scale-fs-16) !important;
  font-weight: 600 !important;
}

.scale-modern-builder--combo-modifier > .scale-modern-builder-titlebar {
  min-height: 50px;
  padding: 2px 16px 12px;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-titlebar button,
.scale-modern-builder--combo-modifier .scale-modern-builder-title-action {
  font-size: var(--scale-fs-16) !important;
  font-weight: 400 !important;
  line-height: 1.3;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-title-action.is-add {
  font-weight: 600 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-titlebar strong {
  font-size: var(--scale-fs-16) !important;
  font-weight: 600 !important;
  line-height: 1.3;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-kicker {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--scale-fs-9) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.scale-modern-builder--combo-modifier .scale-modern-combo-choice-list {
  gap: 6px;
}

.scale-modern-builder--combo-modifier .scale-modern-combo-choice-list > span {
  padding: 4px 4px;
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.scale-modern-builder--combo-modifier .scale-modern-combo-choice {
  min-height: 52px !important;
  padding: 10px 12px !important;
  border-radius: 11px !important;
  gap: 10px !important;
}

.scale-modern-builder--combo-modifier .scale-modern-combo-choice strong {
  font-size: var(--scale-fs-14) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-combo-choice small {
  font-size: var(--scale-fs-11) !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-group-head strong {
  font-size: var(--scale-fs-16) !important;
  font-weight: 600 !important;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-group-head span {
  font-size: var(--scale-fs-9) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-group-head em {
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-option {
  min-height: 40px !important;
  height: 40px !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-option span {
  font-size: var(--scale-fs-14) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-option small {
  font-size: var(--scale-fs-11) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* Modifier and combo option tiles use the same card rhythm as product tiles. */
.scale-modern-builder--modifier .scale-modern-builder-option-grid,
.scale-modern-builder--combo .scale-modern-builder-option-grid,
.scale-modern-builder--combo-modifier .scale-modern-builder-option-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important;
  align-items: start;
  gap: 8px !important;
}

.scale-modern-builder--modifier .scale-modern-builder-option,
.scale-modern-builder--combo .scale-modern-builder-option,
.scale-modern-builder--combo-modifier .scale-modern-builder-option {
  aspect-ratio: 12 / 9 !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100%;
  padding: 10px 10px 9px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  overflow: hidden;
}

.scale-modern-builder--modifier .scale-modern-builder-option span,
.scale-modern-builder--combo .scale-modern-builder-option span,
.scale-modern-builder--combo-modifier .scale-modern-builder-option span {
  flex: 0 0 auto !important;
  width: 100% !important;
  display: block !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  padding-right: 0 !important;
}

.scale-modern-builder--modifier .scale-modern-builder-option small,
.scale-modern-builder--combo .scale-modern-builder-option small,
.scale-modern-builder--combo-modifier .scale-modern-builder-option small {
  margin-top: auto !important;
}

.scale-modern-builder--modifier .scale-modern-builder-option em,
.scale-modern-builder--combo .scale-modern-builder-option em,
.scale-modern-builder--combo-modifier .scale-modern-builder-option em {
  position: absolute !important;
  right: 9px !important;
  bottom: 9px !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-summary-card h3 {
  font-size: var(--scale-fs-17) !important;
  font-weight: 600 !important;
  line-height: 1.2;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-summary-card p,
.scale-modern-builder--combo-modifier .scale-modern-builder-summary-card small {
  font-size: var(--scale-fs-12) !important;
  font-weight: 500 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-summary-card strong {
  font-size: var(--scale-fs-20) !important;
  font-weight: 600 !important;
}

.scale-modern-builder--combo-modifier .scale-modern-builder-actions button {
  min-height: 46px !important;
  font-size: var(--scale-fs-16) !important;
  font-weight: 600 !important;
}

.scale-modern-builder-summary-card-head h3,
.scale-modern-item-detail-product h3 {
  font-size: var(--scale-type-title-3-size);
  font-weight: 600;
  letter-spacing: 0;
}

.scale-modern-builder-summary-card-head p,
.scale-modern-item-detail-product p {
  font-size: var(--scale-type-footnote-size);
  font-weight: 500;
}

.scale-modern-builder-qty-row > span,
.scale-modern-item-detail-row > span {
  font-size: var(--scale-type-body-size);
  font-weight: 500;
}

.scale-modern-builder-line-total strong,
.scale-modern-item-detail-total strong {
  font-family: var(--scale-font-mono);
  font-size: var(--scale-fs-24);
  font-weight: 700;
  letter-spacing: var(--scale-tracking-mid);
  font-variant-numeric: tabular-nums;
}

.scale-modern-builder-note span,
.scale-modern-item-detail-comment span {
  font-size: var(--scale-type-caption-1-size);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.scale-modern-builder-note textarea,
.scale-modern-comment-textarea,
.scale-modern-item-detail-comment textarea {
  font-size: var(--scale-type-body-size);
  font-weight: 400;
  line-height: var(--scale-leading-body);
}

.scale-modern-cart-item-dialog {
  width: min(560px, calc(100vw - 32px));
  border-radius: var(--scale-radius-cta);
  box-shadow: var(--scale-shadow-sheet);
}

.scale-modern-item-detail-title strong {
  font-size: var(--scale-type-headline-size);
  font-weight: 600;
}

.scale-modern-item-detail-button {
  min-height: 42px;
  font-size: var(--scale-type-callout-size);
  font-weight: 600;
}

/* ============================================================================
 * COMBO BUILDER — wireframe redesign (2026-07-27)
 *
 * New layout per the shared wireframe:
 *   · summary list + total card on the LEFT, option groups on the RIGHT
 *     (the previous build had these two columns reversed)
 *   · each option group is a horizontal ROW: a navy group-label tile on the
 *     left, its option cards flowing to the right
 *   · selected option cards keep a white face with a navy ring + a filled
 *     navy count badge in the TOP-right corner (no more full navy fill)
 *   · titlebar shows the combo name in the display serif with an "Apply"
 *     primary pill; the running total lives in the left total card
 *
 * All type/weights come from the token ramp; the navy is --scale-primary.
 * This block is intentionally last in source order (last-loaded builder
 * partial) so it wins over the earlier combo rules without new hex.
 * ==========================================================================*/

/* --- Column swap: summary left (fixed), options right (flexible) ---------- */
.scale-modern-builder--combo {
  grid-template-columns: 360px minmax(0, 1fr);
}

.scale-modern-builder--combo > .scale-modern-builder-summary {
  grid-column: 1;
  grid-row: 2;
}

.scale-modern-builder--combo > .scale-modern-builder-main {
  grid-column: 2;
  grid-row: 2;
}

/* --- Titlebar: display-serif combo name + primary "Apply" pill ------------ */
.scale-modern-builder--combo > .scale-modern-builder-titlebar {
  min-height: 56px;
  padding: 2px 16px 12px;
  align-items: flex-start;
}

.scale-modern-builder--combo .scale-modern-builder-titlebar > div {
  gap: 3px;
  padding-top: 2px;
}

/* Combo name = the same headline size every dialog title uses (sans, 17/600) —
   NOT a bespoke hero heading. */
.scale-modern-builder--combo .scale-modern-builder-titlebar strong {
  font-family: var(--scale-font-sans) !important;
  font-size: var(--scale-type-headline-size) !important;
  font-weight: var(--scale-type-headline-weight) !important;
  line-height: var(--scale-leading-snug) !important;
}

.scale-modern-builder--combo .scale-modern-builder-kicker {
  color: var(--scale-text-soft);
  font-size: var(--scale-fs-11) !important;
  font-weight: 700 !important;
  letter-spacing: var(--scale-tracking-caps);
}

.scale-modern-builder--combo .scale-modern-builder-title-action {
  height: 40px;
  color: var(--scale-primary);
  font-size: var(--scale-fs-16) !important;
  font-weight: 500 !important;
}

.scale-modern-builder--combo .scale-modern-builder-title-action.is-add {
  min-width: 104px;
  padding: 0 22px;
  border-radius: var(--scale-radius-round);
  background: var(--scale-primary) !important;
  color: var(--scale-text-on-primary) !important;
  font-weight: 600 !important;
}

.scale-modern-builder--combo .scale-modern-builder-title-action.is-add:disabled {
  background: var(--scale-chip-bg) !important;
  color: var(--scale-text-soft) !important;
}

/* --- Each group is a horizontal row: navy tile + option cards ------------- */
.scale-modern-builder--combo .scale-modern-builder-scroll {
  gap: 8px;
}

.scale-modern-builder--combo .scale-modern-builder-group {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.scale-modern-builder--combo .scale-modern-builder-group-tile {
  flex: 0 0 128px;
  width: 128px;
  height: 104px;
  padding: 12px;
  border-radius: 11px;
  background: var(--scale-primary);
  color: var(--scale-text-on-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.scale-modern-builder--combo .scale-modern-builder-group-tile strong {
  font-size: var(--scale-fs-14);
  font-weight: 700;
  line-height: 1.2;
}

/* Progress/count badge is pinned to the tile footer regardless of how the
   group name wraps above it. */
.scale-modern-builder--combo .scale-modern-builder-group-tile em {
  margin-top: auto;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--scale-radius-round);
  background: rgba(255, 255, 255, 0.18);
  color: var(--scale-text-on-primary);
  font-size: var(--scale-fs-12);
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Option cards: ONE row to the right of the tile, scrolled horizontally ---
   The cards deliberately do NOT wrap onto a second line. Each group stays exactly
   one tile tall so the group list reads as a stack of equal rows; a group with
   more options than fit scrolls sideways instead of pushing the groups below it
   down the page. Same nowrap + thin-scrollbar pattern as the category rows in
   modern-pos-wireframe.css. */
.scale-modern-builder--combo .scale-modern-builder-option-grid {
  flex: 1 1 auto;
  min-width: 0;
  grid-template-columns: none !important;
  grid-auto-flow: column;
  grid-auto-columns: 128px;
  gap: 8px !important;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--scale-separator) transparent;
  /* Fixed height = the 104px card + a lane the scrollbar draws into. Without it a
     group that overflows would be ~10px taller than one that fits, and the group
     rows would sit off a common baseline. (scrollbar-gutter does not help: it only
     reserves the gutter for a VERTICAL scrollbar.)
     The 2px inset matters: a selected card's ring is a box-shadow, which paints
     OUTSIDE the card's border box, so against a scroll container's edge it was
     being clipped on the first card and along the top. box-sizing is border-box
     here, so the padding comes out of the 118px rather than adding to it. */
  height: 118px;
  padding: 2px 2px 0 2px;
}

.scale-modern-builder--combo .scale-modern-builder-option-grid::-webkit-scrollbar {
  height: 6px;
}

.scale-modern-builder--combo .scale-modern-builder-option-grid::-webkit-scrollbar-track {
  background: transparent;
}

.scale-modern-builder--combo .scale-modern-builder-option-grid::-webkit-scrollbar-thumb {
  background: var(--scale-separator);
  border-radius: 999px;
}

.scale-modern-builder--combo .scale-modern-builder-option {
  aspect-ratio: auto !important;
  min-height: 104px !important;
  height: 104px !important;
  padding: 12px !important;
  border-radius: 11px !important;
}

.scale-modern-builder--combo .scale-modern-builder-option span {
  font-size: var(--scale-fs-14) !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.scale-modern-builder--combo .scale-modern-builder-option small {
  padding-right: 28px !important;
  color: var(--scale-text-mute) !important;
  font-size: var(--scale-fs-11) !important;
  font-weight: 500 !important;
}

.scale-modern-builder--combo .scale-modern-builder-option small i {
  font-size: var(--scale-fs-14);
}

/* Count badge → bottom-right (footer), filled navy — shares the footer line
   with the price on the left. */
.scale-modern-builder--combo .scale-modern-builder-option em {
  position: absolute !important;
  bottom: 10px !important;
  right: 10px !important;
  top: auto !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: var(--scale-radius-round);
  background: var(--scale-primary) !important;
  color: var(--scale-text-on-primary) !important;
  font-size: var(--scale-fs-12) !important;
  font-weight: 600 !important;
}

/* Selected → white face, navy ring, dark text (no full fill) */
.scale-modern-builder--combo .scale-modern-builder-option.is-selected {
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: 0 0 0 1.5px var(--scale-primary);
}

.scale-modern-builder--combo .scale-modern-builder-option.is-selected span {
  color: var(--scale-text) !important;
}

.scale-modern-builder--combo .scale-modern-builder-option.is-selected small {
  color: var(--scale-text-mute) !important;
}

/* --- Summary list: single bordered white card, tight rows split by hairlines - */
.scale-modern-builder--combo .scale-modern-builder-summary-list {
  gap: 0 !important;
  padding: 4px 8px !important;
  background: var(--scale-panel) !important;
  box-shadow: 0 0 0 1px var(--scale-border) !important;
}

/* Row height comes from the text, not from a min-height: these rows hold one line, and a
   32/34/36px floor was leaving ~15px of air around it. Padding matches the POS cart line
   (7px above/below the item name), so an item and its modifiers read at the same rhythm
   here as they do in the cart. */
.scale-modern-builder--combo .scale-modern-builder-summary-line {
  min-height: 0 !important;
  padding: 7px 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-bottom: var(--scale-hairline) solid var(--scale-separator) !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line:last-child {
  border-bottom: 0 !important;
}

/* An item and the modifier rows under it are ONE thing, so no hairline runs between
   them — the rule drops the border on any row FOLLOWED by a modifier row, which covers
   the item→first-modifier and modifier→modifier boundaries. The hairline survives where
   it actually separates two things: item→item, and last-modifier→next-item. */
.scale-modern-builder--combo .scale-modern-builder-summary-line:has(+ .scale-modern-builder-summary-line.is-child) {
  border-bottom: 0 !important;
}

/* No left bar on modifier rows. With the hairlines above gone, the modifiers already read
   as belonging to the item above them — the bar was a second marker for the same fact,
   and it drew a vertical line into a block that is now deliberately line-free. The
   indent stays: that is what still marks them as children. */
.scale-modern-builder--combo .scale-modern-builder-summary-line.is-child::before {
  content: none;
}

/* The qty cell carries a fixed `height: 22px` from its old pill styling (modern-builder.css),
   and since it is the tallest thing in the row it set the floor for EVERY row — 22px of box
   around a 15.6px line, which is where the extra air came from. Sized to its text now; the
   cell itself still has to exist (empty on modifier rows) to hold the middle grid track. */
.scale-modern-builder--combo .scale-modern-builder-summary-line em {
  height: auto !important;
}

/* Modifier rows sit as close under their item as the cart's modifier lines do: 1px of air
   around a 15.6px line vs the cart's 15.4px, indent kept on the left only. The 12px RIGHT
   padding went with it — that inset made each modifier amount land 8px inside the item
   amounts instead of in the same column. */
.scale-modern-builder--combo .scale-modern-builder-summary-line.is-child {
  min-height: 0 !important;
  padding: 1px 4px 1px 12px !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent {
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent span,
.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent span strong,
.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent b,
.scale-modern-builder--combo .scale-modern-builder-summary-line.is-parent em {
  font-weight: 700 !important;
}

/* --- Total card: breakdown (Base / Options) left, grand total right -------- */
.scale-modern-builder--combo .scale-modern-builder-total-card {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  box-shadow: 0 0 0 1px var(--scale-border) !important;
}

.scale-modern-builder--combo .scale-modern-builder-total-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scale-modern-builder--combo .scale-modern-builder-total-breakdown > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.scale-modern-builder--combo .scale-modern-builder-total-breakdown span {
  min-width: 52px;
  color: var(--scale-text-mute);
  font-size: var(--scale-fs-12);
  font-weight: 500;
}

.scale-modern-builder--combo .scale-modern-builder-total-breakdown b {
  color: var(--scale-text);
  font-size: var(--scale-fs-14);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.scale-modern-builder--combo .scale-modern-builder-total-grand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

/* Grand total mirrors the POS page total exactly: sans, fs-24/700, tight
   tracking, tabular — not a bespoke hero number. */
.scale-modern-builder--combo .scale-modern-builder-total-grand > span {
  color: var(--scale-text-soft);
  font-size: var(--scale-fs-11) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scale-modern-builder--combo .scale-modern-builder-total-grand strong {
  font-family: var(--scale-font-sans) !important;
  font-size: var(--scale-fs-24) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  line-height: 1.1 !important;
  font-variant-numeric: tabular-nums;
}

.scale-modern-builder--combo .scale-modern-builder-total-grand strong small {
  font-family: var(--scale-font-sans) !important;
  font-size: var(--scale-fs-11) !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  color: var(--scale-text-mute);
}

/* ============================================================================
 * MODIFIER BUILDER — same layout as the combo builder.
 *
 * RenderModernModifierBuilder's root now carries BOTH .scale-modern-builder--combo
 * (which supplies the whole layout above: summary column left, option groups as
 * navy label tile + option cards right) and --modifier, the same way the
 * combo-modifier builder stacks --combo + --combo-modifier.
 *
 * Everything below only neutralizes the older `--modifier` rules in
 * modern-builder.css that the combo block does not already override. This file
 * loads last, so equal-specificity rules here win.
 * ==========================================================================*/

/* Title block returns to the flex flow (the modifier builder used to pin it
   absolutely, centred) and the kicker comes back, so the titlebar reads
   [Cancel] [kicker + name] [Add] exactly like the combo one. */
.scale-modern-builder--modifier .scale-modern-builder-titlebar > div {
  position: static;
  left: auto;
  top: auto;
  width: auto;
  transform: none;
}

.scale-modern-builder--modifier .scale-modern-builder-kicker {
  display: block;
}

/* The bespoke "Pick required options…" subtitle has no combo counterpart. */
.scale-modern-builder--modifier .scale-modern-builder-titlebar strong::after {
  content: none;
}

/* Summary column spacing comes from the combo block, not the old modifier one. */
.scale-modern-builder--modifier > .scale-modern-builder-summary {
  gap: 10px;
  padding-top: 0;
}

/* The option card is a two-row grid here; the old auto margin fought row 2. */
.scale-modern-builder--modifier .scale-modern-builder-option small {
  margin-top: 0;
}

/* Required/Optional sits inside the group tile between the name and the count
   badge (which stays pinned to the tile footer via its own margin-top:auto).
   This is the one element a combo group tile has no equivalent for. */
.scale-modern-builder--modifier .scale-modern-builder-group-tile span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--scale-fs-10);
  font-weight: 700;
  letter-spacing: var(--scale-tracking-caps);
  text-transform: uppercase;
}

