/* =========================================================
   فروشگاه الکترونیکی - استایل اصلی (نسخه بازنویسی شده)
   رنگ‌بندی: آبی سرمه‌ای (#1A2A4A) و سفید
   ========================================================= */

/* ── ریست و متغیرها ── */
:root {
  --primary:       #1A2A4A;
  --primary-light: #243a66;
  --primary-dark:  #111c33;
  --accent:        #2979FF;
  --accent-hover:  #1565C0;
  --white:         #FFFFFF;
  --bg:            #F4F6FA;
  --bg-card:       #FFFFFF;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --border:        #e2e8f0;
  --success:       #16a34a;
  --error:         #dc2626;
  --warning:       #d97706;
  --discount:      #dc2626;
  --shadow-sm:     0 1px 4px rgba(26,42,74,.08);
  --shadow-md:     0 4px 16px rgba(26,42,74,.12);
  --shadow-lg:     0 8px 32px rgba(26,42,74,.16);
  --radius:        10px;
  --radius-sm:     6px;
  --transition:    .22s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  direction: rtl;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
  height: auto;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input, textarea, select {
  font-family: inherit;
}

/* ── کانتینر ── */
.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   هدر
   ========================================================= */
.main-header {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}
.logo i {
  color: #64b5f6;
  font-size: 1.5rem;
}
.logo-img {
  height: 50px;
  width: auto;
  display: block;
}

/* جستجو */
.search-wrapper {
  flex: 1;
  position: relative;
}
.search-form {
  display: flex;
}
.search-form input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0; /* راست‌چین: گردی سمت چپ */
  font-size: .95rem;
  outline: none;
  background: rgba(255,255,255,.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.2);
  border-left: none; /* برای جلوگیری از دوگانگی */
  transition: background var(--transition);
}
.search-form input::placeholder {
  color: rgba(255,255,255,.55);
}
.search-form input:focus {
  background: rgba(255,255,255,.2);
}
.search-form button {
  padding: 10px 18px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius) 0 0 var(--radius); /* راست‌چین: گردی سمت راست */
  font-size: 1rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.search-form button:hover {
  background: var(--accent-hover);
}

/* پیشنهادات جستجو */
.search-suggestions {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--white);
  color: var(--text);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.search-suggestions.open {
  display: block;
}
.suggestion-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.suggestion-item:hover {
  background: var(--bg);
}
.suggestion-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* دکمه‌های هدر */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  font-size: .9rem;
  white-space: nowrap;
}
.btn-icon:hover {
  background: rgba(255,255,255,.15);
}
.btn-admin {
  background: rgba(41,121,255,.3);
}
.cart-btn {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--discount);
  color: var(--white);
  font-size: .7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.3rem;
  padding: 8px;
}

/* ناوبری دسته‌ها */
.category-nav {
  background: var(--primary-light);
}
.cat-list {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}
.cat-list::-webkit-scrollbar {
  display: none;
}
.cat-list li a {
  display: block;
  padding: 10px 16px;
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  white-space: nowrap;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
}
.cat-list li a:hover,
.cat-list li a.active {
  color: var(--white);
  border-bottom-color: var(--accent);
}
.special-link {
  color: #ffd54f !important;
  font-weight: 700;
}

/* =========================================================
   Flash Messages
   ========================================================= */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  margin: 10px 0;
  border-radius: var(--radius);
  font-weight: 500;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.flash-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.flash-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.flash-close {
  margin-right: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
}

/* =========================================================
   محتوای اصلی
   ========================================================= */
.main-content {
  min-height: calc(100vh - 200px);
}

/* =========================================================
   اسلایدر
   ========================================================= */
.slider-section {
  position: relative;
  overflow: hidden;
  background: var(--primary-dark);
}
.slider-track {
  display: flex;
  transition: transform .6s ease;
}
.slide {
  min-width: 100%;
  position: relative;
  height: 420px;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .7;
}
.slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 20px;
}
.slide-content h2 {
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.slide-content p {
  font-size: 1.1rem;
  margin-top: 8px;
  opacity: .9;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(26,42,74,.6);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  z-index: 10;
}
.slider-btn:hover {
  background: var(--accent);
}
.slider-prev {
  right: 16px;
}
.slider-next {
  left: 16px;
}
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.slider-dot.active {
  background: var(--white);
}

/* =========================================================
   کارت‌های محصول
   ========================================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 20px;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  padding-right: 14px;
}
.section-title::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 4px;
}
.view-all {
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
}
.view-all:hover {
  text-decoration: underline;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 32px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: var(--discount);
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.product-img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img {
  transform: scale(1.06);
}
.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 2.5rem;
}

.product-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.product-stock {
  font-size: .8rem;
  color: var(--success);
}
.product-stock.out {
  color: var(--error);
}

.product-pricing {
  margin-top: auto;
}
.price-original {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price-final {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}
.price-final.discounted {
  color: var(--discount);
}

.btn-cart {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cart:hover {
  background: var(--accent);
}
.btn-cart:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

/* ── علاقه‌مندی (قلب) کنار سبد خرید ── */
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.product-actions .btn-cart,
.product-actions .btn-add-cart {
  width: auto;
  flex: 1;
  margin-top: 0;
}
.btn-wishlist {
  flex: 0 0 auto;
  width: 42px;
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  color: #a0a0a0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-wishlist:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}
.btn-wishlist.active {
  background: #fdecea;
  border-color: #e74c3c;
  color: #e74c3c;
}
.btn-wishlist:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.btn-wishlist.btn-wishlist-lg {
  width: 54px;
  font-size: 1.2rem;
}

/* =========================================================
   صفحه محصولات (فیلتر)
   ========================================================= */
.products-page {
  display: flex;
  gap: 24px;
  padding: 24px 0;
}
.filter-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 76px;
}
.filter-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}
.filter-group {
  margin-bottom: 20px;
}
.filter-group label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.filter-group input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
  margin-bottom: 6px;
}
.filter-check input {
  accent-color: var(--accent);
}
.products-area {
  flex: 1;
}
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 8px;
}
.sort-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--white);
}

/* =========================================================
   صفحه جزئیات محصول
   ========================================================= */
.product-detail {
  display: flex;
  gap: 40px;
  padding: 32px 0;
}
.product-gallery {
  flex: 1;
}
.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8f9fa;
  aspect-ratio: 1;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.gallery-thumb.active {
  border-color: var(--accent);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info {
  flex: 1;
}
.product-detail-info h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.detail-price-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.detail-price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: .9rem;
}
.detail-price-final {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.detail-price-final.disc {
  color: var(--discount);
}
.detail-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  margin-bottom: 12px;
}
.badge-in {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-out {
  background: #fee2e2;
  color: #b91c1c;
  padding: 3px 10px;
  border-radius: 20px;
}
.qty-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.qty-wrap label {
  font-weight: 600;
}
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.qty-btn:hover {
  background: var(--primary);
  color: var(--white);
}
.qty-input {
  width: 52px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: .95rem;
  outline: none;
}
.btn-add-cart {
  padding: 13px 32px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-add-cart:hover {
  background: var(--accent);
}
.product-description {
  margin-top: 24px;
}
.product-description h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* نظرات */
.reviews-section {
  padding: 32px 0;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.review-author {
  font-weight: 700;
  font-size: .95rem;
}
.stars {
  color: #f59e0b;
  font-size: 1rem;
}
.review-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 100px;
  font-size: .9rem;
}

/* =========================================================
   سبد خرید
   ========================================================= */
.cart-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 32px 0;
}
.cart-table {
  width: 100%;
  border-collapse: collapse;
}
.cart-table th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  text-align: right;
  font-weight: 600;
  font-size: .9rem;
}
.cart-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.cart-item-name {
  font-weight: 600;
  font-size: .95rem;
}
.cart-remove {
  background: none;
  border: none;
  color: var(--error);
  font-size: 1.1rem;
  cursor: pointer;
}
.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 80px;
}
.cart-summary h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
}
.summary-total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.btn-checkout {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 16px;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-checkout:hover {
  background: var(--accent);
}

/* =========================================================
   فرایند پرداخت (Checkout Steps)
   ========================================================= */
.checkout-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 24px 0 32px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-muted);
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all var(--transition);
}
.step.active .step-num {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.step.done .step-num {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}
.step.done + .step-line {
  background: var(--success);
}

.checkout-box {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.checkout-box h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary);
}

/* انتخاب روش ارسال */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shipping-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.shipping-opt:hover {
  border-color: var(--accent);
  background: #f0f4ff;
}
.shipping-opt input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
.shipping-opt-info {
  flex: 1;
}
.shipping-opt-name {
  font-weight: 700;
  font-size: .95rem;
}
.shipping-opt-desc {
  font-size: .82rem;
  color: var(--text-muted);
}
.shipping-opt-cost {
  font-weight: 700;
  color: var(--primary);
  font-size: .9rem;
}

/* کد تخفیف */
.coupon-form {
  display: flex;
  gap: 10px;
}
.coupon-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  outline: none;
}
.coupon-form input:focus {
  border-color: var(--accent);
}
.btn-apply {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background var(--transition);
}
.btn-apply:hover {
  background: var(--accent-hover);
}

/* صفحه پرداخت نهایی */
.payment-box {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f5e9 100%);
  border-radius: var(--radius);
  border: 2px dashed var(--accent);
}
.payment-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}
.payment-card {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 4px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 12px 0;
}
.payment-msg {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.8;
  margin-top: 12px;
}
.btn-copy {
  margin-top: 8px;
  padding: 8px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-copy:hover {
  background: var(--border);
}

/* =========================================================
   فرم‌ها (ورود / ثبت‌نام)
   ========================================================= */
.auth-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.auth-tab-content {
  display: none;
}
.auth-tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
}
.form-group label span.req {
  color: var(--error);
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,121,255,.1);
}
.form-error {
  font-size: .82rem;
  color: var(--error);
  margin-top: 4px;
}
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition);
}
.btn-primary:hover {
  background: var(--accent);
}

/* =========================================================
   پنل کاربری داشبورد
   ========================================================= */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 32px 0;
}
.dashboard-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: fit-content;
}
.dashboard-user {
  background: var(--primary);
  color: var(--white);
  padding: 20px;
  text-align: center;
}
.dashboard-user i {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: .8;
}
.dashboard-user .uname {
  font-weight: 700;
  font-size: 1rem;
}
.dashboard-user .uemail {
  font-size: .82rem;
  opacity: .7;
}
.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  color: var(--text);
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: #f0f4ff;
  color: var(--accent);
}
.dashboard-nav a i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
}
.dashboard-nav a.active i {
  color: var(--accent);
}

.dashboard-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.dashboard-tab {
  display: none;
}
.dashboard-tab.active {
  display: block;
}

/* جدول سفارشات */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}
.orders-table th {
  background: var(--bg);
  padding: 11px 14px;
  text-align: right;
  font-weight: 700;
  font-size: .88rem;
  color: var(--text-muted);
}
.orders-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.orders-table tr:last-child td {
  border-bottom: none;
}
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.status-pending    { background: #fef3c7; color: #92400e; }
.status-confirmed  { background: #d1fae5; color: #065f46; }
.status-gathering  { background: #dbeafe; color: #1e40af; }
.status-shipped    { background: #ede9fe; color: #5b21b6; }
.status-delivered  { background: #d1fae5; color: #065f46; }
.status-cancelled  { background: #fee2e2; color: #b91c1c; }
.status-pending_review { background: #fef3c7; color: #92400e; }
.status-approved   { background: #d1fae5; color: #065f46; }
.status-rejected   { background: #fee2e2; color: #b91c1c; }

/* =========================================================
   پنل مدیریت
   ========================================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--primary-dark);
  color: var(--white);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  overflow-y: auto;
  z-index: 900;
  transition: transform .3s ease;
}
.admin-logo {
  padding: 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-nav-section {
  padding: 12px 0;
}
.admin-nav-section h4 {
  padding: 6px 20px;
  font-size: .75rem;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  letter-spacing: 1px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  transition: all var(--transition);
}
.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,.1);
  color: var(--white);
}
.admin-nav a i {
  width: 18px;
  text-align: center;
}
.admin-main {
  margin-right: 260px;
  padding: 24px;
  min-height: 100vh;
  background: var(--bg);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}
.admin-topbar {
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}
.admin-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}
.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--primary);
}

/* آمار داشبورد ادمین */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #d1fae5; color: #065f46; }
.stat-icon.orange { background: #fef3c7; color: #92400e; }
.stat-icon.red    { background: #fee2e2; color: #b91c1c; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-muted);
}

/* جدول ادمین */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  background: var(--bg);
  padding: 11px 14px;
  text-align: right;
  font-weight: 700;
  font-size: .88rem;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.admin-table tr:hover td {
  background: #f8f9fa;
}
.admin-table img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* دکمه‌های ادمین */
.btn-sm {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-edit    { background: #dbeafe; color: #1d4ed8; }
.btn-delete  { background: #fee2e2; color: #b91c1c; }
.btn-view    { background: #d1fae5; color: #065f46; }
.btn-approve { background: #d1fae5; color: #065f46; }
.btn-reject  { background: #fee2e2; color: #b91c1c; }
.btn-sm:hover { opacity: .8; }

/* فرم مدیریت */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-form-grid .full {
  grid-column: 1 / -1;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group {
  flex: 1;
}
textarea.form-control {
  resize: vertical;
  min-height: 120px;
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
}

/* آپلود تصویر */
.img-preview-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.img-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
}
.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-remove {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(220,38,38,.85);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-area:hover {
  border-color: var(--accent);
  background: #f0f4ff;
}
.upload-area i {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.upload-area p {
  font-size: .9rem;
  color: var(--text-muted);
}

/* =========================================================
   صفحه سفارش ویژه
   ========================================================= */
.special-order-page {
  max-width: 680px;
  margin: 40px auto;
}
.special-order-page .page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.priority-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.priority-opt {
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: all var(--transition);
}
.priority-opt.selected {
  border-color: var(--accent);
  background: #f0f4ff;
  color: var(--accent);
}

/* =========================================================
   فوتر
   ========================================================= */
.main-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.8);
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 32px;
  padding: 40px 0 20px;
}
.footer-col h3,
.footer-col h4 {
  color: var(--white);
  margin-bottom: 14px;
  font-size: 1rem;
}
.footer-col p {
  font-size: .9rem;
  line-height: 1.8;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col ul li a {
  font-size: .9rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover {
  color: var(--white);
}
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.social-links a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background var(--transition);
}
.social-links a:hover {
  background: var(--accent);
  color: var(--white);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 16px 0;
  text-align: center;
  font-size: .85rem;
}

/* =========================================================
   صفحه‌بندی
   ========================================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 0;
}
.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* =========================================================
   ابزارکها
   ========================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-muted);
  margin: 16px 0;
  flex-wrap: wrap;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb i {
  font-size: .7rem;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #b91c1c; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: .4;
  display: block;
}
.empty-state p {
  font-size: 1rem;
}
.empty-state a {
  color: var(--accent);
  font-weight: 600;
}

/* modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2,1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2,1fr);
  }
  .products-page {
    flex-direction: column;
  }
  .filter-sidebar {
    width: 100%;
    position: static;
  }
}

/* ── Mobile sidebar toggle ── */
.admin-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
  background: var(--primary-dark);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 850;
}
.admin-overlay.open {
  display: block;
}

@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }
  .admin-main {
    margin-right: 220px;
  }
}
@media (max-width: 768px) {
  .admin-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .admin-sidebar {
    transform: translateX(100%);
    width: 260px !important;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-layout {
    display: block;
  }
  .admin-main {
    margin-right: 0 !important;
    padding: 16px;
    padding-top: 64px;
  }
  .admin-topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .priority-options {
    grid-template-columns: repeat(2,1fr);
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .d-none-mobile {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .slide {
    height: 220px;
  }
  .slide-content h2 {
    font-size: 1.2rem;
  }
  .checkout-steps {
    gap: 4px;
  }
  .step-line {
    width: 20px;
  }
  /* اصلاح جستجو در موبایل */
  .header-inner {
    flex-wrap: wrap;
  }
  .search-wrapper {
    order: 10;
    flex-basis: 100%;
  }
  .search-form input {
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .search-form button {
    border-radius: var(--radius) 0 0 var(--radius);
  }
}
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-main {
    padding: 12px;
    padding-top: 60px;
  }
  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: .82rem;
  }
  .cart-page {
    grid-template-columns: 1fr;
  }
  .cart-summary {
    position: static;
  }
}