/* Section: 支付浮层与二维码展示样式 */

/* Purpose: 提供支付弹窗、支付方式选择、二维码展示、支付成功结果页的统一视觉 */

/* 底部支付按钮（id 化的主按钮） */
.pay-main-button {
  position: fixed;
  bottom: 25px;
  left: 5%;
  z-index: 998;
  width: 90%;
  height: 56px;
  border: 3px solid #f7debf;
  font-size: 16px;
  font-weight: bold;
  line-height: 50px;
  text-align: center;
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(90deg, #409eff, #67c23a, #409eff);
  border-radius: 10px;
  box-shadow: 0 0.2rem 0.8rem rgb(66 88 135 / 35%);
  animation: colorFlow 4s ease infinite;
  background-size: 400%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pay-main-button:active {
  opacity: 0.85;
}

.pay-main-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 通用遮罩层 */
.pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgb(0 0 0 / 55%);
}

.pay-overlay.show {
  display: flex;
}

/* 支付浮层主容器 */
.pay-modal {
  width: 88%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 20%);
  overflow: hidden;
  animation: pay-modal-in 0.2s ease;
}

@keyframes pay-modal-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pay-modal__header {
  position: relative;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #333;
  border-bottom: 1px solid #f1f1f1;
}

.pay-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 28px;
  text-align: center;
  color: #999;
  cursor: pointer;
  user-select: none;
}

.pay-modal__close:hover {
  color: #333;
}

/* 支付方式选择列表 */
.pay-method-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.pay-method-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.pay-method-item:hover {
  background: #fafafa;
}

.pay-method-item[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.pay-method-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-right: 12px;
}

.pay-method-text {
  flex: 1;
  font-size: 15px;
  color: #333;
}

.pay-method-radio {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d0d0d0;
  border-radius: 50%;
  flex-shrink: 0;
}

.pay-method-item.selected .pay-method-radio {
  border-color: #07c160;
}

.pay-method-item.selected .pay-method-radio::after {
  position: absolute;
  inset: 3px;
  background: #07c160;
  border-radius: 50%;
  content: "";
}

/* 二维码展示区 */
.pay-qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 18px 8px;
}

.pay-qrcode__image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 220px;
  height: 220px;
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

.pay-qrcode__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pay-qrcode__loading {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: #888;
  background: rgb(255 255 255 / 85%);
}

.pay-qrcode__hint {
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: #555;
  margin-top: 12px;
}

.pay-qrcode__amount {
  font-size: 18px;
  font-weight: 600;
  color: #e4393c;
  margin-top: 4px;
}

.pay-qrcode__status {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 二维码容器内的"完成支付"按钮 */
.pay-qrcode__action {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 6px;
  padding: 0 18px;
}

.pay-qrcode__action button {
  width: 100%;
  height: 42px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: #07c160;
  border-radius: 21px;
  cursor: pointer;
}

.pay-qrcode__action button:active {
  opacity: 0.85;
}

/* 支付成功结果页 */
.pay-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px 18px;
}

.pay-success__check {
  width: 56px;
  height: 56px;
  font-size: 36px;
  line-height: 56px;
  text-align: center;
  color: #fff;
  background: #07c160;
  border-radius: 50%;
  margin-bottom: 12px;
}

.pay-success__title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.pay-success__sub {
  font-size: 13px;
  text-align: center;
  color: #888;
  margin-bottom: 14px;
}

.pay-success__qrcode-img {
  width: 200px;
  height: 200px;
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 6px;
}

.pay-success__tip {
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: #e4393c;
  margin-top: 14px;
}

/* 错误提示 */
.pay-error {
  padding: 36px 18px;
  font-size: 14px;
  text-align: center;
  color: #888;
}

.pay-error__retry {
  display: inline-block;
  padding: 8px 22px;
  font-size: 14px;
  color: #fff;
  background: #409eff;
  border-radius: 18px;
  cursor: pointer;
  margin-top: 14px;
}

/* Section: 移动端 iframe 收银台遮罩 */

/* Purpose: 在手机端 (微信内/外) 用 iframe 嵌入 pay_url 收银台,
   收银台 closeWindow 只关 iframe 不影响商户页 */
.pay-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  background: #fff;
}

.pay-iframe-overlay.show {
  display: flex;
}

.pay-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pay-iframe-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 36px;
  text-align: center;
  color: #333;
  background: rgb(255 255 255 / 85%);
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
}

.pay-iframe-tip {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 10px 12px;
  font-size: 12px;
  text-align: center;
  color: #fff;
  background: rgb(0 0 0 / 60%);
}
