/* Shared styles for the book-shop section (books/ hub + dedicated series/subject pages).
   Loaded AFTER css/style.css so it can reuse the sitewide :root variables and header/footer
   styling without duplicating them (see bcs-result/ folder for the bug this pattern avoids). */

/* Book-promo widget embedded inline inside prep/question-solution article content
   (bcs-preliminary-all-modules.html, *-question-solution/*.html "ভূমিকা" sections, etc.).
   Cards stretch to fill the full width of the article column (repeat(3,1fr), same as the
   sitewide .books-grid default) rather than being fixed-width and centered with dead space
   on the sides — the 300px .hub-book-card cap only matters on very wide columns (e.g. the
   sidebar-less all-modules pages), keeping cards from growing oversized there. */
.combo-buy-all {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: #eefbf3; border: 1px solid #b7e4c7; border-radius: 10px;
    padding: 14px 20px; margin-top: 16px;
}
.combo-buy-all-text { display: flex; flex-direction: column; gap: 4px; }
.combo-buy-all-text strong { font-size: 0.95rem; color: #1a3a2e; }
.combo-buy-all-price { font-size: 1.1rem; font-weight: 700; color: var(--deep-green); }
.combo-buy-all-btn { flex-shrink: 0; }
@media (max-width: 560px) {
    .combo-buy-all { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Rich "about this book" section: overview + features/why-buy cards + table of contents. */
.book-detail-section { max-width: 900px; margin: 55px auto 0; }
.book-detail-section > h2 { font-size: 1.5rem; text-align: center; margin-bottom: 16px; color: #1a3a2e; }
.book-detail-section > p.book-detail-overview { color: var(--text-gray); line-height: 1.9; margin: 0 auto 34px; max-width: 760px; text-align: center; }
.book-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 40px; }
.book-feature-list, .book-why-list {
    background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 5px 20px var(--shadow-light);
}
.book-feature-list h3, .book-why-list h3 {
    font-size: 1.08rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: #1a3a2e;
}
.book-feature-list h3 i, .book-why-list h3 i { color: var(--deep-red); }
.book-feature-list ul, .book-why-list ul { padding-left: 20px; line-height: 1.85; color: #333; margin: 0; }
.book-feature-list li, .book-why-list li { margin-bottom: 9px; }

.book-toc { background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 5px 20px var(--shadow-light); }
.book-toc > h3 { font-size: 1.2rem; margin-bottom: 22px; display: flex; align-items: center; gap: 8px; color: #1a3a2e; }
.book-toc > h3 i { color: var(--deep-red); }
.book-toc-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; }
.book-toc-part h4 {
    font-size: 0.97rem; font-weight: 700; color: var(--deep-green); margin-bottom: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border-gray);
}
.book-toc-part ul { list-style: none; padding: 0; margin: 0; }
.book-toc-part li { font-size: 0.89rem; color: #444; padding: 4px 0; line-height: 1.6; }
@media (max-width: 768px) {
    .book-detail-grid, .book-toc-parts { grid-template-columns: 1fr; }
}

/* Click-to-open, scroll-to-read demo viewer (single-page preview tile + full-page modal),
   replacing the old inline 2-page flip viewer for pages migrated to pdf-book-viewer-v2.js. */
.demo-preview-tile {
    max-width: 320px; margin: 0 auto; cursor: pointer; position: relative;
    border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    transition: transform 0.25s ease;
}
.demo-preview-tile:hover, .demo-preview-tile:focus-visible { transform: translateY(-4px); }
.demo-preview-canvas-wrap {
    display: flex; justify-content: center; align-items: center; background: #f4f4f4; min-height: 220px;
}
.demo-preview-overlay {
    position: absolute; inset: 0; background: rgba(11,79,39,0); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px; color: #fff; opacity: 0;
    transition: opacity 0.25s, background 0.25s;
}
.demo-preview-tile:hover .demo-preview-overlay,
.demo-preview-tile:focus-visible .demo-preview-overlay {
    opacity: 1; background: rgba(11,79,39,0.6);
}
.demo-preview-overlay i { font-size: 2rem; }
.demo-preview-overlay span { font-weight: 700; font-size: 0.95rem; text-align: center; padding: 0 16px; }

.demo-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 3000;
    display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto;
}
.demo-modal-overlay.is-open { display: flex; }
.demo-modal-box {
    background: #fff; border-radius: 12px; width: 100%; max-width: 780px; max-height: calc(100vh - 60px);
    display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.demo-modal-header {
    display: flex; align-items: center; justify-content: space-between; padding: 14px 20px;
    background: var(--deep-green); color: #fff; font-weight: 700; flex-shrink: 0;
}
.demo-modal-close {
    background: rgba(255,255,255,0.15); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; font-size: 1rem; transition: background 0.2s; flex-shrink: 0;
}
.demo-modal-close:hover { background: rgba(255,255,255,0.3); }
.demo-modal-scroll { overflow-y: auto; padding: 20px; background: #e9ecef; flex-grow: 1; min-height: 0; }
.demo-modal-page { display: flex; justify-content: center; margin-bottom: 16px; min-height: 300px; }
.demo-modal-canvas, .demo-preview-canvas { box-shadow: 0 4px 14px rgba(0,0,0,0.18); border-radius: 4px; max-width: 100%; }
@media (max-width: 600px) {
    .demo-modal-overlay { padding: 0; }
    .demo-modal-box { max-width: 100%; max-height: 100vh; border-radius: 0; }
}

.book-shop-hero {
    color: #fff;
    padding: 60px 0 50px;
    text-align: center;
}
.book-shop-hero h1 { font-size: 2.2rem; margin-bottom: 14px; }
.book-shop-hero p { font-size: 1.05rem; max-width: 720px; margin: 0 auto; opacity: 0.95; line-height: 1.8; }
.book-shop-hero p.hero-desc-wide { max-width: 960px; }
.book-shop-hero .price-badge {
    display: inline-block; background: #D3AE37; color: #1a3a2e; font-weight: 700;
    padding: 9px 26px; border-radius: 30px; font-size: 0.95rem; letter-spacing: 0.3px; margin-top: 18px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.book-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-8px); box-shadow: 0 12px 28px var(--shadow-dark); }
.hub-book-card { max-width: 300px; width: 100%; margin: 0 auto; }
.hub-book-card .book-cover-wrapper { aspect-ratio: 3 / 4; }
.series-book-card { max-width: 320px; width: 100%; margin: 0 auto; }
.series-book-card .book-cover-wrapper { aspect-ratio: 3 / 4; }
.book-cover-wrapper { display: block; position: relative; width: 100%; aspect-ratio: 1488 / 2105; overflow: hidden; background: #eee; }
.book-cover-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-wrapper a { display: block; width: 100%; height: 100%; }
.book-card-content { padding: 18px 20px 22px; display: flex; flex-direction: column; flex-grow: 1; text-align: center; align-items: center; }
.book-title { font-size: 1.05rem; font-weight: 700; line-height: 1.5; margin-bottom: 8px; color: #212529; }
.book-desc { font-size: 0.88rem; color: var(--text-gray); line-height: 1.6; margin-bottom: 14px; flex-grow: 1; }
.book-price-tag { font-size: 1.1rem; font-weight: 700; color: var(--deep-green); margin-bottom: 14px; }
.book-price-tag .old-price { font-size: 0.85rem; color: var(--text-gray); text-decoration: line-through; font-weight: 400; margin-right: 8px; }
.book-price-tag--combo { font-size: 0.85rem; font-weight: 600; font-style: italic; color: var(--text-gray); }
.book-actions { display: flex; gap: 10px; }
.book-actions a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    text-align: center; padding: 10px 8px; border-radius: 6px; font-size: 0.85rem; font-weight: 700;
    transition: background 0.3s, color 0.3s;
}
.book-actions a i { font-size: 1.05rem; }
.btn-demo, .btn-download { background: var(--light-gray); color: #212529; border: 1px solid var(--border-gray); }
.btn-demo:hover, .btn-download:hover { background: var(--border-gray); }

/* Single-book showcase (subject pages: বাংলা/ইংরেজি/গণিত — one book, shown as a proper
   product layout instead of a lone grid card floating in empty space) */
.single-book-showcase {
    display: flex; gap: 40px; align-items: center; max-width: 820px; margin: 50px auto 0;
    background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 5px 20px var(--shadow-light);
}
.single-book-showcase .showcase-cover { flex: 0 0 230px; }
.single-book-showcase .showcase-cover img { width: 100%; border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,0.18); display: block; }
.single-book-showcase .showcase-info { flex: 1; text-align: left; }
.single-book-showcase .showcase-info h2 { font-size: 1.6rem; margin-bottom: 14px; color: #212529; }
.single-book-showcase .showcase-info p { color: var(--text-gray); line-height: 1.8; margin-bottom: 18px; }
.single-book-showcase .showcase-info .book-price-tag { font-size: 1.35rem; margin-bottom: 18px; }
.single-book-showcase .showcase-info .book-actions { max-width: 340px; }

@media (max-width: 768px) {
    .single-book-showcase { flex-direction: column; text-align: center; padding: 30px 24px; }
    .single-book-showcase .showcase-cover { flex: 0 0 auto; max-width: 200px; }
    .single-book-showcase .showcase-info { text-align: center; }
    .single-book-showcase .showcase-info .book-actions { max-width: 100%; margin: 0 auto; }
}

/* Pricing / combo table */
.pricing-section { margin: 55px 0; }
.pricing-section h2 { font-size: 1.5rem; margin-bottom: 20px; text-align: center; color: #212529; }
.combo-note-text { text-align: center; color: var(--text-gray); max-width: 620px; margin: -8px auto 22px; line-height: 1.7; }
.pricing-table-wrap { max-width: 760px; margin: 0 auto; overflow-x: auto; }
.pricing-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 20px var(--shadow-light); }
.pricing-table th, .pricing-table td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border-gray); }
.pricing-table th { background: var(--deep-green); color: #fff; font-size: 0.95rem; }
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-table td.price-cell { font-weight: 700; color: var(--deep-green); font-size: 1.05rem; white-space: nowrap; }
.pricing-table td.best-value { position: relative; }
.pricing-table tr.highlight-row td { background: #f7fbf8; }
.badge-best {
    display: inline-block; background: var(--deep-red); color: #fff; font-size: 0.7rem; font-weight: 700;
    padding: 2px 10px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
}

/* WhatsApp buttons */
.btn-whatsapp {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: #25D366; color: #fff; padding: 10px 22px; border-radius: 6px; font-weight: 700;
    font-size: 0.92rem; text-decoration: none; transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
}
.btn-whatsapp:hover { background: #1eb959; transform: translateY(-2px); }
.btn-whatsapp i { font-size: 1.1rem; }
.btn-whatsapp-large {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: #25D366; color: #fff; padding: 16px 40px; border-radius: 8px; font-weight: 700;
    font-size: 1.05rem; text-decoration: none; transition: background 0.3s, transform 0.2s;
}
.btn-whatsapp-large:hover { background: #1eb959; transform: translateY(-2px); }

/* Demo PDF viewer — a custom canvas-rendered "open book" page-flip reader (PDF.js),
   no native browser PDF toolbar. Two levels of navigation on series pages:
   outer arrows (.book-viewer-arrow) switch between book VARIANTS (exam-wise/by-subject/...),
   inner arrows (.book-page-nav button) flip PAGES within the currently loaded PDF. */
.demo-viewer-section { margin: 55px 0; }
.demo-viewer-section h2 { font-size: 1.5rem; margin-bottom: 20px; text-align: center; color: #212529; }
.book-viewer { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 960px; margin: 0 auto; }
.book-viewer-arrow {
    flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: #fff;
    border: 1px solid var(--border-gray); box-shadow: 0 3px 10px var(--shadow-light);
    cursor: pointer; font-size: 1.1rem; color: var(--deep-green);
    transition: background 0.3s, color 0.3s;
}
.book-viewer-arrow:hover:not(:disabled) { background: var(--deep-green); color: #fff; }
.book-viewer-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.demo-viewer-frame-wrap {
    flex: 1; min-width: 0; background: #2b2f26; border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 26px var(--shadow-dark); border: 1px solid var(--border-gray);
}
.book-viewer-label {
    text-align: center; padding: 12px 16px; font-weight: 700; color: #fff; background: var(--deep-green);
    font-size: 0.95rem;
}
.book-spread-wrap {
    display: flex; justify-content: center; align-items: center; gap: 0; padding: 24px;
    min-height: 300px; background: #3a3f33;
}
.book-loading { color: #cfd6c9; font-weight: 600; padding: 60px 0; }
.book-page-canvas {
    background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    max-width: 100%; height: auto;
}
.book-spread-wrap .book-page-canvas:only-child { border-radius: 4px; }
.book-spread-wrap .book-page-canvas:first-child:not(:only-child) { border-radius: 4px 0 0 4px; box-shadow: -6px 6px 18px rgba(0,0,0,0.35); }
.book-spread-wrap .book-page-canvas:last-child:not(:only-child) { border-radius: 0 4px 4px 0; box-shadow: 6px 6px 18px rgba(0,0,0,0.35); margin-left: 3px; }
.book-page-nav {
    display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 16px;
    background: #fff; border-top: 1px solid var(--border-gray);
}
.book-page-nav-btn {
    width: 38px; height: 38px; border-radius: 50%; background: var(--light-gray);
    border: 1px solid var(--border-gray); color: var(--deep-green); cursor: pointer;
    font-size: 0.95rem; transition: background 0.3s, color 0.3s;
}
.book-page-nav-btn:hover:not(:disabled) { background: var(--deep-green); color: #fff; }
.book-page-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.book-page-label { font-weight: 700; color: #212529; font-size: 0.9rem; min-width: 140px; text-align: center; }
.demo-viewer-footer { display: flex; justify-content: center; padding: 16px; border-top: 1px solid var(--border-gray); background: #fff; }

/* Cross-sell combo box (subject pages) */
.combo-crosssell {
    max-width: 820px; margin: 55px auto; background: var(--light-gray); border-radius: 12px;
    padding: 35px 30px; text-align: center;
}
.combo-crosssell h2 { font-size: 1.35rem; margin-bottom: 20px; }
.combo-crosssell .combo-books { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.combo-crosssell .combo-book-chip {
    display: flex; align-items: center; gap: 10px; background: #fff; padding: 10px 16px 10px 10px;
    border-radius: 30px; box-shadow: 0 3px 10px var(--shadow-light); text-decoration: none; color: #212529; font-weight: 600; font-size: 0.9rem;
}
.combo-crosssell .combo-book-chip img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; }

/* Purchase note box */
.purchase-note {
    max-width: 760px; margin: 30px auto 0; background: #fdf6e3; border: 1px solid #f0e2b0;
    border-radius: 8px; padding: 16px 20px; font-size: 0.9rem; color: #6b5b1e; text-align: center; line-height: 1.7;
}

@media (max-width: 992px) {
    .books-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .books-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
    .book-shop-hero h1 { font-size: 1.6rem; }
    .pricing-table th, .pricing-table td { padding: 12px; font-size: 0.85rem; }
    .btn-whatsapp-large { padding: 14px 28px; font-size: 0.95rem; }
    .book-viewer { gap: 8px; }
    .book-spread-wrap { flex-direction: column; gap: 12px; padding: 16px; }
    .book-spread-wrap .book-page-canvas:first-child:not(:only-child),
    .book-spread-wrap .book-page-canvas:last-child:not(:only-child) {
        border-radius: 4px; margin-left: 0; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    }
    .book-page-nav { gap: 10px; padding: 10px; }
    .book-page-label { font-size: 0.8rem; min-width: auto; }
    .book-viewer-arrow { width: 38px; height: 38px; font-size: 0.9rem; }
    .book-viewer-label { font-size: 0.82rem; padding: 10px 8px; }
}
