/* ============================================================
   Cart2 Step 3 - 表单控件与订单汇总覆盖样式
   ============================================================ */

/* 配置项行：去除原本的圆角矩形卡片背景，只保留竖向间距 + 底分隔线，
   让多行配置项视觉上是同一张卡里的列表，而不是一堆并列的小卡片。 */
.configureproduct {
  margin-bottom: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgba(var(--cc-brand-rgb), .10);
  border-radius: 0;
  background: transparent;
}

.configureproduct:last-of-type {
  border-bottom: 0;
  padding-bottom: 4px;
}

.configureproduct .col-form-label {
  color: var(--cc-text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.01em;
}

.configureproduct select.form-control,
.configureproduct .cc-form-select,
.configureproduct .bootstrap-select > .dropdown-toggle,
.configureproduct .cc-select__trigger,
.cc-form-input,
input.configoption_range_val {
  border-color: rgba(var(--cc-brand-rgb), .16) !important;
  border-radius: var(--cc-radius-sm) !important;
  background-color: #fff !important;
}

.configureproduct select.form-control:focus,
.configureproduct .cc-form-select:focus,
.configureproduct .bootstrap-select > .dropdown-toggle:focus,
.configureproduct .cc-select__trigger:focus,
.configureproduct .cc-select.is-open .cc-select__trigger,
.cc-form-input:focus,
input.configoption_range_val:focus {
  border-color: var(--cc-brand) !important;
  box-shadow: 0 0 0 4px rgba(var(--cc-brand-rgb), .12) !important;
}

.btn-group-toggle:not(.btn-custom-group) .btn,
.btn-custom-group .btn-custom,
.btn-custom-group > label.btn,
label.btn.btn-custom,
.configureproduct .form-check {
  border-color: rgba(var(--cc-brand-rgb), .16) !important;
  border-radius: var(--cc-radius-sm) !important;
  background: #fff !important;
  color: var(--cc-text) !important;
  /* 扁平化：只过渡颜色/边框，不再过渡 transform & box-shadow */
  box-shadow: none !important;
  transition: border-color .2s ease, background .2s ease, color .2s ease !important;
}

.btn-group-toggle:not(.btn-custom-group) .btn:hover,
.btn-custom-group .btn-custom:hover,
.btn-custom-group > label.btn:hover,
.configureproduct .form-check:hover {
  border-color: rgba(var(--cc-brand-rgb), .34) !important;
  /* 扁平化：hover 不再上浮 + 不再加阴影 */
  transform: none !important;
  box-shadow: none !important;
}

.btn-group-toggle:not(.btn-custom-group) .btn.active,
.btn-group-toggle:not(.btn-custom-group) .btn:has(input:checked),
.btn-custom-group .btn-custom.active,
.btn-custom-group .btn-custom:has(input:checked),
.btn-custom-group > label.btn.active,
.btn-custom-group > label.btn:has(input:checked),
.configureproduct .form-check:has(input:checked) {
  border-color: var(--cc-brand) !important;
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-strong)) !important;
  color: #fff !important;
  /* 扁平化：选中态去掉发光阴影，仅靠绿色填充 + 边框区分 */
  box-shadow: none !important;
  transform: none !important;
}

.configureproduct .form-check:has(input:checked) .form-check-label {
  color: #fff;
}

.configureproduct .form-check-input:checked {
  border-color: var(--cc-brand);
  background: var(--cc-brand);
}

input.configoption_range {
  background: #e2f2ec;
}

input.configoption_range::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--cc-brand) var(--range-progress, 0%), #e2f2ec var(--range-progress, 0%));
}

input.configoption_range::-webkit-slider-thumb {
  border-color: var(--cc-brand);
  box-shadow: 0 2px 8px rgba(var(--cc-brand-rgb), .3), 0 0 0 4px rgba(var(--cc-brand-rgb), .08);
}

input.configoption_range::-moz-range-progress {
  background: linear-gradient(90deg, var(--cc-brand), var(--cc-brand-strong));
}

input.configoption_range::-moz-range-thumb {
  border-color: var(--cc-brand);
  box-shadow: 0 2px 8px rgba(var(--cc-brand-rgb), .3);
}

.cc-range-unit {
  border-color: var(--cc-brand-border);
  background: linear-gradient(135deg, #effff9, #d9f8ee);
  color: var(--cc-brand-dark);
}

.cc-config-wrap {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 132px;
}

.cc-config-sidebar {
  width: auto;
  max-width: none;
}

.cc-receipt {
  position: fixed !important;
  top: auto !important;
  right: 16px !important;
  bottom: var(--cc-receipt-bottom, 16px) !important;
  left: 16px !important;
  z-index: 1200 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 auto !important;
  transform: none !important;
}

.cc-receipt-card {
  display: grid;
  /* 列：header(1fr) | 配置费用按钮 | 周期优惠摘要(可隐) | 应付金额 | 操作 */
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 12px;
  align-items: center;
  width: 100% !important;
  max-width: 1680px !important;
  min-height: 88px;
  margin: 0 auto !important;
  padding: 14px 18px;
  overflow: visible;
  border-radius: var(--cc-radius-lg);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 45px rgba(32, 132, 101, .14);
}

.cc-receipt-card::before,
.cc-receipt-card::after,
.cc-receipt-holes,
.cc-receipt-total::before,
.cc-receipt-footer::before {
  display: none;
}

.cc-receipt-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: transparent;
}

.cc-receipt-logo {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  margin: 0;
  border: 1px solid rgba(var(--cc-brand-rgb), .18);
  border-radius: 16px;
  background: linear-gradient(135deg, #effff9, #d9f8ee);
  color: var(--cc-brand-dark);
  font-size: 22px;
}

.cc-receipt-shop {
  margin: 0;
  color: var(--cc-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.cc-receipt-slogan {
  display: none;
}

.cc-receipt-product {
  min-width: 0;
  overflow: hidden;
  color: var(--cc-text);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-receipt-body {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 周期优惠摘要（折扣行） ----------
   仅在当前选中周期带 cycle_discount 且节省金额 > 0 时显示，
   显隐 + 数值由 configureproduct.js syncReceiptDiscount() 控制。 */
.cc-receipt-discount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  padding: 0 12px;
  text-align: right;
  border-left: 1px dashed rgba(var(--cc-brand-rgb), .22);
  border-right: 1px dashed rgba(var(--cc-brand-rgb), .22);
}

.cc-receipt-discount[hidden] {
  display: none;
}

.cc-receipt-discount-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

.cc-receipt-discount-label i {
  color: #ef4444;
  font-size: 14px;
}

.cc-receipt-discount-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cc-receipt-discount-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  box-shadow: 0 2px 6px rgba(225, 29, 72, .25);
}

.cc-receipt-discount-amount {
  display: inline-flex;
  align-items: baseline;
  color: #e11d48;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
}

.cc-receipt-discount-sign {
  font-size: 16px;
  font-weight: 800;
}

.cc-receipt-discount-currency {
  margin: 0 1px 0 1px;
  font-size: 13px;
  font-weight: 800;
}

.cc-receipt-total {
  min-width: 0;
  margin: 0;
  padding: 0 6px 0 4px;
  text-align: right;
  background: transparent;
}

.cc-receipt-total-label {
  margin-bottom: 2px;
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.cc-receipt-total-price {
  justify-content: flex-end;
}

.cc-receipt-currency {
  color: var(--cc-brand-dark);
  font-size: 16px;
  text-shadow: none;
}

.cc-receipt-amount {
  color: var(--cc-brand-dark);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  text-shadow: none;
}

.cc-receipt-footer {
  padding: 0;
  background: transparent;
}

.cc-receipt-barcode,
.cc-receipt-barcode-text,
.cc-receipt-note {
  display: none;
}

.cc-receipt-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.cc-receipt-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: 50px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.cc-receipt-btn i {
  font-size: 17px;
  line-height: 1;
}

.cc-receipt-btn-primary {
  min-width: 140px;
  padding: 0 20px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-strong));
  color: #fff;
  box-shadow:
    0 10px 22px rgba(var(--cc-brand-rgb), .28),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.cc-receipt-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 55%);
  pointer-events: none;
}

.cc-receipt-btn-primary:hover {
  background: linear-gradient(135deg, var(--cc-brand-strong), var(--cc-brand-dark));
  box-shadow:
    0 14px 28px rgba(var(--cc-brand-rgb), .36),
    inset 0 1px 0 rgba(255, 255, 255, .24);
  color: #fff;
}

.cc-receipt-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(var(--cc-brand-rgb), .28);
}

.cc-receipt-btn-outline {
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(var(--cc-brand-rgb), .28);
  background: rgba(255, 255, 255, .9);
  color: var(--cc-brand-dark);
  box-shadow: 0 4px 12px rgba(15, 95, 71, .06);
}

.cc-receipt-btn-outline:hover {
  border-color: var(--cc-brand);
  background: var(--cc-brand-bg);
  color: var(--cc-brand-dark);
  box-shadow: 0 8px 18px rgba(15, 95, 71, .10);
  transform: translateY(-1px);
}

.cc-receipt-btn-outline:active {
  transform: translateY(0);
}

.cc-receipt-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--cc-brand-rgb), .22),
    0 10px 22px rgba(var(--cc-brand-rgb), .28);
}

@media (max-width: 760px) {
  .cc-config-wrap {
    padding-bottom: 164px;
  }

  .cc-receipt {
    right: 10px !important;
    bottom: var(--cc-receipt-bottom, 10px) !important;
    left: 10px !important;
    width: auto !important;
  }

  .cc-receipt-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 12px;
  }


  .cc-receipt-total {
    min-width: 122px;
  }

  .cc-receipt-amount {
    font-size: 28px;
  }

  .cc-receipt-footer {
    grid-column: 1 / -1;
  }

  /* 移动端把周期优惠摘要独占一行，避免挤压总价 / 操作区 */
  .cc-receipt-discount {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px dashed rgba(var(--cc-brand-rgb), .22);
    border-radius: 10px;
    background: rgba(254, 226, 226, .35);
  }

  .cc-receipt-discount-amount {
    font-size: 18px;
  }

  .cc-receipt-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .cc-receipt-btn {
    height: 46px;
    padding: 0 16px;
    font-size: 14px;
  }

  .cc-receipt-btn-primary {
    min-width: 0;
    padding: 0 18px;
  }

  .cc-receipt-btn-outline {
    width: auto;
    padding: 0 14px;
  }
}
