/* =================================================================
 * 旺质康 - 全栈补丁样式 v5 (2026-07-30)
 *
 * 整合来源:
 *   - cart-alipay-fix.css      (废弃, 合并)
 *   - payment-flow-fix.css     (核心, 保留)
 *   - product-img-v2.css       (废弃, 合并)
 *
 * 所有 wzk- 前缀类, 避免与 popup-modals.css 冲突
 * ================================================================= */

/* ====== Modal 容器基础 ====== */
.wzk-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wzk-fade-in 0.2s ease-out;
}

.wzk-modal-container {
  background: #fff;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: wzk-slide-up 0.3s ease-out;
}

@keyframes wzk-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wzk-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ====== Modal Header ====== */
.wzk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.wzk-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.wzk-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wzk-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* ====== Modal Body ====== */
.wzk-modal-body {
  padding: 20px;
}

.wzk-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
}

/* ====== Buttons ====== */
.wzk-btn-primary, .wzk-btn-secondary {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
}

.wzk-btn-primary {
  background: #02bd6c;
  color: white;
}

.wzk-btn-primary:hover {
  background: #00a85c;
}

.wzk-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.wzk-btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.wzk-btn-secondary:hover {
  background: #e8e8e8;
}

/* ====== Checkout Modal ====== */
.wzk-order-id {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}

.wzk-order-items {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.wzk-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #f0f0f0;
}

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

.wzk-order-item img {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
}

.wzk-item-info {
  flex: 1;
  min-width: 0;
}

.wzk-item-name {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wzk-item-price {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.wzk-order-total {
  font-size: 15px;
  color: #666;
  text-align: right;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
}

.wzk-total {
  font-size: 22px;
  font-weight: 600;
  color: #ff4d4f;
}

/* ====== Payment Method Tabs ====== */
.wzk-payment-methods {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.wzk-method-tab {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
  background: #fff;
}

.wzk-method-tab input {
  display: none;
}

.wzk-method-tab.active {
  border-color: #02bd6c;
  color: #02bd6c;
  background: #f0fdf6;
}

.wzk-method-tab:hover {
  border-color: #02bd6c;
}

/* ====== Payment QR Modal ====== */
.wzk-sandbox-warn {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #d46b08;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

.wzk-order-info {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  text-align: center;
}

.wzk-qr-wrapper {
  text-align: center;
  padding: 16px 0;
}

.wzk-qr-code-img {
  display: inline-block;
  width: 220px;
  height: 220px;
  border: 1px solid #f0f0f0;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
}

.wzk-qr-code-img img,
.wzk-qr-code-img {
  display: block;
}

.wzk-tip {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-top: 12px;
}

/* ====== Bank Transfer Modal ====== */
.wzk-bank-info {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}

.wzk-bank-info p {
  margin: 4px 0;
}

.wzk-bank-img {
  width: 100%;
  max-width: 280px;
  display: block;
  margin: 12px auto;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
}

/* ====== Receipt (购物小票) - 锯齿边框 ====== */
.wzk-receipt {
  background: #fff;
  position: relative;
  padding: 24px 20px;
}

.wzk-receipt::before,
.wzk-receipt::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  background:
    radial-gradient(circle at 6px 6px, #fff 6px, transparent 6px);
  background-size: 12px 12px;
}

.wzk-receipt::before {
  top: -6px;
  background-position: 0 -6px;
}

.wzk-receipt::after {
  bottom: -6px;
  background-position: 0 6px;
}

.wzk-receipt-header {
  text-align: center;
  border-bottom: 2px dashed #f0f0f0;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.wzk-receipt-title {
  font-size: 22px;
  font-weight: 700;
  color: #02bd6c;
  margin-bottom: 4px;
}

.wzk-receipt-time {
  font-size: 12px;
  color: #999;
}

.wzk-receipt-amount {
  font-size: 36px;
  font-weight: 700;
  color: #ff4d4f;
  text-align: center;
  margin: 16px 0;
}

.wzk-receipt-orderid {
  font-size: 13px;
  color: #999;
  text-align: center;
  margin-bottom: 16px;
}

.wzk-receipt-items {
  border-top: 1px dashed #f0f0f0;
  padding-top: 12px;
  margin-bottom: 12px;
}

.wzk-receipt-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: #333;
}

.wzk-receipt-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.wzk-receipt-qty {
  color: #999;
  margin-right: 12px;
  white-space: nowrap;
}

.wzk-receipt-price {
  color: #ff4d4f;
  font-weight: 500;
  white-space: nowrap;
}

.wzk-receipt-points {
  background: linear-gradient(135deg, #fff7e6, #ffe7ba);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin: 16px 0;
  border: 1px dashed #ff9c6e;
}

.wzk-receipt-points-icon {
  font-size: 24px;
  margin-right: 8px;
}

.wzk-receipt-points-text {
  font-size: 15px;
  color: #d46b08;
  font-weight: 500;
}

.wzk-receipt-actions {
  padding: 16px 0 0;
  text-align: center;
}

/* ====== Cart Badge ====== */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  display: none;
}

/* ====== Mobile 适配 ====== */
@media (max-width: 480px) {
  .wzk-modal-container {
    width: 95%;
    max-width: none;
  }

  .wzk-payment-methods {
    flex-wrap: wrap;
  }

  .wzk-method-tab {
    flex: 0 0 calc(33.33% - 6px);
  }

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