/* ==================== ریست و پایه ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --dark: #1e293b;
  --gray: #64748b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
}
/*//////////////////////////////////////////////////////////////////
[ FONT ]*/
@font-face {
  font-family: Vazirmatn;
  src: url('../fonts/webfonts/Vazirmatn[wght].woff2'); 
}
 
@font-face {
  font-family: Vazirmatn-Regular;
  src: url('../fonts/webfonts/Vazirmatn-Regular.woff2'); 
}

@font-face {
  font-family: Vazirmatn-Light;
  src: url('../fonts/webfonts/Vazirmatn-Light.woff2'); 
}

@font-face {
  font-family: Vazirmatn-ExtraLight;
  src: url('../fonts/webfonts/Vazirmatn-ExtraLight.woff2'); 
}

@font-face {
  font-family: Vazirmatn-Medium;
  src: url('../fonts/webfonts/Vazirmatn-Medium.woff2'); 
}

@font-face {
  font-family: Vazirmatn-Italic;
  src: url('../fonts/webfonts/Vazirmatn-Italic.woff2'); 
}

@font-face {
  font-family: Vazirmatn-Bold;
  src: url('../fonts/webfonts/Vazirmatn-Bold.woff2'); 
}

@font-face {
  font-family: Vazirmatn-SemiBold;
  src: url('../fonts/webfonts/Vazirmatn-ExtraBold.woff2'); 
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: #fff;
  color: var(--dark);
  line-height: 1.7;
  font-size: 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== دکمه‌ها ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 48px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-ghost:hover { background: rgba(255,255,255,0.25); }

.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-sm { padding: 8px 16px; font-size: 14px; min-height: 38px; }
.btn-block { width: 100%; }

/* ==================== هدر ==================== */
.header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 20px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 24px;
}
.nav a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { color: var(--primary); }

/* ==================== Hero ==================== */
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  padding: 80px 0 100px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 20px;
}
.highlight {
  background: #fbbf24;
  color: var(--dark);
  padding: 4px 16px;
  border-radius: 12px;
  display: inline-block;
}

.hero-sub {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-trust {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 15px;
  opacity: 0.95;
}

/* ==================== بخش‌ها ==================== */
section { padding: 80px 0; }

.section-title {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--gray);
  font-size: 18px;
  margin-bottom: 48px;
}

/* ==================== Steps ==================== */
.steps { background: var(--light); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.step-card {
  background: #fff;
  padding: 32px 24px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.step-num {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  margin: 0 auto 16px;
}

.step-card h3 { font-size: 20px; margin-bottom: 8px; }
.step-card p { color: var(--gray); }

/* ==================== پنل‌ها ==================== */
.panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}
.panel-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(99,102,241,0.15);
}

.panel-card.popular {
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(99,102,241,0.15);
  transform: scale(1.03);
}

.badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.panel-icon { font-size: 48px; margin-bottom: 12px; }
.panel-card h3 { font-size: 24px; margin-bottom: 8px; }
.panel-desc { color: var(--gray); margin-bottom: 20px; font-size: 15px; }

.panel-features {
  list-style: none;
  text-align: right;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--light);
  border-radius: 12px;
}
.panel-features li {
  padding: 6px 0;
  font-size: 15px;
}

.panel-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 20px;
}
.panel-price span { font-size: 14px; color: var(--gray); font-weight: 500; }

/* ==================== نمونه کارها ==================== */
.portfolio { background: var(--light); }

.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter {
  padding: 10px 24px;
  border-radius: 24px;
  border: 2px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter.active, .filter:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.portfolio-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: all 0.3s;
}
.portfolio-card:hover { transform: translateY(-6px); }

.portfolio-img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.portfolio-info { padding: 20px; }
.portfolio-info h4 { font-size: 18px; margin-bottom: 4px; }
.portfolio-info p { color: var(--gray); font-size: 14px; margin-bottom: 12px; }

/* ==================== FAQ ==================== */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  text-align: right;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q span {
  font-size: 24px;
  color: var(--primary);
  transition: transform 0.2s;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s;
  padding: 0 24px;
  color: var(--gray);
}

.faq-item.open .faq-a {
  max-height: 200px;
  padding: 0 24px 20px;
}
.faq-item.open .faq-q span { transform: rotate(45deg); }

/* ==================== CTA پایانی ==================== */
.cta-final {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  text-align: center;
}
.cta-final h2 { font-size: 36px; margin-bottom: 12px; }
.cta-final p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }

/* ==================== فوتر ==================== */
.footer {
  background: var(--dark);
  color: #fff;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
}

/* ==================== واتساپ شناور ==================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37,211,102,0.4);
  z-index: 99;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ==================== مودال ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal.open { display: flex; }

.modal-content {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--light);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

/* نوار پیشرفت */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 8px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
}

.progress-step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
}

.progress-step.active span {
  background: var(--primary);
  color: #fff;
}
.progress-step.active { color: var(--primary); }

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

/* مرحله‌ها */
.modal-step h3 { font-size: 22px; margin-bottom: 8px; }
.modal-sub { color: var(--gray); margin-bottom: 24px; font-size: 15px; }

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.template-card {
  border: 3px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.template-card:hover { border-color: var(--primary); }
.template-card.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}

.template-preview {
  height: 120px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 12px;
}

.template-card h4 { font-size: 16px; margin-bottom: 4px; }
.template-card p { color: var(--gray); font-size: 13px; }

/* خلاصه سفارش */
.order-summary {
  background: var(--light);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: grid;
  gap: 8px;
  font-size: 15px;
}

/* فرم */
#orderForm {
  display: grid;
  gap: 12px;
}

#orderForm input,
#orderForm textarea {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s;
}
#orderForm input:focus,
#orderForm textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== موبایل ==================== */
@media (max-width: 768px) {
  .nav { display: none; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 17px; }
  .section-title { font-size: 26px; }
  .section-sub { font-size: 16px; }
  section { padding: 60px 0; }
  .panel-card.popular { transform: none; }
  .hero-trust { gap: 16px; font-size: 13px; }
  .modal-content { padding: 20px; }
  .progress-step { font-size: 12px; }
  .progress-step span { width: 26px; height: 26px; }
  .progress-line { width: 20px; }
  .cta-final h2 { font-size: 26px; }
}

/* ==================== 🔔 Toast ذخیره خودکار ==================== */
.autosave-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 999;
}
.autosave-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== 🔔 دکمه پیش‌نمایش روی کارت قالب ==================== */
.template-card {
  position: relative;
  padding-bottom: 60px;
}
.btn-preview {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-preview:hover {
  background: var(--primary);
  color: #fff;
}

/* ==================== 🔔 مودال پیش‌نمایش ==================== */
.preview-modal { padding: 0; }
.preview-content {
  max-width: 95vw;
  width: 95vw;
  height: 92vh;
  max-height: 92vh;
  padding: 0;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  gap: 16px;
  flex-wrap: wrap;
}

.preview-title strong {
  font-size: 18px;
  display: block;
}
.preview-hint {
  font-size: 13px;
  color: var(--gray);
}

.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-close-inline {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--light);
  border: none;
  font-size: 16px;
  cursor: pointer;
  margin-right: 8px;
}

.preview-body {
  flex: 1;
  position: relative;
  background: #f1f5f9;
  overflow: hidden;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
  transition: all 0.3s;
}

/* حالت موبایل */
.preview-body.device-mobile {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.preview-body.device-mobile #previewFrame {
  width: 375px;
  height: calc(100% - 40px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  border: 8px solid #1e293b;
}

.preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 5;
  gap: 16px;
}
.preview-loader.hide { display: none; }
.preview-loader p { color: var(--gray); font-size: 15px; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 🎥 مودال ویدیو ==================== */
.video-content {
  max-width: 800px;
}
.video-content h3 {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
}

.video-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  margin-bottom: 20px;
}
.video-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}

.video-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.video-step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.video-step span {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* ==================== حالت دکمه لودینگ ==================== */
.btn-loading { display: inline; }
#submitBtn:disabled { opacity: 0.7; cursor: wait; }

/* ==================== موبایل ==================== */
@media (max-width: 768px) {
  .preview-content {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .preview-header {
    padding: 10px 12px;
  }
  .preview-title strong { font-size: 15px; }
  .preview-hint { display: none; }
  .preview-actions { gap: 4px; }
  .preview-actions .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
  }
  .preview-body.device-mobile #previewFrame {
    width: 100%;
    height: 100%;
    border-width: 4px;
    border-radius: 16px;
  }
  .autosave-toast {
    right: 12px;
    left: 12px;
    bottom: 90px;
    text-align: center;
  }
}

/* ============================================================
   🎨 پنل شخصی‌سازی
   ============================================================ */
.preview-content {
  display: flex !important;
  flex-direction: row !important;
  position: relative;
}

.preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.customize-panel {
  width: 300px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s;
  overflow-y: auto;
  flex-shrink: 0;
}

.customize-panel.open {
  transform: translateX(0);
}

.customize-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}

.customize-header h4 { font-size: 16px; }

.customize-close {
  background: var(--light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.customize-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.customize-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px #fff inset;
}

.color-picker-input {
  width: 100%;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 4px;
}

.logo-upload {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.logo-upload:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}

.logo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.logo-preview span { font-size: 32px; }
.logo-preview p { font-size: 13px; color: var(--gray); }

.logo-preview img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 8px;
}

#shopNameInput,
#fontSelect {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
#shopNameInput:focus,
#fontSelect:focus {
  outline: none;
  border-color: var(--primary);
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  background: var(--light);
  border-radius: 10px;
}
.switch-label input { width: 20px; height: 20px; cursor: pointer; }

/* موبایل */
@media (max-width: 768px) {
  .preview-content { flex-direction: column !important; }
  .customize-panel {
    width: 100%;
    max-height: 60vh;
    border-right: none;
    border-top: 1px solid var(--border);
    transform: translateY(100%);
  }
  .customize-panel.open {
    transform: translateY(0);
  }
}

.payment-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed var(--border);
}

.payment-divider {
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}
.payment-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.payment-divider span {
  background: #fff;
  padding: 0 12px;
  color: var(--gray);
  font-size: 13px;
  position: relative;
}

.payment-cards { display: grid; gap: 10px; margin-bottom: 16px; }

.payment-card-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.payment-card-option:hover { border-color: var(--primary); }
.payment-card-option.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.payment-card-option input { margin-top: 4px; }
.payment-card-option strong { display: block; font-size: 15px; }
.payment-card-option p { font-size: 13px; color: var(--gray); margin: 2px 0 0; }

.payment-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  margin-top: 12px;
}