/* ============================================================
   آتی دُر — atd-shop.css
   نسخه: 8.0  (فقط رابط آرشیو — کارت محصول به atd-core.css منتقل شد)
   محل: wp-content/themes/flatsome-child/css/atd-shop.css
   بارگذاری: فقط صفحه فروشگاه و دسته‌بندی‌های محصول
   پیش‌نیاز: atd-core.css
   ------------------------------------------------------------
   تغییرات نسبت به نسخه ۷:
   • «بخش ۱ — کارت محصول» حذف و به atd-core.css منتقل شد، چون
     کارت محصول در صفحه اصلی، محصولات مرتبط و جستجو هم دیده می‌شود.
     در نتیجه کامنت مرزی ATD-ARCHIVE-ONLY و کد PHP تقسیم‌کننده
     فایل دیگر لازم نیست — آن قلاب را از functions.php حذف کنید.
   • :root حذف شد؛ توکن‌ها فقط در atd-core.css تعریف می‌شوند.
   • متغیرهای --atdc-* به --atd-* تبدیل شدند (الیاس سازگاری
     همچنان در core هست، ولی کد جدید نباید از آن استفاده کند).
   ============================================================ */

body.atd-lock { overflow: hidden; }

/* محافظ اندازه آیکون فیلتر */
.atd-filter svg { max-width: 24px; max-height: 24px; }
.atd-catrow { display: flex; }


/* ---------- سربرگ دسته و بردکرامب ---------- */

.atd-shop .shop-page-title.page-title,
.atd-shop .shop-page-title .page-title-inner,
.atd-shop .shop-page-title .page-title-bg {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
.atd-shop .shop-page-title.page-title { border-bottom: 1px solid var(--atd-line); }
.atd-shop .shop-page-title .page-title-inner {
  padding-top: 22px !important; padding-bottom: 20px !important;
  min-height: auto !important; align-items: flex-end;
}

/* بردکرامب بالای عنوان */
.atd-shop .shop-page-title .page-title-inner > .flex-col.flex-grow {
  display: flex; flex-direction: column; align-items: flex-start;
}
.atd-shop .shop-page-title .page-title-inner > .flex-col.flex-grow > .is-small { order: 1; margin: 0 0 14px; }
.atd-shop .shop-page-title h1.shop-page-title { order: 2; margin: 0; }

/* بردکرامب فروشگاه — عیناً نسخه ۷ (نوار خاکستری عمومی حفظ می‌شود)
   اگر روزی خواستید نوار خاکستری زیر بردکرامبِ فروشگاه برداشته شود،
   سه خط زیر را از کامنت دربیاورید:
   background-color: transparent; padding: 0; min-height: 0; */
.atd-shop .rank-math-breadcrumb {
  text-transform: none !important; letter-spacing: 0 !important; line-height: 1 !important;
}
.atd-shop .rank-math-breadcrumb p {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin: 0; padding: 0; font-size: .78rem; color: var(--atd-gray); line-height: 1;
}
.atd-shop .rank-math-breadcrumb a {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 8px; margin: 0;
  background: var(--atd-mist); border: 1px solid transparent;
  color: var(--atd-gray); font-weight: 600; transition: .16s ease;
}
.atd-shop .rank-math-breadcrumb a:hover { background: var(--atd-blue-tint); border-color: #cfe0f7; color: var(--atd-blue-deep); }
.atd-shop .rank-math-breadcrumb .separator { opacity: .35; padding: 0 2px; }
.atd-shop .rank-math-breadcrumb .last {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 8px;
  background: var(--atd-orange-tint); color: var(--atd-ink); font-weight: 700;
}
.atd-shop .rank-math-breadcrumb p > a:first-child::before {
  content: ""; width: 14px; height: 14px; flex: 0 0 14px;
  margin-inline-end: 6px; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3.2 3 11h2.4v8.3c0 .4.3.7.7.7H10v-5.6h4V20h3.9c.4 0 .7-.3.7-.7V11H21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3.2 3 11h2.4v8.3c0 .4.3.7.7.7H10v-5.6h4V20h3.9c.4 0 .7-.3.7-.7V11H21z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.atd-shop h1.shop-page-title {
  font-size: 1.62rem; font-weight: 800; color: var(--atd-ink);
  letter-spacing: -.01em; line-height: 1.7;
  position: relative; padding-bottom: 12px;
}
.atd-shop h1.shop-page-title::after {
  content: ""; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 54px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--atd-orange), var(--atd-blue));
}
.atd-shop .term-description { color: var(--atd-gray); font-size: .89rem; line-height: 2.1; max-width: 74ch; margin-top: 14px; }

.atd-shop .category-filtering,
.atd-shop .shop-page-title .woocommerce-result-count { display: none !important; }


/* ---------- نوار دسته‌بندی ---------- */

.atd-filter { position: relative; margin: 22px 0; }
.atd-catnav { display: flex; align-items: center; gap: 10px; position: relative; }

.atd-arrow {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--atd-line); border-radius: 50%;
  background: #fff; color: var(--atd-blue-deep); box-shadow: var(--atd-sh);
  transition: .16s ease; padding: 0;
}
.atd-arrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.atd-arrow:hover:not(:disabled) { background: var(--atd-blue); border-color: var(--atd-blue); color: #fff; }
.atd-arrow:disabled { opacity: .28; cursor: default; box-shadow: none; }
.atd-arrow[hidden] { display: none; }

.atd-catrow {
  flex: 1 1 auto; min-width: 0;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 6px 2px; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
}
.atd-catrow::-webkit-scrollbar { display: none; }
.atd-catrow.is-drag { cursor: grabbing; scroll-behavior: auto; }
.atd-catrow.has-end   { -webkit-mask-image: linear-gradient(to left,  #000 88%, transparent); mask-image: linear-gradient(to left,  #000 88%, transparent); }
.atd-catrow.has-start { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
.atd-catrow.has-start.has-end {
  -webkit-mask-image: linear-gradient(to left, transparent, #000 6% 94%, transparent);
          mask-image: linear-gradient(to left, transparent, #000 6% 94%, transparent);
}

.atd-c {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 8px 6px 16px; border-radius: 99px; white-space: nowrap;
  border: 1px solid var(--atd-line); background: #fff; color: var(--atd-ink);
  font-size: .86rem; font-weight: 700; line-height: 1;
  box-shadow: 0 1px 2px rgba(14,28,48,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
  user-select: none;
}
.atd-c-ic {
  flex: 0 0 30px; width: 30px; height: 30px;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--atd-blue-tint); color: var(--atd-blue);
  font-size: .84rem; font-weight: 800; line-height: 1;
}
.atd-c-ic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.atd-c-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.atd-c-ic--mono { background: linear-gradient(140deg, var(--atd-blue-tint), #dfeaf9); color: var(--atd-blue-deep); }
.atd-c-n {
  font-size: .71rem; font-weight: 700; color: var(--atd-gray);
  background: var(--atd-mist); padding: 3px 8px; border-radius: 99px;
  font-variant-numeric: tabular-nums;
}
.atd-c:hover { transform: translateY(-2px); border-color: #cfe0f7; box-shadow: var(--atd-sh); color: var(--atd-blue-deep); }
.atd-c:hover .atd-c-ic { background: var(--atd-orange-tint); color: var(--atd-orange-deep); }
.atd-c.is-on {
  background: linear-gradient(135deg, var(--atd-blue), var(--atd-blue-deep));
  border-color: var(--atd-blue-deep); color: #fff;
  box-shadow: 0 8px 20px rgba(17,64,126,.26);
}
.atd-c.is-on .atd-c-ic { background: rgba(255,255,255,.2); color: #fff; }
.atd-c.is-on .atd-c-n  { background: rgba(255,255,255,.22); color: #fff; }
.atd-c--all { border-style: dashed; color: var(--atd-blue-deep); }
.atd-c--all .atd-c-ic { background: var(--atd-orange-tint); color: var(--atd-orange-deep); }


/* ---------- فیلتر و مرتب‌سازی ---------- */

.atd-fbar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 12px 0;
  border-block: 1px solid var(--atd-line);
}
.atd-fbtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 17px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--atd-line); background: #fff; color: var(--atd-ink);
  font-family: inherit; font-size: .85rem; font-weight: 700; line-height: 1;
  transition: .16s ease;
}
.atd-fbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.atd-fbtn:hover,
.atd-fbtn[aria-expanded="true"],
.atd-fbtn.is-on { border-color: var(--atd-blue); color: var(--atd-blue-deep); background: var(--atd-blue-tint); }
.atd-fbtn b {
  min-width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 99px; background: var(--atd-orange); color: #fff;
  font-size: .7rem; font-variant-numeric: tabular-nums;
}
.atd-count { margin-inline-start: auto; color: var(--atd-gray); font-size: .83rem; }
.atd-count b { color: var(--atd-ink); font-weight: 800; font-variant-numeric: tabular-nums; }

.atd-active { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; }
.atd-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 99px; font-size: .79rem; font-weight: 700;
  background: var(--atd-orange-tint); color: var(--atd-orange-deep); border: 1px solid #ffddbf; transition: .16s ease;
}
.atd-tag span { font-size: 1rem; line-height: 1; opacity: .65; }
.atd-tag:hover { background: var(--atd-orange); color: #fff; border-color: var(--atd-orange); }
.atd-tag--clear { background: transparent; color: var(--atd-gray); border-color: var(--atd-line); }
.atd-tag--clear:hover { background: var(--atd-blue-tint); color: var(--atd-blue-deep); border-color: #cfe0f7; }

.atd-sheet {
  position: absolute; z-index: 60; top: calc(100% - 6px); inset-inline-start: 0;
  width: min(340px, 92vw); background: #fff;
  border: 1px solid var(--atd-line); border-radius: var(--atd-r);
  box-shadow: var(--atd-sh-lg); overflow: hidden;
}
.atd-sheet[hidden] { display: none; }
.atd-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 17px; border-bottom: 1px solid var(--atd-line);
  background: var(--atd-blue-tint); position: relative;
}
.atd-sheet-head b { font-size: .92rem; color: var(--atd-ink); }
.atd-x { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--atd-gray); padding: 0 4px; }
.atd-x:hover { color: var(--atd-orange-deep); }
.atd-sheet-body { padding: 9px; display: grid; gap: 4px; max-height: 58vh; overflow-y: auto; }
.atd-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: var(--atd-r-sm);
  color: var(--atd-ink); font-size: .87rem; font-weight: 600;
}
.atd-opt::before {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px;
  border-radius: 50%; border: 2px solid var(--atd-line);
}
.atd-opt-tx { flex: 1 1 auto; }
.atd-opt-n {
  font-size: .72rem; font-weight: 700; color: var(--atd-gray);
  background: var(--atd-mist); padding: 3px 9px; border-radius: 99px;
  font-variant-numeric: tabular-nums;
}
.atd-opt:hover { background: var(--atd-mist); color: var(--atd-blue-deep); }
.atd-opt.is-on { background: var(--atd-blue-tint); color: var(--atd-blue-deep); }
.atd-opt.is-on::before { border-color: var(--atd-orange); background: var(--atd-orange); box-shadow: inset 0 0 0 3px #fff; }
.atd-opt.is-on .atd-opt-n { background: #fff; color: var(--atd-blue-deep); }

.atd-backdrop { position: fixed; inset: 0; z-index: 55; background: transparent; }
.atd-backdrop[hidden] { display: none; }


/* ---------- سایدبار و صفحه‌بندی ---------- */

.atd-shop .shop-sidebar .widget {
  border: 1px solid var(--atd-line); border-radius: var(--atd-r);
  padding: 15px 17px; background: #fff; margin-bottom: 16px; box-shadow: var(--atd-sh);
}
.atd-shop .shop-sidebar .widget-title {
  display: block; font-size: .98rem; font-weight: 800; color: var(--atd-ink);
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 2px solid var(--atd-orange);
}
.atd-shop .shop-sidebar .widget ul li a {
  display: block; padding: 8px 10px; border-radius: var(--atd-r-sm);
  color: var(--atd-ink); font-size: .85rem; font-weight: 600; transition: .16s ease;
}
.atd-shop .shop-sidebar .widget ul li a:hover { background: var(--atd-blue-tint); color: var(--atd-blue-deep); padding-inline-start: 16px; }
.atd-shop .shop-sidebar .widget ul li.current-menu-item > a { background: var(--atd-blue); color: #fff; }
.atd-shop .shop-sidebar .widget ul .sub-menu { border-inline-start: 2px solid var(--atd-line); margin-inline-start: 10px; }
.atd-shop .shop-sidebar .widget ul .sub-menu a { font-size: .81rem; font-weight: 500; color: var(--atd-gray); }
@media (min-width: 1024px) { .atd-shop .shop-sidebar .widget_nav_menu { position: sticky; top: 80px; } }

.atd-shop .woocommerce-pagination { margin-top: 10px; }
.atd-shop .woocommerce-pagination .page-numbers li a,
.atd-shop .woocommerce-pagination .page-numbers li span {
  min-width: 42px; height: 42px; line-height: 40px; border-radius: 11px;
  border: 1px solid var(--atd-line); color: var(--atd-ink); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.atd-shop .woocommerce-pagination .page-numbers li .current,
.atd-shop .woocommerce-pagination .page-numbers li a:hover {
  background: var(--atd-blue) !important; border-color: var(--atd-blue) !important; color: #fff !important;
}


/* ---------- موبایل ---------- */

@media (max-width: 849px) {
  .atd-shop .shop-page-title .page-title-inner { padding-top: 16px !important; padding-bottom: 14px !important; }
  .atd-shop h1.shop-page-title { font-size: 1.22rem; padding-bottom: 10px; }
  .atd-shop .rank-math-breadcrumb p { font-size: .72rem; gap: 4px; }
  .atd-shop .rank-math-breadcrumb a,
  .atd-shop .rank-math-breadcrumb .last { padding: 5px 10px; }

  .atd-filter { margin: 14px 0 16px; }
  .atd-arrow { display: none !important; }
  .atd-catrow { padding: 4px 2px 8px; }
  .atd-c { padding: 5px 6px 5px 13px; font-size: .81rem; gap: 7px; }
  .atd-c-ic { flex: 0 0 26px; width: 26px; height: 26px; font-size: .78rem; }
  .atd-c-n { font-size: .67rem; padding: 2px 7px; }

  .atd-fbar {
    position: sticky; top: 0; z-index: 50; margin-top: 8px;
    background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
    margin-inline: -15px; padding-inline: 15px;
  }
  .atd-fbtn { flex: 1 1 0; justify-content: center; padding: 12px 8px; }
  .atd-count { display: none; }

  .atd-sheet {
    position: fixed; inset: auto 0 0 0; top: auto; width: 100%;
    border-radius: 20px 20px 0 0; border-bottom: 0; max-height: 78vh;
    box-shadow: 0 -14px 44px rgba(14,28,48,.24);
    animation: atd-up .22s ease-out;
  }
  .atd-sheet-head { padding: 17px 18px 14px; }
  .atd-sheet-head::before {
    content: ""; position: absolute; top: 7px; inset-inline: 0; margin-inline: auto;
    width: 42px; height: 4px; border-radius: 99px; background: var(--atd-line);
  }
  .atd-sheet-body { padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); max-height: 60vh; }
  .atd-opt { padding: 14px 15px; font-size: .9rem; }
  .atd-backdrop { background: rgba(14,28,48,.45); }

  @keyframes atd-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
}


/* ---------- دسترس‌پذیری ---------- */

.atd-filter a:focus-visible,
.atd-fbtn:focus-visible,
.atd-arrow:focus-visible,
.atd-x:focus-visible {
  outline: 3px solid var(--atd-orange); outline-offset: 2px; border-radius: var(--atd-r-sm);
}
@media (prefers-reduced-motion: reduce) {
  .atd-c, .atd-fbtn, .atd-arrow, .atd-sheet {
    transition: none !important; animation: none !important; transform: none !important;
  }
  .atd-catrow { scroll-behavior: auto; }
}