/* =========================================================
   ABCLOUD 产品配置页 (水浒云 IDC 左右分栏联动架构标准样式)
   ========================================================= */

/* ---- 右侧配置主容器覆盖 ---- */
.nq-cart-main.nq-cart-main--config {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 0 76px 0 !important;
  min-height: calc(100vh - 60px) !important;
  background: #f4f6fa !important;
  box-sizing: border-box !important;
}

.nq-cart-main--config .abcloud-config-workspace {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.nq-cart-main--config #addCartForm {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
}

/* ---- 核心包裹容器 (左主配置卡片 + 右350px推荐栏) ---- */
.nq-productconfig-wrap {
  display: flex !important;
  gap: 16px !important;
  margin: 16px 20px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* ---- 左侧主要配置面板 ---- */
.nq-productconfig {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border: 1px solid #eef2f6 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden !important;
}

.nq-productconfig-main {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* ---- 面板头部 (返回按钮 + 标题) ---- */
.nq-productconfig-header {
  padding: 14px 24px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
  background: #ffffff !important;
}

.nq-productconfig-back {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  color: #64748b !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}
.nq-productconfig-back:hover {
  background: #e8f3ff !important;
  color: #1677ff !important;
  border-color: #93c5fd !important;
}

.nq-productconfig-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.4 !important;
}

/* ---- 配置表单主体 ---- */
.nq-productconfig-body {
  padding: 16px 24px 28px !important;
  flex: 1 1 auto !important;
}

/* ---- 通用配置行 ---- */
.nq-productconfig-row {
  display: flex !important;
  align-items: flex-start !important;
  padding: 12px 0 !important;
  border-bottom: 1px dashed #f1f5f9 !important;
}
.nq-productconfig-row:last-child {
  border-bottom: none !important;
}

.nq-productconfig-label {
  width: 120px !important;
  min-width: 120px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  line-height: 32px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.nq-productconfig-field {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

/* ---- 兼容 Bootstrap form-group row 原生样式 ---- */
.nq-productconfig-body .form-group.row {
  display: flex !important;
  align-items: flex-start !important;
  padding: 12px 0 !important;
  margin: 0 !important;
  border-bottom: 1px dashed #f1f5f9 !important;
}
.nq-productconfig-body .form-group.row > label.col-form-label {
  width: 120px !important;
  max-width: 120px !important;
  flex: 0 0 120px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  padding: 0 !important;
  line-height: 32px !important;
  margin: 0 !important;
}
.nq-productconfig-body .form-group.row > div[class*="col-"] {
  flex: 1 1 0% !important;
  max-width: none !important;
  padding: 0 !important;
}

/* ---- 1. 同组产品型号选择行 (药丸标签组) ---- */
.nq-spec-group {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.nq-spec-item {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 16px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}
.nq-spec-item:hover {
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  color: #1677ff !important;
}
.nq-spec-item.active {
  background: #e8f3ff !important;
  border-color: #1677ff !important;
  color: #1677ff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(22, 119, 255, 0.15) !important;
}

.nq-spec-hint {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ---- 2. 操作系统网格选择器 ---- */
.nq-productconfig-os-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.nq-productconfig-os-card {
  width: 155px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  overflow: visible !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
}
.nq-productconfig-os-card:hover {
  border-color: #1677ff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
.nq-productconfig-os-card.active {
  border-color: #1677ff !important;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15) !important;
}

.nq-productconfig-os-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  cursor: pointer !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background 0.2s ease !important;
}
.nq-productconfig-os-card.active .nq-productconfig-os-header {
  background: #e8f3ff !important;
}

.nq-productconfig-os-icon {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}
.nq-productconfig-os-name {
  font-size: 13px !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.nq-productconfig-os-card.active .nq-productconfig-os-name {
  color: #1677ff !important;
}

/* 操作系统下拉选择版本 */
.nq-productconfig-os-select {
  position: relative !important;
}
.nq-productconfig-os-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 6px 10px !important;
  background: #ffffff !important;
  cursor: pointer !important;
  height: 30px !important;
  font-size: 11px !important;
  color: #334155 !important;
  border-radius: 0 0 6px 6px !important;
}
.nq-productconfig-os-trigger i,
.nq-productconfig-os-trigger svg {
  color: #94a3b8 !important;
  flex-shrink: 0 !important;
}
.nq-productconfig-os-trigger-label {
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.nq-productconfig-os-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: -1px !important;
  right: -1px !important;
  background: #ffffff !important;
  border: 1px solid #1677ff !important;
  border-top: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  z-index: 1000 !important;
  max-height: 180px !important;
  overflow-y: auto !important;
  border-radius: 0 0 6px 6px !important;
  display: none;
}
.nq-productconfig-os-select.open .nq-productconfig-os-dropdown {
  display: block !important;
}
.nq-productconfig-os-option {
  padding: 6px 10px !important;
  cursor: pointer !important;
  font-size: 11px !important;
  color: #334155 !important;
  transition: background 0.15s ease !important;
}
.nq-productconfig-os-option:hover {
  background: #f1f5f9 !important;
  color: #1677ff !important;
}
.nq-productconfig-os-option.active {
  background: #e8f3ff !important;
  color: #1677ff !important;
  font-weight: 600 !important;
}

/* ---- 3. 单选按钮组与周期选择 ---- */
.btn-group.btn-group-toggle label.btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 16px !important;
  border-radius: 6px !important;
  margin-right: 8px !important;
  margin-bottom: 6px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
.btn-group.btn-group-toggle label.btn:hover {
  border-color: #93c5fd !important;
  color: #1677ff !important;
  background: #eef6ff !important;
}
.btn-group.btn-group-toggle label.btn.active {
  background: #e8f3ff !important;
  border-color: #1677ff !important;
  color: #1677ff !important;
  font-weight: 700 !important;
}

.cycle-select-discount {
  position: absolute !important;
  top: -8px !important;
  right: -2px !important;
  display: inline-block !important;
  padding: 0 5px !important;
  height: 15px !important;
  background: #ff4d4f !important;
  border-radius: 4px !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 15px !important;
}

/* ---- 4. 右侧精选推荐产品辅助栏 (350px 独立卡片流) ---- */
.nq-cart-recommend {
  width: 330px !important;
  flex: 0 0 330px !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 180px) !important;
}
.nq-cart-recommend-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}
.nq-cart-recommend .nq-product-card {
  min-height: auto !important;
  padding: 14px !important;
}
.nq-cart-recommend .nq-product-card::before {
  display: none !important;
}
.nq-cart-recommend .nq-product-header {
  padding: 0 0 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.nq-cart-recommend .nq-product-name {
  font-size: 14px !important;
}
.nq-cart-recommend .nq-product-desc {
  padding: 8px 0 !important;
  font-size: 12px !important;
}
.nq-cart-recommend .config-row {
  font-size: 12px !important;
  padding: 2px 0 !important;
}
.nq-cart-recommend .config-icon {
  width: 18px !important;
  height: 18px !important;
}
.nq-cart-recommend .config-label {
  width: 44px !important;
  font-size: 12px !important;
}
.nq-cart-recommend .config-value {
  font-size: 12px !important;
}
.nq-cart-recommend .nq-product-footer {
  padding: 10px 0 0 !important;
  border-top: 1px dashed #f1f5f9 !important;
}
.nq-cart-recommend .nq-price-current {
  font-size: 20px !important;
}
.nq-cart-recommend .btn-primary {
  height: 32px !important;
  line-height: 32px !important;
  font-size: 13px !important;
}

/* ---- 5. 底部固定浮动实时结算栏 (nq-productconfig-footer) ---- */
.nq-productconfig-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 240px !important;
  right: 0 !important;
  width: auto !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08) !important;
  z-index: 999 !important;
}

@media (max-width: 768px) {
  .nq-productconfig-footer {
    left: 0 !important;
  }
}

.nq-productconfig-footer .configoption_total {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 24px !important;
  max-width: none !important;
  gap: 16px !important;
}

/* 结算栏 - 左侧价格 */
.nq-productconfig-footer-left {
  flex: 1 1 auto !important;
  min-width: 260px !important;
  text-align: left !important;
}
.nq-productconfig-footer-price {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.nq-productconfig-footer-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #64748b !important;
}
.nq-productconfig-footer-amount {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #ef4444 !important;
  line-height: 1 !important;
}
.nq-productconfig-footer-amount small {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #94a3b8 !important;
  margin-left: 2px !important;
}
.nq-productconfig-footer-discount {
  font-size: 12px !important;
  color: #1677ff !important;
  font-weight: 600 !important;
}
.nq-productconfig-footer-nodiscount {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}
.nq-productconfig-footer-note {
  font-size: 11px !important;
  color: #94a3b8 !important;
  margin-top: 4px !important;
}

/* 结算栏 - 右侧操作与费用明细抽屉 */
.nq-productconfig-footer-right {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  flex-shrink: 0 !important;
}

.nq-productconfig-footer-detail {
  position: relative !important;
}
.nq-productconfig-footer-detail-trigger {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 13px !important;
  color: #d97706 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
  border-bottom: 1px dashed #f59e0b !important;
  transition: all 0.2s ease !important;
}
.nq-productconfig-footer-detail-trigger:hover {
  color: #b45309 !important;
}
.nq-productconfig-footer-detail-arrow {
  transition: transform 0.25s ease !important;
}
.nq-productconfig-footer-detail.open .nq-productconfig-footer-detail-arrow {
  transform: rotate(180deg) !important;
}

/* 费用明细浮动抽屉表格 */
.nq-productconfig-footer-breakdown {
  position: absolute !important;
  bottom: calc(100% + 12px) !important;
  right: 0 !important;
  min-width: 480px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15) !important;
  z-index: 100 !important;
  overflow: hidden !important;
}
.nq-productconfig-footer-breakdown-title {
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: #f8fafc !important;
}
.nq-productconfig-footer-breakdown-total em {
  font-style: normal !important;
  font-weight: 700 !important;
  color: #ef4444 !important;
}
.nq-breakdown-close {
  background: transparent !important;
  border: none !important;
  font-size: 16px !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  line-height: 1 !important;
}
.nq-breakdown-close:hover {
  color: #1e293b !important;
}
.nq-productconfig-footer-breakdown-body {
  max-height: 320px !important;
  overflow-y: auto !important;
}
.nq-productconfig-footer-breakdown table {
  width: 100% !important;
  border-collapse: collapse !important;
}
.nq-productconfig-footer-breakdown th {
  padding: 8px 16px !important;
  font-size: 12px !important;
  color: #475569 !important;
  font-weight: 600 !important;
  background: #f1f5f9 !important;
  text-align: left !important;
}
.nq-productconfig-footer-breakdown td {
  padding: 9px 16px !important;
  font-size: 13px !important;
  color: #334155 !important;
  border-bottom: 1px solid #f8fafc !important;
}
.nq-productconfig-footer-breakdown td:last-child {
  text-align: right !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.nq-productconfig-footer-right > .btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 24px !important;
  height: 40px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  background: #1677ff !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}
.nq-productconfig-footer-right > .btn:hover {
  background: #0958d9 !important;
}

#addToCartBtn .btn-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#addToCartBtn .btn-loading {
  display: none !important;
}
#addToCartBtn.is-loading .btn-text {
  display: none !important;
}
#addToCartBtn.is-loading .btn-loading {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

/* 响应式断点 */
@media (max-width: 1024px) {
  .nq-cart-recommend {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .nq-productconfig-wrap {
    margin: 8px !important;
    flex-direction: column !important;
  }
  .nq-productconfig-footer .configoption_total {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 14px !important;
  }
  .nq-productconfig-footer-right {
    justify-content: space-between !important;
  }
  .nq-productconfig-footer-breakdown {
    min-width: 90vw !important;
  }
}
