/* 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 {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 18px 52px;
}

.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 {
  background: linear-gradient(135deg, #f8fbff, #e7f1ff);
  border: 1px solid #ccdbef;
  border-radius: var(--radius-lg);
  padding: 28px;
  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: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  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;
}

.nd-bundle-detail .product-list-head {
  padding: 18px 20px;
  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;
}

.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: 20px;
  position: sticky;
  top: 124px;
}

.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.45;
}

.nd-bundle-row--dim-muted .nd-bundle-qty-input {
  background: #f4f6f9;
}

.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: 22px 20px;
}

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

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

.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 {
    padding: 20px 12px 96px;
  }

  .nd-bundle-detail .hero {
    padding: 18px 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 16px;
  }

  .nd-bundle-detail .dimension-engine {
    margin: 16px 12px;
    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: 0 12px 12px;
  }

  .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;
  }
}
