/*
 Theme Name:   莹虹商贸 - 子主题
 Theme URI:    https://yhsm.xyz
 Description:  莹虹商贸定制子主题 - 基于 wuqix-hardware-theme
 Version:      1.0.0
 Author:       莹虹商贸
 Author URI:   https://yhsm.xyz
 Template:     wuqix-hardware-theme
 Text Domain:  yhsm-child
*/

@import url('../wuqix-hardware-theme/style.css');

/* ===================================================
   子主题样式（WordPress 自动加载父主题，无需 @import）
   =================================================== */

/* ===================================================
   结算页单页布局
   =================================================== */
.checkout-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.checkout-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-right {
  position: sticky;
  top: 20px;
}

/* ===================================================
   结算区块标题
   =================================================== */
.ck-section {
  background: #fff;
  border: 2px solid #e2e8f0;
  box-shadow: var(--h-shadow-sm, 2px 2px 0 rgba(0,0,0,0.10));
}

.ck-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 2px solid #1b4f72;
  font-size: 15px;
  font-weight: 700;
  color: #0d1b2a;
  background: #f4f6f8;
}

.ck-section-title .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #1b4f72;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ck-section-body {
  padding: 20px 18px;
}

/* ===================================================
   已有地址选择区
   =================================================== */
.address-book {
  margin-bottom: 16px;
}

.address-book-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.address-book-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.addr-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.addr-card:hover { border-color: #1b4f72; }
.addr-card.selected {
  border-color: #e63946;
  background: #fff5f5;
}

.addr-card input[type="radio"] { margin-top: 2px; flex-shrink: 0; }

.addr-card-info { flex: 1; line-height: 1.6; }
.addr-card-info .addr-name { font-weight: 700; color: #0d1b2a; }
.addr-card-info .addr-phone { color: #e63946; font-weight: 700; margin-left: 8px; }
.addr-card-info .addr-detail { color: #555; font-size: 12px; margin-top: 2px; }

.addr-card-actions { display: flex; gap: 8px; }
.addr-card-actions button {
  font-size: 11px; color: #1b4f72; background: none;
  border: none; cursor: pointer; padding: 0; text-decoration: underline;
}

/* 新地址表单 */
.new-addr-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.new-addr-form .full-width { grid-column: 1 / -1; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.5px;
}

.form-field label .required {
  color: #e63946;
  margin-left: 2px;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 9px 12px;
  border: 2px solid #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  color: #1a2530;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #1b4f72;
}

.form-field textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* ===================================================
   附件上传区
   =================================================== */
.file-upload-zone {
  border: 2px dashed #c0c8d0;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f4f6f8;
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
  border-color: #1b4f72;
  background: #eef4f8;
}

.file-upload-zone .fuz-icon { font-size: 28px; margin-bottom: 6px; }
.file-upload-zone p { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #1a2530; }
.file-upload-zone small { font-size: 11px; color: #888; }

.file-upload-zone input[type="file"] { display: none; }

.uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.uploaded-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #eef4f8;
  border: 1px solid #c0c8d0;
  font-size: 12px;
  color: #1a2530;
}

.uploaded-file-item .remove-file {
  color: #e63946;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* ===================================================
   右侧订单摘要
   =================================================== */
.order-summary-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  box-shadow: var(--h-shadow-sm, 2px 2px 0 rgba(0,0,0,0.10));
}

.order-summary-header {
  padding: 14px 18px;
  border-bottom: 2px solid #1b4f72;
  font-size: 14px;
  font-weight: 700;
  color: #0d1b2a;
  background: #f4f6f8;
}

.order-summary-items {
  padding: 14px 18px;
}

.osi-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
  font-size: 13px;
}

.osi-item:last-child { border-bottom: none; }

.osi-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.osi-info { flex: 1; }
.osi-name { font-weight: 600; line-height: 1.4; margin-bottom: 2px; }
.osi-qty { font-size: 12px; color: #888; }

.osi-price {
  font-weight: 700;
  color: #e63946;
  white-space: nowrap;
}

.order-summary-totals {
  padding: 14px 18px;
  border-top: 2px solid #e2e8f0;
  background: #f4f6f8;
}

.ost-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: #555;
}

.ost-row.total {
  font-size: 16px;
  font-weight: 800;
  color: #e63946;
  padding-top: 8px;
  border-top: 2px solid #e2e8f0;
  margin-top: 4px;
}

/* 提交按钮 */
.checkout-submit-section {
  padding: 16px 18px;
}

.btn-checkout-submit {
  width: 100%;
  padding: 16px;
  background: #e63946;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-checkout-submit:hover { background: #c0392b; }
.btn-checkout-submit:disabled { background: #ccc; cursor: not-allowed; }

.checkout-terms-note {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* ===================================================
   支付方式选择
   =================================================== */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #1a2530;
  transition: all 0.2s;
}

.payment-method:hover { border-color: #1b4f72; }
.payment-method.selected {
  border-color: #e63946;
  background: #fff5f5;
}

.payment-method .pm-icon { font-size: 24px; }

/* ===================================================
   Toast 提示
   =================================================== */
.ck-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d1b2a;
  color: #fff;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 99999;
  border-left: 4px solid #27ae60;
  display: none;
}

/* ===================================================
   响应式
   =================================================== */
@media (max-width: 900px) {
  .checkout-wrapper {
    grid-template-columns: 1fr;
  }
  .checkout-right {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .new-addr-form {
    grid-template-columns: 1fr;
  }
  .payment-methods {
    grid-template-columns: 1fr 1fr;
  }
}
