/* ============================================================
   TransHands — Stripe 结账弹窗样式
   商务简约，与站点品牌色一致（深蓝 + 金）
   ============================================================ */

/* ---------- 价格项上的信用卡按钮 ---------- */
.th-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #c9b26a;
  background: #fffdf7;
  color: #8a6116;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.th-card-btn:hover {
  background: #d4a853;
  border-color: #d4a853;
  color: #0f172a;
}
.th-card-btn i { font-size: 14px; }
.th-card-btn .th-card-btn-sub { font-weight: 400; opacity: .85; }

/* ---------- 结账弹窗遮罩 ---------- */
.th-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 20px;
}
.th-modal-overlay.open { display: flex; }

/* ---------- 结账弹窗主体 ---------- */
.th-modal {
  background: #fff;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  padding: 28px 26px 26px;
  position: relative;
  animation: thModalPop .22s ease;
}
@keyframes thModalPop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.th-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.th-modal-close:hover { background: #fee2e2; color: #dc2626; }
.th-modal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.th-modal-brand svg { width: 26px; height: 26px; }
.th-modal-brand span { font-size: 15px; font-weight: 700; color: #0f172a; }
.th-modal h3 { font-size: 20px; color: #0f172a; margin: 8px 0 4px; font-weight: 700; }
.th-modal .th-order-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0 18px;
}
.th-modal .th-order-summary .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #334155;
  gap: 12px;
}
.th-modal .th-order-summary .row + .row { margin-top: 6px; }
.th-modal .th-order-summary .row.total {
  font-weight: 700;
  color: #0f172a;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
  font-size: 16px;
}
.th-modal .th-order-summary .row .amt { color: #8a6116; white-space: nowrap; }
.th-modal .th-order-summary .row.total .amt { color: #0f172a; }

/* ---------- Stripe Elements 卡片 ---------- */
#th-card-element {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
  transition: border-color .15s;
}
#th-card-element.StripeElement--focus { border-color: #b8913a; box-shadow: 0 0 0 3px rgba(212,168,83,.15); }
#th-card-element.StripeElement--invalid { border-color: #ef4444; }
#th-card-element.StripeElement--webkit-autofill { background: #fffdf7; }
.th-email-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  margin-bottom: 8px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.th-email-input:focus { border-color: #b8913a; box-shadow: 0 0 0 3px rgba(212,168,83,.15); }
.th-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.5;
}
.th-error.show { display: block; }
.th-success {
  display: none;
  text-align: center;
  padding: 20px 10px 6px;
}
.th-success.show { display: block; }
.th-success .icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #f0fdf4;
  color: #16a34a;
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.th-success h4 { font-size: 18px; color: #0f172a; margin: 0 0 6px; }
.th-success p { font-size: 13px; color: #64748b; margin: 2px 0; }
.th-success .order-no {
  display: inline-block;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: #0f172a;
  margin: 4px 0;
}
.th-env-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 50px;
  margin-bottom: 8px;
}
.th-env-badge.test { background: #fffbeb; color: #b45309; border: 1px solid #fcd34d; }
.th-env-badge.live { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

.th-pay-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.th-pay-btn:hover:not(:disabled) { background: #1e293b; }
.th-pay-btn:disabled { opacity: .55; cursor: not-allowed; }
.th-pay-btn .lock { font-size: 13px; opacity: .8; }
.th-secure-note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.th-paypal-alt {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.th-paypal-alt a { color: #0f172a; font-weight: 600; text-decoration: none; }
.th-paypal-alt a:hover { color: #b8913a; }

/* RTL */
[dir="rtl"] .th-modal { text-align: right; }
[dir="rtl"] .th-modal-close { right: auto; left: 14px; }
[dir="rtl"] .th-modal .th-order-summary .row { flex-direction: row-reverse; }

@media (max-width: 480px) {
  .th-modal { padding: 22px 18px 20px; }
}
