/* دکمه خرید ۲ مرحله ای - تمام عرض، آبی، فونت از قالب */
.wc-variable-modal-wrapper {
  display: block;
  width: 100%;
  margin: 0.5em 0;
}

.wc-variable-modal-open {
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  padding: 14px 24px;
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}

.wc-variable-modal-open:hover {
  background: #1565c0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.35);
}

/* مودال - RTL، استایل شیک‌تر */
.wc-variable-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  direction: rtl;
  font-family: inherit;
}

.wc-variable-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.wc-variable-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.wc-variable-modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #444;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}

.wc-variable-modal-close:hover {
  background: #e0e0e0;
  color: #222;
}

/* باکس اسم محصول در بالا */
.wc-variable-modal-title-box {
  margin: 0;
  padding: 20px 56px 20px 24px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  background: linear-gradient(180deg, #f8f9fa 0%, #f0f2f5 100%);
  border: 1px solid #e8eaed;
  border-radius: 10px;
  margin: 12px 16px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wc-variable-modal-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.wc-variable-modal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wc-variable-modal-table th,
.wc-variable-modal-table td {
  padding: 14px 12px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
}

.wc-variable-modal-table td {
  vertical-align: middle;
}

.wc-variable-modal-table thead tr {
  background: linear-gradient(180deg, #1976d2 0%, #1565c0 100%);
  color: #fff;
}

.wc-variable-modal-table thead th {
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 16px 12px;
}

.wc-variable-modal-table tbody tr {
  transition: background 0.15s;
}

.wc-variable-modal-table tbody tr:hover {
  background: #f5f7fa;
}

.wc-variable-modal-cell-img {
  width: 100px;
}

.wc-variable-modal-cell-img img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wc-variable-modal-cell-serial {
  text-align: center;
  vertical-align: middle;
  max-width: 240px;
}

.wc-variable-modal-cell-serial .wc-variable-modal-serial-code {
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.wc-variable-modal-cell-serial .wc-variable-modal-serial-desc {
  font-size: 0.88em;
  color: #555;
  line-height: 1.4;
}

.wc-variable-modal-cell-price {
  white-space: nowrap;
  font-weight: 600;
  color: #1565c0;
}

.wc-variable-modal-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wc-variable-modal-qty-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wc-variable-modal-qty-wrap button {
  width: 36px;
  height: 36px;
  border: 1px solid #ccc;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.wc-variable-modal-qty-wrap button:hover {
  background: #e9ecef;
}

.wc-variable-modal-qty-wrap input {
  width: 54px;
  height: 36px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
}

.wc-variable-modal-qty-per-pack {
  font-size: 0.85em;
  color: #666;
}

/* فوتر: پیام تمام‌عرض، سپس تعداد کالا راست و دکمه چپ */
.wc-variable-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #e8eaed;
  background: #fafbfc;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.wc-variable-modal-footer .wc-variable-modal-message {
  flex: 1 1 100%;
  order: -1;
}

.wc-variable-modal-total {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-inline-start: auto;
}

.wc-variable-modal-add-to-cart {
  padding: 14px 32px !important;
  background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
  transition: box-shadow 0.2s, transform 0.1s !important;
}

.wc-variable-modal-add-to-cart:hover {
  background: linear-gradient(180deg, #388e3c 0%, #2e7d32 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}

.wc-variable-modal-add-to-cart:disabled {
  background: #9e9e9e !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

/* پیام در همان پنجره */
.wc-variable-modal-message {
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.wc-variable-modal-message.is-loading {
  background: #e3f2fd;
  color: #1565c0;
}

.wc-variable-modal-message.is-success {
  background: #e8f5e9;
  color: #2e7d32;
}
