/* Hosting builder page. Colours come from the Lagom theme variables, with fallbacks. */
.bb-page {
  --bb-accent: var(--brand-primary, #e87a2c);
  --bb-accent-soft: var(--brand-primary-lighter-4, #fef2e7);
  --bb-ok: var(--brand-success-darker, #2d9f46);
  --bb-ok-soft: var(--brand-success-lighter-4, #e7f8eb);
  --bb-line: rgba(128, 134, 148, .24);
  --bb-soft: rgba(128, 134, 148, .08);
  --bb-muted: rgba(96, 102, 116, .95);
  --bb-radius: 12px;
}
.bb-page [hidden] { display: none !important; }
.bb-page .bb-shared-note { color: var(--bb-muted); }
.bb-back { margin-bottom: 16px; }
.bb-error p { margin: 0 0 10px; }
.bb-error p:last-child { margin-bottom: 0; }
.bb-more { margin-top: 20px; color: var(--bb-muted); }
/* embedded in the CMS page /hosting-builder (call-to-action section #configurator, centred by the theme) */
.bb-cms { text-align: left; margin-top: 32px; }
.bb-cms .bb-more { text-align: center; }

.bb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.bb-main { min-width: 0; }

/* --- parameter rows ------------------------------------------------------------------------- */
.bb-params { border: 1px solid var(--bb-line); border-radius: var(--bb-radius); background: var(--ui-block-bg, transparent); }
.bb-row { padding: 18px 20px; }
.bb-row + .bb-row { border-top: 1px solid var(--bb-line); }
.bb-row-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bb-label { font-weight: 600; }
.bb-value { font-weight: 700; color: var(--bb-accent); }
.bb-price { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--bb-muted); white-space: nowrap; }
.bb-hint { font-size: 13px; color: var(--bb-muted); margin: 2px 0 10px; }
.bb-below { font-size: 13px; color: var(--bb-muted); margin-top: 8px; }

/* sliders: the rail is the coordinate space (0 % = first step, 100 % = last); the range input sits on top of the
   allowed part with its own track transparent, so the drawn rail, fill and dots line up with the thumb */
.bb-slider { --bb-thumb: 26px; padding: 6px calc(var(--bb-thumb) / 2) 0; }
.bb-rail { position: relative; height: var(--bb-thumb); }
.bb-rail-bg, .bb-fill, .bb-forbidden { position: absolute; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; left: 0; }
.bb-rail-bg { right: 0; background: var(--bb-line); }
.bb-fill { background: var(--bb-accent); }
.bb-forbidden {
  z-index: 1; height: 10px; margin-top: -5px; border-radius: 5px; background-color: rgba(128, 134, 148, .18);
  background-image: repeating-linear-gradient(-45deg, rgba(128, 134, 148, .45) 0 2px, transparent 2px 6px);
}
.bb-dot { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px var(--bb-line); pointer-events: none; z-index: 1; }
.bb-dot.bb-off { opacity: .4; }

.bb-range {
  position: absolute; top: 0; z-index: 2; height: var(--bb-thumb); margin: 0; padding: 0; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y;
}
.bb-range:focus { outline: none; }
.bb-range::-webkit-slider-runnable-track { height: var(--bb-thumb); background: transparent; border: 0; }
.bb-range::-moz-range-track { height: var(--bb-thumb); background: transparent; border: 0; }
.bb-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: var(--bb-thumb); height: var(--bb-thumb); border-radius: 50%;
  background: #fff; border: 3px solid var(--bb-accent); box-shadow: 0 1px 4px rgba(16, 24, 40, .25); cursor: grab;
}
.bb-range::-moz-range-thumb {
  width: var(--bb-thumb); height: var(--bb-thumb); box-sizing: border-box; border-radius: 50%;
  background: #fff; border: 3px solid var(--bb-accent); box-shadow: 0 1px 4px rgba(16, 24, 40, .25); cursor: grab;
}
.bb-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--bb-accent-soft), 0 0 0 6px var(--bb-accent); }
.bb-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--bb-accent-soft), 0 0 0 6px var(--bb-accent); }
.bb-range:disabled { cursor: not-allowed; }
.bb-range:disabled::-webkit-slider-thumb { cursor: not-allowed; }

.bb-ticks { position: relative; height: 20px; margin-top: 4px; font-size: 12px; color: var(--bb-muted); font-variant-numeric: tabular-nums; }
.bb-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.bb-tick.bb-first { transform: translateX(calc(var(--bb-thumb) / -2)); }
.bb-tick.bb-last { transform: translateX(calc(-100% + var(--bb-thumb) / 2)); }
.bb-tick.bb-off { opacity: .45; text-decoration: line-through; }
.bb-tick.bb-on { color: var(--bb-accent); font-weight: 700; }
.bb-raised { color: var(--bb-accent); }

/* --- billing term ----------------------------------------------------------------------------- */
.bb-terms { margin-top: 24px; }
.bb-terms-title { font-weight: 600; margin-bottom: 10px; }
.bb-term-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bb-term { position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.bb-term input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bb-term-box {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 1px solid var(--bb-line);
  border-radius: 10px; background: var(--ui-block-bg, transparent);
}
.bb-term:hover .bb-term-box { border-color: var(--bb-accent); }
.bb-term input:focus-visible + .bb-term-box { outline: 2px solid var(--bb-accent); outline-offset: 2px; }
.bb-term.bb-on .bb-term-box { border-color: var(--bb-accent); box-shadow: 0 0 0 1px var(--bb-accent); background: var(--bb-accent-soft); }
.bb-term-name { font-weight: 600; }
.bb-term-pm { font-size: 13px; color: var(--bb-muted); font-variant-numeric: tabular-nums; }
.bb-badge { align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bb-ok-soft); color: var(--bb-ok); }

/* --- summary ---------------------------------------------------------------------------------- */
/* Lagom's .app-main has overflow:hidden, which turns off position:sticky; clip keeps the clipping without that. */
.app-main:has(#bobbuilder-app), .main-body:has(#bobbuilder-app) { overflow: clip; }
/* On phones Lagom also sets overflow-x:hidden on html/body, which makes body the (non-scrolling) sticky container. */
html:has(#bobbuilder-app), body:has(#bobbuilder-app) { overflow-x: clip; overflow-y: visible; }
.bb-summary {
  position: sticky; top: 140px; align-self: start; padding: 20px; border: 1px solid var(--bb-line); border-radius: var(--bb-radius);
  background: var(--ui-block-bg, #fff); box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.bb-sum-now { font-size: 14px; color: var(--bb-muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--bb-line); }
.bb-sum-title { font-weight: 600; }
.bb-sum-old { display: block; color: var(--bb-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.bb-sum-total { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bb-sum-month { color: var(--bb-muted); margin-bottom: 16px; font-variant-numeric: tabular-nums; min-height: 1em; }
.bb-sum-note { font-size: 13px; color: var(--bb-muted); margin-top: 10px; }
.bb-sum-note.bb-note-warn { padding: 10px 12px; border-radius: 6px; background: #fff7e6; color: #8a5300; border: 1px solid #ffd591; }
.bb-action[disabled] { opacity: .5; pointer-events: none; }

@media (max-width: 991px) {
  .bb-layout { grid-template-columns: minmax(0, 1fr); }
  /* the total stays visible at the bottom of the screen while the visitor picks values */
  .bb-summary {
    position: sticky; top: auto; bottom: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--bb-radius) var(--bb-radius) 0 0;
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .08);
  }
  .bb-summary > * { grid-column: 1; }
  .bb-summary .bb-action { grid-column: 2; grid-row: 1 / span 5; width: auto; }
  .bb-sum-now { margin-bottom: 6px; padding-bottom: 6px; }
  .bb-sum-total { font-size: 22px; }
  .bb-sum-month { margin-bottom: 0; }
  .bb-sum-note { display: none; }
  .bb-sum-note.bb-note-warn { display: block; grid-column: 1 / -1; font-size: 12px; margin-top: 8px; padding: 6px 8px; line-height: 1.35; }
  /* the bar must stay short: the current price, the crossed-out price and the monthly line live on desktop only */
  .bb-summary .bb-sum-now, .bb-summary .bb-sum-old, .bb-summary .bb-sum-month { display: none; }
  .bb-summary .bb-sum-title { font-size: 12px; margin: 0; }
  .bb-summary .bb-sum-total { font-size: 20px; margin: 0; }
  .bb-summary .bb-action { grid-row: 1 / span 2; max-width: 11em; white-space: normal; line-height: 1.2; font-size: 13px; padding: 8px 10px; }
}
@media (max-width: 480px) {
  .bb-row { padding: 14px; }
  .bb-term-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-slider { --bb-thumb: 30px; }
  .bb-tick.bb-mid:not(.bb-on), .bb-tick.bb-near { display: none; }
}
