/* فهرست محصولات (templates/shop/products.html) -- ۱۴۰۵/۰۷/۲۳. کارت و شبکه و رنگ‌ها از css/home.css می‌آیند؛
   این‌جا فقط سربرگ صفحه، ردیف دسته‌ها، نوار ابزار چسبان، تراشهٔ فیلترها و حالت «ناموجود». */
main.pl { display: block; max-width: 1240px; margin: 0 auto; padding: clamp(16px, 3vw, 30px) clamp(16px, 4vw, 40px) 24px; }
.pl-body .sf { margin-top: clamp(64px, 8vw, 96px); }

/* ── سربرگ صفحه ─────────────────────────────────────────────────────── */
.pl-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pl-crumbs a { text-decoration: none; } .pl-crumbs a:hover { color: var(--red); }
.pl-crumbs__cat { display: inline-flex; align-items: center; gap: 6px; } .pl-crumbs b { color: var(--ink); font-weight: 800; }
.pl-title { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 18px; margin: 6px 0 16px; }
.pl-title h1 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.25; font-weight: 900; }
.pl-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.pl-sub b { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.pl-live { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 10px; border: 1px solid #cfe9d9; border-radius: 999px; background: #f1faf4; color: #166b40; font-size: 12.5px; font-weight: 800; }
.pl-live i { width: 7px; height: 7px; border-radius: 50%; background: #22a35a; box-shadow: 0 0 0 3px rgba(34, 163, 90, .2); }

/* ── دسته‌ها: ردیف کشویی با عکس ─────────────────────────────────────── */
.pl-cats { display: flex; gap: 10px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)); padding: 2px clamp(16px, 4vw, 40px) 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.pl-cats::-webkit-scrollbar { display: none; }
.pl-cat { position: relative; flex: none; display: grid; justify-items: center; gap: 1px; width: 104px; padding: 8px 8px 10px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--card);
  text-align: center; cursor: pointer; scroll-snap-align: start; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease; -webkit-tap-highlight-color: transparent; }
.pl-cat input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pl-cat:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); transform: translateY(-2px); }
.pl-cat:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.pl-cat:has(input:checked) { border-color: var(--red); background: #fff5f4; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent); }
.pl-cat__img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; margin-bottom: 5px; border-radius: 14px; overflow: hidden; background: var(--soft); }
.pl-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.pl-cat__img.is-all { background: linear-gradient(135deg, var(--red-deep), var(--red)); color: #fff; }
.pl-cat__img.is-all svg { width: 40%; height: 40%; }
.pl-cat b { font-size: 13px; font-weight: 900; line-height: 1.45; }
.pl-cat small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.pl-cat:has(input:checked) b { color: var(--red); }
@media (min-width: 900px) { .pl-cats { flex-wrap: wrap; margin: 0; padding: 2px 0 14px; overflow: visible; } .pl-cat { width: 118px; } }

/* ── نوار ابزار: جست‌وجو، مرتب‌سازی، فیلترها -- زیر سربرگ می‌چسبد ──────── */
.pl-tools { position: sticky; top: var(--pl-top, 60px); z-index: 20; display: grid; gap: 10px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)); padding: 10px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: box-shadow .2s ease; }
.pl-tools.is-stuck { box-shadow: 0 10px 24px rgba(69, 17, 22, .07); border-bottom: 1px solid var(--line); }
.pl-tools__row { display: flex; gap: 8px; }
.pl-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); transition: border-color .2s ease, box-shadow .2s ease; }
.pl-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent); }
.pl-search > svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
.pl-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; outline: 0; }
.pl-search input::-webkit-search-cancel-button { display: none; }
.pl-search button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.pl-sort { position: relative; flex: none; display: flex; align-items: center; min-height: 50px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); }
.pl-sort:focus-within { border-color: var(--red); }
.pl-sort svg { position: absolute; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--red); pointer-events: none; }
.pl-sort select { height: 47px; padding: 0 40px 0 14px; border: 0; border-radius: 16px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; appearance: none; -webkit-appearance: none; outline: 0; }
@media (max-width: 420px) { .pl-sort select { width: 54px; padding: 0; color: transparent; } .pl-sort select option { color: var(--ink); } .pl-sort svg { inset-inline-start: 50%; transform: translateX(50%); } }
.pl-flags { display: flex; align-items: center; gap: 8px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)); padding: 0 clamp(16px, 4vw, 40px); overflow-x: auto; scrollbar-width: none; }
.pl-flags::-webkit-scrollbar { display: none; }
.pl-flag { position: relative; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pl-flag input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pl-flag span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 800; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.pl-flag svg { width: 16px; height: 16px; color: var(--muted); }
.pl-flag:hover span { border-color: var(--red); }
.pl-flag input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.pl-flag input:checked + span { border-color: var(--red); background: var(--red); color: #fff; }
.pl-flag input:checked + span svg { color: #fff; }
.pl-reset { flex: none; min-height: 36px; padding: 0 12px; border: 0; background: none; color: var(--red); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.pl-apply { flex: none; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 13px; font-weight: 800; }

/* ── شبکه ─────────────────────────────────────────────────────────────── */
.pl-grid { margin-top: 12px; }
@media (min-width: 1100px) { .pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pl-grid.is-fresh > .card:not([hidden]) { animation: pl-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pl-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.card__cat { margin: 9px 4px 0; color: var(--muted); font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.card__cat + h3 { margin-top: 2px; }
.card.is-out .card__img img { filter: grayscale(.85); opacity: .6; }
.card.is-out .card__price b { color: var(--muted); }
.card__tag.is-out { background: #5d5452; }
.card__soldout { display: grid; place-items: center; min-height: 40px; border: 1.5px dashed var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 800; }
.pl-empty { display: grid; justify-items: center; gap: 6px; margin-top: 12px; padding: 40px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--card); text-align: center; }
.pl-empty svg { width: 46px; height: 46px; color: var(--red); margin-bottom: 4px; }
.pl-empty b { font-size: 17px; font-weight: 900; }
.pl-empty span { color: var(--muted); font-size: 14px; }
.pl-empty .btn { margin-top: 10px; }
.pl-foot { margin-top: 26px; }
@media (prefers-reduced-motion: reduce) { .pl-grid.is-fresh > .card { animation: none !important; } .pl-cat, .pl-cat:hover { transition: none; transform: none; } }
