﻿/* ============================================================ */
/* wwwroot/css/books-list.css                                    */
/* صفحه لیست کتاب‌ها — حداقل فونت ۱۲px                          */
/* ============================================================ */

/* ============================================================ */
/* هدر صفحه (عنوان + تب‌ها)                                     */
/* ============================================================ */
.books-header {
    background: #0f1824;
    color: #fff;
    padding: 40px 24px 0;
    position: relative;
    overflow: hidden;
}

.books-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 0;
}

.books-header-title {
    flex-shrink: 0;
    padding-bottom: 24px;
}

    .books-header-title h1 {
        font-family: var(--font-heading);
        font-size: 26px;
        font-weight: bold;
        margin: 0 0 4px 0;
        color: #fff;
        line-height: 1.3;
    }

    .books-header-title p {
        font-family: var(--font-primary);
        font-size: 14px;
        color: #cbd5e1;
        margin: 0;
    }

/* تب‌های دسته‌بندی */
.books-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 0;
    align-self: flex-end;
}

.books-tab {
    display: inline-block;
    padding: 10px 16px;
    font-family: var(--font-primary);
    font-size: 13px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
}

    .books-tab:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.05);
    }

    .books-tab.active {
        color: var(--color-primary);
        border-bottom-color: var(--color-primary);
        background: rgba(212, 160, 23, 0.08);
    }

/* ============================================================ */
/* بخش لیست کتاب‌ها                                             */
/* ============================================================ */
.books-list-section {
    background: #f8f9fb;
    padding: 40px 24px 60px;
    min-height: 500px;
}

.books-list-inner {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================================ */
/* شبکه کتاب‌ها — ۶ ستون دسکتاپ                                  */
/* ============================================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* ============================================================ */
/* کارت کتاب                                                     */
/* ============================================================ */
.book-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .book-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
    }

.book-item-image {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    background: #f5f7fa;
    overflow: hidden;
}

    .book-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.4s ease;
    }

.book-item:hover .book-item-image img {
    transform: scale(1.05);
}

/* Badge */
.book-item-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: var(--font-primary);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 2;
}

    .book-item-badge.badge-new {
        background: var(--color-primary);
        color: var(--color-dark);
    }

    .book-item-badge.badge-coming-soon {
        background: #8b5cf6;
        color: #fff;
    }

    .book-item-badge.badge-out-of-stock {
        background: #ef4444;
        color: #fff;
    }

    .book-item-badge.badge-preorder {
        background: #0ea5e9;
        color: #fff;
    }

    .book-item-badge.badge-low-stock {
        background: #f59e0b;
        color: var(--color-dark);
    }

/* بدنه کارت */
.book-item-body {
    padding: 12px 10px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.book-item-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 6px 0;
    line-height: 1.5;
    color: #1a2233;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .book-item-title a {
        color: inherit;
        text-decoration: none;
        transition: color 0.25s ease;
    }

        .book-item-title a:hover {
            color: var(--color-primary);
        }

.book-item-author {
    font-family: var(--font-primary);
    font-size: 12px;
    color: var(--color-primary);
    margin-bottom: 6px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-item-desc {
    font-family: var(--font-primary);
    font-size: 12px;
    color: #718096;
    line-height: 1.7;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.book-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.25s ease;
    margin-top: auto;
}

    .book-item-link:hover {
        color: var(--color-primary);
        gap: 8px;
    }

/* ============================================================ */
/* صفحه‌بندی                                                     */
/* ============================================================ */
.books-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 13px;
    color: #1a2233;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

    .page-btn:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: rgba(212, 160, 23, 0.05);
    }

    .page-btn.active {
        background: var(--color-dark, #0f1824);
        color: #fff;
        border-color: var(--color-dark, #0f1824);
        font-weight: bold;
    }

.page-arrow {
    padding: 0 12px;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-dots {
    font-family: var(--font-primary);
    font-size: 13px;
    color: #94a3b8;
    padding: 0 6px;
}

/* ============================================================ */
/* حالت خالی                                                     */
/* ============================================================ */
.books-empty {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
}

    .books-empty svg {
        color: #cbd5e1;
        margin-bottom: 20px;
    }

    .books-empty h3 {
        font-family: var(--font-heading);
        font-size: 18px;
        color: #1a2233;
        margin: 0 0 8px 0;
    }

    .books-empty p {
        font-family: var(--font-primary);
        font-size: 13px;
        margin: 0 0 20px 0;
    }

/* ============================================================ */
/* RESPONSIVE                                                    */
/* ============================================================ */

/* تبلت بزرگ (<= 1200px) — ۴ ستون */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .books-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .books-header-title {
        padding-bottom: 0;
    }

    .books-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

        .books-tabs::-webkit-scrollbar {
            display: none;
        }
}

/* تبلت (<= 992px) — ۳ ستون */
@media (max-width: 992px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .books-header {
        padding: 30px 20px 0;
    }

    .books-header-title h1 {
        font-size: 22px;
    }
}

/* موبایل بزرگ (<= 768px) — ۳ ستون */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .books-list-section {
        padding: 30px 16px 40px;
    }
}

/* موبایل (<= 600px) — ۲ ستون */
@media (max-width: 600px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .books-header {
        padding: 24px 16px 0;
    }

    .books-header-title h1 {
        font-size: 18px;
    }

    .books-header-title p {
        font-size: 12px;
    }

    .books-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .book-item-body {
        padding: 10px 8px 12px;
    }

    .book-item-title {
        font-size: 13px;
        min-height: 40px;
    }

    .book-item-author {
        font-size: 12px;
    }

    .book-item-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .book-item-link {
        font-size: 12px;
    }

    /* صفحه‌بندی فشرده‌تر */
    .page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
        padding: 0 8px;
    }

    .books-pagination {
        gap: 4px;
    }

    .page-dots {
        font-size: 12px;
    }
}

/* موبایل کوچک (<= 380px) — ۲ ستون خیلی فشرده */
@media (max-width: 380px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .book-item-title {
        font-size: 12px;
    }

    .book-item-desc {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }

    .page-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
}
