/* ============================================================
   NV Commerce Core – Bulk Discount / Bundle Deals
   Nordic Precision Theme v2.1 — Brand Guideline Compliant
   ============================================================
   CSS Variables (from Brand Guideline v2.1, Section 06):
     --nv-bg:             #F8F7F3   (page background)
     --nv-surface:        #FFFFFF   (card surfaces, modals)
     --nv-text:           #111318   (primary text)
     --nv-muted:          #5F6874   (muted text)
     --nv-primary:        #0F766E   (primary CTA)
     --nv-primary-hover:  #0B5E58   (hover state)
     --nv-primary-soft:   rgba(15,118,110,0.07) (teal tint)
     --nv-border:         #E6E8EC   (borders, dividers)
     --nv-sale:           #C2410C   (sale badges only)
     --nv-success:        #1E8E5A   (success states)
   Fonts:
     Sora          — headlines, section titles
     Manrope       — body, buttons, labels, badges, UI
     Space Grotesk — prices, crossed-out prices, savings
   Radius: 14px cards, 10px inner cards, 9999px badges
   Shadows: neutral rgba(17,19,24,...) ONLY — never colored
   ============================================================ */

.nvcc-bundle {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid #E6E8EC;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.04);
  font-family: 'Manrope', -apple-system, sans-serif !important;
}

.nvcc-bundle__title {
  margin: 0 0 6px !important;
  color: #111318 !important;
  font-family: 'Sora', sans-serif !important;
  font-size: clamp(18px, 2.5vw, 22px) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.nvcc-bundle__subtitle {
  margin: 0 0 12px !important;
  color: #5F6874 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

.nvcc-deals {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.nvcc-deal {
  position: relative;
  border: 1px solid #E6E8EC;
  border-radius: 14px;
  background: #FFFFFF;
  transition: border-color 0.24s ease, box-shadow 0.24s ease;
}

.nvcc-deal.is-selected {
  border-color: #0F766E;
  box-shadow: 0 4px 16px rgba(17, 19, 24, 0.06);
  background: rgba(15, 118, 110, 0.07);
}

.nvcc-deal__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 14px 10px;
  cursor: pointer;
}

.nvcc-deal__radio-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
}

.nvcc-deal__radio-wrap input[type="radio"] {
  margin: 0;
  accent-color: #0F766E;
}

.nvcc-deal__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nvcc-deal__title {
  color: #111318 !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
}

.nvcc-deal__subtitle {
  color: #5F6874 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.nvcc-deal__pct-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.10);
  color: #0B5E58 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nvcc-deal__label {
  display: inline-flex;
  width: max-content;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(15, 118, 110, 0.07);
  border: 1px solid rgba(15, 118, 110, 0.15);
  color: #0F766E !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.nvcc-deal__prices {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.nvcc-deal__price-current {
  color: #111318 !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
}

.nvcc-deal__price-regular {
  color: #5F6874 !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: line-through !important;
  line-height: 1.15 !important;
}

.nvcc-deal__savings {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #ECFDF5;
  color: #065F46 !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  white-space: nowrap;
}

.nvcc-deal__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 2;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #0F766E;
  border: none;
  color: #FFFFFF !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  text-align: center;
}

.nvcc-bonus {
  margin: 0 14px 10px;
  padding-top: 8px;
  border-top: 1px dashed #E6E8EC;
}

.nvcc-bonus__strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nvcc-bonus__thumb {
  width: 40px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid #E6E8EC;
  background: #FFFFFF;
  flex: 0 0 auto;
}

.nvcc-bonus__overflow {
  min-width: 40px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid #E6E8EC;
  background: #F3F4F6;
  color: #5F6874;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.nvcc-bonus__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.nvcc-bonus__grid-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nvcc-bonus__title {
  display: block;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  color: #111318 !important;
}

.nvcc-bonus__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.nvcc-bonus__text {
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: #0F766E !important;
}

.nvcc-bonus__toggle {
  -webkit-appearance: none;
  appearance: none;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline;
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  color: #0F766E !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  cursor: pointer;
  white-space: normal;
  text-align: right;
  text-decoration: none;
}

.nvcc-bonus__toggle:hover {
  color: #0B5E58 !important;
  text-decoration: underline;
}

.nvcc-bonus__toggle:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.nvcc-bonus__panel {
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #E6E8EC;
  background: #FFFFFF;
}

.nvcc-bonus__panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.nvcc-bonus__panel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Ensure the HTML [hidden] attribute is respected even when
   display:grid is set. Without this, all deal mix rows are
   visible on page load instead of only the selected one. */
.nvcc-deal__mix[hidden] {
  display: none !important;
}

.nvcc-deal__mix {
  border-top: 1px solid #E6E8EC;
  padding: 10px 14px 14px;
  display: grid;
  gap: 8px;
}

.nvcc-deal__mix-row {
  display: grid;
  grid-template-columns: 28px 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.nvcc-deal__mix-row label {
  color: #5F6874 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: left;
  line-height: 1;
}

.nvcc-deal__thumb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid #E6E8EC;
  background: #FFFFFF;
}

.nvcc-deal__select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #E6E8EC;
  background: #FFFFFF;
  color: #111318;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 15px;
  padding: 8px 10px;
}

.nvcc-deal__select:focus {
  border-color: #0F766E;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  outline: none;
}

.nvcc-bundle__submit.button,
.nvcc-bundle__submit.button.alt,
.woocommerce .nvcc-bundle__submit.button,
.woocommerce .nvcc-bundle__submit.button.alt {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: none;
  background: #0F766E !important;
  color: #FFFFFF !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nvcc-bundle__submit.button:hover,
.nvcc-bundle__submit.button.alt:hover,
.woocommerce .nvcc-bundle__submit.button:hover,
.woocommerce .nvcc-bundle__submit.button.alt:hover {
  background: #0B5E58 !important;
  box-shadow: 0 4px 16px rgba(17, 19, 24, 0.06);
}

.nvcc-bundle__status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #5F6874 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.nvcc-bundle__status.is-error {
  color: #C2410C !important;
}

/* Variant styles B & C — not used in Nordic Precision; kept for backward compat */
.nvcc-bundle--variant-b .nvcc-deal,
.nvcc-bundle--variant-c .nvcc-deal {
  /* Same as variant-a in Nordic Precision — no dark/colored variants */
  background: #FFFFFF;
  border-color: #E6E8EC;
}

.nvcc-bundle--variant-b .nvcc-deal.is-selected,
.nvcc-bundle--variant-c .nvcc-deal.is-selected {
  border-color: #0F766E;
  box-shadow: 0 4px 16px rgba(17, 19, 24, 0.06);
  background: rgba(15, 118, 110, 0.07);
}

/* Legacy row-based fallback */
.nvcc-bundle__rows {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.nvcc-bundle__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #E6E8EC;
  border-radius: 14px;
  background: #FFFFFF;
}

.nvcc-bundle__row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nvcc-bundle__row-label {
  color: #111318 !important;
  font-family: 'Manrope', -apple-system, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.3 !important;
}

.nvcc-bundle__row-price {
  color: #0F766E !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.nvcc-bundle__qty {
  width: 100%;
  min-height: 40px;
  border: 1px solid #E6E8EC;
  border-radius: 10px;
  background: #FFFFFF;
  color: #111318;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 16px;
  font-weight: 700;
}

/* ============================================================
   Mobile — compact bundle for small screens
   Brand guideline: mobile-first, 95% of customers on phones
   ============================================================ */
@media (max-width: 680px) {
  .nvcc-bundle {
    padding: 16px;
    margin-top: 12px;
  }

  .nvcc-bundle__title {
    font-size: 18px !important;
    margin-bottom: 4px !important;
  }

  .nvcc-bundle__subtitle {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }

  .nvcc-deals {
    gap: 8px;
    margin-bottom: 8px;
  }

  .nvcc-deal__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 10px 8px;
    gap: 6px;
  }

  .nvcc-deal__copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    min-width: 0;
  }

  .nvcc-deal__title {
    font-size: 15px !important;
    line-height: 1.22 !important;
  }

  .nvcc-deal__subtitle {
    font-size: 13px !important;
  }

  .nvcc-deal__pct-badge,
  .nvcc-deal__label,
  .nvcc-deal__bogo-badge {
    margin-top: 0;
  }

  .nvcc-deal__prices {
    grid-column: auto;
    justify-items: end;
    text-align: right;
    margin: 0;
    gap: 1px;
  }

  .nvcc-deal__price-current {
    font-size: 14px !important;
  }

  .nvcc-deal__price-regular {
    font-size: 12px !important;
  }

  .nvcc-deal__savings {
    font-size: 11px !important;
    padding: 1px 6px;
    margin-top: 2px;
  }

  .nvcc-bonus {
    margin: 0 10px 8px;
    padding-top: 6px;
  }

  .nvcc-bonus__thumb {
    width: 34px;
    height: 46px;
    border-radius: 12px;
  }

  .nvcc-bonus__overflow {
    min-width: 34px;
    height: 46px;
    font-size: 11px !important;
  }

  .nvcc-bonus__title {
    font-size: 10px !important;
  }

  .nvcc-bonus__text,
  .nvcc-bonus__toggle {
    font-size: 11px !important;
  }

  .nvcc-deal__mix {
    padding: 8px 12px 12px;
    gap: 6px;
  }

  .nvcc-deal__mix-row {
    grid-template-columns: 24px 36px minmax(0, 1fr);
    gap: 6px;
  }

  .nvcc-deal__thumb {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .nvcc-deal__select {
    min-height: 36px;
    font-size: 14px;
    padding: 6px 8px;
  }

  .nvcc-bundle__submit.button,
  .nvcc-bundle__submit.button.alt,
  .woocommerce .nvcc-bundle__submit.button,
  .woocommerce .nvcc-bundle__submit.button.alt {
    min-height: 44px;
    font-size: 15px !important;
    padding: 12px 24px;
  }

  .nvcc-bundle__row {
    grid-template-columns: minmax(0, 1fr) 74px;
    padding: 10px 12px;
  }

  .nvcc-bundle__row-label {
    font-size: 14px !important;
  }
}
