/* ============================================================
Catalog Component - Only layout & unique styles
Depends on ui.css (chip, chip-active, empty-state) and app-shell.css (book-grid, book-card, ...)
============================================================ */

/* ============================================================
   Section Shell & Heading — بازیابی از sections.css
   Scoped به .catalog-section تا روی سایر بخش‌های صفحه اثر نگذارد
   ============================================================ */

.catalog-section .section-shell {
    width: min(1220px, 100%);
    margin: 0 auto;
    padding: 90px 28px 0;
    box-sizing: border-box;
}

.catalog-section .section-heading {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 42px;
}

.catalog-section .section-heading > p {
    margin: 0 0 10px;
    color: var(--landing-purple);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lang-fa .catalog-section .section-heading > p {
    letter-spacing: 0;
    text-transform: none;
}

.catalog-section .section-heading > h2 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.3;
    font-weight: 900;
    color: var(--landing-ink);
}

.lang-fa .catalog-section .section-heading > h2 {
    line-height: 1.55;
}

.catalog-section .section-heading > span {
    display: block;
    max-width: 560px;
    margin: 0 auto;
    color: var(--purple-wash, #6a5a8a);
    font-size: 13px;
    line-height: 1.9;
}

/* نسخهٔ compact — فشرده‌تر */
.catalog-section .section-heading.compact {
    margin-bottom: 28px;
}

.catalog-section .section-heading.compact > h2 {
    font-size: clamp(22px, 2.4vw, 30px);
    margin-bottom: 8px;
}

.catalog-section .section-heading.compact > span {
    font-size: 12.5px;
    line-height: 1.8;
}

/* تخصیص کاتالوگ یادگیری */
.catalog-section .learning-catalog-heading {
    /* در صورت نیاز به override خاص، اینجا اضافه کن */
}

/* ===== نوار دسته‌بندی (Category Strip) ===== */
.category-strip-shell {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: var(--space-2);
    align-items: center;
}

.category-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px 18px 2px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.category-strip::-webkit-scrollbar {
    height: 4px;
}

.category-strip::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

/* اسکرول‌های آیتم‌ها با snap */
.category-strip .chip {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* ===== دکمه‌های چپ و راست اسکرول ===== */
.category-strip-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(124, 88, 253, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    color: var(--landing-purple);
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}

.category-strip-control:hover {
    background: #f8f5ff;
    border-color: var(--landing-purple);
    color: var(--landing-purple-dark);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(124, 88, 253, 0.12);
}

.category-strip-control:active {
    transform: scale(0.95);
}

/* تنظیم جهت فلش‌ها برای زبان فارسی (RTL) */
html[dir="rtl"] .category-strip-control-prev span,
html[dir="rtl"] .category-strip-control-next span {
    display: inline-block;
    transform: scaleX(-1);
}

/* ===== کانتینر نتایج ===== */
.catalog-results {
    min-height: 250px;
    transition: opacity 0.16s ease;
}

.catalog-loading .catalog-results {
    opacity: 0.45;
    pointer-events: none;
}

/* ===== استایل اختصاصی برای حالت خالی (فقط override) ===== */
.catalog-empty {
    margin-top: 26px;
}

.category-icon-dot {
    border-radius: 50%;
    background: var(--landing-purple-dark)!important;
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .65);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .catalog-section .section-shell {
        padding: 60px 16px 0;
    }

    .catalog-section .section-heading {
        margin-bottom: 30px;
    }

    .catalog-section .section-heading > h2 {
        font-size: 24px;
    }

    .catalog-section .section-heading.compact {
        margin-bottom: 22px;
    }

    .catalog-section .section-heading.compact > h2 {
        font-size: 20px;
    }

    .catalog-section .section-heading > span {
        font-size: 12px;
    }

    .category-strip-shell {
        grid-template-columns: 1fr;
    }

    .category-strip-control {
        display: none;
    }

    .category-strip {
        gap: 10px;
        padding: 4px 0 14px 0;
    }
}