/* Upsell — add-on rows (checkbox · thumb · name · FREE · price). */

.wffn-bundles-upsell.wffn-bundles-upsell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The section sits on the page, not on a card: the widget's heading colour, not the card text's. */
.wffn-bundles-upsell-heading.wffn-bundles-upsell-heading {
  font-size: var(--wffn-bundles-title-size);
  color: var(--wffn-bundles-heading-color);
  font-weight: 500;
}
.wffn-bundles-upsell-subtitle.wffn-bundles-upsell-subtitle {
  font-size: var(--wffn-bundles-desc-size);
  color: var(--wffn-bundles-heading-color);
  opacity: 0.7;
}
.wffn-bundles-upsell-items.wffn-bundles-upsell-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wffn-bundles-upsell-item.wffn-bundles-upsell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--wffn-bundles-pad-t) var(--wffn-bundles-pad-r) var(--wffn-bundles-pad-b) var(--wffn-bundles-pad-l);
  border: var(--wffn-bundles-border-width) var(--wffn-bundles-border-style) var(--wffn-bundles-border);
  border-radius: var(--wffn-bundles-corner);
  background: var(--wffn-bundles-bg);
  cursor: pointer;
}
.wffn-bundles-upsell-item--selected.wffn-bundles-upsell-item--selected {
  border-color: var(--wffn-bundles-border-active);
  box-shadow: inset 0 0 0 var(--wffn-bundles-ring-active) var(--wffn-bundles-border-active);
  background: var(--wffn-bundles-bg-active);
}
/* Wanted but not yet resolved (a variable upsell awaiting its options): cue the
   shopper to complete the pick — the row is held out of the selected state. */
.wffn-bundles-upsell-item--needs-options.wffn-bundles-upsell-item--needs-options {
  border-color: var(--wffn-bundles-border-active);
  border-style: dashed;
  /* Wrapping is scoped to this state: `.wffn-bundles-upsell-hint` needs a line of its own
     and only exists here, and the row runs `nowrap` on every theme measured. */
  flex-wrap: wrap;
}

.wffn-bundles-upsell-check.wffn-bundles-upsell-check {
  flex: 0 0 auto;
  width: var(--wffn-bundles-upsell-check-size, 20px);
  height: var(--wffn-bundles-upsell-check-size, 20px);
  margin: 0;
  border: 2px solid var(--wffn-bundles-radio);
  border-radius: 4px;
  background: var(--wffn-bundles-control-bg);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
/* Checked: filled accent + lucide check, mirroring the admin app's checkbox. */
/* Themes draw their own tick as a pseudo-element on the input, sized for their
   box, so it renders over ours. (0,4,1) clears the `:checked` rules themes use. */
.wffn-bundles.wffn-bundles .wffn-bundles-upsell-item .wffn-bundles-upsell-check::before,
.wffn-bundles.wffn-bundles .wffn-bundles-upsell-item .wffn-bundles-upsell-check::after,
.wffn-bundles.wffn-bundles .wffn-bundles-upsell-item .wffn-bundles-upsell-check:checked::before,
.wffn-bundles.wffn-bundles .wffn-bundles-upsell-item .wffn-bundles-upsell-check:checked::after {
  content: none;
}

/* …and hold its own size: the rule above is (0,1,0) and loses to the
   `input[type=checkbox]` (0,1,1) themes reset form controls with. min-* too. */
.wffn-bundles.wffn-bundles .wffn-bundles-upsell-check {
  width: var(--wffn-bundles-upsell-check-size, 20px);
  height: var(--wffn-bundles-upsell-check-size, 20px);
  min-width: var(--wffn-bundles-upsell-check-size, 20px);
  min-height: var(--wffn-bundles-upsell-check-size, 20px);
  padding: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.wffn-bundles-upsell-check.wffn-bundles-upsell-check:checked {
  background-color: var(--wffn-bundles-radio-active);
  border-color: var(--wffn-bundles-radio-active);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: center;
  /* 70% of the box: 14px at the default 20px, scaling with "Checkbox size". */
  background-size: calc(var(--wffn-bundles-upsell-check-size, 20px) * 0.7);
}

.wffn-bundles-upsell-img.wffn-bundles-upsell-img {
  flex: 0 0 auto;
  width: var(--wffn-bundles-upsell-image-size, 44px);
  /* A wide value still leaves the name and price room on a phone, and stays square. */
  max-width: 40%;
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--wffn-bundles-image-radius);
  object-fit: cover;
  background: var(--wffn-bundles-thumb-bg);
}
.wffn-bundles-upsell-main.wffn-bundles-upsell-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.wffn-bundles-upsell-name.wffn-bundles-upsell-name {
  min-width: 0;
  font-size: var(--wffn-bundles-title-size);
  color: var(--wffn-bundles-title-color);
  font-weight: 500;
}
.wffn-bundles-upsell-free.wffn-bundles-upsell-free {
  flex: 0 0 auto;
  background: var(--wffn-bundles-success);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.wffn-bundles-upsell-prices.wffn-bundles-upsell-prices {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
/* Phones: old price above the new one, as the bundle's own rows stack them, leaving the name and pickers the width. */
@media (max-width: 600px) {
  .wffn-bundles-upsell-prices.wffn-bundles-upsell-prices {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    line-height: 1.35;
  }
}
.wffn-bundles-upsell-price-original.wffn-bundles-upsell-price-original {
  /* "Secondary price font" when set, otherwise the row's price size as before. */
  font-size: var(--wffn-bundles-upsell-secondary-price-size, var(--wffn-bundles-price-size));
  color: var(--wffn-bundles-regular-price-color);
  text-decoration: line-through;
}
.wffn-bundles-upsell-price-final.wffn-bundles-upsell-price-final {
  font-size: var(--wffn-bundles-price-size);
  color: var(--wffn-bundles-sale-price-color);
  font-weight: 600;
}

/* Why a ticked variable upsell did not stay ticked. `flex: 1 0 100%` puts it on
   a line of its own; amber rather than the near-black border token, which reads as copy. */
.wffn-bundles-upsell-hint.wffn-bundles-upsell-hint {
  flex: 1 0 100%;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-size: var(--wffn-bundles-control-size);
  line-height: 1.35;
  color: var(--wffn-bundles-warning);
}

/* Same marker the Fixed Bundle out-of-stock notice uses, for the same reason:
   colour alone is not a cue every shopper receives. */
.wffn-bundles-upsell-hint.wffn-bundles-upsell-hint::before {
  content: "⚠";
  flex: 0 0 auto;
  line-height: 1;
}
