/* ===========================================================================
   فست‌کارت — صفحهٔ دسته و برند: سر، زیردسته‌ها، ترتیب، متنِ کامل
   ===========================================================================

   اجزا در `templates/frontend/fastkart/catalog/`. رنگ از نشانه‌های قالب
   (`--theme-color`، `--theme-accent-rgb`، `--theme-ink*`، `--theme-line`)، پس
   «رنگ اصلی»ِ پنل همه‌جای این صفحه را عوض می‌کند. فیلترهای کناری همچنان در
   `category.css` / `brand.css` هستند.
   =========================================================================== */

.lst { --lst-radius: var(--theme-radius-lg, 18px); --lst-line: var(--theme-line, #e8ebf1); }

/* ── سر ─────────────────────────────────────────────────────────────── */
.lst-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    margin-bottom: 18px;
    border: 1px solid var(--lst-line);
    border-radius: var(--lst-radius);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(var(--theme-accent-rgb), .10) 0%, transparent 55%),
        var(--theme-surface, #fff);
    overflow: hidden;
}
.lst-hero__media {
    flex: none;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border-radius: calc(var(--lst-radius) - 4px);
    background: rgba(var(--theme-accent-rgb), .08);
    color: var(--theme-color);
    font-size: 42px;
    overflow: hidden;
}
.lst-hero__media.has-image { background: var(--theme-surface, #fff); box-shadow: inset 0 0 0 1px var(--lst-line); }
.lst-hero__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
span.lst-hero__initial { font-size: 44px; font-weight: 800; line-height: 1; }
.lst-hero__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lst-hero__title { margin: 0; font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; color: var(--theme-ink, #1a1d24); line-height: 1.4; }
.lst-hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
span.lst-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(var(--theme-accent-rgb), .12);
    color: var(--theme-color);
    font-size: 12.5px;
    font-weight: 700;
}
.lst-hero__more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--theme-color); }
.lst-hero__more:hover { text-decoration: underline; }
.lst-hero__excerpt { margin: 0; max-width: 72ch; font-size: 13.5px; line-height: 1.95; color: var(--theme-ink-muted, #5b6170); }
.lst-hero__filter {
    display: none;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--theme-color);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
}

/* ── زیردسته‌ها ─────────────────────────────────────────────────────── */
.lst-subcats { margin-bottom: 20px; }
.lst-subcats__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lst-subcat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid var(--lst-line);
    border-radius: 14px;
    background: var(--theme-surface, #fff);
    color: var(--theme-ink, #1a1d24);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.lst-subcat:hover, .lst-subcat:focus-visible {
    border-color: rgba(var(--theme-accent-rgb), .5);
    box-shadow: 0 8px 22px -14px rgba(var(--theme-accent-rgb), .6);
    transform: translateY(-1px);
    color: var(--theme-ink, #1a1d24);
}
.lst-subcat:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 2px; }
span.lst-subcat__media {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(var(--theme-accent-rgb), .09);
    color: var(--theme-color);
    font-size: 18px;
    overflow: hidden;
}
.lst-subcat__media img { width: 100%; height: 100%; object-fit: cover; }
.lst-subcat__name { font-size: 13.5px; font-weight: 700; line-height: 1.6; }

/* ── ترتیب ─────────────────────────────────────────────────────────── */
.lst-toolbar {
    display: flex;
    align-items: center;
    gap: 6px 14px;
    flex-wrap: wrap;
    padding: 6px 4px 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--lst-line);
}
span.lst-toolbar__label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--theme-ink, #1a1d24); }
.lst-sort { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lst-sort__item {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--theme-ink-muted, #5b6170);
    transition: background-color .15s ease, color .15s ease;
}
.lst-sort__item:hover { color: var(--theme-ink, #1a1d24); background: rgba(var(--theme-ink-rgb, 26, 29, 36), .05); }
.lst-sort__item.is-active { color: var(--theme-color); background: rgba(var(--theme-accent-rgb), .1); font-weight: 700; }
.lst-sort__item:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 1px; }

/* ── خالی ──────────────────────────────────────────────────────────── */
.lst-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 48px 16px;
    margin-top: 8px;
    border: 1px dashed var(--lst-line);
    border-radius: var(--lst-radius);
    text-align: center;
}
.lst-empty[hidden] { display: none; }
.lst-empty > i { font-size: 34px; color: rgba(var(--theme-accent-rgb), .7); margin-bottom: 4px; }
.lst-empty__title { margin: 0; font-size: 15px; font-weight: 800; color: var(--theme-ink, #1a1d24); }
.lst-empty__text { margin: 0; font-size: 13px; color: var(--theme-ink-muted, #5b6170); }

/* ── متنِ کامل ─────────────────────────────────────────────────────── */
.lst-about {
    margin-top: 32px;
    padding: 26px 28px;
    border: 1px solid var(--lst-line);
    border-radius: var(--lst-radius);
    background: var(--theme-surface, #fff);
    scroll-margin-top: 120px;
}
.lst-about__title {
    position: relative;
    margin: 0 0 18px;
    padding-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    color: var(--theme-ink, #1a1d24);
}
.lst-about__title::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: var(--theme-color);
}
.lst-about__body { position: relative; color: var(--theme-ink, #1a1d24); }
.lst-about__body.is-collapsed { max-height: 360px; overflow: hidden; }
.lst-about__body.is-collapsed::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 110px;
    background: linear-gradient(to bottom, transparent, var(--theme-surface, #fff));
    pointer-events: none;
}
.lst-about__body img { max-width: 100%; height: auto; border-radius: 12px; }
.lst-about__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-top: 10px;
    padding: 6px 16px;
    border: 1px solid rgba(var(--theme-accent-rgb), .4);
    border-radius: 999px;
    background: transparent;
    color: var(--theme-color);
    font-size: 13px;
    font-weight: 700;
}
.lst-about__toggle i { transition: transform .2s ease; }
.lst-about__toggle.is-open i { transform: rotate(180deg); }
.lst-about__toggle:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 2px; }

/* ── موبایل و تبلت ─────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .lst-hero__filter { display: inline-flex; }
}
@media (max-width: 575.98px) {
    .lst-hero { flex-wrap: wrap; gap: 14px; padding: 16px; }
    .lst-hero__media { width: 72px; height: 72px; font-size: 28px; }
    .lst-hero__body { flex: 1 1 calc(100% - 90px); }
    .lst-hero__filter { width: 100%; justify-content: center; }
    .lst-subcats__list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
    .lst-subcats__list > li { flex: 0 0 auto; scroll-snap-align: start; }
    .lst-subcat { min-height: 56px; padding: 8px 12px 8px 14px; }
    .lst-toolbar { flex-wrap: nowrap; overflow-x: auto; }
    .lst-sort { flex-wrap: nowrap; }
    .lst-sort__item { white-space: nowrap; }
    .lst-about { padding: 18px 16px; margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .lst-subcat, .lst-about__toggle i { transition: none; }
}

/* قالب به آیکون‌ها حاشیه و ارتفاعِ خط می‌دهد؛ اینجا آیکون باید دقیقاً وسطِ جعبه‌اش بنشیند */
.lst-hero__media > i, .lst-subcat__media > i, .lst-toolbar__label > i,
.lst-hero__more > i, .lst-about__toggle > i, .lst-hero__filter > i {
    margin: 0;
    line-height: 1;
}
