.wcdc-calculator {
  /* Plugin-defined default error token; host themes may override this variable. */
  --pr-error: hsl(0 65% 52%);
}

.wcdc-calculator {
  background: var(--pr-background, #f8f3ee);
  color: var(--pr-text-primary, #1f1813);
}

.wcdc-calculator__fields,
.wcdc-calculator__options {
  display: block;
  margin: 0;
  padding: 0;
}

.wcdc-group {
  margin: 0;
  border: 1px solid var(--pr-border, #d8d2c7);
  background: var(--pr-surface, #ffffff);
}

.wcdc-group__header {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  color: var(--pr-text-primary, #1f1813);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wcdc-group__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pr-text-primary, #1f1813);
}

.wcdc-group__conflict-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pr-error, #d23636);
  font-size: 0.9rem;
  line-height: 1;
}

.wcdc-group__conflict-icon[hidden] {
  display: none;
}

.wcdc-group__selected-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  max-width: 42ch;
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--pr-border, #d8d2c7);
  border-radius: 999px;
  background: var(--pr-surface-muted, #f3eee6);
  color: var(--pr-text-primary, #1f1813);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcdc-group--conflict .wcdc-group__header {
  box-shadow: inset 4px 0 0 var(--pr-error, #d23636);
}

.wcdc-group--conflict .wcdc-group__title {
  color: var(--pr-error, #d23636);
}

.wcdc-group--conflict .wcdc-group__selected-badge {
  border-color: rgba(210, 54, 54, 0.5);
  background: rgba(210, 54, 54, 0.12);
  color: var(--pr-error, #d23636);
}

.wcdc-group__chevron {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  color: var(--pr-text-secondary, #5c5348);
  transition: transform 0.2s ease;
}

.wcdc-group__chevron path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.wcdc-group.is-open .wcdc-group__chevron,
.wcdc-group__header[aria-expanded="true"] .wcdc-group__chevron {
  transform: rotate(180deg);
}

.wcdc-group__content {
  padding: 0 20px 16px;
}

.wcdc-group__content > .wcdc-calculator__field,
.wcdc-group__content > .wcdc-calculator__group {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-inline-size: 0;
}

.wcdc-group__content .wcdc-calculator__group-title,
.wcdc-group__content .wcdc-calculator__label {
  color: var(--pr-text-primary, #1f1813);
}

.wcdc-group__content .wcdc-calculator__group-description,
.wcdc-group__content .wcdc-calculator__field-hint,
.wcdc-group__content .wcdc-calculator__unit,
.wcdc-group__content .wcdc-calculator__option-meta {
  color: var(--pr-text-muted, #7f756a);
}

.wcdc-group__content[data-wcdc-render-mode="numeric"] {
  padding-top: 2px;
}

.wcdc-numeric-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.wcdc-numeric-field {
  flex: 1 1 180px;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcdc-numeric-field__label {
  color: var(--pr-text-primary, #1f1813);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
}

.wcdc-numeric-field__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--pr-border, #d8d2c7);
  border-radius: 8px;
  background: var(--pr-surface, #ffffff);
}

.wcdc-numeric-field__input {
  width: 100%;
  min-inline-size: 0;
  border: 0;
  background: transparent;
  color: var(--pr-text-primary, #1f1813);
  font: inherit;
  padding: 10px 0;
  box-shadow: none;
}

.wcdc-numeric-field__input:focus {
  outline: none;
}

.wcdc-numeric-field__input-wrap:focus-within {
  border-color: var(--pr-brand-primary, #b58452);
  box-shadow: 0 0 0 2px rgba(181, 132, 82, 0.14);
}

.wcdc-numeric-field__unit {
  flex: 0 0 auto;
  color: var(--pr-text-muted, #8b8278);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.wcdc-numeric-field__limits {
  min-height: 1.1em;
  color: var(--pr-text-muted, #8b8278);
  font-size: 0.78rem;
  line-height: 1.3;
}

.wcdc-numeric-field .wcdc-calculator__field-error {
  min-height: 1.1em;
  margin: 0;
}

.wcdc-numeric-field.is-invalid .wcdc-numeric-field__input-wrap {
  border-color: #b32d2e;
}

.wcdc-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wcdc-pill-list--scrollable {
  max-height: 172px;
  overflow-y: auto;
  padding-right: 4px;
}

.wcdc-pill {
  position: relative;
  display: inline-flex;
}

.wcdc-pill__input,
.wcdc-radio-row__input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.wcdc-pill__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--pr-border, #d8d2c7);
  border-radius: 6px;
  background: var(--pr-surface, #ffffff);
  color: var(--pr-text-primary, #1f1813);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.wcdc-pill:hover .wcdc-pill__label {
  background: var(--pr-surface-muted, #f3eee6);
}

.wcdc-pill__input:checked + .wcdc-pill__label {
  border-color: var(--pr-brand-primary, #b58452);
  background: var(--pr-brand-primary, #b58452);
  color: var(--pr-text-inverse, #ffffff);
}

.wcdc-pill--conflict .wcdc-pill__label {
  opacity: 0.5;
  border-color: var(--pr-border, #d8d2c7);
}

.wcdc-pill--conflict:hover .wcdc-pill__label {
  opacity: 0.65;
  background: var(--pr-surface, #ffffff);
}

.wcdc-pill--conflict .wcdc-pill__input:checked + .wcdc-pill__label {
  border-color: var(--pr-brand-primary, #b58452);
  background: var(--pr-brand-primary, #b58452);
  color: var(--pr-text-inverse, #ffffff);
  opacity: 0.5;
}

.wcdc-pill--conflict:hover .wcdc-pill__input:checked + .wcdc-pill__label {
  opacity: 0.65;
}

.wcdc-pill__input:disabled + .wcdc-pill__label {
  opacity: 0.58;
  cursor: not-allowed;
}

.wcdc-radio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wcdc-radio-list__search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 0;
  background: var(--pr-surface, #ffffff);
}

.wcdc-radio-list__search {
  inline-size: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--pr-border, #d8d2c7);
  border-radius: 8px;
  background: var(--pr-surface, #ffffff);
  color: var(--pr-text-primary, #1f1813);
  font-size: 14px;
  line-height: 1.3;
}

.wcdc-radio-list__search:focus {
  outline: 2px solid rgba(181, 132, 82, 0.25);
  outline-offset: 1px;
  border-color: var(--pr-brand-primary, #b58452);
}

.wcdc-radio-list--scrollable {
  max-height: 336px;
  overflow-y: auto;
  padding-right: 4px;
}

.wcdc-radio-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid var(--pr-border, #d8d2c7);
  border-radius: 8px;
  background: var(--pr-surface, #ffffff);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.wcdc-radio-row:hover {
  background: var(--pr-surface-muted, #f3eee6);
}

.wcdc-radio-row--conflict {
  opacity: 0.5;
}

.wcdc-radio-row--conflict:hover {
  opacity: 0.65;
  background: var(--pr-surface, #ffffff);
}

.wcdc-radio-row__circle {
  position: relative;
  inline-size: 18px;
  block-size: 18px;
  flex: 0 0 18px;
  margin-top: 3px;
  border: 2px solid var(--pr-border, #d8d2c7);
  border-radius: 50%;
  background: var(--pr-surface, #ffffff);
  transition: border-color 0.18s ease;
}

.wcdc-radio-row__circle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--pr-brand-primary, #b58452);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.18s ease;
}

.wcdc-radio-row__label {
  display: block;
  color: var(--pr-text-primary, #1f1813);
  line-height: 1.35;
}

.wcdc-radio-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wcdc-radio-list[data-wcdc-has-images="true"] .wcdc-radio-row__image {
  display: inline-block;
  width: 96px;
  min-width: 96px;
  min-height: 72px;
  max-height: 144px;
  flex-shrink: 0;
  border-radius: 4px;
  margin-right: 12px;
  overflow: hidden;
  background: transparent;
}

.wcdc-radio-list[data-wcdc-has-images="true"] .wcdc-radio-row__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 144px;
  object-fit: contain;
}

.wcdc-radio-row__description {
  color: var(--pr-text-muted, #8b8278);
  font-size: 13px;
  line-height: 1.4;
  padding-top: 3px;
}

.wcdc-radio-row__input:checked + .wcdc-radio-row__circle {
  border-color: var(--pr-brand-primary, #b58452);
}

.wcdc-radio-row__input:checked + .wcdc-radio-row__circle::after {
  transform: translate(-50%, -50%) scale(1);
}

.wcdc-radio-row__input:checked ~ .wcdc-radio-row__text .wcdc-radio-row__label {
  font-weight: 600;
}

.wcdc-radio-row:has(.wcdc-radio-row__input:checked) {
  border-color: var(--pr-brand-primary, #b58452);
  background: var(--pr-surface-muted, #f3eee6);
}

.wcdc-radio-row--conflict:has(.wcdc-radio-row__input:checked) {
  background: var(--pr-surface, #ffffff);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-group__selected-badge {
  border-color: var(--pr-border, #d8d2c7);
  background: var(--pr-surface-muted, #f3eee6);
  color: var(--pr-text-primary, #1f1813);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row,
.wcdc-radio-row--single-option {
  border-color: var(--pr-border, #d8d2c7);
  background: var(--pr-surface-muted, #f3eee6);
  cursor: default;
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row:hover,
.wcdc-radio-row--single-option:hover {
  background: var(--pr-surface-muted, #f3eee6);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row__circle,
.wcdc-radio-row--single-option .wcdc-radio-row__circle {
  border-color: var(--pr-text-muted, #8b8278);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row__circle::after,
.wcdc-radio-row--single-option .wcdc-radio-row__circle::after {
  background: var(--pr-text-muted, #8b8278);
  transform: translate(-50%, -50%) scale(1);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row__input:checked + .wcdc-radio-row__circle,
.wcdc-radio-row--single-option .wcdc-radio-row__input:checked + .wcdc-radio-row__circle {
  border-color: var(--pr-text-muted, #8b8278);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row:has(.wcdc-radio-row__input:checked),
.wcdc-radio-row--single-option:has(.wcdc-radio-row__input:checked) {
  border-color: var(--pr-border, #d8d2c7);
  background: var(--pr-surface-muted, #f3eee6);
}

.wcdc-group[data-wcdc-single-option="true"] .wcdc-radio-row__input:checked ~ .wcdc-radio-row__text .wcdc-radio-row__label,
.wcdc-radio-row--single-option .wcdc-radio-row__input:checked ~ .wcdc-radio-row__text .wcdc-radio-row__label {
  font-weight: 500;
}

.wcdc-radio-row__input:disabled ~ .wcdc-radio-row__text,
.wcdc-radio-row__input:disabled + .wcdc-radio-row__circle {
  opacity: 0.58;
  cursor: not-allowed;
}

.wcdc-group__divider {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--pr-border, #d8d2c7);
}

@media (max-width: 379px) {
  .wcdc-radio-list[data-wcdc-has-images="true"] .wcdc-radio-row__image {
    width: 80px;
    min-width: 80px;
  }
}

@media (max-width: 768px) {
  .wcdc-group__content {
    display: none;
  }

  .wcdc-group.is-open .wcdc-group__content {
    display: block;
  }
}

@media (min-width: 769px) {
  .wcdc-group__header {
    cursor: default;
  }

  .wcdc-group__chevron {
    display: none;
  }

  .wcdc-group__content {
    display: block !important;
  }
}
