/* ============================================================
   تاس بریز — آرشیو محصولات (فروشگاه / دسته‌بندی / برچسب)
   ============================================================ */

.tb-shop {
  --w:        #722F37;
  --w-deep:   #4E1F26;
  --w-tint:   #FBF4F5;
  --cream:    #FDFBF8;
  --ink:      #1A1A1A;
  --ink-2:    #55504A;
  --ink-3:    #8C867D;
  --line:     #EFE7DA;

  direction: rtl;
  font-family: 'Vazirmatn', 'YekanBakh', Tahoma, sans-serif;
  font-feature-settings: 'ss01', 'tnum';
  color: var(--ink);
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}
.tb-shop * { box-sizing: border-box; }

/* ── سرصفحه ─────────────────────────────────────────────── */
.tb-shop-head { margin-bottom: 20px; }
.tb-shop-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.9;
}
.tb-shop-desc { font-size: 13.5px; color: var(--ink-3); line-height: 2; }

/* ── چیدمان دو ستونه ────────────────────────────────────── */
.tb-shop-grid {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 22px;
  align-items: start;
}

/* ── سایدبار ────────────────────────────────────────────── */
.tb-filters {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(26,26,26,.03), 0 10px 26px -18px rgba(26,26,26,.16);
}
.tb-filters-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tb-filters-top h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--w);
  line-height: 1.9;
}
.tb-filters-close {
  display: none;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}

.tb-fgroup { padding: 14px 0; border-top: 1px solid var(--line); }
.tb-fgroup:first-of-type { border-top: none; padding-top: 0; }
.tb-fgroup h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* قیمت */
.tb-price-row { display: flex; gap: 8px; }
.tb-price-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tb-price-row span { font-size: 11.5px; color: var(--ink-3); }
.tb-price-row input {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.tb-price-row input:focus {
  border-color: var(--w);
  box-shadow: 0 0 0 3px rgba(114,47,55,.1);
}
.tb-price-hint { margin: 7px 0 0; font-size: 11px; color: var(--ink-3); }

/* چک‌باکس */
.tb-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.tb-check input {
  width: 17px; height: 17px;
  accent-color: var(--w);
  cursor: pointer;
  flex-shrink: 0;
}

/* دسته‌بندی */
.tb-cat-list { list-style: none; margin: 0; padding: 0; max-height: 268px; overflow-y: auto; }
.tb-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.tb-cat-list em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--cream);
  border-radius: 999px;
  padding: 1px 7px;
}
.tb-cat-list a.is-active { background: var(--w-tint); color: var(--w); font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .tb-cat-list a:hover { background: var(--cream); color: var(--w); }
}

/* دکمه‌های فیلتر */
.tb-filters-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.tb-btn-apply {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  background: var(--w);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(114,47,55,.8);
  transition: background .2s;
}
@media (hover: hover) and (pointer: fine) {
  .tb-btn-apply:hover { background: var(--w-deep); color: #fff; }
}
.tb-btn-clear {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .tb-btn-clear:hover { color: var(--w); }
}

/* ── نوار ابزار ─────────────────────────────────────────── */
.tb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tb-count { font-size: 12.5px; color: var(--ink-3); margin-inline-end: auto; }

.tb-filters-open {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.tb-filters-open svg { width: 17px; height: 17px; }

.tb-sort { position: relative; display: flex; align-items: center; }
.tb-sort select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 34px 9px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.tb-sort svg {
  position: absolute;
  inset-inline-start: 11px;
  width: 15px; height: 15px;
  pointer-events: none;
  color: var(--ink-3);
}

/* ── شبکه‌ی محصولات ─────────────────────────────────────── */
.tb-shop-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
/* کارت‌ها در آرشیو باید کش بیایند، نه عرض ثابت اسکرولر */
.tb-shop-list .tb-card {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: initial;
}

/* ── صفحه‌بندی ──────────────────────────────────────────── */
.tb-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}
.tb-pagination .page-numbers {
  min-width: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.tb-pagination .page-numbers.current {
  background: var(--w);
  border-color: var(--w);
  color: #fff;
}
.tb-pagination .page-numbers.dots { border: none; background: none; }
@media (hover: hover) and (pointer: fine) {
  .tb-pagination a.page-numbers:hover { border-color: var(--w); color: var(--w); }
}

/* ── خالی ───────────────────────────────────────────────── */
.tb-empty {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 48px 24px;
  text-align: center;
}
.tb-empty-icon { font-size: 40px; margin-bottom: 12px; }
.tb-empty p { margin: 0 0 18px; font-size: 14px; color: var(--ink-3); }
.tb-empty .tb-btn-apply { max-width: 220px; margin: 0 auto; }

/* ── پرده‌ی سایدبار موبایل ──────────────────────────────── */
.tb-filters-veil {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(26,26,26,.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
.tb-filters-veil.is-open { display: block; opacity: 1; }

/* ════════════════════ موبایل ════════════════════ */
@media (max-width: 900px) {
  .tb-shop-grid { grid-template-columns: 1fr; }
  .tb-filters-open { display: inline-flex; }

  /* سایدبار به کشوی پایین تبدیل می‌شود */
  .tb-filters {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    z-index: 950;
    max-height: 84vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    border-inline: none;
    border-bottom: none;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,.72,0,1);
    box-shadow: 0 -18px 44px -20px rgba(26,26,26,.4);
  }
  .tb-filters.is-open { transform: translateY(0); }
  .tb-filters-close { display: flex; align-items: center; justify-content: center; }

  .tb-shop { padding: 14px 12px 50px; }
  .tb-shop-head h1 { font-size: 18px; }
  .tb-toolbar { padding: 8px 10px; gap: 8px; }
  .tb-count { font-size: 11.5px; }
  .tb-sort select { font-size: 11.5px; padding: 8px 30px 8px 10px; }

  .tb-shop-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-filters, .tb-filters-veil { transition: none; }
}
