/* =========================================================================
   ARCHIVE HEADER REDESIGN — Figma "Frame 590"
   فایل مستقل؛ بعد از product-cat-v2.css لود می‌شود و .archive_header را override می‌کند.
   (فایل‌های دسته‌بندیِ کاربر دست‌نخورده می‌مانند.)
   فقط دسکتاپ (≥768px)؛ موبایل چیدمان فعلی خود را نگه می‌دارد.
   ========================================================================= */
@media (min-width: 768px) {
.tk-archive-v2 .archive_header {
  display: flex !important;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
.tk-archive-v2 .archive_header .woocommerce-notices-wrapper,
.tk-archive-v2 .archive_header .update_price_cat,
.tk-archive-v2 .archive_header .woocommerce-result-count { display: none !important; }

/* ---- ردیف ۱: تعداد نتایج + خط جداکننده زیرش ---- */
.tk-archive-v2 .archive_header .tk_result_count {
  order: 0;
  flex: 1 1 100%;
  margin: 0 !important;
  padding: 0 0 16px !important;
  border-bottom: 1px solid #CCD5D3;
  font-family: 'Estedad-FD';
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: #060707;
  text-align: right;
}
.tk-archive-v2 .archive_header .tk_result_count .tk_v2_in_cat { color: #060707; font-weight: 500; }

/* ---- ردیف ۲: حذف فیلترها (راست) + مرتب‌سازی (چپ) ---- */
.tk-archive-v2 .archive_header .tk_clear_filters {
  order: 1;
  display: inline-flex; flex-direction: row-reverse; align-items: center; justify-content: center; gap: 4px;
  height: 40px; min-width: 96px; box-sizing: border-box; padding: 8px 12px; margin: 0;
  background: none; border: 0; border-radius: 999px; cursor: pointer;
  font-family: 'Estedad-FD'; font-weight: 500; font-size: 14px; line-height: 1.4; color: #ED1C24;
  text-decoration: none; white-space: nowrap;
}
.tk-archive-v2 .archive_header .tk_clear_filters svg { width: 18px; height: 18px; flex: 0 0 auto; }

.tk-archive-v2 .archive_header .mobile_row {
  order: 2;
  display: flex !important; flex-direction: row; align-items: center; gap: 8px; margin: 0 !important;
  width: auto !important;
}
.tk-archive-v2 .archive_header .tk_mobile_filter { display: none !important; }

.tk-archive-v2 .archive_header .woocommerce-ordering {
  display: flex !important; flex-direction: row; align-items: center; gap: 8px; margin: 0 !important; padding: 0 !important; width:auto!important;
}
.tk-archive-v2 .archive_header .woocommerce-ordering label {
  order: 0; margin: 0 !important; white-space: nowrap; display: inline-flex; align-items: center;
  font-family: 'Estedad-FD'; font-weight: 400; font-size: 14px; line-height: 1.4; color: #394040;
}
.tk-archive-v2 .archive_header .woocommerce-ordering .mobile_sort_icon {
  order: -1; display: inline-block !important; width: 16px; height: 16px; margin: 0 !important;
}
.tk-archive-v2 .archive_header select.orderby,
.tk-archive-v2 .archive_header select.tk_orderby {
  order: 2;
  box-sizing: border-box; width: 160px; height: 40px; margin: 0 !important;
  background-color: #fff; border: 1px solid #7E928F !important; border-radius: 0;
  padding: 0 12px !important;
  font-family: 'Estedad-FD'; font-weight: 400; font-size: 14px; line-height: 1; color: #060707;
  text-align: right; direction: rtl;
  -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23060707' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; background-size: 18px 18px;
}

}


/* =========================================================================
   نوارِ مرتب‌سازی نباید روی بقیه‌ی صفحه بیفتد
   ------------------------------------------------------------------------
   style.css:1875 به‌صورت سراسری می‌دهد:
       .woocommerce-ordering { position: relative; z-index: 3; }
   و .tk_archive_container_side چون position:sticky است خودش یک stacking
   context با z-index صفر می‌سازد. نتیجه: کلِ سایدبار — و هرچه داخلش است،
   حتی تولتیپ‌هایی با z-index نجومی — زیرِ فرمِ مرتب‌سازی رندر می‌شود.
   در آرشیو v2 این z-index هیچ کاربردی ندارد، پس خنثی می‌شود.
   بیرون از مدیا-کوئریِ بالا نوشته شده تا در موبایل (پیل‌بار) هم اعمال شود.
   ========================================================================= */
.tk-archive-v2 .archive_header .woocommerce-ordering {
  position: static;
  z-index: auto;
}

/* آیکنِ مرتب‌سازی در بریک‌پوینتِ ≤1024 عرضِ product-cat-v2.css روی
   position:absolute بود و به همان relativeِ بالا تکیه داشت؛ حالا باید در جریان
   عادی بنشیند (همان چیزی که در ≥1025 هم دیده می‌شود). */
.tk-archive-v2 .archive_header .mobile_sort_icon {
  position: static;
  padding: 0;
  background: none;
}
