/* stylelint-disable selector-id-pattern, keyframes-name-pattern */

/* --- Root & Basic Setup --- */
/* --- Root & Basic Setup --- */
:root {
  --primary-color: #2563eb; /* آبی اصلی دکمه‌ها */
  --primary-hover: #1d4ed8; /* آبی هاور */
  --danger-color: #ef4444; /* قرمز حذف */
  --transition: all 0.3s ease; /* انیمیشن نرم کارت‌ها */

  --card-bg: #fff;
  --border-color: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 10%);
}
.hidden {
  display: none !important;
}
/* --- Container & Main Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Header & Title Banner --- */
.page-title-banner {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.page-title-banner h1 {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.page-title-banner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Toolbar Container --- */
.toolbar {
  position: sticky;
  top: 70px;
  z-index: 90;
  background-color: rgb(255 255 255 / 95%);
  backdrop-filter: blur(8px);
  padding: 10px 0;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Categories & Scroll --- */
.categories-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.scroll-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background-color: #fff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
  transition: all 0.2s ease;
  z-index: 2;
}

.scroll-btn:hover {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.categories-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 4px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  background-color: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 6%);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
  background-color: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgb(59 130 246 / 15%);
}

.tab-btn.active {
  background-color: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgb(37 99 235 / 35%);
}

.tab-btn.active i {
  color: #fff;
}

/* --- Bottom Toolbar & Controls --- */
.toolbar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  width: 100%;
}

.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.search-box-wrap input {
  width: 100%;
  height: 38px;
  padding: 6px 12px 6px 32px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  background-color: #fff;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.search-box-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

.search-box-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
}

.btn-toggle-grid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-toggle-grid:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-filter-selected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-filter-selected:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-filter-selected.active {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn-filter-selected .badge-count {
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: bold;
  line-height: 1;
}

.btn-filter-selected.active .badge-count {
  background: #fff;
  color: #2563eb;
}

/* --- Floating Bottom Bar --- */
.floating-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 850px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 30%);
  z-index: 90;
  flex-wrap: wrap;
  gap: 15px;
  backdrop-filter: blur(8px);
}

.bar-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.95rem;
}

.bar-info strong {
  color: #38bdf8;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item i {
  color: #38bdf8;
}

.info-divider {
  width: 1px;
  height: 20px;
  background: #334155;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper i {
  position: absolute;
  right: 10px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.select-wrapper select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.btn-clear {
  background: #334155;
  color: #f8fafc;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-clear:hover {
  background: #ef4444;
  color: #fff;
}

.btn-submit {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #1d4ed8;
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 50%);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-cancel {
  background: #f1f5f9;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --- Image Preview Modal (Lightbox) --- */
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-preview-modal.hidden {
  display: none;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 85%);
  backdrop-filter: blur(8px);
}

.preview-container {
  position: relative;
  background: #1e293b;
  border-radius: 16px;
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 50%);
  z-index: 2;
  animation: scaleUpModal 0.25s ease forwards;
}

@keyframes scaleUpModal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.preview-close-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgb(0 0 0 / 60%);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s;
  z-index: 10;
}

.preview-close-btn:hover {
  background: #ef4444;
}

#previewModalImg {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  background: #0f172a;
}

.preview-footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #1e293b;
  color: #f8fafc;
  gap: 15px;
}

.preview-footer h3 {
  font-size: 1.1rem;
  margin: 0;
}

#previewActionBtn {
  width: 100%;
  max-width: 280px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* --- Order Card & Badges --- */
.order-card {
  background: #fff;
  border-radius: 10px;
  border-right: 5px solid #ccc;
  margin-bottom: 15px;
  padding: 15px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 5%);
}

.order-card.status-pending {
  border-right-color: #fd7e14;
}

.order-card.status-paid {
  border-right-color: #28a745;
}

.order-card.status-processing {
  border-right-color: #007bff;
}

.order-card.status-completed {
  border-right-color: #6f42c1;
}

.order-card.status-canceled {
  border-right-color: #dc3545;
}

.badge {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #fff;
  font-weight: bold;
  display: inline-block;
}

.badge-pending {
  background-color: #fd7e14;
}

.badge-paid {
  background-color: #28a745;
}

.badge-processing {
  background-color: #007bff;
}

.badge-completed {
  background-color: #6f42c1;
}

.badge-canceled {
  background-color: #dc3545;
}

/* --- Responsive Layout --- */
@media (width <= 640px) {
  .floating-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .bar-info {
    justify-content: space-between;
  }

  .bar-actions {
    justify-content: space-between;
  }

  .select-wrapper select {
    width: 100%;
  }
}
/* #region collage */
/* یکدست کردن ساختار کاتالوگ و کارت‌ها */
#cardsGrid {
  display: grid;

  gap: 20px;
  direction: rtl; /* تضمین راست‌چین بودن کل گرید */
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: Bone;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* یکسان‌سازی ابعاد تصاویر داخل کارت‌ها */
.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* مربع و هم‌اندازه کردن تمام تصاویر کاتالوگ */
  overflow: hidden;
  background-color: #f7fafc;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* پر کردن کادر بدون دفرمه شدن تصویر */
  cursor: pointer;
}

/* استایل راست‌چین و مرتب برای دکمه‌ها و متون */
.card-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: right;
}

.card-title {
  font-size: 0.95rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2d3748;
}

.card-actions {
  margin-top: auto; /* چسباندن دکمه‌ها به پایین کارت در یک خط تراز */
}

.btn-card-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  background-color: #2563eb;
  color: #fff;
  transition: background-color 0.2s;
}

/* تغییر رنگ دکمه در صورت انتخاب شدن (مانند فروشگاه اصلی که سبز می‌شود) */
.btn-card-action.btn-selected {
  background-color: #16a34a !important;
}

/* فاصله آیکون‌ها در فونت‌های فارسی */
.ms-2 {
  margin-left: 0.5rem;
}
.ms-1 {
  margin-left: 0.25rem;
}
/* #endregion */
/* این استایل‌ها فقط روی موبایل و تبلت (نمایشگرهای کوچک‌تر از 768 پیکسل) اعمال می‌شوند */
@media screen and (max-width: 767px) {
  /* اجبار به دو ستونه شدن در موبایل هنگام کلیک روی دکمه */
  #cardsGrid.grid-2-col,
  .cards-grid.grid-2-col {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* اجبار به تک ستونه شدن در موبایل */
  #cardsGrid.grid-1-col,
  .cards-grid.grid-1-col {
    grid-template-columns: 1fr !important;
  }

  /* جلوگیری از بیرون زدن کارت‌ها در گوشی‌های کوچک مثل J5 Pro */
  #cardsGrid.grid-2-col > div,
  #cardsGrid.grid-2-col .catalog-card,
  #cardsGrid.grid-2-col .card {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
