/* Mahoor font */
@font-face {
  font-family: 'Mahoor';
  src: url('font/mahoor.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Base */
:root {
  /* theme (green / brand) */
  --brand: #156f48;          /* main green */
  --brand-600: #0f5c3b;
  --brand-700: #0b4b31;
  --brand-100: #e6f3ec;

  --color-bg: #f7f8f6;
  --color-surface: #ffffff;
  --color-text: #1b1f1a;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-primary: var(--brand);
  --color-primary-hover: var(--brand-600);
  --color-accent: var(--brand);
  --color-accent-hover: var(--brand-600);
  --radius: 8px;
  --container: 1200px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Mahoor", "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

/* Ensure controls use same font */
button, input, select, textarea { font-family: inherit; }

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }

/* Accessibility */
.skip-link {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -100px;
  background: var(--color-primary); color: #fff; padding: 0.5rem 0.75rem; border-radius: 8px;
  transition: 0.2s;
}
.skip-link:focus { inset-block-start: 1rem; }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  padding-inline: 20px;
  margin-inline: auto;
}

/* Buttons */
.btn { appearance: none; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: background .2s, border-color .2s, color .2s, box-shadow .2s; font-weight: 700; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 6px 14px rgba(21,111,72,.16); }
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(
--color-border);
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(0,0,0,0.05); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: center;
  height: 70px;
  gap: 16px;
}
.brand {
  display: flex; align-items: center;
}
.logo-link {
  display: flex; align-items: center; text-decoration: none;
}
.logo-img {
  height: 40px; width: auto; display: block;
}
.header-center {
  flex: 1; display: flex; justify-content: center; align-items: center;
}
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(148,163,184,0.1);
  padding: 8px 16px; border-radius: 20px;
  font-size: 0.9rem;
}
.user-name {
  color: var(--color-text);
}
.user-icon {
  font-size: 1rem;
}
.header-icons {
  display: flex; align-items: center; gap: 12px;
}
.icon-btn {
  appearance: none; border: none; background: transparent;
  color: var(--color-text); font-size: 1.2rem; cursor: pointer;
  padding: 8px; border-radius: 6px; position: relative;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.cart-btn {
  position: relative;
}
.cart-badge {
  position: absolute; top: 2px; left: 2px;
  background: #16a34a; color: white;
  border-radius: 50%; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600;
  line-height: 1;
}

/* Mobile Navbar */
.mobile-navbar { display: none; }
.mobile-navbar .nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 16px; text-decoration: none;
  color: var(--color-muted);
  transition: color 0.2s;
  border-radius: 8px;
}
.mobile-navbar .nav-item:active {
  color: var(--color-primary);
  background: rgba(0,0,0,0.05);
}
.nav-icon {
  font-size: 1.5rem;
}
.nav-label {
  font-size: 0.75rem;
}

/* Desktop/Mobile visibility */
.desktop-only {
  display: none;
}

/* Exit Warning Modal */
.exit-modal-dialog {
  max-width: 400px;
}
.exit-message {
  text-align: center; margin: 20px 0;
  font-size: 1rem; color: var(--color-text);
}
.exit-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 24px;
}
.exit-actions .btn {
  min-width: 100px;
}

/* Product Page */
.product-page { padding: 0; }
.product-container {
  display: grid; grid-template-columns: 1fr;
  min-height: calc(100vh - 70px);
}
.product-image-section {
  background: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 32px 16px;
}
.image-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
}
.product-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}
.product-image:hover {
  transform: scale(1.01);
}
.image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.image-nav:hover { background: rgba(0,0,0,0.75); }
.image-nav:focus-visible {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: 0;
}
.image-nav.prev { left: 12px; }
.image-nav.next { right: 12px; }

.image-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 600px;
}
.thumbnail-button {
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thumbnail-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color 0.2s ease;
}
.thumbnail-button:hover,
.thumbnail-button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
.thumbnail-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.thumbnail-button.active::after {
  border-color: var(--color-primary, #0c854e);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: min(900px, 90vw);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.lightbox-content img {
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.lightbox-nav {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,0.22);
}

.product-details-section {
  background: var(--color-surface); padding: 40px 20px;
  display: flex; flex-direction: column; gap: 24px;
}
.product-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.product-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.product-title {
  margin: 0; font-size: 1.75rem; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
}
.bookmark-btn {
  appearance: none; border: none; background: transparent;
  font-size: 1.5rem; cursor: pointer; padding: 8px;
}
.product-price {
  font-size: 1.5rem; font-weight: 600; color: var(--color-text);
}
.color-section { display: flex; flex-direction: column; gap: 12px; }
.color-options {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.color-swatch {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.2s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--color-text); }
.color-info {
  margin: 0; font-size: 0.9rem; color: var(--color-muted);
}
.btn-order {
  width: 100%; height: 50px; background: var(--color-primary);
  color: white; border: none; border-radius: 6px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-order:hover { background: var(--color-primary-hover); }
.expandable-sections { display: flex; flex-direction: column; gap: 8px; }
.expandable-item {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
}
.expandable-item summary {
  cursor: pointer; font-weight: 500; padding: 8px 0;
  list-style: none; position: relative;
}
.expandable-item summary::-webkit-details-marker { display: none; }
.expandable-item summary::after {
  content: '›'; position: absolute; left: 0;
  transition: transform 0.2s;
}
.expandable-item[open] summary::after { transform: rotate(90deg); }
.expandable-content {
  padding: 12px 0; color: var(--color-muted);
  font-size: 0.9rem;
}
.product-specs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text);
}
.product-specs li strong {
  color: var(--color-muted);
  font-weight: 600;
  margin-inline-end: 4px;
}
.social-icons {
  display: flex; gap: 16px; margin-top: 16px;
}
.social-icons a {
  color: var(--color-text); font-size: 1.2rem;
  text-decoration: none; font-weight: 600;
}


/* Reveal animations */
.reveal { opacity: 0; transform: translateY(12px); transition: 600ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 100; }
.modal[aria-hidden="false"] { display: flex; }
.modal .modal-dialog { width: min(720px, 96vw); }
.modal .modal-content { background: var(--color-surface); border-radius: 12px; padding: 16px; box-shadow: none; overflow: auto; border: none; }
/* Progress header */
.progress-header {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 12px;
  position: absolute;
  left: 0;
  right: 0;
  top: 90px;
  z-index: 2;
}
.progress-logo {
  height: 28px;
  opacity: .95;
  margin: 6px auto 90px;
  display: block;
}
/* edge-to-edge progress bar (RTL) */
.checkout-progress {
  --progress: 0; /* number 0..100 (deprecated) */
  --progress-pct: 0%; /* preferred percent */
  --dot: 20px;
  --line: 2px;
  --pad: calc(var(--dot) / 2);
  position: relative;
  display: flex;
  padding: 0;
  justify-content: center;
}
.checkout-progress::before{ content:""; position:absolute; left:0; right:0; top:12px; height:var(--line); background:#E5E7EB; z-index:1; border-radius:999px; }
.checkout-progress::after{ content:""; position:absolute; right:var(--pad); top:12px; height:var(--line); width: calc((100% - (var(--pad) * 2)) * var(--progress-pct, var(--progress))); background: var(--brand); z-index:2; border-radius:999px; transition: width .25s ease; }
.progress-step {
  position: relative;
  flex: 0.17;
  text-align: center;
  margin-top: 3px;
}
.progress-step .dot{ width:var(--dot); height:var(--dot); border-radius:999px; background:#D1D5DB; border:2px solid #D1D5DB; margin:0 auto; position:relative; z-index:2; }
.progress-step.completed .dot{ background: var(--brand); border-color: var(--brand); }
.progress-step.active .dot{ background: var(--brand); border-color: var(--brand); }
.progress-step .label{ margin-top:6px; font-size:.72rem; line-height:1; color:#94A3B8; }
.progress-step.active .label{ color: var(--brand-700); font-weight:700; }
.progress-step.completed .label{ color: var(--brand-700); }
.modal .modal-title { margin: 0 0 12px 0; }
/* دکمه‌های پایانی در هر مرحله همیشه در دید کاربر بمانند */
.step .actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--color-surface) 16px); padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--color-border); }
/* Modal افزودن آدرس باید بالای modal اصلی باشد */
#addAddressModal { z-index: 200; }
/* Modal حذف آدرس هم بالاتر از modal اصلی باشد */
#deleteAddressModal { z-index: 210; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
/* backdrop برای modal افزودن آدرس باید تیره‌تر باشد */
#addAddressModal .modal-backdrop { background: rgba(0,0,0,0.7); }
/* برای مودال حذف هم کمی تیره‌تر */
#deleteAddressModal .modal-backdrop { background: rgba(0,0,0,0.7); }

/* بهینه‌سازی ویژه موبایل برای کاهش ارتفاع و جلوگیری از پرش */
@media (max-width: 640px) {
  .modal { align-items: stretch; }
  /* استفاده از 100dvh برای پوشش کامل ارتفاع با نوارهای داینامیک موبایل */
  .modal .modal-dialog { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; display: flex; background: var(--color-surface); }
  .modal .modal-content { padding: 12px; border-radius: 0; height: 95dvh; width: 100%; display: flex; flex-direction: column; padding-bottom: calc(env(safe-area-inset-bottom, 0) + 12px); box-shadow: none; border: none; }
  .step { flex: 1 1 auto; overflow: auto; min-height: 0; }
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .form-group { margin-bottom: 10px; }
  .address-list-scrollable { max-height: 160px; }
}

/* Full-height address list in order step (substep 2) */
#orderAddressSection { display: flex; flex-direction: column; gap: 12px; }
#orderAddressSection .address-section { flex: 1 1 auto; display: flex; flex-direction: column; }
#orderAddressSection #addressList { flex: 1 1 auto; overflow: auto; max-height: none; }

/* Full-height carrier list in order step (substep 3) */
#orderCarrierSection { display: flex; flex-direction: column; gap: 12px; }
#orderCarrierSection .address-section { flex: 1 1 auto; display: flex; flex-direction: column; }
#orderCarrierSection #carrierList { flex: 1 1 auto; overflow: auto; max-height: none; }
#orderCarrierSection .address-item{
  display: grid;
}
#orderCarrierSection .address-item input{
  margin: 2px auto 0 auto;
}
.modal-dialog {
  position: relative; width: min(92vw, 520px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 24px; z-index: 1;
}
.modal-title { margin: 0 0 16px; font-size: 1.25rem; font-weight: 600; }
.modal-close { position: absolute; inset-inline-end: 10px; inset-block-start: 8px; background: transparent; color: var(--color-text); border: none; font-size: 24px; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(0,0,0,0.05); border-radius: 4px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #374151; }
.input-row { display: grid; gap: 8px; }
.input-row input { height: 44px; border-radius: 12px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text); font-size: 1rem; }
.input-row input:focus { outline: none; border-color: var(--color-primary); }
.form-hint { margin: 8px 0 0; color: var(--color-muted); font-size: 0.85rem; }
.form-error { margin-top: 8px; color: #dc2626; background: #fee2e2; border: 1px solid #fecaca; padding: 10px 12px; border-radius: 6px; font-size: 0.9rem; }
.dynamic-fields { display: grid; gap: 16px; }
.dynamic-fields .form-label { margin-bottom: 8px; }
.dynamic-fields input { width: 100%; height: 44px; border-radius: 12px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text); font-size: 1rem; }
.dynamic-fields input:focus { outline: none; border-color: var(--color-primary); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.muted { color: var(--color-muted); }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--color-border); border-top-color: var(--color-primary); animation: spin 0.9s linear infinite; margin: 16px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.captcha-section { margin-top: 12px; }
.captcha-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.captcha-box {
  display: flex; align-items: center; gap: 8px; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 8px;
}
.captcha-image { width: 120px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--color-border); }
.captcha-refresh { height: 36px; }
.captcha-input { height: 44px; border-radius: 12px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text); }
.captcha-input:focus { outline: none; border-color: var(--color-primary); }

/* Step styles */
.step-title { margin: 0 0 10px; font-size: 1.2rem; font-weight: 600; }
.step input[type="text"],
.step input[type="email"],
.step input[type="tel"],
.step textarea {
  width: 100%; height: 44px; border-radius: 12px; padding: 10px 12px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text); font-size: 1rem;
}
/* اگر input داخل form-row-2 نباشد، margin-bottom دارد */
.step > input[type="text"],
.step > input[type="email"],
.step > input[type="tel"],
.step > textarea {
  margin-bottom: 16px;
}
.step textarea {
  height: auto; padding: 12px; resize: vertical; min-height: 80px;
}
.step input:focus, .step textarea:focus {
  outline: none; border-color: var(--color-primary);
}

/* Invoice Summary */
/* Invoice summary card */
.invoice-summary { border:1px solid var(--color-border); border-radius:12px; padding:12px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.03); margin-bottom:12px; }
.invoice-item { display:flex; align-items:center; justify-content:space-between; padding:8px 0; border-bottom:1px dashed #e5e7eb; }
.invoice-item:last-child { border-bottom:none; font-weight:700; }
.invoice-item span:first-child { color:#6b7280; }
.invoice-item.invoice-total {
  font-weight: 600; font-size: 1.1rem; margin-top: 8px;
  padding-top: 12px;
  border-bottom: none;
}
.invoice-item.discount-item {
  color: #16a34a;
}

/* Discount Section */
.discount-section {
  margin-bottom: 20px;
}
.discount-section .input-row {
  margin-top: 8px;
}
.discount-section .input-row input{ border-radius:12px; }

/* Payment Section */
.payment-section {
  margin-bottom: 20px;
}
.payment-options {
  display: flex; flex-direction: column; gap: 12px; margin-top: 12px;
}
.payment-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.payment-option:hover {
  background: rgba(0,0,0,0.02); border-color: var(--color-primary);
}
.payment-option input[type="radio"] {
  width: 18px; height: 18px; cursor: pointer;
}
.payment-option span {
  font-size: 1rem; cursor: pointer;
}
.payment-option input[type="radio"]:checked ~ span {
  font-weight: 600; color: var(--color-primary);
}

.actions {
  display: flex; gap: 12px; justify-content: space-between; margin-top: 24px;
}
.actions .btn { min-width: 150px; }

/* Form Row - Two Columns */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group .form-label {
  margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1rem;
}
.form-group textarea {
  height: auto;
  padding: 12px;
  resize: vertical;
  min-height: 80px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Referral Code Wrapper */
.referral-code-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.referral-code-wrapper input {
  flex: 1;
  margin: 0;
  width: auto;
  min-width: 0;
}

.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: auto;
  flex-shrink: 0;
}

.referral-code-wrapper .form-hint {
  margin-top: 4px;
  font-size: 0.85rem;
}

.referral-code-wrapper .form-hint.success {
  color: #16a34a;
}

.referral-code-wrapper .form-hint.error {
  color: #dc2626;
}
.form-group select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive: Single column on mobile */
@media (max-width: 639px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-group {
    margin-bottom: 16px;
  }
}

/* Address Section */
.address-section {
  margin-bottom: 20px;
}
.address-list {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px;
}
.address-list-scrollable {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.address-list-scrollable::-webkit-scrollbar {
  width: 6px;
}
.address-list-scrollable::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: 3px;
}
.address-list-scrollable::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
.address-list-scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}
.address-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border); border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.address-item:hover {
  background: rgb(233 255 245);
  border-color: var(--color-primary);
}
.address-item input[type="radio"] {
  width: 20px; height: 20px; cursor: pointer; margin-top: 2px;
  flex-shrink: 0;
}
.address-item input[type="radio"]:checked ~ .address-item-content {
  color: var(--color-primary);
}
.address-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
#bankList .address-item-content{
  align-items: center;
  flex-direction: row;
}
.address-item-actions {
  display: flex; align-items: center; gap: 8px;
}
.address-delete-btn {
  appearance: none; border: none; background: transparent; cursor: pointer;
  color: #dc2626; font-size: 18px; padding: 4px; border-radius: 6px;
}
.address-delete-btn img {
  width: 20px;
  height: auto;
  display: block;
}
.address-delete-btn:hover { background: rgba(220,38,38,0.08); }
.address-item-title {
  font-weight: 600; 
  font-size: 0.9rem; 
  color: var(--color-text);
  display: block;
}
.address-item-text {
  font-size: 0.9rem; 
  color: var(--color-muted);
  display: block;
  line-height: 1.5;
}
.payment-section .address-item-text {
 margin-right: auto;
}
.address-item-text img{
  height: 45px !important;
  width: 45px;
  object-fit: cover;
}
.address-item input[type="radio"]:checked ~ .address-item-content .address-item-text {
  color: var(--color-text);
}
.carrier-price { font-weight: 600; }
.carrier-delay { color: var(--color-muted); font-size: .85rem; }
.new-address-form {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* Error Debug Modal */
.error-modal-dialog {
  max-width: 500px;
}
.error-debug-content {
  margin: 20px 0;
}
.error-message {
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  padding: 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}
.error-details {
  margin-top: 16px;
}
.error-details summary {
  user-select: none;
}
.error-details-text {
  background: #1a1a1a;
  color: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Desktop ≥ 1024px */
@media (min-width: 1024px) {
  .product-container {
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 70px);
  }
  .product-image-section {
    padding: 60px 40px;
  }
  .product-details-section {
    padding: 60px 40px;
  }
  .product-title { font-size: 2rem; }
  .desktop-only {
    display: flex;
  }
  .mobile-navbar {
    display: none;
  }
  /* اضافه کردن padding-bottom برای محتوا در موبایل */
  .product-page {
    padding-bottom: 70px;
  }
  /* Desktop: hide progress bar and header */
  .checkout-progress { display: none !important; }
  .progress-header { display: none !important; }
  .progress-logo { margin: 6px auto 8px; height: 28px; }
}

/* Mobile adjustments */
@media (max-width: 1023px) {
  .product-page {
    padding-bottom: 70px; /* فضا برای navbar پایین */
  }
  .header-center {
    display: none; /* مخفی کردن بخش مرکزی در موبایل */
  }
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}
.otp-inputs .otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.otp-inputs .otp-digit:focus {
  outline: none;
  border-color: var(--color-primary, #166534);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.2);
}


