/* =========================================================================
 *  cards.css — Shafa Shahd Luxury Minimal Cards & Panels (Honeycomb Edition)
 * ========================================================================= */

.cta-panel {
  max-width: 56rem; margin: 0 auto; text-align: center;
  padding: clamp(var(--s-6), 6vw, var(--s-8)) clamp(var(--s-4), 5vw, var(--s-7));
  background:
    radial-gradient(circle at 50% 0%, rgba(223, 190, 122, 0.16) 0%, transparent 60%),
    var(--shafa-panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 60px -10px rgba(197, 160, 89, 0.15),
    0 4px 16px rgba(24, 22, 20, 0.03),
    0 0 0 1px var(--shafa-inset-ring) inset;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  position: relative;
  overflow: hidden;
}

.cta-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--shafa-gold-gradient);
}

.cta-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../img/honeycomb-luxury.svg');
  background-repeat: repeat;
  background-size: 56px 96px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.cta-panel > * {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border-radius: var(--shafa-radius-full);
  font-size: var(--shafa-fs-caption); font-weight: 500;
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
}
.badge--accent {
  background: var(--shafa-gold-gradient);
  color: var(--shafa-on-gold);
  box-shadow: 0 2px 8px rgba(197, 160, 89, 0.25);
}
.badge--sale {
  background: var(--shafa-emerald-tint-bg);
  color: var(--shafa-emerald-ink);
  border: 1px solid var(--shafa-emerald-tint-border);
  border-radius: var(--shafa-radius-full);
  padding: 3px 12px;
  font-size: var(--shafa-fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

@keyframes badge-subtle-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.25);
    border-color: rgba(197, 160, 89, 0.5);
  }
  50% {
    box-shadow: 0 4px 16px rgba(197, 160, 89, 0.45);
    border-color: var(--shafa-gold-hover);
  }
}
.badge--top {
  position: absolute; top: var(--s-3); right: var(--s-3); z-index: 5;
  background: var(--shafa-gold-gradient);
  color: var(--shafa-on-gold);
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: var(--shafa-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 12px rgba(197, 160, 89, 0.40);
  animation: badge-subtle-glow 4s ease-in-out infinite;
}

/* Boutique Product Card — Luxury Honeycomb Edition */
.product-card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--shafa-card-bg);
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 20px; padding: var(--s-4);
  box-shadow:
    0 4px 20px -2px rgba(24, 22, 20, 0.05),
    0 0 0 1px var(--shafa-inset-ring) inset;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 450ms ease;
  overflow: hidden;
}

/* Subtle Honeycomb Watermark on Card Hover */
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../img/honeycomb-luxury.svg');
  background-repeat: repeat;
  background-size: 42px 72px;
  opacity: 0;
  transition: opacity 450ms ease;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
}

.product-card:hover::before {
  opacity: 0.22;
}

/* Inset Gold Hairline Frame */
.product-card::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(197, 160, 89, 0.12);
  border-radius: 14px;
  pointer-events: none;
  z-index: 1;
  transition: border-color 300ms ease;
}

.product-card:hover::after {
  border-color: rgba(197, 160, 89, 0.35);
}

.product-card > * {
  position: relative;
  z-index: 2;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(197, 160, 89, 0.65);
  box-shadow:
    0 24px 48px -10px rgba(197, 160, 89, 0.25),
    0 6px 18px rgba(24, 22, 20, 0.06);
}

.product-card:active {
  transform: translateY(-2px) scale(0.99);
  transition-duration: 100ms;
}

/* از style.css منتقل شد. outline برای حالتی است که کاربر داخل کارت فوکوس
   کرده (چک‌باکس مقایسه) — بدون آن فوکوس کاملاً گم می‌شد. */
.product-card:focus-within {
  /* outline با offset 4px بیرون از کارت و روی پس‌زمینهٔ بخش کشیده می‌شود،
     پس روی سطح روشن سنجیده می‌شود: ۵٫۰۶:۱. رنگ قبلی #C5A059 فقط ۲٫۳۲:۱. */
  outline: 2px solid var(--shafa-gold-text);
  outline-offset: 4px;
}

/* modifierهای امضای Stitch — از style.css منتقل شد. این‌ها توسط
   personalization.php و index.php با کلید opts فعال می‌شوند. */
.product-card--paper {
  background-image: var(--paper-texture);
  background-color: var(--shafa-card-bg);
}
.product-card--center { text-align: center; }
.product-card--center .product-card__meta,
.product-card--center .product-card__identity,
.product-card--center .product-card__cat { justify-content: center; }

/* aspect-ratio از 1 به 4/3 — تصویر مربع ۴۶٪ ارتفاع کارت را می‌گرفت و کارت
   را ۱:۲.۰۵ می‌کرد. 4/3 همان قاب مربع را با ~۲۵٪ ارتفاع کمتر نگه می‌دارد.
   هدف دیزاین‌سیستم (MASTER.md:260) ۴۰۰×۴۸۰ است؛ با حفظ خلاصه/وزن/منطقه
   روی کارت، ۱:۱.۲ بدون حذف محتوا قابل‌دستیابی نیست. */
.product-card__img {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: var(--shafa-media-bg);
  border: 1px solid rgba(197, 160, 89, 0.20);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.04);
  transition: border-color 350ms ease, box-shadow 350ms ease;
}

/* از style.css منتقل شد — آن نسخه border 2px و overflow داشت و اینجا
   1px بود، پس قاب تصویر در همهٔ صفحات ۲ پیکسل نازک‌تر رندر می‌شد. */
.product-card__img.img-frame {
  border: 2px solid var(--shafa-border-subtle);
  overflow: hidden;
}

/* از style.css منتقل شد: تنها قانونی که وضعیت «هنوز لود نشده» را صریحاً
   صفر می‌کرد. بدون آن، تصویر قبل از .is-loaded یک پرش کوتاه می‌داشت. */
html.js-motion .product-card__img img:not(.is-loaded) { opacity: 0; }

/* از style.css منتقل شد — ظاهر برچسب منطقه/فصل داخل __meta. */
.product-card__meta .tag {
  padding: 2px 10px;
  border: 1px solid var(--shafa-border-subtle);
  border-radius: var(--shafa-radius-full);
  background: var(--shafa-input-bg);
}

.product-card:hover .product-card__img {
  border-color: rgba(197, 160, 89, 0.50);
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.20);
}

.product-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 300ms ease-out, transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.product-card__img img.is-loaded { opacity: 1; }
.product-card:not(:hover) .product-card__img img { will-change: auto; }
.product-card:hover .product-card__img img {
  transform: scale(1.08);
}

.product-card:hover .product-card__title {
  color: var(--shafa-gold-text);
}
.product-card__title {
  font-size: var(--shafa-fs-body); font-weight: 700; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--shafa-text-primary);
  transition: color 250ms ease;
}
.product-card__title a { color: inherit; text-decoration: none; }

.product-card__meta {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  color: var(--shafa-text-secondary); font-size: var(--fs-small);
}

/* شمارندهٔ پایان برداشت (per-product — جایگزین بنر سراسری حذف‌شده).
   اینجا می‌نشیند، نه در style.css: همان‌طور که خود style.css یادآوری می‌کند،
   تعریف کارت‌ها عمداً از آن فایل به اینجا منتقل شده و برگرداندنش تعریف
   تکراری می‌سازد.

   رنگ: --shafa-status-warning. این توکن در ColorContrastTest جزو
   TEXT_TOKENS است، یعنی روی هر سطحِ تم روشن و تاریک بالای ۴٫۵:۱ سنجیده
   شده — پس نیازی به بررسی دستیِ اینجا نیست و یک رنگ تازه هم ساخته نشده.
   پس‌زمینه و حاشیه هم از توکن‌های موجود گرفته شده‌اند (نه rgba دستی) تا
   با تغییر پالت، این بج هم به‌روز شود.

   Accessibility: بج تزئینی نیست — متن قفل‌شدهٔ «N روز تا پایان برداشت»
   دارد و فقط نسخهٔ کامل‌تر (نام منطقه و تاریخ) در aria-label است. چون متن
   قاعدهٔ دیگری برای شکستن خط دارد (شمارنده تغییر می‌کند)، nowrap می‌ماند
   تا کارت نپرد. */
.product-card__harvest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 2px 10px;
  border: 1px solid var(--shafa-border-subtle);
  border-radius: var(--shafa-radius-full);
  background: var(--shafa-input-bg);
  color: var(--shafa-status-warning);
  font-size: var(--fs-small);
  font-weight: 600;
}
.product-card__harvest .material-symbols-outlined {
  font-size: 15px;
  color: inherit;
}

/* خلاصه و منطقه/فصل هر دو --fs-small و هر دو خاکستری-گرم بودند، پس کاربر
   نمی‌توانست تشخیص دهد کدام اطلاعات تصمیم‌ساز است. منطقه/فصل «منشأ» محصول است
   و برای عسل، مهم‌ترین عامل تمایز — پس رنگ تیره‌تر و وزن بیشتر گرفت. خلاصه
   عمداً کم‌رنگ ماند چون توضیح است، نه داده. */
.product-card__cat {
  display: inline-block;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--shafa-gold-text);   /* ۵.۱:۱ — جایگزین --accent-strong (۳.۰۸:۱) */
  margin-bottom: 4px;
}

/* از pages/product.css منتقل شد — آن فایل فقط در product.php و
   products.php لود می‌شود، پس در ۶+ صفحهٔ دیگر __body بدون flex/gap
   رندر می‌شد و کارت‌ها بین صفحات ناهمگون بودند.
   padding عمداً منتقل نشد: در دو صفحهٔ محصول ۱۲px پدینگ اضافه داخل
   کارتی که خودش ۲۴px دارد می‌ساخت و کارت را بلندتر می‌کرد. */
.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* سقف عرض کارت‌های تک‌کارتی (نتیجهٔ آزمون) — بدون این، کارت تا عرض
   کانتینر (۸۸۰px) کش می‌آید. */
.product-card--single { max-width: 420px; margin-inline: auto; }

.product-card__summary {
  color: var(--shafa-text-tertiary);
  font-size: var(--fs-small);
  line-height: 1.6;
  margin-block: var(--s-1) var(--s-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* وزن و بسته‌بندی — تا نوامبر ۱۴۰۴ فقط در pages/product.css تعریف شده بود، آن هم
   صفحه‌ای که در products.php لود نمی‌شود. نتیجه: در ۸ صفحهٔ مصرف‌کنندهٔ این کارت
   وزن/بسته‌بندی بدون هیچ استایلی رندر می‌شد — یعنی خرید ۵۰۰ گرم عسل بدون دیدن
   وزن. اینجا تعریف شد تا همراه bundle اصلی به همهٔ صفحات برسد. */
.product-card__identity {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--fs-small); color: var(--shafa-text-secondary);
  margin-block: var(--s-1) var(--s-2);
}
.product-card__identity-sep { color: var(--shafa-text-faint); }

/* توجه: تعریف .product-card__price اینجا عمداً نیست. پیش از این در همین فایل
   دو بلوک برای این selector وجود داشت (خط ۲۷۷ و ۳۷۹) و دومی همیشه برنده بود.
   یعنی هر ویرایشی روی اولی بی‌اثر می‌ماند — و برای قیمت (مهم‌ترین عدد کارت)
   دقیقاً همان چیزی است که نباید اتفاق بیفتد. تعریف واحد در بلوک
   «Product Card Footer» پایین‌تر آمده است. */

.pdp-price__old {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-size: var(--fs-small);
  margin-inline-end: var(--s-1);
}
.pdp-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block: var(--s-2);
}
.pdp-price__current {
  color: var(--text);
  font-weight: 700;
}
.pdp-price__save {
  flex-basis: 100%;
  font-size: var(--fs-small);
  color: var(--shafa-emerald-ink);
  font-weight: 700;
}

.pdp-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--shafa-text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--shafa-radius-full);
  background: var(--shafa-input-bg);
  border: 1px solid rgba(197, 160, 89, 0.2);
  transition:
    background var(--t-fast) ease,
    border-color var(--t-fast) ease,
    box-shadow var(--t-fast) ease,
    color var(--t-fast) ease;
}
.pdp-trust-badge .material-symbols-outlined {
  font-size: 20px;
  color: var(--shafa-gold-satin);
}
.pdp-trust-badge:hover {
  color: var(--shafa-text-primary);
  border-color: var(--shafa-gold-text);
  background: var(--shafa-input-bg-strong);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.15);
}

/* =========================================================================
 *  Products Grid — Center-aligned luxury grid (auto-adapting for 1-4 items)
 * ========================================================================= */
/* min() لازم است: در ویویپورت ۳۲۰px عرض دلخواه ۳۲۰ − ۴۸ (پدینگ کانتینر)
   = ۲۷۲px می‌شود که کمتر از حداقل قبلی ۲۸۰px بود و صفحه اسکرول افقی
   می‌داد. با min(280px, 100%) ستون روی عرض دلخواه محدود می‌شود و هرگز
   سرریز نمی‌کند. */
.products-grid,
.products-grid--auto {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 320px));
  justify-content: center;
  position: relative;
  width: 100%;
}

/* =========================================================================
 *  Product Card Footer — Clean 2-row layout with zero overflow
 * ========================================================================= */
.product-card__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid rgba(197, 160, 89, 0.16);
  width: 100%;
}

/* ردیف قیمت.
   flex-wrap اجباری است: این ردیف قیمت + نشان موجودی + نشان فعالیت را کنار هم
   می‌گذارد. در کمینه‌ترین کارت مجاز (grid: 280px، با پدینگ 24px و border 1px
   → فضای داخلی 230px) مجموع محتوا می‌شود:
       قیمت «۱,۲۰۰,۰۰۰ تومان»      ≈ 157px
       + نشان «در انبار»           ≈  74px
       + نشان فعالیت              ≈ 160px
       + دو فاصلهٔ 8px             ≈  16px   →  ≈ 407px
   یعنی 177px سرریز. چون .product-card هم overflow: hidden دارد، آن سرریز
   بریده می‌شد و قیمت ناقص دیده می‌شد. با wrap، نشان‌ها به خط بعدی می‌روند
   و قیمت همیشه کامل می‌ماند. */
.product-card__price-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: var(--s-2);
  width: 100%;
  gap: var(--s-2);
}

/* قیمت.
   ۱) رنگ: پیش از این با گرادیان طلایی و background-clip:text رندر می‌شد.
      هر سه stop آن گرادیان روی پس‌زمینهٔ روشن کارت زیر حد WCAG AA بودند:
          #DFC07A → 1.66:1     #C5A059 → 2.32:1     #9F7E3B → 3.59:1
      یعنی خود قیمت — مهم‌ترین عدد کارت — عملاً ناخوانا بود. حالا از
      --shafa-gold-text استفاده می‌شود که توکن رسمی برند برای «طلاییِ متن»
      است و 5.06:1 روی بدترین نقطهٔ پس‌زمینهٔ کارت (#FAF8F5) می‌دهد.
      در تم تاریک هم خودکار به طلایی روشن تبدیل می‌شود.

   ۲) flex: 0 0 auto — قیمت هرگز فشرده نمی‌شود. این با background-clip:text
      رابطهٔ مستقیم دارد: رنگ فقط داخل جعبهٔ پس‌زمینه وجود دارد، پس هر گلیفی
      که بیرون از جعبه بیفتد با -webkit-text-fill-color: transparent نامرئی
      می‌شود. با ثابت‌ماندن عرض، جعبه همیشه کل متن را می‌پوشاند. */
.product-card__price {
  font-weight: 700;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--shafa-gold-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  flex: 0 0 auto;
}

.product-card__price img {
  width: 18px;
  height: 22px;
  object-fit: contain;
}

.product-card__stock {
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--shafa-radius-full);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.product-card__stock--in {
  color: var(--shafa-emerald-ink);
  background: var(--shafa-emerald-tint-bg);
  border: 1px solid var(--shafa-emerald-tint-border);
}

.product-card__stock--out {
  color: #B91C1C;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.15);
}

/* موجودی کم — تا نوامبر ۱۴۰۴ تعریف نشده بود و product-card.php:118 شاخه‌ای
   داشت که دقیقاً همان متن «در انبار» را تولید می‌کرد، پس هرگز اجرا نمی‌شد.
   کلاس در style.css:2244 با #fff روی --danger بود اما کلیدframes آن‌جا نبود و
   CSS اختصاصی صفحهٔ فهرست لود نمی‌شود — یعنی در عمل هیچ‌وقت رندر نمی‌شد.
   سفید روی #9E2A2B = ۸.۴:۱. */
.product-card__stock--low {
  color: var(--on-strong);
  background: var(--danger);
  border: 1px solid transparent;
  animation: stock-low-pulse 2.4s ease-in-out infinite;
}

/* به‌جای pulse-bg ناموجود (کلیدframes آن هرگز تعریف نشده بود و انیمیشن
   بی‌صدا کار می‌کرد) یک کلیدframes واقعی. فقط opacity تغییر می‌کند تا
   layout shift نداشته باشیم. */
@keyframes stock-low-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card__stock--low { animation: none; }
}

.product-card__actions {
  display: flex;
  align-items: stretch;
  gap: var(--s-2);
  width: 100%;
  margin-top: 0;
}

.product-card__actions .product-card__view {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: var(--shafa-radius-full);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: var(--shafa-input-bg);
  color: var(--shafa-text-primary);
  transition:
    background 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease,
    color 250ms ease,
    transform 250ms ease;
}

.product-card__actions .product-card__view:hover {
  background: var(--shafa-input-bg-strong);
  border-color: var(--shafa-gold-text);
  color: var(--shafa-gold-text);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.15);
  transform: translateY(-1px);
}

.product-card__actions form {
  flex: 1;
  min-width: 0;
  display: flex;
  margin: 0;
}

.product-card__actions form button,
.product-card__actions form .btn--primary {
  width: 100%;
  min-width: 0;
  min-height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: var(--shafa-radius-full);
  white-space: nowrap;
  background: var(--shafa-green-alpine);
  color: var(--shafa-on-emerald);
  border: 1px solid var(--shafa-emerald-tint-border);
  box-shadow: 0 4px 12px rgba(22, 43, 33, 0.20);
  transition:
    background 250ms ease,
    box-shadow 250ms ease,
    transform 250ms ease;
}

.product-card__actions form button:hover,
.product-card__actions form .btn--primary:hover {
  background: var(--shafa-green-hover);
  box-shadow: 0 6px 16px rgba(22, 43, 33, 0.30);
  transform: translateY(-1px);
}

.product-card__actions form button .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

/* محصول ناموجود — پیش از این هیچ دکمه‌ای رندر نمی‌شد و نیمهٔ چپ ردیف خالی
   می‌ماند. رنگ‌ها از --out گرفته شده تا با badge «ناموجود» هماهنگ باشد.

   نکتهٔ آبشار: buttons.css بعد از cards.css لود می‌شود و `.btn:disabled`
   آنجا opacity: 0.45 می‌دهد. اگر تکرارش کنیم بی‌اثر است (برندهٔ بعدی)،
   پس به‌جای کم‌کردن opacity، کم‌رنگی را با رنگ کم‌رنگ‌تر نشان می‌دهیم.
   نسبت کنتراست #B91C1C روی #F7EEEE = ۵.۶۷:۱ که بالای حد AA است. */
/* شمارندهٔ خرید زنده — از style.css منتقل شد. activity-widget.js این المان را
   با [data-activity-badge] پیدا می‌کند و فقط [data-activity-text] را پر می‌کند
   (اگر کل المان نوشته می‌شد، آیکون visibility پاک می‌شد). */
.product-card__activity {
  font-size: .75rem; color: var(--shafa-text-tertiary); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
}
.product-card__activity .material-symbols-outlined { font-size: 16px; }
.product-card__activity.is-hidden { display: none; }

.product-card__compare {
  display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s-3);
  font-size: var(--fs-small); color: var(--shafa-text-tertiary);
  cursor: pointer; user-select: none;
}
/* ── Compare checkbox: 44×44px touch target (WCAG 2.5.5), visual 18px via scale() ── */
.product-card__compare input[type="checkbox"] {
  appearance: none; width: 44px; height: 44px; margin: 0;
  border: 2px solid var(--shafa-border-strong); border-radius: 4px;
  background: var(--shafa-card-bg); cursor: pointer; position: relative; flex-shrink: 0;
  transform: scale(0.45); transform-origin: center;
}
.product-card__compare input[type="checkbox"]:checked {
  background: var(--shafa-gold-text); border-color: var(--shafa-gold-text);
}
/* تیک روی --shafa-gold-text: سفید در تم روشن (۵.۳۶:۱ روی #8A641A) و جوهرِ
   تیره در تم تاریک که اکسنت شنی روشن است (#D6BD98 → ۷.۱۳:۱). نسخهٔ قبلی
   روی --accent-strong (#B38D45) فقط ۳.۰۸:۱ بود. scale(2.2) جبران transform والد */
.product-card__compare input[type="checkbox"]:checked::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(2.2);
  color: var(--on-strong); font-size: 12px; font-weight: 700;
}
.product-card__compare input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--shafa-gold-text); outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.product-card__unavailable {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: var(--shafa-radius-full);
  white-space: nowrap;
  color: #B91C1C;
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.15);
  cursor: not-allowed;
}
.product-card__unavailable .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

/* شمارندهٔ آزمایش — آیکون تنهای «verified» می‌گفت آزمایشی وجود دارد، نه اینکه
   چند آزمون و با چه کیفیتی. برای محصولی که ادعای اصلی‌اش اعتماد است، عدد
   همان چیزی است که تیک بدون عدد از کاربر می‌گیرد: اطلاعات صفر. */
.product-card__lab-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: var(--shafa-radius-full);
  background: var(--success);
  color: var(--on-strong);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(27, 94, 54, 0.3);
}
.product-card__lab-badge .material-symbols-outlined { font-size: 16px; }

/* stretched-link: لینک عنوان فقط متنش را پوشش می‌داد. این لایه ناحیهٔ کلیک را
   به کل کارت می‌برد. z-index پایین‌تر از دکمه‌ها و چک‌باکس مقایسه است تا آن‌ها
   همچنان کلیک‌پذیر بمانند. */
.product-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.product-card__actions,
.product-card__compare,
.product-card__foot .product-card__activity {
  position: relative;
  z-index: 2;
}

/* =========================================================================
 *  Hexagon Card Utility — 6-Sided Honeycomb Shape (Global)
 *  Provides regular hexagon clip-path, gold border frame via pseudo-elements,
 *  and drop-shadow glow. Used by .process-step, .stat-card, .guarantee-step,
 *  .process-editorial__step, .trust-flow__step, etc.
 * ========================================================================= */

/* Base glow: dark ambient halo hugging the hex edges */
.hex-glow {
  filter:
    drop-shadow(0 0 4px  rgba(139, 90, 24, 0.35))
    drop-shadow(0 0 10px rgba(139, 90, 24, 0.18));
  transition:
    filter 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover: intensify — darker, wider, pushed further outward */
.hex-glow:hover {
  filter:
    drop-shadow(0 0 8px  rgba(139, 90, 24, 0.55))
    drop-shadow(0 0 20px rgba(139, 90, 24, 0.32))
    drop-shadow(0 0 34px rgba(139, 90, 24, 0.16));
}

/* Dark theme: glow follows the sand accent of the dark palette
   (--shafa-dk-accent-sand) so the halo matches the hex frame above it. */
[data-theme="dark"] .hex-glow {
  filter:
    drop-shadow(0 0 4px  rgba(214, 189, 152, 0.38))
    drop-shadow(0 0 12px rgba(214, 189, 152, 0.20));
}

[data-theme="dark"] .hex-glow:hover {
  filter:
    drop-shadow(0 0 10px rgba(214, 189, 152, 0.55))
    drop-shadow(0 0 24px rgba(214, 189, 152, 0.32))
    drop-shadow(0 0 40px rgba(214, 189, 152, 0.18));
}

/* Reduced motion: static glow, no transition */
@media (prefers-reduced-motion: reduce) {
  .hex-glow {
    transition: none;
  }
}

/* Hexagon Card Utility — 6-Sided Honeycomb Shape */
.hex-card {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  width: 100%;
  box-sizing: border-box;
  position: relative;
  aspect-ratio: 1 / 1.1547;   /* regular pointy-topped hexagon: height = width × 2/√3 */
  filter:
    drop-shadow(0 0 2px rgba(24, 22, 20, 0.30))
    drop-shadow(0 0 6px rgba(139, 90, 24, 0.25));
}

/* Gold border frame — clipped to hexagon by parent's clip-path.
   CSS `border` only renders on the 2 vertical edges of a clipped
   polygon, so pseudo-elements with solid backgrounds create the frame
   on all 6 edges instead.
   Both pseudo-elements sit at z-index -1 so they paint BEHIND the
   card's in-flow content (h3 / p / badge) — otherwise the ::after
   surface would overlay and wash out the text. The parent's
   filter: drop-shadow() already establishes a stacking context,
   so -1 stays contained within the card. */
.hex-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--shafa-gold-satin);
  border-radius: inherit;
  box-sizing: border-box;
  pointer-events: none;
}

/* Inner hexagon — card surface, inset by border width (2px) to
   reveal the gold frame between ::before and ::after */
.hex-card::after {
  content: '';
  position: absolute;
  inset: 2px;
  z-index: -1;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--shafa-surface-veil);
  border-radius: inherit;
  box-sizing: border-box;
  pointer-events: none;
}

[data-theme="dark"] .hex-card::before {
  background: var(--shafa-dk-border-focus);
}

/* Hover: border + halo intensify together for a coherent lift */
.hex-card:hover {
  filter:
    drop-shadow(0 0 4px  rgba(139, 90, 24, 0.45))
    drop-shadow(0 0 10px rgba(139, 90, 24, 0.30));
}

.hex-card:hover::before {
  background: var(--shafa-gold-hover);
}

[data-theme="dark"] .hex-card {
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.40))
    drop-shadow(0 0 6px rgba(214, 189, 152, 0.28));
}

[data-theme="dark"] .hex-card:hover {
  filter:
    drop-shadow(0 0 4px  rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 10px rgba(214, 189, 152, 0.36));
}

[data-theme="dark"] .hex-card:hover::before {
  background: var(--shafa-dk-gold-text);
}

/* Mobile fallback: at small screens, drop the hexagon shape and gold frame */
@media (max-width: 580px) {
  .hex-card {
    clip-path: none;
    border-radius: 22px;
    aspect-ratio: auto; /* allow natural height on mobile rounded panels */
  }
  /* Mobile: drop the gold frame entirely — cards render as clean rounded panels */
  .hex-card::before,
  .hex-card::after {
    display: none;
  }
}

/* =========================================================================
 *  Hexagon Micro-Animations (Global)
 *  Used by .process-step, .process-editorial__step, .guarantee-step
 * ========================================================================= */

@keyframes hex-num-pulse {
  0%   { box-shadow: 0 4px 12px rgba(197, 160, 89, 0.40); }
  50%  { box-shadow: 0 4px 22px rgba(197, 160, 89, 0.70), 0 0 0 6px rgba(197, 160, 89, 0.18); }
  100% { box-shadow: 0 4px 12px rgba(197, 160, 89, 0.40); }
}

@keyframes hex-icon-bloom {
  0%   { transform: scale(0.85); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1); opacity: 0.55; }
}

/* =========================================================================
 *  Weight Variant Dropdown (Phase 25)
 *  کارت محصول: dropdown وزن در کنار دکمه «افزودن به سبد».
 *  فقط برای محصولات چندvariant نمایش داده می‌شود.
 * ========================================================================= */

.product-card__variant-select-wrap {
  width: 100%;
  margin-bottom: var(--s-2);
}

.product-card__variant-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background:
    var(--shafa-input-bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C5A059' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  padding: 8px 32px 8px 12px;
  font-size: var(--fs-small);
  font-family: inherit;
  color: var(--shafa-text-primary);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: var(--shafa-radius-full);
  background-color: var(--shafa-input-bg);
  cursor: pointer;
  transition:
    border-color 250ms ease,
    box-shadow 250ms ease,
    background-color 250ms ease;
}

.product-card__variant-select:focus-visible {
  outline: none;
  border-color: var(--shafa-gold-text);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.25);
}

/* نام درست توکن «--shafa-surface-card» است. «--shafa-surface» هرگز تعریف
   نشده بود، پس این background باطل بود و مرورگر رنگ پیش‌فرض option
   (سفید سیستمی) را می‌گذاشت — در تم تاریک متن روشن روی سفید.
   کشف: scripts/…/verify-frontend-contract.cjs بررسی ۳. */
.product-card__variant-select option {
  font-family: inherit;
  color: var(--shafa-text-primary);
  background: var(--shafa-surface-card);
}
