/* Native checked state also updates after Configurator AJAX/property changes. */
#configurator_block {
  --fmce-choice-background: #ffffff;
  --fmce-choice-border: #e2e7e4;
  --fmce-choice-selected-background: #eaf7ef;
  --fmce-choice-selected-text: #176641;
  --fmce-choice-accent: #198754;
}

/* Text radio choices only; image swatches, measurements and yes/no toggles stay intact. */
#configurator_block .option_group:not(.option_block):has(input[type="radio"][name^="step["]) {
  width: 100%;
  position: relative;
  min-height: 44px;
  max-width: 480px;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 10px 44px 10px 12px;
  text-align: left;
  border: 1px solid var(--fmce-choice-border);
  border-radius: 10px;
  background-color: var(--fmce-choice-background);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
#configurator_block .option_group:not(.option_block):has(input[type="radio"][name^="step["]) > label {
  display: inline-block;
  width: auto;
  max-width: calc(100% - 36px);
  float: none;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0;
  vertical-align: middle;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
#configurator_block .option_group:not(.option_block) input[type="radio"][name^="step["] {
  margin-right: 10px;
  accent-color: var(--fmce-choice-accent);
}
#configurator_block .option_group:not(.option_block):not(.disabled):has(input[type="radio"][name^="step["]:not(:disabled)):hover {
  border-color: var(--fmce-choice-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
#configurator_block .option_group:not(.option_block):not(.disabled):has(input[type="radio"][name^="step["]:checked:not(:disabled)) {
  background-color: var(--fmce-choice-selected-background);
  border-color: var(--fmce-choice-accent);
  color: var(--fmce-choice-selected-text);
  box-shadow: inset 3px 0 0 var(--fmce-choice-accent);
}
#configurator_block .option_group:not(.option_block):not(.disabled):has(input[type="radio"][name^="step["]:checked:not(:disabled)) > label {
  color: var(--fmce-choice-selected-text);
  font-weight: 600;
}
#configurator_block .option_group:not(.option_block):not(.disabled):has(input[type="radio"][name^="step["]:checked:not(:disabled))::before {
  content: '✓';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 23px;
  height: 23px;
  line-height: 21px;
  text-align: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--fmce-choice-selected-text);
  font-size: 14px;
  font-weight: 700;
  box-sizing: border-box;
  pointer-events: none;
}
#configurator_block .option_group:not(.option_block):has(input[type="radio"][name^="step["]:focus-visible) {
  outline: 2px solid var(--fmce-choice-accent);
  outline-offset: 2px;
}

/* Generated DMConcept options have option_STEP_OPTION IDs. Position 0 is valid;
   the placeholder and remove-choice position -1 must not become selected green. */
#configurator_block .step_options select.select_option {
  min-height: 44px;
  max-width: 100%;
  border-radius: 10px;
  box-sizing: border-box;
}
#configurator_block .step_options select.select_option:not(:disabled):has(option[id^="option_"]:checked:not([value=""]):not([value="-1"])) {
  background-color: var(--fmce-choice-selected-background);
  border-color: var(--fmce-choice-accent);
  color: var(--fmce-choice-selected-text);
  font-weight: 600;
}
/* Uniform replaces the visible part of native selects with a sibling span. */
#configurator_block .step_options .selector:has(select.select_option) {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 44px;
  background-image: none;
}
#configurator_block .step_options .selector:has(select.select_option) > span {
  display: flex;
  align-items: center;
  min-height: 44px;
  height: auto;
  border-radius: 10px;
  box-sizing: border-box;
}
#configurator_block .step_options .selector:has(select.select_option:not(:disabled) option[id^="option_"]:checked:not([value=""]):not([value="-1"])) > span {
  position: relative;
  padding-right: 32px;
  background-color: var(--fmce-choice-selected-background);
  background-image: none;
  border-color: var(--fmce-choice-accent);
  color: var(--fmce-choice-selected-text);
  font-weight: 600;
}
#configurator_block .step_options .selector:has(select.select_option:not(:disabled) option[id^="option_"]:checked:not([value=""]):not([value="-1"])) > span::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: inherit;
  pointer-events: none;
}
#configurator_block .step_options select.select_option option {
  background-color: #ffffff;
  color: #222222;
}
@media (prefers-reduced-motion: reduce) {
  #configurator_block .option_group:not(.option_block) { transition: none; }
}
