/* =========================================================
   KarlyCollection — Components
   کتابخانه‌ی کامپوننت‌های قابل‌استفاده‌ی مجدد. هر کامپوننت یک بلوک
   مستقل با کلاس ثابت است؛ در صفحات جدید همین کلاس‌ها را استفاده کن،
   استایل تازه‌ی جدا نساز.

   فهرست: دکمه/آیکون‌دکمه، شیشه (.glass)، تیتر سکشن، بج‌ها،
   کارت دسته‌بندی، کارت محصول + فیلتر، جزئیات محصول (رنگ/سایز/تعداد)،
   فرم‌ها، پنل جستجو، دراور سبد خرید، مودال، توست.
   ========================================================= */

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 7px 13px;
}
.btn-whatsapp { background: var(--color-whatsapp); color: #fff; }
.btn-telegram { background: var(--color-telegram); color: #fff; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--color-text);
  border-radius: 50%;
  position: relative;
  transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: var(--color-bg-alt); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- شیشه‌ی مایع (Liquid Glass) ----------
   یوتیلیتی مشترک: هر عنصر شناور روی محتوا (هدر، پنل، دراور، مودال،
   دراپ‌داون) این کلاس را می‌گیرد؛ رنگ/سایز خودش را جدا تعریف کند. */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
/* عناصر شناور جدا (دراپ‌داون/مودال/دراور، نه خودِ هدر) بلور محسوس‌تری می‌گیرن +
   isolation برای این‌که روی بعضی مرورگرها (که backdrop-filter تودرتو رو درست
   رندر نمی‌کنن) توی لایه‌ی کامپوزیت مستقل خودش بمونه و شیشه‌ای دیده بشه. */
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(calc(var(--glass-blur) + 8px)) saturate(165%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 8px)) saturate(165%);
  isolation: isolate;
}

/* ---------- تیتر سکشن ---------- */
.section-heading { text-align: center; margin-bottom: 22px; }
.section-heading h2 { font-size: 21px; font-weight: 700; color: var(--color-text); }
.section-heading p { color: var(--color-text-muted); margin-top: 5px; font-size: 13px; }
.section-eyebrow {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
  display: block;
}

/* ---------- پنل جستجوی محصولات ---------- */
.search-panel {
  position: fixed;
  top: var(--header-h);
  right: 0; left: 0;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: var(--shadow-md);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 150;
  max-height: 75vh;
  overflow-y: auto;
}
.search-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
#search-overlay { z-index: 140; }
.search-panel-inner { display: flex; align-items: center; gap: 7px; padding: 9px 0; color: var(--color-text-muted); }
.search-panel-inner input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--color-text);
  outline: none;
}
.search-panel-inner input::placeholder { color: var(--color-text-muted); }
.search-panel-inner input::-webkit-search-cancel-button,
.search-panel-inner input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-panel-inner input::-ms-clear { display: none; }
.search-close-btn { flex-shrink: 0; width: 34px; height: 34px; }
.search-results { padding-bottom: 5px; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--color-border);
  transition: background-color .2s var(--ease);
  position: relative;
}
.search-result-item:hover { background: var(--color-bg-alt); }
.search-result-media { width: 32px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--color-bg-alt); }
.search-result-media img { width: 100%; height: 100%; object-fit: contain; background: var(--color-bg-alt); }
.search-result-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.search-result-name { font-size: 11.5px; font-weight: 600; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-price { font-size: 11px; color: var(--color-primary); font-weight: 600; }
.search-result-stock { font-size: 9.5px; font-weight: 600; color: #c0374a; flex-shrink: 0; }
.search-hint, .search-empty { padding: 11px 0; text-align: center; color: var(--color-text-muted); font-size: 11.5px; }

/* ---------- کارت دسته‌بندی ---------- */
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .2s var(--ease);
}
.category-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.category-card img { width: 100%; height: 100%; object-fit: cover; }
.category-card .img-placeholder { position: absolute; inset: 0; border-radius: var(--radius-lg); }
.category-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(var(--color-primary-rgb), .78), transparent 65%);
  display: flex; align-items: flex-end;
  padding: 11px;
  z-index: 2;
}
.category-overlay h3 { color: #fff; font-size: 14px; font-weight: 700; }

/* کارت «همه محصولات» — بدون تصویر، فقط رنگ گرادیان برند، وسط‌چین (نه ته‌چین مثل بقیه)
   تا هم متمایز باشه هم اولین گزینه‌ی طبیعی برای برگشت به کل کاتالوگ به نظر برسه. */
.category-card--all { background: var(--gradient-brand); }
.category-overlay--all { position: static; background: none; align-items: center; justify-content: center; height: 100%; }
.category-overlay--all h3 { text-align: center; }

/* دسته‌ی فعال (طبق فیلتر فعلی محصولات) با حاشیه‌ی رنگی مشخص می‌شه تا همیشه معلوم
   باشه الان کدوم دسته انتخاب شده — جابه‌جایی بین دسته‌ها رو با بازخورد فوری راحت‌تر می‌کنه. */
.category-card.is-active { border-color: var(--color-primary); }
.category-card.is-active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

/* ---------- فیلتر دسته‌بندی ---------- */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: all .2s var(--ease);
}
.filter-btn i { font-size: 10px; }
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-btn.active {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #fff;
}

/* ---------- کارت محصول ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 1000px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- صفحه‌بندی گریدهای محصول ---------- */
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.pagination-bar:empty { display: none; }

.pagination-rowsize { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); }
.pagination-rowsize-trigger {
  width: 56px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 4px 22px 4px 8px;
  font-family: inherit;
  font-size: 12.5px;
  text-align: center;
}

.pagination-controls { display: flex; align-items: center; gap: 6px; }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-page-btn,
.pagination-nav-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pagination-page-btn:hover,
.pagination-nav-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.pagination-page-btn.is-active {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #fff;
}
.pagination-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-gap { padding: 0 4px; color: var(--color-text-muted); font-size: 12.5px; }

.pagination-jump { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); }
.pagination-jump input[type="number"] {
  width: 52px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12.5px;
  text-align: center;
}
.pagination-jump-btn {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pagination-jump-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }


.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
  display: flex;
  flex-direction: column;
  /* رندر کارت‌های خارج از دید صفحه رو تا رسیدن اسکرول به‌شون به تعویق می‌ندازه —
     روی گریدهای بلند محصولات، افت فریم اسکرول رو در دستگاه‌های ضعیف‌تر کم می‌کنه */
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
[data-theme="dark"] .product-card { border-color: var(--color-border); }
[data-theme="dark"] .product-card:hover { border-color: var(--color-primary); }
.product-media { position: relative; aspect-ratio: 4 / 5; background: var(--color-bg-alt); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .img-placeholder { position: absolute; inset: 0; }

.product-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-bottom: 5px;
}
/* بج‌های مینیمال: بردر + متن هم‌رنگ به‌جای پرشدگی توپر — سبک‌تر و کم‌حجم‌تر از قبل */
.badge-pill {
  font-size: 8.5px; font-weight: 600;
  padding: 2px 8px;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  white-space: nowrap;
}
.badge-promo { color: var(--color-primary); }
.badge-bestseller { color: var(--color-gold); }
.badge-discount {
  color: #c0374a;
  font-weight: 700;
  animation: badge-discount-pulse 1.8s ease-in-out infinite;
}
@keyframes badge-discount-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-discount { animation: none; }
}

.out-of-stock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 16, 20, .55);
  color: #fff;
  font-size: 12px; font-weight: 700;
  letter-spacing: .3px;
  z-index: 3;
}
.is-out-of-stock .product-media img { filter: grayscale(.5); }

.media-color-swatches {
  position: absolute; bottom: 6px; left: 6px;
  display: flex; flex-direction: column; gap: 3px;
  z-index: 2;
}
.media-color-swatch {
  width: 10px; height: 10px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.product-category-icon {
  position: absolute; bottom: 6px; right: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.stock-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  width: fit-content;
}
.stock-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.stock-status.in-stock { color: #2f8a4e; }
.stock-status.in-stock .stock-dot { background: #2f8a4e; }
.stock-status.out-of-stock { color: #c0374a; }
.stock-status.out-of-stock .stock-dot { background: #c0374a; }

.product-info { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.product-category { font-size: 10.5px; color: var(--color-text-muted); display: inline-block; width: fit-content; }
.product-category:hover { color: var(--color-primary); text-decoration: underline; }
.product-name { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.product-price { font-size: 12.5px; font-weight: 700; color: var(--color-primary); margin-top: auto; }
.product-price.has-discount .current-price { color: #c0374a; animation: price-pop .35s ease; }
.product-price .old-price {
  text-decoration: line-through;
  text-decoration-color: #e14f4f;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 11px;
  margin-inline-start: 5px;
}
.add-to-cart-btn {
  margin-top: 4px;
  width: 100%;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--color-primary-rgb), .25);
  background: rgba(var(--color-primary-rgb), .12);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.add-to-cart-btn:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.add-to-cart-btn.is-disabled {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  cursor: not-allowed;
  pointer-events: none;
}

.no-results { text-align: center; color: var(--color-text-muted); padding: 22px 0; grid-column: 1 / -1; }
.product-media-link { display: block; }

/* ---------- جزئیات محصول (سایز المان‌ها ~۴۵٪ کوچک‌تر از قبل) ---------- */
.product-detail { padding: 12px 0 34px; }
.back-link {
  display: flex;
  width: fit-content;
  margin-inline-start: auto;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  padding: 5px 11px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.back-link:hover { color: var(--color-primary); border-color: var(--color-primary); }

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 800px) {
  /* تصویر محصول همیشه سمت چپ باشه (مطابق الگوی مرجع)، صرف‌نظر از RTL بودن کل سایت —
     گرید رو LTR می‌چرخونیم (ستون اول یعنی گالری می‌ره چپ) و متن ستون اطلاعات رو
     دوباره RTL می‌کنیم تا چیدمان متن فارسی و منطق dir:auto/logical properties داخلش دست‌نخورده بمونه. */
  .product-detail-grid { grid-template-columns: minmax(0, 440px) 1fr; align-items: start; gap: 32px; direction: ltr; }
  .product-detail-info { direction: rtl; }
}

.product-detail-media-wrap { display: flex; flex-direction: column; gap: 10px; }

.product-detail-media {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-md);
}

/* ---------- ردیف تامبنیل‌های گالری (زیر تصویر اصلی، کلیک = پرش مستقیم به همون تصویر) ---------- */
.pd-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.pd-gallery-thumb {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--color-bg-alt);
  transition: border-color .2s var(--ease), opacity .2s var(--ease);
  opacity: .7;
}
.pd-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-gallery-thumb:hover { opacity: 1; }
.pd-gallery-thumb.active { border-color: var(--color-primary); opacity: 1; }
.product-detail-media .img-placeholder { position: absolute; inset: 0; border-radius: var(--radius-lg); }
.product-detail-info .product-badges { margin-bottom: 8px; }
.product-detail-info .badge-discount { font-size: 11px; padding: 3px 10px; }
.product-detail-media .media-color-swatches { bottom: 9px; left: 9px; gap: 4px; z-index: 4; }
.product-detail-media .media-color-swatch { width: 12px; height: 12px; border-radius: 4px; }
.product-detail-media .product-category-icon { bottom: 9px; right: 9px; width: 22px; height: 22px; font-size: 10px; z-index: 4; }

.pd-gallery { position: absolute; inset: 0; overflow: hidden; }
.pd-gallery-track {
  position: absolute; inset: 0;
  display: flex;
  direction: ltr;
  width: 100%; height: 100%;
  transition: transform .35s var(--ease);
  will-change: transform;
  touch-action: pan-y;
}
.pd-gallery-track.dragging { transition: none; }
.pd-gallery-slide { flex: 0 0 100%; width: 100%; height: 100%; }
.pd-gallery-slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }

.pd-gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  border: none;
  color: var(--color-text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.pd-gallery-arrow:hover { background: #fff; }
.pd-gallery-arrow:active { transform: translateY(-50%) scale(.92); }
.pd-gallery-arrow.prev { left: 8px; }
.pd-gallery-arrow.next { right: 8px; }
/* دکمه‌های اسلاید چپ/راست فقط روی دسکتاپ لازمن (موبایل با سوایپ کار می‌کنه)؛
   عکس گالری هم روی موبایل باید بدون فضای خالی، لبه‌به‌لبه‌ی کادر رو پر کنه. */
@media (max-width: 799px) {
  .pd-gallery-arrow { display: none; }
}

.product-detail-info { display: flex; flex-direction: column; min-width: 0; }
.pd-name { font-size: 16px; font-weight: 700; margin: 2px 0 5px; line-height: 1.4; }
/* باکس توضیحات محصول — استاندارد رایج سایت‌های فروشگاهی: کارت مجزا با هدر مشخص و
   یک نوار رنگی برند در لبه‌ی شروع (در RTL یعنی سمت راست)، به‌جای باکس تخت کم‌کنتراست
   قبلی که فقط از --color-bg-alt (خیلی نزدیک به رنگ پس‌زمینه‌ی خود صفحه) استفاده می‌کرد. */
.pd-description-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.pd-material-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.pd-material-badge img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px var(--color-border); }
.pd-material-badge span { font-size: 11.5px; font-weight: 700; color: var(--color-text); }
.pd-material-badge:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.pd-description-heading {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--color-border);
}
/* هر پاراگراف یک <p> مستقل با dir صریح + unicode-bidi:plaintext می‌گیره (به‌جای یک
   <p> بزرگ با <br> بین خط‌ها) تا مرورگر جهت هر پاراگراف رو جدا و صحیح حساب کنه —
   وگرنه با متن‌های ترکیبی فارسی/لاتین-عدد، نقطه‌ی پایان یک پاراگراف می‌تونست بصری
   به ابتدای متن (لبه‌ی راست) پرت بشه.
   هر خط به‌صورت یک ردیف مجزا با بردر پایین (مطابق جدول ویژگی‌های الگوی مرجع) نمایش داده
   می‌شه، نه یک پاراگراف پیوسته — این‌طوری هر مورد به‌وضوح از بقیه جدا و «طبقه‌بندی‌شده» دیده می‌شه. */
.pd-description {
  margin: 0;
  padding: 5px 2px;
  color: var(--color-text);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: break-word;
  unicode-bidi: plaintext;
  text-align: start;
  border-bottom: 1px solid var(--color-border);
}
.pd-description:first-child { padding-top: 0; }
.pd-description:last-child { border-bottom: none; padding-bottom: 0; }
.product-detail-info .stock-status { margin-bottom: 5px; font-size: 11px; }
.product-detail-info .stock-progress { margin-bottom: 9px; max-width: 200px; }
.pd-price { font-size: 15px; font-weight: 700; color: var(--color-primary); margin-bottom: 10px; }
.pd-price.has-discount .current-price { color: #c0374a; font-size: 19px; animation: price-pop .4s ease; }
.pd-price .old-price {
  text-decoration: line-through;
  text-decoration-color: #e14f4f;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 13px;
  margin-inline-start: 8px;
}

@keyframes price-pop {
  0% { transform: scale(.85); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}

/* شمارش‌معکوس واقعی تخفیفِ زمان‌دار — روی کارت محصول کوچک/کم‌حجم، روی صفحه‌ی خود محصول بزرگ‌تر */
.discount-countdown {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  padding: 3px 8px; margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: rgba(192, 55, 74, .07);
  border: 1px solid rgba(192, 55, 74, .18);
  width: fit-content;
  max-width: 100%;
}
.discount-countdown .countdown-label { color: #c0374a; display: flex; align-items: center; gap: 3px; font-size: 9px; white-space: nowrap; }
.discount-countdown .countdown-unit { min-width: 16px; }
.discount-countdown .countdown-unit strong { color: #c0374a; font-size: 10px; }
.discount-countdown .countdown-unit small { font-size: 6.5px; }
.discount-countdown .countdown-sep { font-size: 9px; }
.product-detail-info .discount-countdown { padding: 8px 12px; margin-bottom: 14px; gap: 10px; }
.product-detail-info .discount-countdown .countdown-label { font-size: 13px; gap: 5px; }
.product-detail-info .discount-countdown .countdown-unit { min-width: 26px; }
.product-detail-info .discount-countdown .countdown-unit strong { font-size: 14px; }
.product-detail-info .discount-countdown .countdown-unit small { font-size: 8px; }
.product-detail-info .discount-countdown .countdown-sep { font-size: 13px; }

/* تخفیفِ مبتنی‌بر موجودی: جذابیت بصری/فوریت بیشتر از شمارش‌معکوس عادی — عمداً پررنگ‌تر و با پالس،
   ولی روی کارت محصول باید کم‌حجم بمونه (فقط صفحه‌ی خود محصول بزرگ‌تر می‌شه) */
.stock-discount-urgent {
  display: flex; align-items: center; gap: 4px;
  width: fit-content; max-width: 100%;
  padding: 3px 9px; margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff4d6d, #c0374a);
  color: #fff;
  font-size: 9.5px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(192, 55, 74, .35);
  animation: stock-urgent-pulse 1.6s ease-in-out infinite;
}
.stock-discount-urgent i { color: #ffd166; font-size: 9.5px; }
.product-detail-info .stock-discount-urgent { font-size: 14px; padding: 9px 16px; margin-bottom: 14px; gap: 6px; }
.product-detail-info .stock-discount-urgent i { font-size: 14px; }
@keyframes stock-urgent-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(192, 55, 74, .35); }
  50% { transform: scale(1.06); box-shadow: 0 3px 14px rgba(192, 55, 74, .55); }
}
@media (prefers-reduced-motion: reduce) {
  .stock-discount-urgent { animation: none; }
}

/* ---------- بلاک‌های ویژگی (رنگ‌بندی/سایزبندی) — کارت‌های مجزا کنار هم، مطابق الگوی مرجع ---------- */
.pd-attributes-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
@media (min-width: 480px) {
  .pd-attributes-grid { grid-template-columns: 1fr 1fr; }
}
.pd-attribute-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--color-bg-alt);
}

.pd-option-group { margin-bottom: 9px; }
.pd-option-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 5px; }
.pd-option-label strong {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(var(--color-primary-rgb), .12);
}

.pd-saved-size-btn {
  background: none; border: none; color: var(--color-primary);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 0;
}
.pd-saved-size-btn:hover { text-decoration: underline; }
.pd-size-help-link {
  display: block; background: none; border: none; color: var(--color-primary);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; margin-top: 6px;
  text-align: right;
}
.pd-size-help-link:hover { text-decoration: underline; }
.pd-saved-size-panel[hidden] { display: none; }
.pd-saved-size-panel {
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 7px; border-radius: var(--radius-sm);
  background: var(--color-bg-alt); box-shadow: var(--shadow-sm);
}
.pd-saved-size-option {
  text-align: right; padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text); font-size: 11.5px; cursor: pointer;
  transition: background-color .15s var(--ease);
}
.pd-saved-size-option:hover { background: rgba(var(--color-primary-rgb), .1); }
.pd-saved-size-empty { font-size: 11px; color: var(--color-text-muted); margin: 0; }

.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.color-swatch-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, .15);
}
.color-swatch:hover { border-color: var(--color-primary); }
.color-swatch.active { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), .1); }

.size-options { display: flex; gap: 5px; flex-wrap: wrap; }
.size-option {
  min-width: 32px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  transition: all .2s var(--ease);
}
.size-option:hover { border-color: var(--color-primary); }
.size-option.active { background: var(--gradient-brand); border-color: transparent; color: #fff; }

.qty-stepper { display: inline-flex; align-items: center; gap: 7px; }
.qty-stepper .qty-btn { width: 22px; height: 22px; font-size: 12px; }
.qty-stepper .qty-value { font-size: 12px; min-width: 16px; }

.pd-add-btn { margin-top: 2px; margin-bottom: 9px; padding: 9px 18px; font-size: 13px; }

.product-not-found { text-align: center; padding: 44px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--color-text-muted); }

/* ---------- اورلی مشترک (پشت پنل/دراور/مودال) ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 6, 10, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
  z-index: 200;
}
.overlay.active { opacity: 1; pointer-events: auto; }

/* ---------- درور سبد خرید (باز شدن از سمت راست، منطبق با RTL) ---------- */
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(320px, 100%);
  z-index: 210;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border-width: 0 0 0 1px;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}
.cart-header h2 { font-size: 14px; font-weight: 700; }
.cart-header-actions { display: flex; align-items: center; gap: 4px; }
#cart-clear-btn:hover { color: #e14f4f; }
.cart-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; color: var(--color-text-muted); }
.cart-empty svg { opacity: .4; width: 40px; height: 40px; }

.cart-items { display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; gap: 8px; align-items: center; }
.cart-item-media {
  width: 44px; height: 55px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--color-bg-alt);
}
.cart-item-media img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-media .img-placeholder { position: absolute; inset: 0; }
.cart-item-media .img-placeholder svg { width: 16px; height: 16px; }
.cart-item-media .img-placeholder span { display: none; }
.cart-item-media .img-spinner::after { width: 12px; height: 12px; border-width: 2px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 11.5px; font-weight: 600; margin-bottom: 3px; }
.cart-item-variant { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--color-text-muted); margin-bottom: 3px; }
.color-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--color-border); flex-shrink: 0; }
.cart-item-price { font-size: 11px; color: var(--color-primary); font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.qty-btn {
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--color-text);
}
.qty-btn:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.qty-value { font-size: 11px; font-weight: 600; min-width: 15px; text-align: center; }
.remove-item-btn {
  margin-inline-start: auto;
  background: transparent; border: none;
  color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  width: 19px; height: 19px;
}
.remove-item-btn:hover { color: #e14f4f; }
.remove-item-btn svg { width: 14px; height: 14px; }

.cart-footer { padding: 11px 14px 14px; border-top: 1px solid var(--color-border); }
.cart-total { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 9px; }
.cart-total span:last-child { color: var(--color-primary); }

/* ---------- مودال (عمومی؛ چک‌اوت از همین کامپوننت استفاده می‌کند) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 12, 28, .4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  /* visibility:hidden وقتی غیرفعاله لازمه: بدون این، فیلدهای داخل مودال (مثلاً
     input[type=tel]) با اینکه دیده نمی‌شن هنوز focusable و tab-پذیرند و روی
     موبایل باعث می‌شن مرورگر/اتوفیل کیبورد رو باز کنه در حالی که مودال نامرئیه. */
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s linear .35s;
  z-index: 220;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .35s var(--ease), visibility 0s linear; }
.modal {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 19px 16px 16px;
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(28px) scale(.94);
  opacity: 0;
  transition: transform .45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .3s var(--ease);

  /* اسکرول اختصاصی مودال، جدا از اسکرول صفحه */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary-light) transparent;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }
.checkout-modal { border-radius: 1px; }

/* ---------- چک‌اوت این‌لاین (نه پاپ‌آپ): برای اینکه سوییچ به اپ بانک بین راه
   وضعیت فرم/تایمر کارت رو از دست نده، به‌جای اورلی ثابت روی کل صفحه، به‌عنوان
   یک بخش عادی داخل جریان صفحه نمایش داده می‌شه. ---------- */
.modal-overlay.inline-checkout-overlay {
  position: static;
  inset: auto;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 20px 16px 48px;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: none;
  z-index: auto;
  display: none;
}
.modal-overlay.inline-checkout-overlay.active { display: flex; }
.modal-overlay.inline-checkout-overlay .modal {
  max-width: 460px;
  max-height: none;
  overflow-y: visible;
  transform: none;
  opacity: 1;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.inline-checkout-overlay .modal::before { display: none; }
.modal-overlay.inline-checkout-overlay .modal-close {
  position: static;
  width: auto; height: auto;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 10px;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.modal-overlay.inline-checkout-overlay .modal-close::before {
  content: 'بازگشت به سبد خرید';
}
.modal-overlay.inline-checkout-overlay .modal-close svg { width: 15px; height: 15px; }

/* ---------- صفحه‌ی اختصاصی ثبت سفارش از Shein ---------- */
.shein-order-page { padding: 20px 0 48px; }
.shein-page-card {
  max-width: 460px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 20px;
}
.shein-price-note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  margin-bottom: 8px;
}
.shein-price-note i { color: var(--color-primary); font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.shein-price-note p { font-size: 11px; line-height: 1.9; color: var(--color-text-muted); margin: 0; }
.shein-price-note--delivery { background: color-mix(in srgb, var(--color-warning, #e6a23c) 12%, transparent); }
.shein-price-note--delivery i { color: var(--color-warning, #e6a23c); }
.shein-product-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.shein-product-preview-img { width: 40px; height: 50px; object-fit: contain; background: var(--color-bg-alt); border-radius: var(--radius-sm); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.shein-product-preview-title { font-size: 12.5px; font-weight: 600; line-height: 1.5; }

/* ---------- صفحه‌ی اختصاصی تکمیل سفارش (/checkout) ----------
   دیگه پاپ‌آپه نیست: یک صفحه‌ی کامل و مستقله که از دکمه‌ی «ثبت سفارش» توی
   سبد خرید در یک تب جدید باز می‌شه. موبایل: تک‌ستونه؛ از ۹۰۰px به بالا فرم
   اصلی + کارت اعتمادسازی کنار هم قرار می‌گیرن. */
.checkout-page { padding: 20px 0 56px; }
.checkout-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
}
.checkout-page-card {
  border-radius: var(--radius-lg);
  padding: 22px 18px;
}
.checkout-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.checkout-back-link:hover { color: var(--color-primary); }
.checkout-page-aside { display: flex; flex-direction: column; gap: 14px; }
.checkout-trust-card { border-radius: var(--radius-lg); padding: 18px; }
.checkout-trust-card h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-primary);
}
.checkout-trust-card ul { display: flex; flex-direction: column; gap: 9px; }
.checkout-trust-card li {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.6;
}
.checkout-trust-card li i { color: var(--color-success); margin-top: 3px; flex-shrink: 0; }
.checkout-empty-state {
  text-align: center;
  padding: 40px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--color-text-muted);
}
.checkout-empty-state svg { opacity: .6; }

@media (min-width: 900px) {
  .checkout-page-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; }
  .checkout-page-card { padding: 28px 26px; }
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb {
  background: var(--gradient-brand);
  border-radius: 999px;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; right: 24px; left: 24px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: var(--gradient-brand);
  opacity: .9;
}

.modal-close {
  position: absolute;
  top: 16px; left: 16px;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.modal-close:hover {
  background: var(--gradient-brand);
  color: #fff;
  transform: rotate(90deg);
}
.modal-subtitle { color: var(--color-text-muted); font-size: 11.5px; margin: 5px 0 13px; }
#checkout-title, .modal-title { font-size: 16px; font-weight: 700; }

/* ---------- مودال راهنمای سایز (فقط چارت تصویری) ---------- */
.modal-size-chart { max-width: 480px; }
.size-guide-image { width: 100%; border-radius: var(--radius-md); margin-top: 10px; }

.size-guide-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}
.size-guide-note h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.size-guide-note ul { margin: 0 0 8px; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.size-guide-note li { font-size: 12px; color: var(--color-text); }
.size-guide-note p { font-size: 12px; color: var(--color-text-muted); margin: 0 0 6px; line-height: 1.6; }
.size-guide-note p:last-child { margin-bottom: 0; }
.size-guide-note-warning { color: #c0374a !important; font-weight: 600; }

/* ---------- aside راهنمای ارسال (صفحه‌ی ثبت سفارش + سوالات متداول) ---------- */
.shipping-info-aside {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}
.shipping-info-aside-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 13px;
}
.shipping-info-aside strong { display: block; font-size: 12.5px; margin-bottom: 4px; }
.shipping-info-aside p { font-size: 12px; color: var(--color-text-muted); margin: 0; line-height: 1.65; }

/* ---------- فرم‌ها ---------- */
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 4px; color: var(--color-text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 12.5px;
  resize: vertical;
  transition: border-color .2s var(--ease);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-group.has-error input, .form-group.has-error textarea { border-color: #e14f4f; }
/* تایپ توضیحات محصول در پنل ادمین هم باید همون رفتار بیدی صحیح صفحه محصول رو داشته
   باشه (هر خط/پاراگراف مستقل)، وگرنه موقع تایپ متن ترکیبی فارسی/لاتین-عدد همون
   جابه‌جایی نادرست نقطه‌ی پایان پاراگراف این‌جا هم دیده می‌شه. */
#pf-description { unicode-bidi: plaintext; }
.form-group input:disabled, .form-group input:read-only:not([data-popup]) { background: var(--color-bg-alt); color: var(--color-text-muted); cursor: not-allowed; }
.form-error { display: block; font-size: 10.5px; color: #e14f4f; margin-top: 3px; min-height: 12px; }
.form-hint { display: block; font-size: 10.5px; color: var(--color-text-muted); margin-top: 3px; }

/* ---------- سلکتور جنس محصول (ترک/شین) — فرم ایجاد محصول پنل ادمین ---------- */
.material-selector { display: flex; gap: 10px; }
.material-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.material-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.material-option img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.material-option span { font-size: 12.5px; font-weight: 600; color: var(--color-text); }
.material-option:has(input:checked), .material-option.active {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), .08);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), .15);
}

/* ---------- گروه انتخاب گزینه (چیپ رادیویی) — روش ارسال/پرداخت و مشابه ---------- */
.option-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.option-chip[hidden] { display: none; }
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.option-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-chip:has(input:checked), .option-chip.active {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #fff;
}
.option-chip:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.option-chip.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- کارت به کارت اختصاصی (تنها روش پرداخت) ---------- */
.card-payment-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--color-bg-alt);
}
.card-payment-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.card-payment-details { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.card-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 8px;
}
.card-detail-row:last-of-type { border-bottom: none; padding-bottom: 0; }
.card-detail-row strong { color: var(--color-text); font-size: 13.5px; letter-spacing: .2px; }
.card-detail-value { display: flex; align-items: center; gap: 6px; }
.card-payment-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), .08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 2px;
}
.card-payment-timer strong { color: var(--color-primary); }
.card-payment-timer--expired {
  color: #c0374a;
  background: rgba(192, 55, 74, .08);
}
.card-payment-timer--expired strong { color: #c0374a; }

/* ---------- انتخاب سایز آیتم‌های سبد از روی سایزهای ذخیره‌شده (خودم/آشنایان)
   موقع تکمیل سفارش — همون سیستم پروفایل سایز که در صفحه‌ی محصول هم هست، اینجا
   هم برای هر آیتمی که سایزبندی ثبت‌شده داره در دسترس می‌مونه. ---------- */
.checkout-size-profiles { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.checkout-size-item {
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.checkout-size-item-name { font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }
.checkout-size-item .option-chips { margin-bottom: 6px; }
.checkout-size-profile-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.checkout-size-profile-quick-btn {
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.checkout-size-profile-quick-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.checkout-size-profile-quick-btn.active { border-style: solid; border-color: var(--color-primary); color: var(--color-primary); background: rgba(var(--color-primary-rgb), .08); }

.checkout-summary {
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-bottom: 12px;
  font-size: 11px;
}
.checkout-summary-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--color-text-muted); }
.checkout-summary-row.total { font-weight: 700; color: var(--color-text); border-top: 1px solid var(--color-border); margin-top: 4px; padding-top: 7px; }
.checkout-discount-row { display: flex; gap: 6px; margin-top: 7px; }
.checkout-discount-row input {
  flex: 1; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); font-size: 11px; font-family: inherit;
}
.checkout-discount-row .btn { padding: 6px 11px; font-size: 11px; }

/* ---------- رسید رنگی هزینه‌ی ارسال/جمع کل چک‌اوت ---------- */
.checkout-receipt { display: flex; flex-direction: column; }

/* ردیف محصول در رسید خلاصه‌ی سفارش: عکس کوچک + جنس + تعداد، برای هر تعداد آیتم */
.checkout-receipt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--color-border);
}
.checkout-receipt-item:first-child { padding-top: 0; }
.checkout-receipt-item-media {
  flex-shrink: 0;
  width: 40px; height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}
.checkout-receipt-item-media img { width: 100%; height: 100%; object-fit: contain; background: var(--color-bg-alt); }
.checkout-receipt-item-info { flex: 1; min-width: 0; }
.checkout-receipt-item-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.checkout-receipt-item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.checkout-receipt-item-material { display: inline-flex; align-items: center; gap: 3px; }
.checkout-receipt-item-material img { width: 12px; height: 12px; border-radius: 50%; object-fit: cover; }
.checkout-receipt-item-qty { flex-shrink: 0; font-size: 11px; color: var(--color-text-muted); }
.checkout-receipt-item-price { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.checkout-summary-row--discount { color: var(--color-success, #2e9c5a); font-weight: 600; }
.checkout-summary-row--discount i { margin-left: 4px; }
.checkout-summary-row--shipping {
  color: var(--color-primary);
  font-weight: 600;
  border-top: 1px dashed var(--color-border);
  margin-top: 4px;
  padding-top: 7px;
}
.checkout-summary-row--shipping i { margin-left: 4px; }
.checkout-summary-row.total { font-size: 13px; }

.option-chip-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  color: inherit;
}
.option-chip:not(:has(input:checked)):not(.active) .option-chip-badge {
  background: rgba(var(--color-primary-rgb), .12);
  color: var(--color-primary);
}

/* ---------- انیمیشن پالس دکمه‌ی نهایی پرداخت — کاربر رو به تکمیل خرید ترغیب می‌کنه ---------- */
@keyframes btn-pulse-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), .55); }
  50% { box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb), 0); }
}
.btn-pulse:not(:disabled) { animation: btn-pulse-anim 1.8s infinite; }
.btn-pulse:disabled { animation: none; }

.checkout-success { text-align: center; padding: 4px 0 3px; }
.success-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--color-success);
  background: radial-gradient(circle, rgba(46, 158, 91, .16), rgba(46, 158, 91, .03) 70%);
  animation: success-pop .55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-icon svg { width: 40px; height: 40px; }
.success-icon svg path { animation: success-check .4s ease .25s both; }
@keyframes success-pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes success-check {
  from { stroke-dasharray: 40; stroke-dashoffset: 40; }
  to { stroke-dasharray: 40; stroke-dashoffset: 0; }
}
.checkout-success h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.checkout-success p { color: var(--color-text-muted); font-size: 12px; margin-bottom: 14px; }
.success-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.success-actions .btn { transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .25s var(--ease); }
.success-actions .btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md); }

/* ---------- منوی حساب کاربری (دراپ‌داون ساده، نه داشبورد) ---------- */
.account-menu { position: relative; }
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 190px;
  border-radius: var(--radius-md);
  padding: 6px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 160;
}
.account-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.account-dropdown-header { display: flex; align-items: center; gap: 7px; padding: 7px 9px 9px; border-bottom: 1px solid var(--color-border); margin-bottom: 4px; }
.account-dropdown-header strong { display: block; font-size: 12px; }
.account-dropdown-header span { font-size: 10.5px; color: var(--color-text-muted); }
.account-dropdown-avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--color-bg-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); font-size: 13px;
}
.account-dropdown-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: none;
  text-align: right;
  transition: background-color .2s var(--ease);
}
.account-menu-item:hover { background: rgba(var(--color-primary-rgb), .12); color: var(--color-primary); }
.account-menu-item i { width: 14px; text-align: center; color: var(--color-primary); }
.account-menu-item.logout { color: #c0374a; }
.account-menu-item.logout i { color: #c0374a; }
.account-login-prompt { padding: 10px 9px 9px; text-align: center; }
.account-login-prompt p { font-size: 11px; color: var(--color-text-muted); margin-bottom: 8px; }

/* ---------- صفحات حساب کاربری (سایز/سفارش/پروفایل/پیگیری) ---------- */
.account-page { padding: 22px 0 50px; }
.account-page-intro { max-width: 640px; margin: 0 auto 16px; text-align: center; }
.account-guard {
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
  padding: 22px 14px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.account-guard p { color: var(--color-text-muted); margin-bottom: 10px; }

.size-form, .profile-form {
  max-width: 460px;
  margin: 0 auto 18px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.admin-form-card {
  width: 100%;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.size-live-preview {
  text-align: center;
  padding: 7px;
  margin: 3px 0 9px;
  border-radius: var(--radius-sm);
  background: rgba(var(--color-primary-rgb), .1);
  color: var(--color-primary);
  font-size: 11.5px;
}
.size-live-preview strong { font-size: 13px; }

.size-profile-list, .order-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 0 auto; }
.size-profile-card, .order-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
/* بخش اضافه‌ی کارت سفارش شین (پیش‌نمایش محصول/دکمه‌ی تکمیل/دلیل رد) — چون این
   محتوا خیلی بزرگ‌تر از یک ردیف فشرده‌ست، همیشه به‌صورت یک خط کامل جدا زیر می‌افته. */
.shein-order-extra { flex: 1 0 100%; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--color-border); }
.shein-order-extra .shein-product-preview { margin-bottom: 8px; }
.size-profile-info strong, .order-card-info strong { display: block; font-size: 12.5px; margin-bottom: 3px; }
.size-profile-info span, .order-card-info span { font-size: 11px; color: var(--color-text-muted); }
.size-profile-badge {
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--gradient-brand);
  padding: 4px 10px; border-radius: 999px; flex-shrink: 0;
}
.size-profile-delete { flex-shrink: 0; color: var(--color-text-muted); }
.size-profile-delete:hover { color: #c0374a; background: rgba(192, 55, 74, .1); }

.order-status-badge {
  font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: rgba(var(--color-primary-rgb), .12); color: var(--color-primary);
  flex-shrink: 0;
}

.avatar-upload { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar-preview {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden;
  background: var(--color-bg-alt); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); font-size: 17px;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.upload-progress { margin-top: 6px; }
.upload-progress-bar { height: 5px; border-radius: 999px; background: var(--color-bg-alt); overflow: hidden; }
.upload-progress-bar span { display: block; height: 100%; background: var(--gradient-brand); border-radius: 999px; transition: width .15s linear; }
.upload-progress-label { font-size: 10px; color: var(--color-text-muted); margin-top: 3px; display: block; }

.track-form { max-width: 380px; margin: 0 auto 18px; padding: 14px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.track-timeline { max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 3px; }
.track-step { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.track-step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-border); flex-shrink: 0; }
.track-step.done .track-step-dot { background: var(--gradient-brand); }
.track-step span { font-size: 11.5px; color: var(--color-text-muted); }
.track-step.done span { color: var(--color-text); font-weight: 600; }
.track-not-found { text-align: center; color: var(--color-text-muted); padding: 12px 0; }

.track-order-card {
  max-width: 420px; margin: 0 auto 13px; padding: 12px;
  border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.track-order-header { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--color-border); }
.track-order-header strong { font-size: 12px; }
.track-order-header span { font-size: 10.5px; color: var(--color-text-muted); }

.track-step-reveal { opacity: 0; transform: translateX(10px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.track-step-reveal.is-visible { opacity: 1; transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .track-step-reveal { opacity: 1; transform: none; transition: none; }
}

.track-step-dot.is-current { animation: track-step-pulse 1.6s ease-out infinite; }
@keyframes track-step-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), .5); }
  100% { box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .track-step-dot.is-current { animation: none; }
}

/* ---------- پنل ادمین: chrome سبک (سایدبار + جدول‌ها)، جدا از هدر مشتری ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 190px;
  flex-shrink: 0;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-radius: 0;
  border-width: 0 1px 0 0;
}
.admin-brand { display: flex; align-items: center; gap: 7px; padding: 0 5px 12px; }
.admin-brand strong { font-size: 12.5px; flex: 1; }
.admin-sidebar-close-btn, .admin-menu-toggle-btn { display: none; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.admin-nav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 11.5px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.admin-nav-link i { width: 13px; text-align: center; }
.admin-nav-link:hover, .admin-nav-link.active { background: rgba(var(--color-primary-rgb), .12); color: var(--color-primary); }
.admin-sidebar-footer { border-top: 1px solid var(--color-border); padding-top: 9px; display: flex; flex-direction: column; gap: 5px; }
.admin-sidebar-footer .admin-name { font-size: 11px; font-weight: 600; color: var(--color-text); }

.admin-main { flex: 1; padding: 18px; overflow-x: auto; min-width: 0; }
.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.admin-header-row h1 { font-size: 16px; font-weight: 700; }

.admin-list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-search-input {
  flex: 1;
  min-width: 220px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 12.5px;
  transition: border-color .2s var(--ease);
}
.admin-search-input:focus { outline: none; border-color: var(--color-primary); }
.admin-sort-trigger {
  width: 140px;
  padding: 8px 26px 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 12.5px;
  text-align: right;
  cursor: pointer;
}

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: 11.5px; }
.admin-table th, .admin-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--color-border); white-space: nowrap; vertical-align: middle; }
.admin-table th { color: var(--color-text-muted); font-weight: 600; background: var(--color-bg-alt); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700; background: rgba(var(--color-primary-rgb), .12); color: var(--color-primary); }
.admin-empty { padding: 22px; text-align: center; color: var(--color-text-muted); }
.admin-table-actions { display: flex; align-items: center; gap: 4px; height: 100%; }
.admin-material-cell { display: inline-flex; align-items: center; gap: 6px; }
.admin-material-cell img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--color-border); flex-shrink: 0; }

/* دکمه‌ی «لینک محصول Shein» — چون تنها ابزار ادمینه برای دیدن محصول واقعی روی سایت
   Shein، باید همیشه اول چیزی باشه که چشم می‌بینه، نه یه دکمه‌ی خنثی مثل بقیه. */
.shein-product-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(var(--color-accent-rgb), .12);
  border: 1.5px solid rgba(var(--color-accent-rgb), .35);
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 13px;
  transition: background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.shein-product-link-btn i { font-size: 15px; }
.shein-product-link-btn:hover { background: rgba(var(--color-accent-rgb), .2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.shein-product-link-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(var(--color-accent-rgb), .08);
  border: 1px solid rgba(var(--color-accent-rgb), .22);
}
.shein-product-link-cell img { width: 32px; height: 40px; border-radius: 6px; object-fit: contain; background: var(--color-bg-alt); flex-shrink: 0; }
.shein-product-link-cell i { color: var(--color-accent-dark); }
.shein-product-link-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.order-status-select {
  padding: 6px 22px 6px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 11px;
  min-width: 110px;
  transition: border-color .2s var(--ease);
}
.order-status-select:hover { border-color: var(--color-primary); }
.admin-table-actions .icon-btn { width: 24px; height: 24px; }

.permission-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.color-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row .color-name { flex: 1; }
.color-row .color-hex {
  width: 42px; height: 38px; padding: 2px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); cursor: pointer; flex-shrink: 0;
}
.color-row .icon-btn { width: 36px; height: 36px; flex-shrink: 0; }

.color-swatch-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.color-swatch-grid .color-swatch-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 13px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.color-swatch-grid .color-swatch-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex-shrink: 0; }
.color-swatch-grid .color-swatch-chip:has(input:checked) { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), .1); font-weight: 600; }
.color-swatch-add {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
}
.color-swatch-add input[type="text"] { flex: 1; min-width: 120px; }
.color-rgb-input-wrap { display: flex; align-items: center; gap: 8px; }
.color-rgb-input-wrap input[type="text"] { width: 150px; flex: initial; }
.color-rgb-preview {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: transparent;
  transition: background-color .15s var(--ease);
}
.color-rgb-preview.is-invalid { border-color: #c0374a; }

.variant-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.variant-color-group { display: flex; flex-direction: column; gap: 8px; }
.variant-bulk-apply {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: rgba(var(--color-primary-rgb), .07);
  border: 1px dashed rgba(var(--color-primary-rgb), .35);
}
.variant-bulk-apply-label { font-size: 12px; color: var(--color-text-muted); }
.variant-bulk-apply input.variant-bulk-qty { width: 90px; text-align: center; }
.variant-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--color-bg-alt); }
.variant-row-label { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.variant-row-label .color-swatch-dot { width: 14px; height: 14px; }
.variant-row input.variant-qty { width: 90px; text-align: center; }

.category-tree-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.category-tree-item.is-child { margin-right: 28px; background: var(--color-bg-alt); box-shadow: none; }
.category-tree-item-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- مدیریت اسلایدهای هیرو سکشن در پنل ادمین ---------- */
.hero-slide-admin-list { display: flex; flex-direction: column; gap: 8px; }
.hero-slide-admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.hero-slide-admin-thumb { width: 64px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--color-bg-alt); }
.hero-slide-admin-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hero-slide-admin-info strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-slide-admin-info span { font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-slide-admin-order { display: flex; gap: 2px; flex-shrink: 0; }

.admin-image-gallery {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 10px;
}
.admin-image-thumb {
  position: relative;
  width: 64px; height: 78px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--color-bg-alt); flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.admin-image-thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--color-bg-alt); }
.admin-image-cover-badge {
  position: absolute; bottom: 3px; left: 3px;
  font-size: 9px; font-weight: 600; color: #fff;
  background: var(--gradient-brand);
  padding: 2px 6px; border-radius: 999px;
}
.admin-image-remove-btn {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20, 16, 20, .65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; border: none; cursor: pointer;
}
.admin-image-remove-btn:hover { background: #c0374a; }
.admin-image-setmain-btn {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20, 16, 20, .65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; border: none; cursor: pointer;
}
.admin-image-setmain-btn:hover { background: var(--gradient-brand); }

.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 14px; }
.admin-login-card { max-width: 320px; width: 100%; padding: 18px 15px; border-radius: var(--radius-lg); }

.admin-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 998;
}

@media (max-width: 860px) {
  .admin-menu-toggle-btn { display: inline-flex; flex-shrink: 0; }
  .admin-sidebar-close-btn { display: inline-flex; flex-shrink: 0; }

  .admin-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 82vw;
    max-width: 300px;
    height: 100vh;
    z-index: 999;
    border-width: 0 0 0 1px;
    transform: translateX(100%);
    transition: transform .25s var(--ease);
    overflow-y: auto;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar-overlay.open { display: block; }

  .admin-nav { overflow-x: visible; }
  .admin-sidebar-footer { flex-direction: column; border-top: 1px solid var(--color-border); padding-top: 14px; }
  .admin-main { padding: 18px; }
  .admin-header-row { flex-wrap: nowrap; gap: 10px; }
  .admin-header-row h1 { font-size: 18px; }
}

@media (max-width: 560px) {
  .admin-form-card { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-table-actions { gap: 8px; }
  .admin-table-actions .icon-btn { width: 36px; height: 36px; }
  .color-preset-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; }
  .admin-header-row { gap: 8px; }
  .admin-header-row .btn { font-size: 13px; padding: 9px 14px; }
}

/* ---------- سایدبار فیلتر محصولات (دسته‌بندی/موجودی/رنگ) ---------- */
.filter-mobile-open-btn { display: inline-flex; margin-bottom: 9px; }
@media (min-width: 900px) { .filter-mobile-open-btn { display: none; } }

.filter-sidebar {
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-self: start;
}
.filter-sidebar-header { display: none; align-items: center; justify-content: space-between; }
.filter-sidebar-header h3 { font-size: 13px; font-weight: 700; }

.filter-group h4 { font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 9px; letter-spacing: .3px; }
.filter-checkbox-row { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.filter-checkbox-row:hover { background: rgba(var(--color-primary-rgb), .06); color: var(--color-primary); }
.filter-checkbox-row input { accent-color: var(--color-primary); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.filter-checkbox-row-child { padding-inline-start: 20px; font-size: 12.5px; }

.filter-category-group { margin-bottom: 2px; }
.filter-category-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 7px 4px; border-radius: var(--radius-sm); background: none; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; font-family: inherit; color: var(--color-text); text-align: right;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.filter-category-group-toggle span { display: flex; align-items: center; gap: 9px; }
.filter-category-group-toggle:hover { color: var(--color-primary); background: rgba(var(--color-primary-rgb), .06); }
.filter-group-active-label { color: var(--color-primary); font-weight: 600; }
.filter-group-caret { font-size: 11px; color: var(--color-text-muted); transition: transform .2s var(--ease); }
.filter-category-group.is-expanded .filter-group-caret { transform: rotate(180deg); color: var(--color-primary); }
.filter-category-children {
  max-height: 0; overflow: hidden;
  transition: max-height .25s var(--ease);
}
.filter-category-group.is-expanded .filter-category-children { max-height: 320px; }

.filter-switch { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 11.5px; }
.filter-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-switch-track { width: 28px; height: 16px; border-radius: 999px; background: var(--color-border); position: relative; transition: background-color .2s var(--ease); flex-shrink: 0; }
.filter-switch-track::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.filter-switch input:checked + .filter-switch-track { background: var(--gradient-brand); }
.filter-switch input:checked + .filter-switch-track::after { transform: translateX(-12px); }

.filter-color-list { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-color-swatch {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.filter-color-swatch-dot {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, .15);
}
.filter-color-swatch:hover { border-color: var(--color-primary); }
.filter-color-swatch.active { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), .1); font-weight: 600; }

.filter-empty-hint { font-size: 10.5px; color: var(--color-text-muted); }

@media (max-width: 899px) {
  .filter-sidebar {
    position: fixed; top: 0; right: 0; height: 100%; width: min(340px, 88%);
    z-index: 230; border-radius: 0;
    padding: 16px 15px;
    gap: 18px;
    transform: translateX(100%);
    transition: transform .3s var(--ease);
    overflow-y: auto;
  }
  .filter-sidebar.open { transform: translateX(0); }
  .filter-sidebar-header { display: flex; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); margin-bottom: 2px; }
  .filter-sidebar-header h3 { font-size: 15px; }
  #filter-overlay { z-index: 225; }

  .filter-group h4 { font-size: 12px; margin-bottom: 10px; }
  .filter-checkbox-row { padding: 7px 0; font-size: 13.5px; gap: 9px; }
  .filter-checkbox-row input { width: 17px; height: 17px; }
  .filter-checkbox-row-child { padding-inline-start: 22px; font-size: 13px; }
  .filter-category-group-toggle { padding: 7px 0; font-size: 13.5px; }
  .filter-switch { font-size: 13.5px; }
  .filter-switch-track { width: 34px; height: 20px; }
  .filter-switch-track::after { width: 16px; height: 16px; }
  .filter-switch input:checked + .filter-switch-track::after { transform: translateX(-14px); }

  .filter-color-list { gap: 9px; }
  .filter-color-swatch { padding: 6px 12px 6px 8px; font-size: 12.5px; }
  .filter-color-swatch-dot { width: 18px; height: 18px; }

  .filter-mobile-open-btn { width: 100%; justify-content: center; padding: 10px; font-size: 13px; }
}

/* ---------- آکاردئون سوالات متداول ---------- */
.faq-page { padding: 22px 0 50px; }
.faq-intro { max-width: 760px; margin: 0 auto 18px; text-align: center; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  background: transparent;
  border: none;
  color: var(--color-text);
}
.faq-question i { transition: transform .25s var(--ease); color: var(--color-primary); flex-shrink: 0; }
.faq-item.open .faq-question i { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-item.open .faq-answer { max-height: 600px; }
.faq-answer-inner { padding: 0 13px 11px; color: var(--color-text-muted); font-size: 11.5px; line-height: 1.9; }
.faq-empty { text-align: center; color: var(--color-text-muted); padding: 16px 0; }

/* ---------- صفحه‌ی تماس با ما ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto 20px;
}
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.contact-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: #fff;
}
.contact-card-icon--whatsapp { background: #25d366; }
.contact-card-icon--telegram { background: #29a9eb; }
.contact-card-icon--phone { background: var(--color-primary); }
.contact-card-icon--location { background: var(--color-secondary, var(--color-primary)); }
.contact-card-body h3 { font-size: 13.5px; margin-bottom: 4px; }
.contact-card-body p { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.8; margin: 0; }
.contact-hours-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 16px;
  border-radius: var(--radius-md);
}
.contact-hours-card h3 { font-size: 13.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.contact-hours-card .footer-hours { margin: 0; }
/* .footer-hours رنگ‌هاش برای پس‌زمینه‌ی همیشه-تیره‌ی فوتر ثابت شده (#a89ba3/#e9e3e7)؛
   این کارت روی زمینه‌ی شیشه‌ای صفحه (که در تم روشن روشنه) با همون رنگ‌ها تضاد کافی
   نداره، پس این‌جا با متغیرهای تم (که خودشون بین روشن/تیره سوییچ می‌شن) بازنویسی می‌شه. */
.contact-hours-card .footer-hours li { color: var(--color-text-muted); }
.contact-hours-card .footer-hours li span:last-child { color: var(--color-text); }

/* ---------- نوار شناور تماس سریع (تلگرام/واتساپ/تماس) ----------
   نسخه‌ی تاییدشده‌ی قبلی (نوار کامل پایین صفحه با لیبل) — فقط باریک‌تر/کوچیک‌تر
   شده (ارتفاع و آیکون‌ها کوچیک‌تر)، بدون تغییر در حالت کلی (پیل کوچک گوشه‌ای نبود). */
.contact-bar {
  --contact-bar-h: 34px;
  position: fixed;
  right: 0; left: 0; bottom: 0;
  z-index: 250;
  display: flex;
  height: var(--contact-bar-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-width: 1px 1px 0 1px;
  overflow: hidden;
}
.contact-bar-item {
  flex: 1 1 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  position: relative;
  color: var(--color-text);
  font-size: 10.5px; font-weight: 600;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.contact-bar-item + .contact-bar-item::before {
  content: '';
  position: absolute; right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--glass-border);
}
.contact-bar-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 9.5px; color: #fff;
  transition: transform .2s var(--ease);
  flex-shrink: 0;
}
.contact-bar-item:hover .contact-bar-icon { transform: scale(1.1); }
.contact-bar-item:hover { background: var(--color-bg-alt); }
.contact-bar-item--telegram .contact-bar-icon { background: var(--color-telegram); }
.contact-bar-item--whatsapp .contact-bar-icon { background: var(--color-whatsapp); }
.contact-bar-item--phone .contact-bar-icon { background: var(--gradient-brand); }
@media (max-width: 560px) {
  .contact-bar { --contact-bar-h: 32px; }
  .contact-bar-item { font-size: 9px; gap: 4px; }
  .contact-bar-icon { width: 16px; height: 16px; font-size: 9px; }
}
body.cart-open .contact-bar,
body.checkout-open .contact-bar {
  display: none;
}

/* ---------- اسکلت لودینگ ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--color-surface-rgb), .55), transparent);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

.skeleton-card { display: flex; flex-direction: column; gap: 8px; }
.skeleton-card .skeleton-image { aspect-ratio: 4 / 5; }
.skeleton-card .skeleton-line { height: 12px; border-radius: 999px; }
.skeleton-category { aspect-ratio: 4 / 3; }
.skeleton-hero { width: 100%; aspect-ratio: 21 / 9; border-radius: var(--radius-lg); }
.skeleton-pdp { width: 100%; max-width: 480px; aspect-ratio: 3 / 4; border-radius: var(--radius-lg); margin: 24px auto; }

/* ---------- نوار پیشرفت بارگذاری صفحه ---------- */
#page-load-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  background: var(--gradient-brand);
  z-index: 9999;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
#page-load-bar.is-loading {
  width: 70%;
  opacity: 1;
  transition: width 8s cubic-bezier(.1, .9, .1, 1), opacity .2s ease;
}

/* ---------- fade/reveal پلکانی هنگام اسکرول ---------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
}

/* ---------- توست ---------- */
.toast {
  position: fixed;
  top: calc(var(--header-h) + 16px + env(safe-area-inset-top, 0));
  right: 16px;
  left: auto;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-primary);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 9990;
}
.toast.show { opacity: 1; transform: translateX(0); pointer-events: auto; }
body.has-banner .toast { top: calc(var(--banner-h, 40px) + var(--header-h) + 16px + env(safe-area-inset-top, 0)); }
@media (max-width: 560px) {
  .toast { right: 10px; padding: 12px 14px; font-size: 13px; }
  body.has-banner .toast { top: calc(var(--banner-h-mobile, 34px) + var(--header-h) + 16px + env(safe-area-inset-top, 0)); }
}

/* ==========================================================================
   ویژوالایزور دموی چندمرحله‌ای کارلی شاپ — کامپوننت اختصاصی، مستقل از اسلایدر
   تصویری هیرو؛ هر مرحله قابلیت واقعی سایت رو با انیمیشن مخصوص خودش روایت می‌کنه.
   ========================================================================== */
.hero-demo { padding: 50px 0 60px; position: relative; overflow: hidden; }
.hero-demo-heading { text-align: center; max-width: 640px; margin: 0 auto 26px; }
.hero-demo-stage {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius-lg);
  outline: none;
}
.hero-demo-panels { position: relative; min-height: 300px; }

.hero-demo-panel {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 30px;
  padding: 26px 30px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease);
}
.hero-demo-panel.is-active {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; position: relative;
  box-shadow: var(--shadow-lg), 0 0 32px rgba(var(--color-primary-rgb), .16);
}
/* حاشیه‌ی نازک گرادیانتِ چرخان — یک لایه‌ی conic-gradient بزرگ‌تر از کارت که پشتِ
   بک‌گراند خودِ کارت می‌شینه (z-index:-1 داخل stacking context‌ای که transform
   روی خودِ .hero-demo-panel ساخته)، فقط ۲px حاشیه‌اش از پشتِ لبه‌ی کارت دیده می‌شه. */
.hero-demo-panel::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: transparent;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.hero-demo-panel.is-active::before { opacity: 1; animation: hdv-border-spin 5s linear infinite; }
@keyframes hdv-border-spin { to { transform: rotate(-360deg); } }

.hero-demo-panel-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff; font-size: 19px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), .35);
}
.hero-demo-panel-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.hero-demo-panel-info p { font-size: 13px; color: var(--color-text-muted); line-height: 1.9; }

.hero-demo-visual {
  min-height: 180px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

/* مرحله ۱: کشف محصول — چیپ‌ها و کارت‌ها با ورود پلکانی (stagger) */
.hdv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hdv-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--color-surface); box-shadow: var(--shadow-sm);
  font-size: 11.5px; font-weight: 600; color: var(--color-text);
  opacity: 0; transform: translateY(8px);
}
.hero-demo-panel.is-active .hdv-chip { animation: hdv-fade-up .5s var(--ease) forwards; animation-delay: calc(var(--d) * .12s); }
.hdv-chip i { color: var(--color-primary); }
/* هر کارت یعنی «یک نتیجه‌ی منطبق با فیلتر» — آیکون نوع پوشاک + نشان تیک تاییدِ
   مطابقت، به‌جای یک مستطیل گرادیانت تخت و بی‌معنی. */
.hdv-cards { display: flex; gap: 8px; }
.hdv-card {
  position: relative;
  flex: 1; height: 46px; border-radius: var(--radius-sm);
  background: var(--gradient-brand); opacity: 0; transform: scale(.85);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .85); font-size: 17px;
}
.hero-demo-panel.is-active .hdv-card { animation: hdv-pop-in .5s var(--ease) forwards; animation-delay: calc(.3s + var(--d) * .1s); }
.hdv-card-match {
  position: absolute; top: -5px; left: -5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; color: var(--color-success, #2e9e5b);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; box-shadow: var(--shadow-sm);
}

/* مرحله ۲: راهنمای سایز — نوار اندازه‌گیری با پرشدن انیمیشنی + نتیجه با ورود تاخیری */
.hdv-size-rows { display: flex; flex-direction: column; gap: 10px; }
.hdv-size-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--color-text-muted); }
.hdv-size-row span:first-child { width: 34px; flex-shrink: 0; }
.hdv-size-bar-track { flex: 1; height: 7px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.hdv-size-bar { height: 100%; width: 0; border-radius: 999px; background: var(--gradient-brand); }
.hero-demo-panel.is-active .hdv-size-bar { animation: hdv-fill-bar .7s var(--ease) forwards; animation-delay: calc(var(--d) * .15s); }
.hdv-size-result {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: rgba(var(--color-primary-rgb), .1);
  font-size: 12px; font-weight: 600; color: var(--color-primary);
  opacity: 0;
}
.hero-demo-panel.is-active .hdv-size-result { animation: hdv-fade-up .5s var(--ease) forwards; animation-delay: .7s; }
.hdv-size-result strong { font-size: 16px; }

/* مرحله ۳: سفارش از Shein — تایم‌لاین با خط پیشرونده */
.hdv-timeline { display: flex; flex-direction: column; gap: 4px; position: relative; padding-inline-start: 6px; }
.hdv-timeline-step { display: flex; align-items: center; gap: 12px; padding: 7px 0; opacity: 0; transform: translateX(10px); }
.hero-demo-panel.is-active .hdv-timeline-step { animation: hdv-slide-in .5s var(--ease) forwards; animation-delay: calc(var(--d) * .25s); }
.hdv-timeline-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient-brand);
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), .15);
}
.hdv-timeline-step { margin-inline-start: 5px; padding-inline-start: 15px; }
.hdv-timeline-step:not(:last-child) { border-inline-start: 2px dashed var(--color-border); }
.hdv-timeline-label { font-size: 12px; font-weight: 500; }

/* مرحله ۴: رسید پرداخت — ردیف‌های رنگی با ورود پلکانی */
.hdv-receipt { display: flex; flex-direction: column; gap: 6px; }
.hdv-receipt-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--color-text-muted);
  padding: 6px 0; opacity: 0; transform: translateY(6px);
}
.hero-demo-panel.is-active .hdv-receipt-row { animation: hdv-fade-up .45s var(--ease) forwards; animation-delay: calc(var(--d) * .18s); }
.hdv-receipt-row--shipping { color: var(--color-primary); font-weight: 600; border-top: 1px dashed var(--color-border); }
.hdv-receipt-row--total { font-weight: 700; color: var(--color-text); font-size: 13.5px; border-top: 1px solid var(--color-border); padding-top: 9px; }

/* مرحله ۵: پیگیری سفارش — تایم‌لاین با تیک سبز و خط پیشرونده */
.hdv-track { display: flex; flex-direction: column; gap: 4px; }
.hdv-track-step { display: flex; align-items: center; gap: 12px; padding: 6px 0; opacity: 0; transform: translateX(10px); }
.hero-demo-panel.is-active .hdv-track-step { animation: hdv-slide-in .5s var(--ease) forwards; animation-delay: calc(var(--d) * .22s); }
.hdv-track-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-success, #2e9e5b); color: #fff; font-size: 9px;
}
/* margin/padding باید روی همه‌ی مرحله‌ها یکسان باشه تا دات‌ها هم‌تراز بمونن؛
   فقط خط نقطه‌چین اتصال (border) لازم نیست مرحله‌ی آخر داشته باشه، چون بعدش
   مرحله‌ی دیگه‌ای نیست که بهش وصل بشه. */
.hdv-track-step { margin-inline-start: 9px; padding-inline-start: 15px; }
.hdv-track-step:not(:last-child) { border-inline-start: 2px dashed var(--color-border); }
.hdv-track-label { font-size: 12px; font-weight: 500; }

/* دات‌های ناوبری دستی بین مراحل */
.hero-demo-progress { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.hero-demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); border: none; cursor: pointer; transition: all .25s var(--ease); }
.hero-demo-dot.active { width: 22px; border-radius: 999px; background: var(--gradient-brand); }

@keyframes hdv-fade-up { to { opacity: 1; transform: translateY(0); } }
@keyframes hdv-pop-in { to { opacity: 1; transform: scale(1); } }
@keyframes hdv-slide-in { to { opacity: 1; transform: translateX(0); } }
@keyframes hdv-fill-bar { to { width: var(--w); } }

@media (prefers-reduced-motion: reduce) {
  .hero-demo-panel { transition: opacity .2s linear; }
  .hero-demo-panel::before { animation: none !important; }
  .hdv-chip, .hdv-card, .hdv-size-bar, .hdv-size-result, .hdv-timeline-step, .hdv-receipt-row, .hdv-track-step {
    animation: none !important; opacity: 1 !important; transform: none !important; width: var(--w, auto) !important;
  }
}

@media (max-width: 820px) {
  .hero-demo-panel { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .hero-demo-stage, .hero-demo-panels { min-height: 420px; }
}
@media (max-width: 560px) {
  .hero-demo { padding: 34px 0 44px; }
  .hero-demo-panel-info h3 { font-size: 15.5px; }
  .hero-demo-stage, .hero-demo-panels { min-height: 460px; }
}

/* ---------- مودال مشاهده کامل سفارش (ادمین) ---------- */
.order-detail-modal { max-width: 620px; text-align: right; }
.order-detail-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.order-detail-section:first-of-type { margin-top: 14px; }
.order-detail-section h4 { font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 10px; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13.5px; line-height: 1.9; }
.order-detail-grid .order-detail-span2 { grid-column: 1 / -1; }
.order-detail-items { display: grid; gap: 10px; }
.order-detail-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); background: rgba(0,0,0,.02); }
.order-detail-item-img { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; background: var(--color-bg-alt); flex-shrink: 0; }
.order-detail-item-img--empty { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); background: rgba(0,0,0,.05); }
.order-detail-item-info { flex: 1; min-width: 0; }
.order-detail-item-name { font-weight: 600; font-size: 13.5px; }
.order-detail-item-meta { font-size: 12px; color: var(--color-text-muted); }
.order-detail-item-total { font-weight: 700; font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) {
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* ---------- مودال بزرگ‌نمایی گالری تصاویر محصول ---------- */
.pd-gallery-slide { cursor: zoom-in; }
.pd-lightbox-overlay { background: rgba(10, 8, 10, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 0; }
.pd-lightbox {
  position: relative;
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: scale(.94); opacity: 0;
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .3s var(--ease);
}
.pd-lightbox-overlay.active .pd-lightbox { transform: scale(1); opacity: 1; }
.pd-lightbox-stage { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 80vh; }
.pd-lightbox-img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-md); user-select: none; -webkit-user-drag: none; }
.pd-lightbox-close { position: absolute; top: -46px; left: 0; background: rgba(255,255,255,.12); color: #fff; }
.pd-lightbox-close:hover { background: rgba(255,255,255,.22); }
.pd-lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.pd-lightbox-dots { display: flex; gap: 6px; }
.pd-lightbox-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.pd-lightbox-dot.active { background: #fff; transform: scale(1.25); }
@media (max-width: 560px) {
  .pd-lightbox { padding: 0 12px; }
  .pd-lightbox-stage { max-height: 65vh; }
}
