/* ==========================================
   Base Resets & Page Setup
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #1e293b;
    line-height: 1.6;
    padding: 2rem 1rem;
}

.product-container,
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.space {
    height: 2.5rem;
}


/* ==========================================
   SECTION 1: Product Header Layout
   ========================================== */

.product-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    align-items: center;
}

@media (min-width: 850px) {
    .product-card {
        /* Book cover on right (380px), Details on left (1fr) */
        grid-template-columns: 380px 1fr;
    }
}


/* Book Media Frame */

.book-media {
    display: flex;
    justify-content: center;
}

.image-frame {
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    max-width: 380px;
    width: 100%;
}

.image-frame img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}


/* Details Side */

.book-details {
    display: flex;
    flex-direction: column;
}

.badge-wrapper {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.category-badge {
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.book-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0a4b9c;
    margin-bottom: 0.4rem;
}

.book-author {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}


/* Price & Rating Bar */

.price-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.price-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.price-label,
.rating-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.price-value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    color: #0a4b9c;
}

.price-value .amount {
    font-size: 1.6rem;
    font-weight: 800;
}

.price-value .currency {
    font-size: 1rem;
    font-weight: 700;
}

.divider {
    width: 1px;
    height: 36px;
    background-color: #e2e8f0;
}

.rating-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #f59e0b;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.review-count {
    font-size: 0.75rem;
    color: #64748b;
}


/* Meta Features Grid */

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 520px) {
    .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.meta-card {
    background-color: #f8fafc;
    color: #0f172a;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
}

.meta-icon {
    width: 20px;
    height: 20px;
    color: #0a4b9c;
}

.meta-title {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
}

.meta-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
}


/* Action Buttons */

.action-buttons {
    display: flex;
    gap: 0.85rem;
}

.btn {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.btn-primary {
    flex: 1.8;
    background-color: #0a4b9c;
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background-color: #083c7d;
}

.btn-secondary {
    flex: 1;
    background-color: #ffffff;
    color: #0a4b9c;
    border: 1px solid #0a4b9c;
}

.btn-secondary:hover {
    background-color: #f0f7ff;
}

.btn-icon {
    width: 18px;
    height: 18px;
}


/* ==========================================
   SECTION 2: Description & TOC Layout
   ========================================== */

.book-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 850px) {
    .book-info-grid {
        /* Description on right (1fr), Contents sidebar on left (340px) */
        grid-template-columns: 1fr 340px;
    }
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #0a4b9c;
    margin-bottom: 1.25rem;
}

.section-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.title-icon {
    width: 24px;
    height: 24px;
    stroke: #0a4b9c;
}


/* Description Details */

.description-section {
    padding-left: 0.5rem;
}

.description-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.learn-subtitle {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 1rem;
}

.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 2px solid #e0ebf6;
    padding-right: 1rem;
}

.checklist li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    font-size: 0.925rem;
    color: #334155;
    font-weight: 500;
}

.check-icon {
    width: 20px;
    height: 20px;
    color: #0a4b9c;
    flex-shrink: 0;
}


/* Sidebar Table of Contents */

.contents-section {
    background-color: #f4f6f9;
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.toc-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.page-number {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
}

.chapter-title {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}