﻿/* ============================================================
   Book Detail Page
   ============================================================ */

.book-detail {
    padding-bottom: 40px;
}

/* === عنوان === */
.book-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e293b;
}

.book-title-en {
    font-size: 1.1rem;
    font-weight: 400;
    color: #64748b;
    margin-bottom: 15px;
    direction: ltr;
    text-align: right;
}

/* ============================================================
   گالری
   ============================================================ */
.book-gallery {
    position: sticky;
    top: 20px;
}

.gallery-main {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

    .gallery-main img {
        width: 100%;
        height: auto;
        display: block;
        aspect-ratio: 3/4;
        object-fit: contain;
        background: #f8fafc;
    }

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .gallery-thumbnails .thumbnail {
        width: 70px;
        height: 90px;
        border-radius: 8px;
        overflow: hidden;
        border: 2px solid transparent;
        transition: all 0.2s;
        cursor: pointer;
        position: relative;
    }

        .gallery-thumbnails .thumbnail:hover,
        .gallery-thumbnails .thumbnail.active {
            border-color: #3b82f6;
            transform: translateY(-2px);
        }

        .gallery-thumbnails .thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .gallery-thumbnails .more-images .more-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.6);
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 0.85rem;
    }

/* ============================================================
   نوار دست‌اندرکاران
   ============================================================ */
.book-contributors-section {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.contributors-header {
    color: #334155;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.contributors-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

    .contributors-strip::-webkit-scrollbar {
        height: 6px;
    }

    .contributors-strip::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }

.contributor-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}

    .contributor-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    }

.contributor-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .contributor-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.avatar-placeholder {
    color: #fff;
    font-size: 1.5rem;
}

.contributor-info {
    flex: 1;
    min-width: 0;
}

.contributor-name {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contributor-name-en {
    font-size: 0.75rem;
    opacity: 0.85;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contributor-role {
    font-size: 0.78rem;
    margin-top: 3px;
    opacity: 0.95;
}

/* ============================================================
   قیمت
   ============================================================ */
.book-price-block {
    padding: 12px 0;
}

.price-original {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 4px;
}

    .price-original .strike {
        text-decoration: line-through;
    }

.price-final {
    font-size: 1.6rem;
    font-weight: 700;
    color: #dc2626;
}

    .price-final .small {
        font-size: 0.85rem;
        font-weight: 400;
        color: #64748b;
    }

/* ============================================================
   Rating Input
   ============================================================ */
.rating-input {
    font-size: 1.6rem;
    color: #fbbf24;
    cursor: pointer;
    user-select: none;
}

    .rating-input i {
        margin-left: 4px;
        transition: transform 0.15s;
    }

        .rating-input i:hover {
            transform: scale(1.2);
        }

/* ============================================================
   Grid کتاب‌های مرتبط
   ============================================================ */
.related-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.book-mini-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .book-mini-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 14px rgba(0,0,0,0.12);
        color: inherit;
    }

.book-mini-image img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.book-mini-body {
    padding: 8px 10px;
}

.book-mini-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #1e293b;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-mini-price {
    font-size: 0.85rem;
    color: #dc2626;
    font-weight: 600;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .book-gallery {
        position: static;
    }

    .book-title {
        font-size: 1.4rem;
    }

    .related-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}
