/* Bundle detail page — scoped to avoid overriding global header/search */

.nd-bundle-detail button,
.nd-bundle-detail input,
.nd-bundle-detail select {
  font: inherit;
}

.nd-bundle-detail.page {
  /* Match site header/nav horizontal gutter; keep panel pad shared by hero + columns */
  --nd-bundle-page-gutter: 18px;
  --nd-bundle-panel-pad: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--nd-bundle-page-gutter) 52px;
  box-sizing: border-box;
}

.nd-bundle-detail .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--blue-800);
  font-weight: 900;
  margin-bottom: 18px;
}

.nd-bundle-detail .hero,
.nd-bundle-detail .list-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}

.nd-bundle-detail .hero {
  background: linear-gradient(135deg, #f8fbff, #e7f1ff);
  border: 1px solid #ccdbef;
  border-radius: var(--radius-lg);
  padding: 28px var(--nd-bundle-panel-pad);
  box-shadow: var(--shadow);
}

.nd-bundle-detail .tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #d8e7fa;
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 12px;
}

.nd-bundle-detail h1 {
  margin: 0 0 10px;
  color: var(--blue-950);
  font-size: clamp(30px, 5vw, 44px);
}

.nd-bundle-detail .lead {
  margin: 0;
  color: #3e5878;
  line-height: 1.55;
  max-width: 840px;
  font-size: 17px;
}

.nd-bundle-detail .summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.nd-bundle-detail .summary-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-width: 0;
}

.nd-bundle-detail .summary-card b {
  display: block;
  color: var(--blue-950);
  font-size: 20px;
}

.nd-bundle-detail .summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.35;
}

.nd-bundle-detail .list-section {
  margin-top: 24px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 24px;
  align-items: start;
}

.nd-bundle-detail .product-list,
.nd-bundle-detail .confirm-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(7, 29, 58, 0.06);
  overflow: hidden;
  min-width: 0;
}

.nd-bundle-detail .product-list-head {
  padding: 20px var(--nd-bundle-panel-pad);
  border-bottom: 1px solid var(--line);
}

.nd-bundle-detail .product-list-head h2 {
  margin: 0;
  color: var(--blue-950);
}

.nd-bundle-detail .product-list-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.nd-bundle-detail .nd-bundle-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px var(--nd-bundle-panel-pad) 24px;
  box-sizing: border-box;
}

.nd-bundle-detail .nd-bundle-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.nd-bundle-detail .nd-bundle-table th,
.nd-bundle-detail .nd-bundle-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e8eef7;
  vertical-align: top;
}

.nd-bundle-detail .nd-bundle-table th {
  color: var(--blue-950);
  background: #f8fbff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nd-bundle-detail .nd-bundle-table td {
  color: #22324a;
}

.nd-bundle-detail .nd-bundle-table tr:last-child td {
  border-bottom: 0;
}

.nd-bundle-detail .sku {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

.nd-bundle-detail .nd-product-spec-line {
  color: #0f3b78;
  font-weight: 700;
  line-height: 1.5;
}

.nd-bundle-detail .status {
  color: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.nd-bundle-detail .confirm-card {
  padding: var(--nd-bundle-panel-pad);
  position: sticky;
  top: 124px;
  box-sizing: border-box;
}

.nd-bundle-detail .confirm-card h2 {
  margin: 0 0 10px;
  color: var(--blue-950);
}

.nd-bundle-detail .confirm-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 16px;
}

.nd-bundle-detail .confirm-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 16px;
  display: grid;
  gap: 10px;
  color: #38516f;
  font-size: 14px;
}

.nd-bundle-detail .confirm-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--blue-950);
  padding: 13px 16px;
  font-weight: 900;
  cursor: pointer;
  min-height: 48px;
}

.nd-bundle-detail .confirm-button:hover {
  filter: brightness(0.98);
}

.nd-bundle-detail .confirm-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.nd-bundle-detail .note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.nd-bundle-detail .nd-bundle-qty-input {
  width: 72px;
  min-height: 38px;
  border: 1px solid #c8d8ea;
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
  font-weight: 700;
  color: var(--blue-900);
}

.nd-bundle-row--matched {
  background: #eef8f0;
}

.nd-bundle-row--matched td {
  border-bottom-color: #c8e6d0;
}

.nd-bundle-row--dim-muted {
  opacity: 0.72;
}

.nd-bundle-row--dim-muted .nd-bundle-qty-input {
  background: #fff;
  pointer-events: auto;
}

.nd-dimension-match-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #daf3e4;
  color: #246447;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.nd-bundle-detail .nd-bundle-use-cell {
  font-size: 13px;
  line-height: 1.45;
  max-width: 220px;
}

.nd-row-dim-verify {
  color: #246447;
  font-weight: 700;
}

.nd-dimension-result-reason,
.nd-dimension-result-dims,
.nd-dimension-result-use {
  display: block;
  margin-top: 4px;
  color: #5d718d;
  font-size: 12px;
  line-height: 1.4;
}

.nd-dimension-result-dims {
  color: #0f3b78;
  font-weight: 700;
}

.nd-dimension-result-use {
  color: #45607f;
  font-style: italic;
}

/* Dimension engine (bundle detail context) */
.nd-bundle-detail .dimension-engine {
  margin: 20px var(--nd-bundle-panel-pad) 8px;
}

.nd-bundle-detail .engine-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.nd-bundle-detail .engine-field--name {
  margin-top: 10px;
}

.nd-bundle-detail .engine-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.nd-bundle-detail .engine-button {
  min-height: 44px;
}

/* Sticky mobile confirm bar */
.nd-bundle-mobile-confirm {
  display: none;
}

.nd-footer-payment-content strong,
.nd-footer-payment-content b {
  color: var(--white);
}

@media (max-width: 900px) {
  .nd-bundle-detail .list-section {
    grid-template-columns: 1fr;
  }

  .nd-bundle-detail .confirm-card {
    position: static;
  }

  .nd-bundle-detail .engine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nd-bundle-detail .engine-result-row {
    grid-template-columns: 1fr 64px;
  }

  .nd-bundle-detail .engine-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nd-bundle-detail .summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .nd-bundle-detail .summary-card {
    padding: 12px;
  }

  .nd-bundle-detail .summary-card b {
    font-size: 18px;
  }

  .nd-bundle-detail .summary-card span {
    font-size: 11px;
  }
}

@media (max-width: 650px) {
  .nd-bundle-detail.page {
    --nd-bundle-page-gutter: 12px;
    --nd-bundle-panel-pad: 16px;
    padding: 20px var(--nd-bundle-page-gutter) 96px;
  }

  .nd-bundle-detail .hero {
    padding: 18px var(--nd-bundle-panel-pad);
  }

  .nd-bundle-detail .list-section {
    gap: 16px;
  }

  .nd-bundle-detail h1 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .nd-bundle-detail .lead {
    font-size: 15px;
  }

  .nd-bundle-detail .summary-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nd-bundle-detail .product-list-head {
    padding: 14px var(--nd-bundle-panel-pad);
  }

  .nd-bundle-detail .dimension-engine {
    margin: 14px var(--nd-bundle-panel-pad) 4px;
    padding: 14px;
  }

  .nd-bundle-detail .engine-grid {
    grid-template-columns: 1fr;
  }

  .nd-bundle-detail .engine-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nd-bundle-detail .engine-button {
    width: 100%;
  }

  .nd-bundle-detail .nd-bundle-table-wrap {
    overflow: visible;
    padding: 4px var(--nd-bundle-panel-pad) 16px;
  }

  .nd-bundle-detail .nd-bundle-table {
    min-width: 0;
    border: 0;
  }

  .nd-bundle-detail .nd-bundle-table thead {
    display: none;
  }

  .nd-bundle-detail .nd-bundle-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .nd-bundle-detail .nd-bundle-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    overflow: hidden;
  }

  .nd-bundle-detail .nd-bundle-table tr.nd-bundle-row--matched {
    border-color: #b8dfc4;
  }

  .nd-bundle-detail .nd-bundle-table td {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #eef3f8;
  }

  .nd-bundle-detail .nd-bundle-table td::before {
    display: block;
    content: attr(data-label);
    color: var(--blue-950);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .nd-bundle-detail .nd-bundle-table td:last-child {
    border-bottom: 0;
  }

  .nd-bundle-detail .nd-bundle-table td[data-label=""]::before {
    content: none;
  }

  .nd-bundle-detail .nd-bundle-use-cell {
    max-width: none;
  }

  .nd-bundle-detail .nd-bundle-qty-input {
    width: 100%;
    max-width: 120px;
  }

  .nd-bundle-detail .confirm-card .confirm-button {
    display: none;
  }

  .nd-bundle-mobile-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(7, 29, 58, 0.12);
  }

  .nd-bundle-mobile-confirm__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .nd-bundle-mobile-confirm__label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .nd-bundle-mobile-confirm__amount {
    color: var(--blue-950);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
  }

  .nd-bundle-mobile-confirm__btn {
    flex: 0 1 auto;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--blue-950);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    max-width: 58%;
  }

  .nd-bundle-mobile-confirm__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
  }
}

/* Bundle V2 — Bundle Item sections, USE checkboxes, option rows */
.nd-bundle-detail .nd-bundle-item {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.nd-bundle-detail .nd-bundle-item__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.nd-bundle-detail .nd-bundle-item__badge {
  margin: 0 0 6px;
  color: #6b7c93;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nd-bundle-detail .nd-bundle-item__title {
  margin: 0;
  color: var(--blue-950);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.nd-bundle-detail .nd-bundle-item__hint {
  margin: 8px 0 0;
  color: #5b6b82;
  font-size: 14px;
  line-height: 1.45;
}

.nd-bundle-detail .nd-bundle-item__note {
  margin: 6px 0 0;
  color: #5b6b82;
  font-size: 13px;
}

.nd-bundle-detail .nd-bundle-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.nd-bundle-detail .nd-bundle-item__state {
  font-weight: 900;
  font-size: 16px;
  color: #9a5b00;
}

.nd-bundle-detail .nd-bundle-item__state.is-incomplete {
  color: #9a5b00;
}

.nd-bundle-detail .nd-bundle-item__state.is-complete {
  color: #0b6b3a;
}

.nd-bundle-detail .nd-bundle-item__state.is-optional {
  color: #6b7c93;
}

.nd-bundle-detail .nd-bundle-item__progress {
  color: #6b7c93;
  font-size: 13px;
  font-weight: 600;
}

.nd-bundle-detail .nd-bundle-options__label {
  margin: 0 0 8px;
  color: var(--blue-950);
  font-size: 13px;
  font-weight: 800;
}

.nd-bundle-detail .nd-bundle-options__head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 88px 96px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #f3f6fb;
  color: #6b7c93;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nd-bundle-detail .nd-bundle-row__use .nd-dimension-match-badge {
  display: block;
  margin-top: 6px;
  font-size: 10px;
}

.nd-bundle-detail .nd-bundle-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 88px 96px 110px;
  gap: 12px;
  align-items: center;
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid #dce6f3;
  border-radius: 12px;
  background: #fff;
}

.nd-bundle-detail .nd-bundle-row.is-used {
  border-color: #c5d7ef;
  box-shadow: 0 1px 0 rgba(15, 59, 120, 0.04);
}

.nd-bundle-detail .nd-bundle-row--matched {
  border-color: #b8dfc4 !important;
  background: #f7fcf8;
}

/* Matched finder rows stay fully interactive (checkbox + qty). */
.nd-bundle-detail .nd-bundle-row--matched,
.nd-bundle-detail .nd-bundle-row--matched .nd-bundle-qty-input,
.nd-bundle-detail .nd-bundle-row--matched .nd-bundle-use {
  opacity: 1;
  pointer-events: auto;
}

.nd-bundle-detail .nd-bundle-row--dim-hidden,
.nd-bundle-detail .nd-bundle-item--dim-hidden {
  display: none !important;
}

.nd-bundle-detail .nd-bundle-row--dim-muted {
  opacity: 0.72;
}

.nd-bundle-detail .nd-bundle-row--dim-muted .nd-bundle-qty-input,
.nd-bundle-detail .nd-bundle-row--dim-muted .nd-bundle-use {
  pointer-events: auto;
  cursor: pointer;
}

.nd-bundle-detail .nd-bundle-use {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.nd-bundle-detail .nd-bundle-use__cb {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.nd-bundle-detail .nd-bundle-use__box {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid #8fa3bf;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  position: relative;
}

.nd-bundle-detail .nd-bundle-use__cb:checked + .nd-bundle-use__box {
  background: var(--blue-900, #0f3b78);
  border-color: var(--blue-900, #0f3b78);
}

.nd-bundle-detail .nd-bundle-use__cb:checked + .nd-bundle-use__box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.nd-bundle-detail .nd-bundle-use__cb:disabled + .nd-bundle-use__box {
  opacity: 0.45;
  cursor: not-allowed;
}

.nd-bundle-detail .nd-bundle-use__cb:focus-visible + .nd-bundle-use__box {
  outline: 2px solid #7eb0ff;
  outline-offset: 2px;
}

.nd-bundle-detail .nd-bundle-row__name {
  display: block;
  color: var(--blue-950);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.nd-bundle-detail .nd-bundle-row__sku,
.nd-bundle-detail .nd-bundle-row__spec {
  display: block;
  margin-top: 3px;
  color: #6b7c93;
  font-size: 12px;
  line-height: 1.4;
}

.nd-bundle-detail .nd-bundle-row__qty {
  text-align: center;
}

.nd-bundle-detail .nd-bundle-qty-input {
  width: 64px;
  max-width: 100%;
  text-align: center;
  border: 1px solid #c9d6e8;
  border-radius: 8px;
  padding: 8px 6px;
  color: var(--blue-950);
  font-weight: 700;
}

.nd-bundle-detail .nd-bundle-row__price {
  color: var(--blue-950);
  font-weight: 800;
  line-height: 1.35;
}

.nd-bundle-detail .nd-bundle-row__price-was {
  display: inline-block;
  margin-right: 6px;
  color: #6b7c93;
  font-weight: 700;
  text-decoration: line-through;
  opacity: 0.75;
}

.nd-bundle-detail .nd-bundle-row__price-now {
  color: var(--blue-950);
  font-weight: 800;
}

.nd-bundle-detail .nd-bundle-row__status .status {
  color: #0b6b3a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .nd-bundle-detail .nd-bundle-options__head {
    display: none;
  }

  .nd-bundle-detail .nd-bundle-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nd-bundle-detail .nd-bundle-row__use,
  .nd-bundle-detail .nd-bundle-row__product,
  .nd-bundle-detail .nd-bundle-row__qty,
  .nd-bundle-detail .nd-bundle-row__price,
  .nd-bundle-detail .nd-bundle-row__status {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .nd-bundle-detail .nd-bundle-row__use::before,
  .nd-bundle-detail .nd-bundle-row__product::before,
  .nd-bundle-detail .nd-bundle-row__qty::before,
  .nd-bundle-detail .nd-bundle-row__price::before,
  .nd-bundle-detail .nd-bundle-row__status::before {
    content: attr(data-label);
    color: #6b7c93;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .nd-bundle-detail .nd-bundle-item__head {
    flex-direction: column;
  }

  .nd-bundle-detail .nd-bundle-item__meta {
    align-items: flex-start;
    text-align: left;
  }
}

.nd-bundle-detail .nd-bundle-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef5ff;
  color: var(--blue-950);
  font-weight: 700;
}

.nd-bundle-detail .nd-bundle-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7df;
  border: 1px solid #f0df9a;
  color: #7a5a00;
  font-size: 13px;
  font-weight: 700;
}

.nd-bundle-detail .confirm-button.is-disabled,
.nd-bundle-detail .confirm-button:disabled {
  background: #d7dde7 !important;
  color: #6b7280 !important;
  cursor: not-allowed;
}

.nd-bundle-detail .nd-bundle-subtotal-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5edf7;
}

.nd-bundle-detail .nd-bundle-subtotal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  color: var(--blue-950);
}

.nd-bundle-detail .nd-bundle-subtotal-note {
  margin: 6px 0 0;
  color: #6b7c93;
  font-size: 12px;
}
