/* CellMind Product Bundle panel */

.cm-bundle-panel {
  --cm-cream: #f7f6f3;
  --cm-cream-soft: #fafaf8;
  --cm-line: #e8e4dc;
  --cm-gold: #b89a3e;
  --cm-gold-deep: #8a7530;
  --cm-mustard: #a8862b;
  --cm-save: #6b8e4e;
  --cm-ink: #1a1a1a;
  --cm-muted: #7a7565;
  border: 0.5px solid var(--cm-line);
  background: #fff;
  padding: 20px 18px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cm-bundle-heading {
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cm-muted);
  font-weight: 500;
  font-family: inherit;
}

.cm-bundle-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cm-bundle-tier {
  position: relative;
  appearance: none;
  border: 1px solid var(--cm-line);
  background: #fff;
  padding: 18px 10px 14px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: inherit;
  color: var(--cm-ink);
}

.cm-bundle-tier:hover {
  border-color: #d8d4cc;
}

.cm-bundle-tier.is-active {
  background: var(--cm-cream);
  border-color: var(--cm-ink);
  box-shadow: none;
}

.cm-bundle-tier__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #9a958c;
  border: 0.5px solid var(--cm-line);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  white-space: nowrap;
  line-height: 1;
}

.cm-bundle-tier.is-active .cm-bundle-tier__badge {
  color: var(--cm-ink);
  border-color: #d8d4cc;
}

.cm-bundle-tier__qty {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}

.cm-bundle-tier__unit {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cm-muted);
}

.cm-bundle-tier__price {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.cm-bundle-tier__label {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.cm-bundle-tier__label--discount {
  margin-top: 6px;
  padding: 4px 10px;
  background: #fff;
  color: var(--cm-muted);
  border: 0.5px solid var(--cm-line);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 22px;
  box-sizing: border-box;
}

.cm-bundle-tier__label--discount:empty,
.cm-bundle-tier__label--discount[aria-hidden='true'] {
  visibility: hidden;
  border-color: transparent;
  background: transparent;
}

.cm-bundle-tier.is-active .cm-bundle-tier__label--discount:not(:empty) {
  color: var(--cm-ink);
  border-color: #d8d4cc;
}

.cm-bundle-paired-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-bundle-paired {
  display: grid;
  grid-template-columns: auto 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cm-line);
  background: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.cm-bundle-paired:has(.cm-bundle-paired__input:checked) {
  background: var(--cm-cream);
  border-color: var(--cm-ink);
}

.cm-bundle-paired--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cm-bundle-paired__input {
  width: 16px;
  height: 16px;
  accent-color: var(--cm-ink);
  margin: 0;
}

.cm-bundle-paired__thumb {
  width: 44px;
  height: 44px;
  border: 1px solid var(--cm-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cm-bundle-paired__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cm-bundle-paired__thumb-label {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-muted);
  text-align: center;
  padding: 4px;
  line-height: 1.2;
}

.cm-bundle-paired__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cm-bundle-paired__title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cm-ink);
  line-height: 1.2;
}

.cm-bundle-paired__note {
  font-size: 12px;
  color: var(--cm-muted);
  line-height: 1.4;
}

.cm-bundle-paired__price {
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cm-bundle-paired__price-sale {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cm-ink);
}

.cm-bundle-paired__price-regular {
  font-size: 12px;
  color: var(--cm-muted);
}

.cm-bundle-section--quantity {
  border-top: 1px solid var(--cm-line);
  padding-top: 14px;
}

.cm-bundle-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cm-bundle-qty-row__label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cm-muted);
  font-weight: 500;
}

.cm-bundle-qty-ctrl {
  display: flex;
  align-items: stretch;
  border: 0.5px solid var(--cm-line);
  background: #fff;
  position: relative;
  z-index: 3;
  isolation: isolate;
}

.cm-bundle-qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--cm-ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: background 0.15s ease;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.cm-bundle-qty-btn:hover {
  background: #f5f5f3;
}

.cm-bundle-qty-input {
  width: 48px;
  height: 40px;
  border: none;
  border-left: 0.5px solid var(--cm-line);
  border-right: 0.5px solid var(--cm-line);
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cm-ink);
  background: #fff;
  -moz-appearance: textfield;
  padding: 0;
}

.cm-bundle-qty-input::-webkit-outer-spin-button,
.cm-bundle-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cm-bundle-total {
  border-top: 1px solid var(--cm-line);
  padding-top: 16px;
  margin-top: 14px;
}

.cm-bundle-total__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cm-bundle-total__label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cm-muted);
}

.cm-bundle-total__amount {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--cm-ink);
  letter-spacing: -0.5px;
}

.cm-bundle-total__save {
  margin: 6px 0 0;
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-save);
  min-height: 16px;
}

.cm-bundle-total__save:empty {
  display: none;
}

.cm-bundle-actions {
  margin-top: 2px;
}

.cm-bundle-actions .single_add_to_cart_button {
  display: block;
  width: 100%;
  background: var(--cm-ink) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  padding: 18px 32px !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cm-bundle-actions .single_add_to_cart_button:hover {
  background: #333 !important;
  color: #fff !important;
}

/* Hide theme qty when bundle active (do not require JS-added classes) */
.cm-bundle-active-page form.cart .qty-ctrl {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.cm-bundle-active-page.cm-bundle-hide-price .product-price {
  display: none;
}

.cm-bundle-active-page .aurora-add-to-cart form.cart.cm-bundle-form {
  padding: 0;
  gap: 0;
}

.cm-bundle-active-page .aurora-add-to-cart.cm-bundle-has-panel {
  border: none;
  background: transparent;
}

@media (max-width: 768px) {
  .cm-bundle-panel {
    background: #fafaf8;
    border-color: #e8e4dc;
  }

  .cm-bundle-section--tiers {
    margin: 0 -4px;
  }

  .cm-bundle-section--tiers .cm-bundle-heading {
    color: var(--cm-muted);
    font-size: 9px;
    letter-spacing: 0.24em;
    margin-bottom: 14px;
  }

  .cm-bundle-tiers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: #fff;
    border: 0.5px solid #e8e4dc;
  }

  .cm-bundle-tier {
    border: none;
    border-right: 0.5px solid #e8e4dc;
    border-bottom: 3px solid #e8e4dc;
    border-radius: 0;
    background: #fff;
    padding: 24px 6px 12px;
    gap: 4px;
    box-shadow: none;
    min-height: 138px;
    justify-content: flex-start;
  }

  .cm-bundle-tier:last-child {
    border-right: none;
  }

  .cm-bundle-tier:hover {
    border-color: transparent;
    border-bottom-color: #e8e4dc;
  }

  .cm-bundle-tier.is-active {
    background: #f7f6f3;
    border-bottom: 3px solid var(--cm-ink);
    box-shadow: inset 0 0 0 0.5px var(--cm-line);
  }

  .cm-bundle-tier.is-active:hover {
    border-bottom-color: var(--cm-ink);
  }

  .cm-bundle-tier__badge {
    top: 6px;
    left: 0;
    right: 0;
    transform: none;
    background: transparent;
    color: #9a958c;
    font-size: 7px;
    letter-spacing: 0.14em;
    padding: 0;
    font-weight: 600;
  }

  .cm-bundle-tier.is-active .cm-bundle-tier__badge {
    color: var(--cm-ink);
  }

  .cm-bundle-tier__qty {
    font-size: clamp(36px, 11vw, 44px);
    letter-spacing: -2px;
    color: #c8c3b8;
    margin-top: 4px;
  }

  .cm-bundle-tier.is-active .cm-bundle-tier__qty {
    color: var(--cm-ink);
  }

  .cm-bundle-tier__unit {
    font-size: 8px;
    letter-spacing: 0.2em;
    color: #c8c3b8;
  }

  .cm-bundle-tier.is-active .cm-bundle-tier__unit {
    color: var(--cm-muted);
  }

  .cm-bundle-tier__price {
    font-size: clamp(14px, 3.8vw, 17px);
    margin-top: 6px;
    color: var(--cm-ink);
    line-height: 1.1;
    font-weight: 600;
  }

  .cm-bundle-tier.is-active .cm-bundle-tier__price {
    color: var(--cm-ink);
  }

  .cm-bundle-tier__label--discount:not(:empty) {
    margin-top: 8px;
    font-size: clamp(10px, 2.8vw, 11px);
    letter-spacing: 0.12em;
    padding: 5px 10px;
    background: #fff;
    border: 0.5px solid #e8e4dc;
    color: var(--cm-muted);
  }

  .cm-bundle-tier.is-active .cm-bundle-tier__label--discount:not(:empty) {
    color: var(--cm-ink);
    border-color: #d8d4cc;
    background: #fff;
  }

  .cm-bundle-actions .single_add_to_cart_button {
    background: var(--cm-ink) !important;
  }

  .cm-bundle-actions .single_add_to_cart_button:hover {
    background: #333 !important;
  }

  .cm-bundle-paired {
    grid-template-columns: auto 40px 1fr;
    grid-template-areas:
      'check thumb body'
      'check thumb price';
  }

  .cm-bundle-paired__input {
    grid-area: check;
  }

  .cm-bundle-paired__thumb {
    grid-area: thumb;
  }

  .cm-bundle-paired__body {
    grid-area: body;
  }

  .cm-bundle-paired__price {
    grid-area: price;
    grid-column: 2 / -1;
    text-align: left;
    padding-left: 56px;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
}
