.wc_payment_method.payment_method_sonnypay label img{ height:30px; } 

.form-container * {
  box-sizing: border-box;
}

.form-container {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  width: 400px;
  max-width: 100%;
  box-sizing: border-box;
}

.input-group {
  margin-bottom: 20px;
  position: relative;
}

#sonny-payment-form label {
  display: block;
  margin-bottom: 5px;
  color: #6b7c93;
  font-size: 14px;
  font-weight: 500;
}

#sonny-payment-form input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid #e0e6ef;
  border-radius: 4px;
  font-size: 16px;
  transition: all 0.3s;
}

.card-icons {
  position: absolute;
  right: 12px;
  top: 38px;
  display: flex;
  gap: 5px;
}

.cvc-icon {
  position: absolute !important;
  right: 12px;
  top: 38px;
  width: 30px;
  opacity: 1;
  height: 20px !important;
  max-width: 30px !important;
}

input:focus {
  outline: none;
  border-color: #6772e5;
  box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.2);
}

.expiry-row {
  display: flex;
  gap: 15px;
}

.expiry-select {
  flex: 1;
  /*padding: 12px;*/
  border: 1px solid #e0e6ef;
  border-radius: 4px;
  font-size: 16px;
  background-color: white;
  cursor: pointer;
  max-width: 48%;
}

.expiry-select:focus {
  outline: none;
  border-color: #6772e5;
  box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.2);
}

.pay-error {
  color: #e25959;
  font-size: 12px;
  /*margin: 5px 0;*/
  position: absolute;
  /*top: 65px;*/
  display: none;
}

button {
  background: #6772e5;
  color: white;
  border: none;
  padding: 15px;
  width: 100%;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

@keyframes rotateIcon {
  0% {
    opacity: 0;
  }
  33.33% {
    opacity: 1;
  }
  66.66% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.rotating-group {
  position: relative;
  width: 30px;
  height: 20px;
}

.rotating-icon {
  position: absolute !important;
  right: 0;
  top: 0;
  opacity: 0;
  margin: unset !important;
  width: 30px;
  height: 20px !important;
  max-width: 30px !important;
}

.rotating-icon.active {
  opacity: 1 !important;
  animation: none !important;
}

#visa-icon {
  animation: rotateIcon 6s infinite;
  animation-delay: 0s;
}

#mastercard-icon {
  animation: rotateIcon 6s infinite;
  animation-delay: 1.2s;
}

#amex-icon {
  animation: rotateIcon 6s infinite;
  animation-delay: 2.4s;
}

#discover-icon {
  animation: rotateIcon 6s infinite;
  animation-delay: 3.6s;
}

#jcb-icon {
  animation: rotateIcon 6s infinite;
  animation-delay: 4.8s;
}

/* 新增错误时红色边框 */
.input-error {
  border-color: #e25959;
  box-shadow: 0 0 0 2px rgba(226, 89, 89, 0.2);
}

/* Modal样式 - 结构优化版 */
.sonnypay-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

/* 使用Flexbox作为容器基础，精确控制布局 */
.sonnypay-modal-content {
  background-color: #fefefe;
  width: 90%;
  max-width: 500px;
  margin: auto; /* 配合父容器居中 */
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalopen 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 关键：使用Flexbox垂直排列内容 */
  display: flex;
  flex-direction: column;
}

/* 头部区域 - 仅包含关闭按钮 */
.sonnypay-modal-header {
  padding: 15px 20px;
}

.sonnypay-close-btn {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto; /* 推到右侧 */
}

.sonnypay-close-btn:hover,
.sonnypay-close-btn:focus {
  color: #e74c3c;
  background-color: #f8f8f8;
  text-decoration: none;
}

/* 主体内容区域 - 紧凑布局 */
.sonnypay-modal-body {
  padding: 0 20px;
  text-align: center;
  color: #555;
  flex: 1; /* 占据可用空间但不拉伸 */
}

#sonnypay-modal-title {
  color: #e74c3c;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px; /* 仅保留底部必要间距 */
}

#sonnypay-modal-message {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 18px; /* 仅保留底部必要间距 */
}

/* 底部操作区域 - 包含按钮和倒计时 */
.sonnypay-modal-footer {
  padding: 0 20px 20px; /* 仅底部和水平方向有内边距 */
  text-align: center;
}

#sonnypay-modal-button {
  width: 30%;
  padding: 5px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
  margin: 0 auto 12px; /* 仅底部有间距 */
  display: inline-block;
}

#sonnypay-modal-button:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

#sonnypay-countdown {
  font-size: 14px;
  color: #999;
  font-style: italic;
  margin: 0; /* 移除默认margin */
}

@keyframes modalopen {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 响应式调整 */
@media (max-width: 480px) {
  .sonnypay-modal-content {
    width: 95%;
  }
  
  #sonnypay-modal-title {
    font-size: 20px;
  }
  
  #sonnypay-modal-button {
    width: 50%;
    padding: 5px;
  }
}
