/**
 * Konfigurator Frontend – orientiert sich am Elementor Site Kit (Standardkit).
 * Nutzt --e-global-color-* und --e-global-typography-* mit Fallbacks außerhalb von Elementor.
 */

/* Kurzcode-Hülle: Konfigurator + optional Elementor unter der Zusammenfassung */
.kb-konfigurator-shell {
  width: 100%;
  max-width: 100%;
}

.kb-elementor-below-summary {
  width: 100%;
  max-width: 100%;
  clear: both;
}

/* Aktions-Buttons unter dem Konfigurator (zentriert, Abstand nach oben) */
.kb-share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 48px;
  margin-bottom: 0.25rem;
  padding: 0 0.125rem;
  width: 100%;
  font-family: var(--e-global-typography-accent-font-family, var(--e-global-typography-text-font-family, inherit));
}

.kb-share-actions .elementor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.35rem;
  font-size: var(--e-global-typography-accent-font-size, 15px);
  font-weight: var(--e-global-typography-accent-font-weight, 600);
  line-height: 1.2;
  text-align: center;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-sizing: border-box;
}

.kb-share-actions .elementor-button-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.kb-share-actions .elementor-button-text {
  flex-grow: unset;
}

/* Link kopieren + Preisanfrage: gleiche Primärfläche, Hover Schrift in Kit-Primary (grün) */
.kb-share-actions .kb-share-actions__copy.elementor-button,
.kb-share-actions .kb-share-actions__popup.elementor-button {
  background-color: var(--e-global-color-primary, #6ec1e4);
  color: #fff;
  box-shadow: none;
}

.kb-share-actions .kb-share-actions__copy.elementor-button:hover,
.kb-share-actions .kb-share-actions__popup.elementor-button:hover {
  filter: none;
  background-color: #fff;
  color: var(--e-global-color-primary, #61ce70);
  box-shadow: inset 0 0 0 2px var(--e-global-color-primary, #61ce70);
}

.kb-share-actions .kb-share-actions__copy.elementor-button:hover .elementor-button-text,
.kb-share-actions .kb-share-actions__popup.elementor-button:hover .elementor-button-text {
  color: inherit;
}

.kb-share-actions .kb-share-actions__copy.elementor-button.kb-share-actions__copy--done {
  outline: 2px solid var(--e-global-color-accent, var(--e-global-color-primary, #61ce70));
  outline-offset: 2px;
}

/* Einheitliche frühe Ladephase (HTML aus Shortcode, kein zweites Shell-Replace vor dem Fetch) */
.kb-konfigurator.kb-konfigurator--phase-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 28rem);
}

.kb-konfigurator-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.kb-konfigurator {
  /* Kit → interne Aliase */
  --kb-text: var(--e-global-color-text, #333333);
  --kb-primary: var(--e-global-color-primary, #6ec1e4);
  --kb-secondary: var(--e-global-color-secondary, #54595f);
  --kb-accent: var(--e-global-color-accent, var(--e-global-color-primary, #61ce70));
  --kb-surface: #ffffff;
  --kb-surface-muted: #f4f5f6;
  /* Options-Spalte: weiß; Karten: fast weiß, nur Auswahl mit grünem Rahmen */
  --kb-card-bg: #f7f8fa;
  --kb-card-bg-hover: #eef0f3;
  /* Ausgewählte Karte: Elementor Primary (Kit) */
  --kb-card-selected-border: var(--e-global-color-primary, #61ce70);
  --kb-card-caption: #6a6a6a;
  --kb-card-caption-sub: #858585;
  --kb-border: color-mix(in srgb, var(--kb-text) 14%, transparent);
  --kb-radius: 0.35em;
  --kb-shadow-sm: 0 1px 3px color-mix(in srgb, var(--kb-text) 8%, transparent);
  --kb-tab-disabled-text: #8a8a8a;

  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;

  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: var(--e-global-typography-text-font-size, 1rem);
  font-weight: var(--e-global-typography-text-font-weight, 400);
  line-height: var(--e-global-typography-text-line-height, 1.6);
  color: var(--kb-text);
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-konfigurator {
    --kb-border: rgba(0, 0, 0, 0.12);
    --kb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
}

.kb-konfigurator *,
.kb-konfigurator *::before,
.kb-konfigurator *::after {
  box-sizing: border-box;
}

.kb-ui {
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  background: var(--kb-surface);
  overflow: hidden;
  box-shadow: var(--kb-shadow-sm);
}

/* Tabs: Akzent-Typografie der Kit-„Accent“-Gruppe */
.kb-tabs-bar {
  border-bottom: 1px solid var(--kb-border);
  background: var(--kb-surface-muted);
}

.kb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: none;
  background: transparent;
}

.kb-tabs-mobile {
  display: none;
  padding: 0.65rem 0.85rem 0.75rem;
}

/* Gegen Theme/Elementor: Mobile-Navigation nur per Dropdown, Desktop nur Tabs. */
.kb-konfigurator .kb-tabs-bar .kb-tabs-mobile {
  display: none;
}

.kb-tabs-mobile__label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
}

.kb-tabs-mobile__label-text {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kb-secondary);
  line-height: 1.2;
}

.kb-tabs-select {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.65rem 2.25rem 0.65rem 0.75rem;
  min-height: 2.75rem;
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--kb-text);
  background-color: var(--kb-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  border: 1px solid var(--kb-border);
  border-radius: calc(var(--kb-radius) * 0.85);
  appearance: none;
  cursor: pointer;
}

.kb-tabs-select:focus-visible {
  outline: 2px solid var(--kb-accent);
  outline-offset: 2px;
}

.kb-tabs-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kb-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.75em 1.1em;
  cursor: pointer;
  margin-bottom: -1px;
  border-radius: 0;

  font-family: var(
    --e-global-typography-accent-font-family,
    var(--e-global-typography-text-font-family, inherit)
  );
  font-size: var(--e-global-typography-accent-font-size, 0.875rem);
  font-weight: var(--e-global-typography-accent-font-weight, 500);
  line-height: var(--e-global-typography-accent-line-height, 1.4);
  letter-spacing: var(--e-global-typography-accent-letter-spacing, normal);
  text-transform: var(--e-global-typography-accent-text-transform, none);

  color: var(--kb-secondary);
  border-bottom: 2px solid transparent;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.kb-tab:hover {
  color: var(--kb-text);
  background: color-mix(in srgb, var(--kb-surface) 70%, var(--kb-surface-muted));
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-tab:hover {
    background: rgba(255, 255, 255, 0.75);
  }
}

/* Aktiv: Lesetext (Kit-Akzent ist oft hell/weiß und auf weißer Fläche unleserlich) */
.kb-tab.is-active {
  background: var(--kb-surface);
  color: var(--kb-text);
  border-bottom-color: var(--kb-accent);
  font-weight: var(--e-global-typography-accent-font-weight, 600);
}

.kb-tab:disabled,
.kb-tab[disabled] {
  cursor: not-allowed;
  color: var(--kb-tab-disabled-text);
  background: transparent;
}

.kb-tab:disabled:hover,
.kb-tab[disabled]:hover {
  color: var(--kb-tab-disabled-text);
  background: transparent;
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-tab:disabled:hover,
  .kb-tab[disabled]:hover {
    background: transparent;
  }
}

.kb-tab:focus-visible {
  outline: 2px solid var(--kb-accent);
  outline-offset: 2px;
}

.kb-tab:disabled:focus-visible,
.kb-tab[disabled]:focus-visible {
  outline-color: var(--kb-tab-disabled-text);
}

.kb-konfigurator .kb-tabs button.kb-tab {
  border-radius: 0 !important;
}

.kb-split {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: 55vh;
}

.kb-panel--options {
  flex: 0 0 35%;
  max-width: 35%;
  padding: 0.45rem 0.5rem 0.55rem;
  border-right: 1px solid var(--kb-border);
  background: var(--kb-surface);
  background-color: var(--kb-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

.kb-konfigurator .kb-panel--options {
  background-color: var(--kb-surface) !important;
  background-image: none !important;
}

/* Tab „Modell“: alle Karten ohne Innen-Scroll sichtbar (Seite scrollt bei Bedarf) */
.kb-panel--options.kb-panel--options--expand-models {
  overflow: visible;
}

.kb-panel--options.kb-panel--options--expand-models .kb-card-grid {
  flex: none !important;
  overflow: visible !important;
  min-height: 0 !important;
}

.kb-panel--preview {
  flex: 1 1 65%;
  min-width: min(100%, 280px);
  min-height: 0;
  padding: clamp(0.45rem, 1.2vw, 0.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  background: var(--kb-surface);
  align-self: stretch;
}

.kb-preview-head {
  margin: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--kb-border);
}

.kb-preview-title {
  font-family: var(
    --e-global-typography-primary-font-family,
    var(--e-global-typography-text-font-family, inherit)
  );
  font-size: var(--e-global-typography-primary-font-size, 1.125rem);
  font-weight: var(--e-global-typography-primary-font-weight, 600);
  line-height: var(--e-global-typography-primary-line-height, 1.3);
  letter-spacing: var(--e-global-typography-primary-letter-spacing, normal);
  color: var(--kb-text);
  margin: 0 0 0.35rem;
}

.kb-preview-model {
  margin: 0;
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.8rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.88));
  font-weight: 500;
  line-height: 1.35;
  color: var(--kb-secondary);
}

.kb-preview-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 0.3rem;
}

.kb-zoom-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.kb-zoom-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.12em 0.32em;
  min-width: 1.35rem;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--kb-text);
  background: var(--kb-surface-muted);
  border: 1px solid var(--kb-border);
  border-radius: calc(var(--kb-radius) * 0.65);
  cursor: pointer;
  box-sizing: border-box;
}

.kb-zoom-btn:hover {
  background: color-mix(in srgb, var(--kb-surface-muted) 88%, var(--kb-text));
}

.kb-zoom-btn:focus-visible {
  outline: 1px solid var(--kb-accent);
  outline-offset: 1px;
}

.kb-zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.kb-zoom-pct {
  min-width: 2.35rem;
  padding: 0 0.15em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.65rem;
  line-height: 1.15;
  color: var(--kb-secondary);
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-zoom-btn:hover {
    background: #e8e9eb;
  }
}

.kb-konfigurator .kb-zoom-btn {
  font-size: 0.65rem !important;
  padding: 0.12em 0.32em !important;
  min-height: 0 !important;
  min-width: 1.35rem !important;
  line-height: 1.15 !important;
}

.kb-konfigurator .kb-zoom-pct {
  font-size: 0.65rem !important;
}

/* Ebenen-Legende: volle Breite unter der 35/65-Zeile */
.kb-layer-legend {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border: none;
  border-top: 1px solid var(--kb-border);
  border-radius: 0;
  background: var(--kb-surface-muted);
  overflow: visible;
  flex-shrink: 0;
}

.kb-layer-legend__title {
  font-family: var(--e-global-typography-accent-font-family, var(--e-global-typography-text-font-family, inherit));
  font-size: max(0.72rem, calc(var(--e-global-typography-accent-font-size, 0.875rem) * 0.95));
  font-weight: var(--e-global-typography-accent-font-weight, 600);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kb-secondary);
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--kb-border);
}

/* Zusammenfassung: mobil bis ca. 2 Spalten; bricht auf 1 Spalte, wenn die Karte zu schmal würde */
.kb-layer-legend__list--cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.25rem), 1fr));
  align-items: stretch;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .kb-layer-legend__list--cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
}

.kb-layer-legend__card.kb-layer-legend__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.55rem 0.55rem;
  box-sizing: border-box;
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  background: var(--kb-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--kb-text) 6%, transparent);
}

@media (min-width: 900px) {
  .kb-layer-legend__card.kb-layer-legend__item {
    flex: 1 1 0;
    width: auto;
    min-width: 5.5rem;
    max-width: none;
  }
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-layer-legend__card.kb-layer-legend__item {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  }
}

.kb-layer-legend__item--zone-back {
  border-left: 3px solid color-mix(in srgb, var(--kb-secondary) 55%, transparent);
}

.kb-layer-legend__item--zone-front {
  border-left: 3px solid var(--kb-accent);
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-layer-legend__item--zone-back {
    border-left-color: rgba(84, 89, 95, 0.45);
  }
}

@media (min-width: 900px) {
  .kb-layer-legend__thumb {
    min-height: 3.75rem;
    max-height: 6rem;
  }
}

.kb-layer-legend__zone-pill {
  display: block;
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.58rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.62));
  font-weight: 600;
  line-height: 1.2;
  color: var(--kb-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}

.kb-layer-legend__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 3.25rem;
  max-height: 5.25rem;
  margin-bottom: 0.45rem;
  border-radius: calc(var(--kb-radius) * 0.75);
  background: #fff;
  border: 1px solid var(--kb-border);
  overflow: hidden;
  flex-shrink: 0;
}

.kb-layer-legend__thumb--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--kb-secondary);
  background: #fff;
}

.kb-layer-legend__thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
}

.kb-layer-legend__thumb--stack {
  display: block;
  position: relative;
}

.kb-layer-legend__thumb--stack .kb-layer-legend__stack-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.kb-layer-legend__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kb-layer-legend__cat {
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.65rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.68));
  line-height: 1.25;
  color: var(--kb-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.kb-layer-legend__name {
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.72rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.78));
  line-height: 1.2;
  color: var(--kb-text);
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.kb-layers-viewport {
  position: relative;
  flex: 1;
  min-height: clamp(240px, 50vh, 520px);
  min-width: 0;
  border: 1px dashed var(--kb-border);
  border-radius: var(--kb-radius);
  overflow: hidden;
  touch-action: none;
  cursor: default;
  background: repeating-conic-gradient(
      color-mix(in srgb, var(--kb-text) 4%, var(--kb-surface)) 0% 25%,
      var(--kb-surface) 0% 50%
    )
    50% / 18px 18px;
}

.kb-layers-viewport.kb-layers-viewport--zoomed {
  cursor: grab;
}

.kb-layers-viewport.is-dragging {
  cursor: grabbing;
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-layers-viewport {
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  }
}

.kb-layers-transform {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform;
}

.kb-layers {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-width: 0;
  overflow: visible;
  background: transparent;
}

.kb-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: clamp(0.08rem, 0.6vw, 0.35rem);
}

.kb-stack--front {
  z-index: 2;
}

.kb-stack--back {
  z-index: 1;
}

.kb-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 135%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
}

.kb-option-panel {
  display: block;
}

/* Mobil: kompakte „Dropdown“-Zeile + Sheet mit Karten inkl. Vorschaubild */
@media (min-width: 783px) {
  .kb-konfigurator .kb-option-mobile {
    display: contents;
  }

  .kb-konfigurator .kb-option-mobile-toggle,
  .kb-konfigurator .kb-option-mobile-backdrop {
    display: none !important;
  }

  .kb-konfigurator .kb-option-mobile-list {
    display: contents;
  }

  /* Eine Spaltenhöhe mit Vorschau: Kartenbereich füllt die Fläche, Scroll nur im Grid */
  .kb-konfigurator .kb-option-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .kb-konfigurator .kb-option-panel[hidden] {
    display: none !important;
  }

  .kb-konfigurator .kb-panel--options .kb-card-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }
}

@media (max-width: 782px) {
  .kb-konfigurator .kb-option-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    z-index: 1;
  }

  .kb-konfigurator .kb-option-mobile--open {
    z-index: 100010;
  }

  .kb-konfigurator .kb-option-mobile-toggle {
    display: flex !important;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.45rem 0.55rem;
    box-sizing: border-box;
    border: 1px solid var(--kb-border);
    border-radius: calc(var(--kb-radius) * 0.85);
    background: var(--kb-surface) !important;
    background-color: var(--kb-surface) !important;
    color: var(--kb-text) !important;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
  }

  .kb-konfigurator .kb-option-mobile-toggle__inner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
  }

  .kb-konfigurator .kb-option-mobile-toggle__visual {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .kb-konfigurator .kb-option-mobile-toggle__thumb.kb-card-media,
  .kb-konfigurator .kb-option-mobile-toggle__visual .kb-card-media {
    width: 3rem !important;
    min-width: 3rem !important;
    max-width: 3rem !important;
    min-height: 2.35rem !important;
    aspect-ratio: 4 / 3;
  }

  .kb-konfigurator .kb-option-mobile-toggle__visual .kb-card-media--stack {
    min-height: 2.35rem !important;
  }

  .kb-konfigurator .kb-option-mobile-toggle__textcol {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .kb-konfigurator .kb-option-mobile-toggle__text {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--kb-text) !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .kb-konfigurator .kb-option-mobile-toggle__chev {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
    color: var(--kb-secondary);
    transition: transform 0.2s ease;
    margin-left: 0.15rem;
  }

  .kb-konfigurator .kb-option-mobile--open .kb-option-mobile-toggle__chev {
    transform: rotate(180deg);
  }

  .kb-konfigurator .kb-option-mobile-toggle:focus-visible {
    outline: 2px solid var(--kb-accent);
    outline-offset: 2px;
  }

  .kb-konfigurator .kb-option-mobile-toggle[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .kb-konfigurator .kb-option-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100008;
    background: rgba(15, 15, 20, 0.38);
  }

  .kb-konfigurator .kb-option-mobile--open .kb-option-mobile-backdrop {
    display: block;
  }

  .kb-konfigurator .kb-option-mobile-list {
    display: none;
    position: fixed;
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 100012;
    max-height: min(74vh, 36rem, calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1rem));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.45rem;
    box-sizing: border-box;
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius);
    background: var(--kb-surface);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.2),
      0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .kb-konfigurator .kb-option-mobile-list.is-open {
    display: block;
  }

  .kb-konfigurator .kb-option-mobile-list .kb-card-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .kb-konfigurator .kb-option-mobile-list .kb-card-btn {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    text-align: left !important;
  }

  .kb-konfigurator .kb-option-mobile-list .kb-card-media {
    width: 4.25rem !important;
    min-width: 4.25rem !important;
    max-width: 4.25rem !important;
    min-height: 3.2rem !important;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
  }

  .kb-konfigurator .kb-option-mobile-list .kb-card-media--stack {
    min-height: 3.2rem !important;
  }

  .kb-konfigurator .kb-option-mobile-list .kb-card-cap {
    flex: 1;
    min-width: 0;
    padding: 0.15rem 0 0.15rem 0.35rem;
    text-align: left !important;
  }
}

.kb-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45em;
}

.kb-card-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  border: 2px solid transparent;
  border-radius: var(--kb-radius);
  background: var(--kb-card-bg);
  background-color: var(--kb-card-bg);
  background-image: none;
  padding: 6px;
  cursor: pointer;
  font: inherit;
  color: var(--kb-text);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    transform 0.12s ease;
}

/*
 * Elementor/Themes: oft border:none / border:0 auf Buttons → nur border-color reicht nicht.
 * Volle Kurzform mit !important hält 2px Rahmen; Auswahl = Kit-Akzent (Fallback grün).
 */
.kb-konfigurator .kb-panel--options button.kb-card-btn {
  padding: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  border: 2px solid transparent !important;
  background-color: var(--kb-card-bg) !important;
  background-image: none !important;
  color: var(--kb-card-caption) !important;
  box-shadow: none !important;
}

.kb-card-btn:hover:not(:disabled) {
  background: var(--kb-card-bg-hover);
  background-color: var(--kb-card-bg-hover);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn:hover:not(:disabled):not(.is-selected) {
  background-color: var(--kb-card-bg-hover) !important;
  border: 2px solid transparent !important;
  background-image: none !important;
}

.kb-konfigurator .kb-panel--options button.kb-card-btn:hover:not(:disabled).is-selected {
  background-color: var(--kb-card-bg) !important;
  background-image: none !important;
  border: 2px solid var(--kb-card-selected-border) !important;
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-card-btn:hover:not(:disabled) {
    background: var(--kb-card-bg-hover);
    background-color: var(--kb-card-bg-hover);
  }
}

/* Ausgewählt: grüner Rahmen, Hintergrund wie Basis */
.kb-card-btn.is-selected {
  border: 2px solid var(--kb-card-selected-border, var(--e-global-color-primary, #61ce70));
  background: var(--kb-card-bg);
  background-color: var(--kb-card-bg);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn.is-selected {
  background-color: var(--kb-card-bg) !important;
  background-image: none !important;
  color: var(--kb-card-caption) !important;
  box-shadow: none !important;
  border: 2px solid var(--kb-card-selected-border) !important;
}

/* Nicht für Modell/Oberfläche: sichtbar, aber nicht wählbar */
.kb-card-btn.is-disabled,
.kb-card-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.kb-card-btn.is-disabled:hover,
.kb-card-btn:disabled:hover {
  background: var(--kb-card-bg);
  background-color: var(--kb-card-bg);
  border-color: transparent;
}

.kb-konfigurator .kb-panel--options button.kb-card-btn.is-disabled,
.kb-konfigurator .kb-panel--options button.kb-card-btn:disabled {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.35) !important;
  color: var(--kb-card-caption) !important;
}

.kb-konfigurator .kb-panel--options button.kb-card-btn.is-disabled:hover,
.kb-konfigurator .kb-panel--options button.kb-card-btn:disabled:hover {
  background-color: var(--kb-card-bg) !important;
  border: 2px solid transparent !important;
}

.kb-card-btn:focus-visible {
  outline: 2px solid var(--kb-accent);
  outline-offset: 2px;
}

.kb-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  min-height: 5.5rem;
  min-width: 0;
  width: 100%;
  background: var(--kb-card-bg);
  background-color: var(--kb-card-bg);
  border-radius: calc(var(--kb-radius) * 0.65);
  overflow: hidden;
}

.kb-konfigurator .kb-panel--options .kb-card-media {
  background-color: var(--kb-card-bg) !important;
  background-image: none !important;
}

.kb-konfigurator .kb-panel--options button.kb-card-btn:hover:not(:disabled) .kb-card-media {
  background-color: var(--kb-card-bg-hover) !important;
}

.kb-konfigurator .kb-panel--options button.kb-card-btn.is-selected .kb-card-media {
  background-color: var(--kb-card-bg) !important;
}

/* Direktes Vorschaubild: max. Größe + Zentrierung (nicht 100%/100%, sonst oft Theme height:auto → versetzt) */
.kb-card-media > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

/* Modell-Karten: gleicher Layer-Stack wie Hauptvorschau, verkleinert */
.kb-card-media--stack {
  position: relative;
  overflow: hidden;
}

.kb-card-media--stack .kb-card-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0.2rem;
}

.kb-card-media--stack .kb-card-stack--back {
  z-index: 1;
}

.kb-card-media--stack .kb-card-stack--front {
  z-index: 2;
}

.kb-card-stack-img {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Bilder in Karten: kein Theme-/Elementor-Akzent als „Kärtchen“-Hintergrund (betrifft oft Modell-Tab) */
.kb-konfigurator .kb-panel--options .kb-card-btn img {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.kb-konfigurator .kb-panel--options .kb-card-btn .kb-card-media > img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.kb-card-media--text {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.7rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.8));
  line-height: 1.3;
  padding: 0.3em 0.35em;
  text-align: center;
  color: var(--kb-card-caption);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn .kb-card-media--text {
  color: var(--kb-card-caption) !important;
}

.kb-card-cap {
  display: block;
  margin-top: 0.28em;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: max(0.68rem, calc(var(--e-global-typography-text-font-size, 1rem) * 0.72));
  line-height: 1.15;
  color: var(--kb-card-caption);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn .kb-card-cap {
  color: var(--kb-card-caption) !important;
  line-height: 1.15 !important;
}

.kb-card-cap__title {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  font-weight: 500;
  line-height: 1.15;
}

.kb-card-cap__sub {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin-top: 1px;
  font-size: 0.78em;
  font-weight: 400;
  line-height: 1.12;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--kb-card-caption-sub);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn .kb-card-cap__sub {
  color: var(--kb-card-caption-sub) !important;
  line-height: 1.12 !important;
}

.kb-card-cap small {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin-top: 0.12em;
  font-size: 0.78em;
  font-weight: 400;
  line-height: 1.12;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--kb-card-caption-sub);
}

.kb-konfigurator .kb-panel--options button.kb-card-btn .kb-card-cap small {
  color: var(--kb-card-caption-sub) !important;
}

.kb-loading,
.kb-error {
  font-family: var(--e-global-typography-text-font-family, inherit);
}

.kb-error {
  padding: 1em;
  color: color-mix(in srgb, #c53030 90%, var(--kb-text));
  font-weight: 500;
}

@supports not (color: color-mix(in lab, red, red)) {
  .kb-error {
    color: #b91c1c;
  }
}

/* Ladezustand: Ring-Spinner in Kit-Primary (Schriftzug nur für Screenreader) */
.kb-loading__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.kb-loading--spinner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  margin: 0;
  padding: 1.25rem 1rem;
}

.kb-loading__spinner {
  box-sizing: border-box;
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 50%;
  /* Primary, nicht Accent: Accent ist im Kit oft grau/sekundär. */
  border: 0.24em solid color-mix(in srgb, var(--kb-primary) 24%, var(--kb-surface));
  border-top-color: var(--kb-primary);
  animation: kb-loading-spin 0.72s linear infinite;
}

@supports not (color: color-mix(in srgb, red, red)) {
  .kb-loading__spinner {
    border: 0.24em solid rgba(110, 193, 228, 0.35);
    border-top-color: var(--kb-primary);
  }
}

@keyframes kb-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 782px) {
  /*
   * Options-Sheet nutzt position:fixed. overflow:auto/hidden auf Vorfahren
   * (v. a. ohne --expand-models) clippt das Sheet sonst unter der Vorschau.
   */
  .kb-konfigurator .kb-ui {
    overflow: visible;
  }

  .kb-panel--options,
  .kb-panel--preview {
    flex: 1 1 100%;
    max-width: 100%;
    border-right: none;
    max-height: none;
  }

  .kb-konfigurator .kb-panel--options {
    overflow: visible;
  }

  .kb-split {
    min-height: 55vh;
  }

  .kb-layers-viewport {
    min-height: clamp(200px, 38vh, 320px);
  }

  .kb-konfigurator .kb-tabs-bar .kb-tabs,
  .kb-konfigurator .kb-tabs-bar [role='tablist'] {
    display: none !important;
  }

  .kb-konfigurator .kb-tabs-bar .kb-tabs-mobile {
    display: block !important;
  }
}

@media (min-width: 783px) {
  .kb-konfigurator .kb-tabs-bar .kb-tabs-mobile {
    display: none !important;
  }

  .kb-konfigurator .kb-tabs-bar .kb-tabs,
  .kb-konfigurator .kb-tabs-bar [role='tablist'] {
    display: flex !important;
  }
}
