/* Quantity breaks — ported from shopify-mb (theme_0623_XZB)
   Shopify html font-size is 62.5% (1rem = 10px). Values below are rem×10 in px
   so density matches regardless of Shopline root rem. Colors mapped to Shopline vars. */

.quantity-breaks {
  --qb-accent: var(--color-button-background, var(--color-text));
  --qb-bg: var(--color-background, var(--color-page-background));
  --qb-text: var(--color-text);
  /* Shopify rem → px (×10) */
  --badge-font-size: 15px;
  --badge-line-height: 1.6;
  --label-font-size: 16px;
  --benefit-font-size: 10px;
  --caption-font-size: 14px;
  --price-font-size: 16px;
  --compare-price-font-size: 14px;
  --border-width: 2px;
  --border-radius: 10px;
  --column-gap: 7.5px;
  --row-gap: 8.5px;
  width: 100%;
  color: rgb(var(--qb-text));
  line-height: 1;
  box-sizing: border-box;
}

.quantity-breaks *,
.quantity-breaks *::before,
.quantity-breaks *::after {
  box-sizing: border-box;
}

.quantity-breaks-container {
  position: relative;
  display: grid;
  align-items: flex-start;
  grid-template-columns: repeat(1, 1fr);
  column-gap: var(--column-gap);
  row-gap: var(--row-gap);
}

/* Shopify: .quantity-breaks__title.flex-center.center */
.quantity-breaks__title {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 0 13px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  column-gap: 10px;
  color: rgb(var(--qb-text));
}

.quantity-breaks__title span:nth-of-type(1),
.quantity-breaks__title span:nth-of-type(3) {
  display: block;
  height: 2px;
  flex-grow: 1;
  background: rgb(var(--qb-accent));
}

.quantity-breaks-container > input[type="radio"] {
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
  position: absolute;
  pointer-events: none;
}

.quantity-break {
  display: block;
  padding: 17.5px 17.5px 17.5px 40px;
  cursor: pointer;
  border-radius: var(--border-radius);
  background: rgba(var(--qb-accent), 0.02);
  border: solid var(--border-width) rgba(var(--qb-accent), 0.3);
  position: relative;
  color: rgb(var(--qb-text));
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quantity-breaks-container > input[type="radio"]:checked + .quantity-break {
  background: rgba(var(--qb-accent), 0.1);
  border: solid 2px rgb(var(--qb-accent));
}

.quantity-break:hover {
  background: rgba(var(--qb-accent), 0.15);
  border: solid 2px rgb(var(--qb-accent));
}

.quantity-breaks-container > input[type="radio"].disabled + .quantity-break,
.quantity-breaks-container > input[type="radio"]:disabled + .quantity-break {
  opacity: 0.3;
  pointer-events: none;
}

/* Corner badge — Shopify "Most popular" */
.quantity-break__badge {
  position: absolute;
  background: rgb(var(--qb-accent));
  color: rgb(var(--qb-bg));
  font-weight: 700;
  font-size: var(--badge-font-size);
  line-height: var(--badge-line-height);
  top: -10px;
  right: -10px;
  transform: rotate(3deg);
  margin: 0;
  padding: 0 0.5em;
  border-radius: 0.2em;
  z-index: 1;
}

.quantity-break__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}

.quantity-break__left > span,
.quantity-break__right > span {
  display: block;
}

.quantity-break__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 5px;
  text-align: left;
  min-width: 0;
  flex: 1 1 auto;
}

/* Label + optional benefit chip stay on ONE row (Shopify — no flex-wrap) */
.quantity-break__left .quantity-break__label {
  font-size: var(--label-font-size);
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.quantity-break__label-text {
  line-height: 1;
  white-space: nowrap;
}

.quantity-break__benefit {
  display: inline-block;
  font-size: var(--benefit-font-size);
  background: rgb(var(--qb-bg));
  color: rgb(var(--qb-accent));
  line-height: 1.9;
  padding: 0 0.75em;
  font-weight: 700;
  border: solid 1px rgb(var(--qb-accent));
  border-radius: 0.6em;
  margin-left: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quantity-break__caption {
  font-size: var(--caption-font-size);
  line-height: 1;
  color: rgb(var(--color-light-text, var(--qb-text)));
}

.quantity-break__right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  row-gap: 5px;
  flex-shrink: 0;
}

.quantity-break__price {
  line-height: 1;
  font-size: var(--price-font-size);
  font-weight: 700;
  color: rgb(var(--qb-accent));
}

.quantity-break__compare-price {
  font-size: var(--compare-price-font-size);
  text-decoration: line-through;
  line-height: 1;
  color: rgb(var(--color-light-text, var(--qb-text)));
  opacity: 0.85;
}

/* Radio circle — Shopify 1.5rem / left 2rem */
.quantity-break::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: solid 2px rgba(var(--qb-accent), 0.3);
}

.quantity-breaks-container > input[type="radio"]:checked + .quantity-break::before {
  border: solid 2px rgb(var(--qb-bg));
  background: rgb(var(--qb-accent));
  box-shadow: 0 0 0 1px rgb(var(--qb-accent));
}

/* Compact (2-col) — Shopify .quantity-breaks--compact */
.quantity-breaks--compact {
  --badge-font-size: 11px;
  --benefit-font-size: 11px;
  --price-font-size: 12px;
  --compare-price-font-size: 9px;
  --label-font-size: 14px;
  --row-gap: 7.5px;
  --column-gap: 7.5px;
}

.quantity-breaks--compact .quantity-breaks__title {
  margin-bottom: 9px;
}

.quantity-breaks--compact .quantity-breaks-container {
  grid-template-columns: repeat(2, 1fr);
}

.quantity-breaks--compact .quantity-break {
  padding: 12.5px 15px 12.5px 36px;
}

.quantity-breaks--compact .quantity-break::before {
  left: 18px;
  width: 14px;
  height: 14px;
}

.quantity-breaks--compact .quantity-break__content {
  flex-direction: column;
  align-items: flex-start;
}

.quantity-breaks--compact .quantity-break__left {
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 0;
}

.quantity-breaks--compact .quantity-break__right {
  display: block;
  text-align: center;
  width: 100%;
  align-items: center;
  line-height: 1.1;
}

.quantity-breaks--compact .quantity-break__right span {
  display: inline;
}

.quantity-breaks--compact .quantity-break__caption {
  display: none;
}

.quantity-breaks--compact .quantity-break__badge {
  top: 0;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  text-align: center;
  width: fit-content;
}

.quantity-breaks--compact .quantity-break__label {
  flex-wrap: wrap;
  justify-content: center;
}

.quantity-breaks--compact .quantity-break__benefit {
  margin-left: 0;
}

.quantity-breaks--compact span,
.quantity-breaks--vertical span {
  word-break: break-word;
}

/* Vertical (multi-col + card image) — Shopify .quantity-breaks--vertical */
.quantity-breaks--vertical {
  --badge-font-size: 10px;
  --badge-line-height: 2;
  --label-font-size: 16px;
  --benefit-font-size: 10px;
  --caption-font-size: 10px;
  --price-font-size: 12px;
  --compare-price-font-size: 10px;
  --side-padding: 10px;
  --y-padding: 15px;
  --row-gap: 10px;
}

.quantity-breaks--vertical .quantity-breaks-container {
  grid-template-columns: repeat(min(var(--items-count), 4), 1fr);
  align-items: flex-start;
}

.quantity-breaks--vertical .quantity-break {
  padding: 0 var(--side-padding) var(--y-padding);
  text-align: center;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quantity-breaks--vertical .quantity-break__badge {
  top: calc(var(--border-width) * -1);
  left: calc(var(--border-width) * -1);
  right: auto;
  transform: none;
  width: calc(100% + (var(--border-width) * 2));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.quantity-breaks--vertical .quantity-break__image {
  margin-left: calc(var(--side-padding) * -1);
  margin-right: calc(var(--side-padding) * -1);
}

.quantity-breaks--vertical .quantity-break__image img,
.quantity-breaks--vertical .quantity-break__image-img,
.quantity-breaks--vertical .quantity-break__image .variant-picker__image {
  display: block;
  width: var(--image-width, 70%);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.quantity-breaks--vertical .quantity-break::before {
  display: none;
}

.quantity-breaks--vertical .quantity-break__content {
  row-gap: 10px;
  margin-top: var(--y-padding);
  flex-direction: column;
  align-items: center;
}

.quantity-breaks--space-images .quantity-break__image {
  margin-top: var(--y-padding);
}

.quantity-breaks--vertical .quantity-break__badge + .quantity-break__image {
  padding-top: calc(var(--badge-font-size) * var(--badge-line-height) - var(--border-width));
}

.quantity-breaks--vertical .quantity-break__image + .quantity-break__content,
.quantity-breaks--space-images .quantity-break__badge + .quantity-break__image {
  margin-top: 10px;
}

.quantity-breaks--vertical .quantity-break__badge + .quantity-break__content {
  margin-top: 27px;
}

.quantity-breaks--vertical .quantity-break__label {
  flex-direction: column;
  justify-content: center;
  flex-wrap: wrap;
}

.quantity-breaks--vertical .quantity-break__left,
.quantity-breaks--vertical .quantity-break__right {
  text-align: center;
  align-items: center;
  row-gap: 3px;
  width: 100%;
}

.quantity-breaks--vertical .quantity-break__benefit {
  position: absolute;
  margin: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  top: 0;
  width: fit-content;
}

.quantity-breaks--vertical
  .quantity-break__badge
  ~ .quantity-break__content
  .quantity-break__benefit {
  top: 100%;
}

.quantity-breaks--vertical[data-items="2"],
.quantity-breaks--vertical[data-items="4"],
.quantity-breaks--vertical[data-items="5"] {
  --badge-font-size: 13px;
  --badge-line-height: 1.9;
}

@media screen and (max-width: 999px) {
  .quantity-breaks--vertical[data-items="4"] .quantity-breaks-container,
  .quantity-breaks--vertical[data-items="5"] .quantity-breaks-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .quantity-breaks--vertical[data-items="6"] .quantity-breaks-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .quantity-breaks--vertical[data-items="3"],
  .quantity-breaks--vertical[data-items="6"] {
    --label-font-size: 13px;
    --benefit-font-size: 8px;
    --caption-font-size: 9px;
    --price-font-size: 10px;
    --compare-price-font-size: 9px;
  }
}

@media screen and (min-width: 1000px) {
  .quantity-breaks--vertical[data-items="2"] {
    --badge-font-size: 18px;
    --badge-line-height: 2;
    --label-font-size: 20px;
    --benefit-font-size: 12px;
    --caption-font-size: 16px;
    --price-font-size: 18px;
    --compare-price-font-size: 14px;
    --side-padding: 12px;
    --y-padding: 18px;
  }

  .quantity-breaks--vertical[data-items="3"] {
    --badge-font-size: 14px;
    --badge-line-height: 2;
    --label-font-size: 18px;
    --benefit-font-size: 10px;
    --caption-font-size: 13px;
    --price-font-size: 14px;
    --compare-price-font-size: 12px;
    --y-padding: 17px;
  }

  .quantity-breaks--vertical[data-items="4"] {
    --badge-font-size: 12px;
    --badge-line-height: 1.9;
    --label-font-size: 14px;
    --benefit-font-size: 8px;
    --caption-font-size: 10px;
    --price-font-size: 11px;
    --compare-price-font-size: 10px;
  }
}

/* Free-gift strip under Normal cards — Shopify .swatch-product-free--addon */
.quantity-break--with-gift {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-width: 0;
}

.swatch-product-free--addon {
  width: 100%;
  max-width: 100%;
  background: var(--gift-bg, #7069bc);
  color: var(--gift-fg, #fff);
  border-radius: 0 0 8px 8px;
  margin: -9px 0 4px;
  box-sizing: border-box;
}

.swatch-product-free--addon .image-and-text-container {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.swatch-product-free--addon .image {
  flex-shrink: 0;
  margin-left: 10px;
}

.swatch-product-free--addon__img,
.swatch-product-free--addon .image img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.swatch-product-free--addon .text {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.swatch-product-free--addon .text p {
  margin: 0;
  font-size: var(--gift-font-size, 15px);
  line-height: 1.3;
}

.swatch-product-free--addon .text strong {
  font-weight: 700;
}

.quantity-breaks-container > input[type="radio"]:checked + .quantity-break--with-gift {
  border-bottom-width: 0;
}

/* Variant group spacing (StickyForge / Shopline picker chrome) */
.product-detail__variant-picker .variant-picker__group[data-picker-type="quantity-breaks"],
.product-detail__variant-picker .variant-picker__group[data-picker-type="swatches"] {
  margin: 0;
}

.product-detail__variant-picker .variant-picker__group-head {
  margin-bottom: 0.45rem;
}

/* Swatches — SKU / option images; size + radius from block settings */
.variant-picker__options--swatches {
  --swatch-size: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.variant-picker__options--swatches-small {
  --swatch-size: 36px;
}

.variant-picker__options--swatches-medium {
  --swatch-size: 44px;
}

.variant-picker__options--swatches-large {
  --swatch-size: 56px;
  gap: 10px;
}

.variant-picker__options--swatches-extra-large {
  --swatch-size: 68px;
  gap: 12px;
}

.variant-picker__option--swatch .variant-picker__swatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--swatch-size, 44px);
  height: var(--swatch-size, 44px);
  padding: 2px;
  border-radius: var(--swatch-border-radius, 50%);
  overflow: hidden;
  box-sizing: border-box;
}

.variant-picker__option--swatch .variant-picker__swatch::before,
.variant-picker__option--swatch .variant-picker__swatch::after {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--swatch-border-radius, 50%);
  content: "";
  pointer-events: none;
}

.variant-picker__option--swatch .variant-picker__swatch::after {
  box-shadow: 0 0 0 var(--border-thickness, var(--variant-selector-border-thickness, 1px))
    var(--border-color, rgba(var(--color-text), var(--variant-selector-border-opacity, 0.2)));
  transition: box-shadow 0.2s;
}

.variant-picker__option--swatch .variant-picker__swatch .variant-picker__image,
.variant-picker__option--swatch .variant-picker__swatch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--swatch-border-radius, 50%);
}

.variant-picker__option--swatch
  input[type="radio"]:checked
  + .variant-picker__swatch {
  --border-thickness: calc(var(--variant-selector-border-thickness, 1px) + 1px);
  --border-color: rgb(var(--color-text));
}

.variant-picker__option--swatch .variant-picker__swatch:hover {
  --border-thickness: calc(var(--variant-selector-border-thickness, 1px) + 1px);
}

.variant-picker__group--hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
