/* ==========================================================================
   DeskWerk, configurator
   Tokens komen uit style.css. Links het menu (licht), rechts de 3D-preview (donker).
   ========================================================================== */

/* Voorbeeldbalk, header en werkomgeving samen precies één schermhoogte */
.page-configurator {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.page-configurator .demo-bar,
.page-configurator .site-header { flex: none; }

.cfg {
  display: grid;
  flex: 1;
  grid-template-columns: 420px 1fr;
  min-height: 600px;
}

/* Menu
   -------------------------------------------------------------------------- */
/* position: relative houdt absoluut geplaatste onderdelen (verborgen kopjes,
   radioknoppen) binnen het scrollvlak, anders wordt de pagina zelf langer */
.cfg-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.cfg-panel__head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.cfg-panel__title { font-size: 22px; margin-bottom: 4px; }

.cfg-panel__intro {
  margin-bottom: 12px;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.5;
}

.cfg-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cfg-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  transition: border-color .15s;
}

.cfg-preset:hover { border-color: var(--accent); }

.cfg-preset[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cfg-preset__name { font-size: 15px; font-weight: 700; }
.cfg-preset__price { color: var(--gray); font-size: 13px; }

.cfg-panel__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 24px 24px;
  outline: none;
}

.cfg-noscript { padding: 24px 0; color: var(--gray); }

.cfg-group__title {
  margin: 16px 0 8px;
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Menu-item */
.cfg-item {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}

.cfg-item.is-open { border-color: var(--accent); }

.cfg-item.is-flash { animation: cfg-flash .9s var(--ease) 1; }

@keyframes cfg-flash {
  0% { box-shadow: 0 0 0 0 rgba(15, 92, 94, .35); }
  100% { box-shadow: 0 0 0 8px rgba(15, 92, 94, 0); }
}

.cfg-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
}

.cfg-item__toggle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 4px 14px 16px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}

.cfg-item__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.cfg-item__name { font-size: 16px; font-weight: 700; line-height: 1.3; }

.cfg-item__summary {
  overflow: hidden;
  color: var(--gray);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cfg-item[data-enabled="false"] .cfg-item__name { color: var(--gray); }

.cfg-item__price {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.cfg-item__chevron {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--gray);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .15s;
}

.cfg-item.is-open .cfg-item__chevron { transform: rotate(180deg); }

.cfg-item__fixed {
  color: var(--gray);
  font-size: 13px;
}

.cfg-item__body { padding: 0 16px 16px; }

.cfg-item__intro {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.5;
}

.cfg-item__add { width: 100%; margin-top: 16px; }

/* Schakelaar */
.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #C9C3B8;
  transition: background-color .15s;
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .15s var(--ease);
}

.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(18px); }

/* Velden */
.cfg-field {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.cfg-field__label {
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}

.cfg-field__hint {
  margin-top: 8px;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.5;
}

.cfg-card input,
.cfg-seg input,
.cfg-swatch input,
.cfg-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Kaartkeuze */
.cfg-cards { display: grid; gap: 8px; }

.cfg-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s;
}

.cfg-card:hover { border-color: var(--gray); }

.cfg-card__name { font-size: 15px; font-weight: 700; }
.cfg-card__price { font-size: 15px; font-weight: 500; }
.cfg-card__note { grid-column: 1 / -1; color: var(--gray); font-size: 13px; line-height: 1.45; }

.cfg-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Segmenten */
.cfg-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cfg-seg {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}

.cfg-seg:hover { border-color: var(--gray); }

.cfg-seg small,
.cfg-swatch small { color: var(--gray); font-size: 12px; }

.cfg-seg:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.cfg-seg:has(input:checked) small { color: #fff; }

/* Kleurstalen */
.cfg-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cfg-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}

.cfg-swatch:hover { border-color: var(--gray); }

.cfg-swatch__dot {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(31, 35, 38, .15);
  border-radius: 50%;
}

.cfg-swatch:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Aan/uit-opties */
.cfg-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s;
}

.cfg-check:first-child { margin-top: 16px; }

.cfg-check:hover { border-color: var(--gray); }

.cfg-check__box {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--gray);
  border-radius: 4px;
  transition: background-color .15s, border-color .15s;
}

.cfg-check__box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.cfg-check:has(input:checked) { border-color: var(--accent); }
.cfg-check:has(input:checked) .cfg-check__box { border-color: var(--accent); background: var(--accent); }
.cfg-check:has(input:checked) .cfg-check__box svg { opacity: 1; }

.cfg-check__text { display: flex; flex: 1; flex-direction: column; }
.cfg-check__name { font-size: 15px; font-weight: 700; }
.cfg-check__note { color: var(--gray); font-size: 13px; }
.cfg-check__price { font-size: 15px; font-weight: 500; }

/* Uitgeschakelde keuze en focus */
.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.cfg-card:has(input:focus-visible),
.cfg-seg:has(input:focus-visible),
.cfg-swatch:has(input:focus-visible),
.cfg-check:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Prijs onderaan */
.cfg-summary {
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.cfg-summary__rows { margin: 0 0 12px; }

.cfg-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  font-size: 15px;
}

.cfg-summary__row dt { color: var(--gray); }
.cfg-summary__row dd { margin: 0; font-weight: 700; }

.cfg-summary__row--total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cfg-summary__row--total dt {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-weight: 700;
}

.cfg-summary__row--total dt span {
  color: var(--gray);
  font-size: 13px;
  font-weight: 400;
}

.cfg-summary__row--total dd { font-size: 24px; font-weight: 800; }

.cfg-summary__actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}

.cfg-summary__actions .btn { padding: 0 16px; }

/* Vaste balk onderin, alleen als het menu één scrollvlak is (zie onderaan) */
.cfg-bar { display: none; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.stepper__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.stepper__btn:hover:not(:disabled) { color: var(--accent); }
.stepper__btn:disabled { opacity: .35; cursor: default; }

.stepper__btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.stepper__input {
  width: 48px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 3D-preview
   -------------------------------------------------------------------------- */
/* De werkbalk past zich aan de breedte van de preview aan, niet aan het scherm */
.cfg-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--dark);
  color: var(--ink-on-dark);
  container: stage / inline-size;
}

/* Korte labels alleen als de preview smal is */
.cfg-short { display: none; }

.cfg-stage :focus-visible { outline-color: var(--accent-light); }

.cfg-canvas { position: absolute; inset: 0; }

/* Laadscherm */
.cfg-loader {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--dark);
  transition: opacity .4s var(--ease), visibility .4s;
}

.cfg-loader.is-done {
  opacity: 0;
  visibility: hidden;
}

.cfg-loader__logo { width: auto; height: 34px; }

.cfg-loader__bar {
  width: 240px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #2A2F33;
}

.cfg-loader__bar span {
  display: block;
  width: 5%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent-light);
  transition: width .3s var(--ease);
}

.cfg-loader__text {
  color: var(--gray-on-dark);
  font-size: 14px;
}

.cfg-stage.is-failed .cfg-loader { display: none; }
.cfg-canvas canvas { display: block; outline: none; }

.cfg-fallback {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 360px;
  color: var(--gray-on-dark);
  text-align: center;
  transform: translate(-50%, -50%);
}

.cfg-stage.is-failed .cfg-fallback { display: block; }
.cfg-stage.is-failed .cfg-toolbar,
.cfg-stage.is-failed .cfg-height,
.cfg-stage.is-failed .cfg-help { display: none; }

.cfg-toolbar {
  position: absolute;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.cfg-toolbar--top {
  top: 16px;
  left: 16px;
  right: 16px;
  align-items: center;
  justify-content: space-between;
}

.cfg-toolbar--zoom {
  top: 50%;
  right: 16px;
  flex-direction: column;
  transform: translateY(-50%);
}

.cfg-toolgroup { display: flex; gap: 8px; }

.cfg-tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  background: #202427;
  color: var(--ink-on-dark);
  transition: border-color .15s, background-color .15s, color .15s;
}

.cfg-tool:hover:not(:disabled) {
  border-color: var(--accent-light);
  color: var(--accent-light);
}

.cfg-tool:disabled { opacity: .35; cursor: default; }

.cfg-tool svg,
.cfg-help svg,
.cfg-pop__close svg,
.quote__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfg-views {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--dark-border);
  border-radius: 999px;
  background: #202427;
}

.cfg-views__btn {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-on-dark);
  font-size: 14px;
  font-weight: 500;
  transition: background-color .15s, color .15s;
}

.cfg-views__btn:hover { color: var(--ink-on-dark); }

.cfg-views__btn[aria-pressed="true"] {
  background: var(--accent-light);
  color: var(--dark);
  font-weight: 700;
}

.cfg-height {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 24px;
  background: #202427;
  transform: translateX(-50%);
}

/* Uitleg */
.cfg-help {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 24px;
  width: 280px;
  padding: 14px 36px 14px 14px;
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  background: #202427;
  font-size: 13px;
  line-height: 1.45;
}

.cfg-help[hidden] { display: none; }

/* Muisteksten of aanraakteksten, afhankelijk van het apparaat */
.cfg-help [data-input="touch"] { display: none; }

@media (hover: none) and (pointer: coarse) {
  .cfg-help [data-input="touch"] { display: flex; }
  .cfg-help [data-input="mouse"] { display: none; }
}

.cfg-help__title { margin-bottom: 8px; font-weight: 700; }

.cfg-help__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  color: var(--gray-on-dark);
}

.cfg-help__list svg { flex: none; width: 18px; height: 18px; color: var(--accent-light); }

.cfg-help__keys {
  margin-top: 8px;
  color: var(--gray-on-dark);
  font-size: 12px;
  line-height: 1.7;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--dark-border);
  border-radius: 4px;
  background: var(--dark);
  color: var(--ink-on-dark);
  font: inherit;
  font-size: 12px;
}

.cfg-help__close,
.cfg-pop__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.cfg-help__close:hover { color: var(--accent-light); }

/* Zwevend label */
.cfg-pop {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 260px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.cfg-pop :focus-visible { outline-color: var(--accent); }

.cfg-pop__title { padding-right: 28px; font-size: 16px; font-weight: 800; }
.cfg-pop__summary { color: var(--gray); font-size: 14px; }
.cfg-pop__price { margin-top: 4px; font-size: 15px; font-weight: 700; }

.cfg-pop__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.cfg-pop__btn { flex: 1; height: 40px; padding: 0 12px; font-size: 14px; }

.cfg-pop__close:hover { color: var(--accent); }

/* Tooltip en melding */
.cfg-tip {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}

.cfg-toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 84px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  transform: translateX(-50%);
}

.cfg-toast[hidden] { display: none; }

.cfg-toast__action {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}

.cfg-toast__action:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Offerte
   -------------------------------------------------------------------------- */
.quote {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}

.quote::backdrop { background: rgba(23, 26, 28, .6); }

.quote__inner { position: relative; padding: 32px; }

.quote__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.quote__close:hover { color: var(--accent); }

.quote__title { margin-bottom: 8px; font-size: 28px; }

/* Krijgt de focus bij openen op een aanraakscherm, maar is zelf geen knop */
.quote__title:focus { outline: none; }

.quote__lead { margin-bottom: 24px; color: var(--gray); }

.quote__overview {
  margin-bottom: 24px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
}

.quote__lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

.quote__line-name { color: var(--gray); }
.quote__line-amount { font-weight: 500; white-space: nowrap; }

.quote__total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.quote__total strong { font-size: 20px; font-weight: 800; }

.quote__required { margin-bottom: 16px; color: var(--gray); font-size: 14px; }

.quote__submit { width: 100%; margin-top: 8px; }

.quote__note {
  margin-top: 12px;
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.quote__done { outline: none; }
.quote__done p { color: var(--gray); }

/* Na versturen: duidelijk dat er niets is verstuurd */
.quote__done .demo-note {
  margin-top: 16px;
  color: var(--ink);
  font-size: 14px;
}

.quote__done .btn { margin-top: 24px; }

/* ==========================================================================
   Kleinere previews en schermen
   ========================================================================== */

/* Uitleg onder de werkbalk, zodat hij niet over de zit/sta-schakelaar valt */
@container stage (max-width: 860px) {
  .cfg-help {
    top: 68px;
    bottom: auto;
  }
}

/* Smalle preview: korte labels, weergaven links onderin en zit/sta rechts onderin */
@container stage (max-width: 600px) {
  .cfg-toolbar--top { display: contents; }

  .cfg-toolgroup {
    position: absolute;
    z-index: 2;
    top: 12px;
    gap: 6px;
  }

  .cfg-toolgroup:first-child { left: 12px; }
  .cfg-toolgroup:last-child { right: 12px; }

  .cfg-tool { width: 36px; height: 36px; }

  .cfg-toolbar--zoom { right: 12px; gap: 6px; }

  .cfg-views {
    position: absolute;
    z-index: 2;
    left: 12px;
    bottom: 12px;
    padding: 3px;
  }

  .cfg-views__btn {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .cfg-height {
    left: auto;
    right: 12px;
    bottom: 12px;
    padding: 3px;
    transform: none;
  }

  .cfg-height .toggle__btn {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
  }

  .cfg-long { display: none; }
  .cfg-short { display: inline; }

  .cfg-help {
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: 300px;
    padding: 10px 36px 10px 12px;
    font-size: 12px;
  }

  .cfg-toast {
    bottom: 60px;
    width: max-content;
    max-width: calc(100% - 24px);
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .cfg-loader__bar { width: 180px; }
}

/* Heel smal (kleine telefoon): nog compacter, zodat alles op één regel past */
@container stage (max-width: 359px) {
  .cfg-views__btn { padding: 0 7px; font-size: 12px; }
  .cfg-height .toggle__btn { padding: 0 10px; font-size: 12px; }
}

/* Kleine laptop: smaller menu */
@media (max-width: 1200px) {
  .cfg { grid-template-columns: 360px 1fr; }
}

/* Weinig hoogte, of het menu staat onder de preview: het menu wordt één scrollvlak
   en totaal plus offerte staan in een vaste balk onderin */
@media (max-height: 640px), (max-width: 960px) and (orientation: portrait) {
  .cfg { min-height: 0; }

  .cfg-panel {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-bottom: 88px;
  }

  .cfg-panel__scroll { overflow: visible; }

  /* Totaal en offerteknop staan al in de balk */
  .cfg-summary__row--total,
  .cfg-summary__actions [data-open-quote] { display: none; }

  .cfg-summary__actions { grid-template-columns: 1fr; }

  .cfg-bar {
    position: sticky;
    z-index: 3;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 -8px 24px rgba(31, 35, 38, .08);
  }

  .cfg-bar__total {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
  }

  .cfg-bar__total span {
    color: var(--gray);
    font-size: 13px;
  }

  .cfg-bar__total strong {
    font-size: 20px;
    font-weight: 800;
  }

  /* Past het niet (kleine telefoon), dan gaat "excl. btw" naar de volgende regel */
  .cfg-bar__total small {
    color: var(--gray);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
  }

  .cfg-bar .btn {
    flex: none;
    padding: 0 20px;
  }
}

/* Telefoon en tablet staand: preview boven, menu eronder */
@media (max-width: 960px) and (orientation: portrait) {
  .cfg {
    display: flex;
    flex-direction: column;
  }

  .cfg-stage {
    order: -1;
    flex: none;
    height: 40vh;
    height: 40dvh;
    min-height: 220px;
    max-height: 520px;
  }

  .cfg-panel {
    flex: 1;
    min-height: 0;
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .cfg-panel__head { padding: 16px 20px; }
  .cfg-panel__scroll { padding: 4px 20px 24px; }
  .cfg-summary { padding: 16px 20px 20px; }
  .cfg-bar { padding: 12px 20px; }

  /* Offerte als volledig scherm */
  .quote {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .quote__inner { padding: 24px 20px 32px; }

  .quote__title {
    padding-right: 44px;
    font-size: 24px;
  }

  .quote__close {
    top: 14px;
    right: 10px;
  }
}

/* Kleine telefoon: compactere offerteknop, zodat het totaal ruimte houdt */
@media (max-width: 360px) {
  .cfg-bar { gap: 12px; }

  .cfg-bar .btn {
    padding: 0 14px;
    font-size: 15px;
  }
}

/* Aanraakschermen: geen hover-toestand die na een tik blijft hangen */
@media (hover: none) {
  .cfg-tool:hover:not(:disabled) {
    border-color: var(--dark-border);
    color: var(--ink-on-dark);
  }

  .cfg-views__btn:not([aria-pressed="true"]):hover { color: var(--gray-on-dark); }
  .cfg-preset:not([aria-pressed="true"]):hover { border-color: var(--border); }

  .cfg-card:hover,
  .cfg-seg:hover,
  .cfg-swatch:hover,
  .cfg-check:hover { border-color: var(--border); }

  .cfg-card:has(input:checked):hover,
  .cfg-seg:has(input:checked):hover,
  .cfg-swatch:has(input:checked):hover,
  .cfg-check:has(input:checked):hover { border-color: var(--accent); }

  .cfg-toast__action:hover {
    border-color: var(--ink);
    background: transparent;
    color: var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfg-loader,
  .cfg-loader__bar span { transition: none; }
  .cfg-item.is-flash { animation: none; }
  .switch__thumb,
  .cfg-item__chevron { transition: none; }
}
