.msp-addons {
  margin: 0 0 1em;
  width: 100%;
}

.msp-pricing-label:not([hidden]) {
  display: inline;
  white-space: nowrap;
  font-size: 0.7em;
  font-weight: 400;
}

.msp-addon {
  padding: 6px 0;
}

.msp-layout-row {
  --msp-small: 6rem;
  --msp-medium: 10rem;
  --msp-large: 28rem;
  --msp-price-width: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--msp-price-width);
  align-items: start;
  gap: 0.35rem 0.75rem;
  width: 100%;
  min-width: 0;
}

.msp-layout-main {
  display: contents;
}

.msp-addon__heading,
.msp-field__label {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  margin-bottom: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.msp-layout-row .msp-field__control {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.msp-layout-row .msp-addon__label {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.msp-layout-secondary {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0;
  min-width: 0;
  white-space: nowrap;
}

.msp-layout-price {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.25em;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: var(--msp-price-width);
  padding-top: 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.msp-layout-row :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  box-sizing: border-box;
  min-height: 42px;
  margin: 0;
  font: inherit;
}

.msp-layout-row input[type="number"] {
  width: var(--msp-small);
  min-width: min(100%, var(--msp-small));
  max-width: 100%;
}

.msp-layout-row :is(input[type="date"], input[type="time"], input[type="color"]) {
  width: var(--msp-medium);
  min-width: min(100%, var(--msp-medium));
  max-width: 100%;
}

.msp-layout-row .msp-field__control :is(select, input[type="text"], textarea) {
  width: 100%;
  min-width: 0;
  max-width: var(--msp-large);
}

.msp-layout-row :is(.msp-opt-item, .msp-toggle__option) input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

.msp-layout-row textarea {
  min-height: 6rem;
}

.msp-help {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.msp-layout-row .msp-color__clear {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 0.8em;
  font-weight: normal;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

.msp-layout-row .msp-color__clear:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.msp-layout-row .msp-help__trigger {
  width: 1.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: help;
}

.msp-help__text {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  box-sizing: border-box;
  width: min(18rem, 70vw);
  padding: 0.65rem 0.8rem;
  border-radius: 4px;
  background: #222;
  color: #fff;
  box-shadow: 0 3px 12px #0003;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: pre-line;
  visibility: hidden;
  opacity: 0;
}

.msp-help:hover .msp-help__text,
.msp-help:focus-within .msp-help__text {
  visibility: visible;
  opacity: 1;
}

.msp-addon__label {
  font-weight: 600;
  margin: 0;
}

.msp-addon__variation,
.msp-addon__attribute {
  align-self: start;
}

.msp-addon__price-prefix {
  margin-right: 0.25em;
}

.msp-addon--oos {
  opacity: 0.6;
}

/* Nested addon lines in the cart, mini-cart and checkout. */
.woocommerce-cart-form .variation dt,
.woocommerce-mini-cart .variation dt,
.woocommerce-checkout-review-order-table .variation dt {
  font-weight: normal;
}

.msp-addon__fixed {
  white-space: nowrap;
}

.msp-addon__price--hidden {
  display: none;
}

.msp-grand-total {
  margin-top: 10px;
  font-size: 1.05em;
  font-weight: 600;
}

.msp-grand-total__label {
  margin-right: 0.3em;
}

.price.msp-price-hidden {
  display: none;
}

/* Generic fields (checkbox, radio, dropdown, color, date, time, number, toggle). */
.msp-addon--field .msp-field {
  flex: 1 1 100%;
}

.msp-field__label {
  font-weight: 600;
}

.msp-field__control {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.msp-addon--checkbox .msp-field__control,
.msp-addon--radio .msp-field__control {
  flex-direction: column;
  align-items: flex-start;
}

.msp-opt-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.msp-opt-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.msp-toggle {
  display: inline-flex;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  gap: 16px;
}

.msp-toggle__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.msp-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.msp-datetime {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product span.price {
  color: var(--primary);
}

.msp-opt-item.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msp-color__text,
.msp-field__fixed,
.msp-opt-item__text {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}