/* =========================
   فرم پرداخت WCM Checkout
========================= */
.wcm-checkout-container {
  max-width: 760px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  direction: rtl;
}

/* =========================
   Steps Section (اصلاح شده)
========================= */
.wcm-steps.modern-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 40px;
  padding: 0 20px;
}

.wcm-steps.modern-steps .step {
  position: relative;
  text-align: center;
  flex: 1;
}

/* خط بین مراحل */
.wcm-steps.modern-steps .step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 20px;
  right: -50%;
  width: 100%;
  height: 3px;
  background: #d9dce3;
  z-index: 1;
}

.wcm-steps.modern-steps .step.completed + .step::before {
  background: #1a73e8;
}

.wcm-steps.modern-steps .step.completed::before {
  background: #1a73e8;
}

.wcm-steps.modern-steps .circle {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  border: 3px solid #d9dce3;
  background: #fff;
  color: #7b8190;
  font-weight: bold;
  margin: 0 auto 8px;
  position: relative;
  z-index: 3;
  transition: 0.3s;
}

.wcm-steps.modern-steps .label {
  font-size: 13px;
  color: #6b7280;
  position: relative;
  z-index: 3;
}

.wcm-steps.modern-steps .step.completed .circle {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.wcm-steps.modern-steps .step.active .circle {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 0 0 6px rgba(26,115,232,0.15);
}

.wcm-steps.modern-steps .step.active .label {
  font-weight: bold;
  color: #1a73e8;
}

/* =========================
   فرم فیلدها و چک‌باکس
========================= */
.wcm-checkout-form .form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 18px;
}

.wcm-checkout-form .form-row.single {
  flex-direction: column;
}

.wcm-checkout-form input,
.wcm-checkout-form select {
  width: 100%;
  height: auto !important;
  padding: 12px 15px; /* بهینه‌سازی پدینگ داخلی برای فیلدها جهت لمس راحت در موبایل */
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
  height: auto !important;
}

.wcm-checkout-form input:focus,
.wcm-checkout-form select:focus {
  border-color: #1a73e8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
  outline: none;
}

/* چک‌باکس قوانین */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

/* =========================
   درگاه‌های پرداخت
========================= */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 25px;
}

.gateway-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.gateway-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gateway-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}

.gateway-content img {
  height: 36px;
  width: auto;
  display: block;
}

.gateway-check {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  transition: all 0.25s ease;
  z-index: 2;
}

.gateway-check::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #1a73e8;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.gateway-option:hover .gateway-content {
  border-color: #c1d8fc;
  background: #f8fbff;
  transform: translateY(-2px);
}

.gateway-option input[type="radio"]:checked + .gateway-check {
  border-color: #1a73e8;
}

.gateway-option input[type="radio"]:checked + .gateway-check::after {
  transform: scale(1);
}

.gateway-option input[type="radio"]:checked ~ .gateway-content {
  border-color: #1a73e8;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.15);
}

/* =========================
   مبلغ و دکمه پرداخت
========================= */
.amount-section {
  background: #f8faff;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e5edff;
  margin-bottom: 10px;
  font-size: 16px;
}

.pay-button {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 15px 25px;
  border-radius: 10px;
  font-size: 17px;
  width: 100%;
  box-shadow: 0 5px 18px rgba(26, 115, 232, 0.35);
  cursor: pointer;
  transition: 0.3s;
}

.pay-button:hover {
  background: #155fc3;
}

/* =======================================
   کارت بانکی و لوگو بانک (اصلاح ساختار یکپارچه)
======================================= */
.card-bank-wrapper {
  position: relative;
  width: 100%;
  display: block; /* بازگشت به ساختار بلاکی یکپارچه */
}

/* فیلد ورودی کارت بانکی تمام عرض */
#bank_card {
  width: 100%;
  padding-left: 55px; /* ایجاد حاشیه امن در سمت چپ برای عدم همپوشانی متن با لوگو */
  direction: ltr; /* شماره کارت برای خوانایی و فرمت‌دهی بهتر چپ به راست باشد */
  text-align: right; /* شروع نوشتن از سمت راست اما با ساختار چپ‌چین برای اعداد */
}

/* محل قرارگیری لوگوی پیش‌نمایش بانک به صورت مطلق داخل فیلد */
#bank_logo_preview {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none; /* غیرفعال کردن کلیک روی تصویر برای کلیک راحت روی اینپوت */
}

#bank_logo_preview img {
  height: 26px; /* ارتفاع کاملاً متناسب برای جاگیری تمیز درون فیلد ورودی */
  max-width: 45px;
  object-fit: contain;
  display: block;
}

/* =========================
   نمایش مودال خطاها
========================= */
.wcm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}

.wcm-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  direction: rtl;
}

.wcm-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.wcm-modal-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #c0392b;
}

.wcm-modal-message {
  font-size: 1rem;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.7;
}

.wcm-modal-close {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 1rem;
  cursor: pointer;
}

.wcm-modal-close:hover {
  background: #a93226;
}

/* =========================
   Responsive (موبایل و تبلت)
========================= */
@media (max-width: 768px) {
  .wcm-checkout-container {
    margin: 15px;
    padding: 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .gateway-grid {
    grid-template-columns: 1fr;
  }
}
