/* Bookstore */
.bookstore-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #fff;
    padding: 4rem 0 3.5rem;
    margin-bottom: 2rem;
}
.bookstore-hero-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.bookstore-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #86efac;
    margin-bottom: 0.75rem;
}
.bookstore-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin: 0 0 1rem;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.bookstore-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
}

.bookstore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}
.bookstore-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}
.bookstore-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}
.bookstore-card.featured { border-color: var(--primary); }
.bookstore-card-link { text-decoration: none; color: inherit; display: block; }
.bookstore-cover-wrap { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #1e293b; }
.bookstore-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.bookstore-cover-fallback {
    width: 100%; height: 100%;
    background: linear-gradient(160deg, var(--book-accent, #10b981), #0f172a);
}
.bookstore-cover-fallback.large { min-height: 420px; border-radius: var(--radius-lg);
}
.bookstore-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--primary); color: #fff;
    font-size: 0.7rem; font-weight: 700; padding: 0.35rem 0.65rem; border-radius: 6px;
}
.bookstore-card-body { padding: 1.25rem; }
.bookstore-card-body h2 { font-size: 1.2rem; margin: 0 0 0.35rem; line-height: 1.3; }
.bookstore-sub { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 0.5rem; }
.bookstore-meta { font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 0.5rem; }
.bookstore-price { font-weight: 800; color: var(--primary); margin: 0; font-size: 1.1rem; }

/* Detail */
.book-detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 3rem;
    padding: 3rem 0;
    align-items: start;
}
@media (max-width: 768px) {
    .book-detail-hero { grid-template-columns: 1fr; }
}
.book-detail-cover img { width: 100%; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.2); }
.book-detail-back { color: var(--primary); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.book-detail-info h1 { font-size: 2.25rem; margin: 0.5rem 0; font-weight: 800; }
.book-detail-sub { font-size: 1.2rem; color: var(--text-secondary); margin: 0 0 0.5rem; }
.book-detail-author { color: var(--text-secondary); margin-bottom: 1rem; }
.book-detail-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); }
.book-detail-desc { line-height: 1.75; color: var(--text-secondary); margin-bottom: 2rem; }
.book-detail-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1.05rem; }
.book-free-tag { font-weight: 700; color: var(--primary); }

.book-formats-section { padding: 2rem 0 4rem; }
.book-formats-section h2 { text-align: center; margin-bottom: 2rem; }
.book-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.book-format-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    text-align: center;
}
.fmt-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.book-physical-banner {
    text-align: center;
    padding: 2.5rem;
    margin-bottom: 4rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* Flipbook reader */
.book-reader-body { margin: 0; background: #1a1a2e; min-height: 100vh; }
.book-reader-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.25rem; background: #0f172a; color: #e2e8f0;
}
.reader-back { color: #86efac; text-decoration: none; font-weight: 600; }
.reader-hint { font-size: 0.85rem; opacity: 0.8; }
.book-reader-preview-bar {
    background: #fef3c7; color: #92400e; text-align: center; padding: 0.75rem 1rem;
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: center;
}
.book-flip-wrap {
    display: flex; justify-content: center; align-items: center;
    min-height: calc(100vh - 120px); padding: 1.5rem;
}
.book-flip-container { box-shadow: 0 30px 80px rgba(0,0,0,0.5); min-width: 280px; min-height: 400px; }
.book-flip-error {
    color: #e2e8f0;
    text-align: center;
    max-width: 420px;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}
.book-flip-error p { margin: 0; line-height: 1.6; font-size: 0.95rem; }
.book-reader-editor-bar { background: #dbeafe; color: #1e40af; }
.book-flip-page {
    background: #fffef8;
    color: #1e293b;
}
.book-flip-page-inner { padding: 1.5rem; height: 100%; box-sizing: border-box; overflow: auto; font-size: 0.88rem; line-height: 1.55; }
.book-flip-page-inner.book-flip-page-cover,
.book-flip-page--cover .book-flip-page-inner {
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}
.book-flip-page--cover .fb-cover-full-page {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-flip-page--cover .fb-cover-full {
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
    object-fit: cover;
    display: block;
    border-radius: 0;
}
.book-flip-page--cover .fb-cover-image {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: block;
}
.book-flip-page--cover .fb-cover-full.fb-cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 0;
}

/* Flipbook interior — shared */
.fb-page { height: 100%; display: flex; flex-direction: column; }
.fb-eyebrow, .fb-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: #64748b; font-weight: 700; display: block; margin-bottom: 0.5rem; }
.fb-meta { font-size: 0.78rem; color: #64748b; margin: 0 0 0.75rem; }

/* Cover page */
.fb-cover { text-align: center; justify-content: flex-end; padding: 0.5rem; }
.fb-cover-img { width: 100%; max-height: 52%; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; }
.fb-cover-text h1 { font-size: 1.35rem; margin: 0.25rem 0; font-weight: 800; line-height: 1.2; }
.fb-subtitle { font-size: 0.85rem; color: #64748b; margin: 0.25rem 0; }
.fb-author { font-size: 0.75rem; color: #94a3b8; margin-top: 0.5rem; }

/* Foreword */
.fb-foreword { justify-content: center; padding: 1rem 0.5rem; }
.fb-foreword h2 { font-size: 1.2rem; color: var(--book-accent, #10b981); margin: 0 0 0.75rem; }

/* Section divider */
.fb-section { justify-content: center; text-align: center; padding: 1rem; }
.fb-section-num { font-size: 2.5rem; font-weight: 800; color: var(--book-accent, #10b981); opacity: 0.35; line-height: 1; display: block; margin-bottom: 0.5rem; }
.fb-section h2 { font-size: 1.35rem; margin: 0 0 0.5rem; color: #1e293b; }
.fb-section p { color: #64748b; font-size: 0.85rem; margin: 0; }

/* Recipe pages — full content */
.fb-recipe { padding: 0.25rem 0; }
.fb-recipe-title { font-size: 1.15rem; margin: 0 0 0.35rem; font-weight: 700; color: #1e293b; }
.fb-recipe-intro { font-size: 0.82rem; margin-bottom: 0.75rem; color: #475569; }
.fb-ingredients { margin: 0; padding-left: 1.1rem; list-style: disc; }
.fb-ingredients li { margin-bottom: 0.3rem; font-size: 0.82rem; }
.fb-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: fbstep; }
.fb-steps li { margin-bottom: 0.65rem; font-size: 0.82rem; padding-left: 1.75rem; position: relative; }
.fb-step-num { position: absolute; left: 0; top: 0; width: 1.35rem; height: 1.35rem; background: var(--book-accent, #10b981); color: #fff; border-radius: 50%; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fb-chef-note { margin-top: 1rem; padding: 0.75rem; background: #f8fafc; border-left: 3px solid var(--book-accent, #10b981); border-radius: 0 8px 8px 0; font-size: 0.78rem; }

/* Template: Editorial */
.tpl-editorial.fb-section { border-top: 4px solid var(--book-accent, #10b981); padding-top: 1.5rem; }
.tpl-editorial .fb-recipe-title { border-left: 3px solid var(--book-accent, #10b981); padding-left: 0.65rem; }

/* Template: Minimal */
.tpl-minimal.fb-page { font-family: Georgia, 'Times New Roman', serif; }
.tpl-minimal .fb-recipe-title { font-weight: 400; }
.tpl-minimal .fb-step-num { background: #1e293b; }

/* Template: Warm */
.tpl-warm.fb-page { background: #fffbf5; }
.tpl-warm .fb-chef-note { background: #fef3c7; border-left-color: #d97706; }
.tpl-warm.fb-section { background: linear-gradient(180deg, #fef3c722, transparent); border-radius: 8px; }

/* Legacy class names (backward compat) */
.fb-cover { display: flex; flex-direction: column; height: 100%; text-align: center; justify-content: flex-end; }
.fb-cover-placeholder { flex: 1; border-radius: 8px; margin-bottom: 1rem; min-height: 120px; }
.fb-cover-text h1 { font-size: 1.35rem; margin: 0.25rem 0; }
.fb-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; }
.fb-author { font-size: 0.8rem; color: #64748b; }
.fb-chapter h2 { font-size: 1.25rem; color: var(--book-accent, #10b981); margin: 0.5rem 0; }
.fb-recipe h3 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.fb-hint { font-size: 0.75rem; font-style: italic; color: #94a3b8; margin-top: 0.75rem; }

/* Title, copyright, TOC, about, thank-you, full cover */
.fb-brand-logo { max-width: 100px; max-height: 56px; object-fit: contain; margin-bottom: 0.75rem; }
.fb-brand-logo.small { max-width: 72px; max-height: 40px; }
.fb-brand-name { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; margin: 0 0 0.5rem; }
.fb-title-page { text-align: center; justify-content: center; padding: 1rem 0.5rem; }
.fb-title-page h1 { font-size: 1.3rem; line-height: 1.25; margin: 0.35rem 0; }
.fb-cover-full-page { padding: 0; justify-content: center; align-items: center; }
.fb-cover-full { width: 100%; height: 100%; max-height: 100%; object-fit: cover; border-radius: 4px; }
.fb-cover-full.fb-cover-placeholder { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.fb-cover-fallback-title { color: #fff; font-size: 1.1rem; font-weight: 700; padding: 1rem; text-align: center; }
.fb-copyright, .fb-toc, .fb-about, .fb-thankyou { justify-content: flex-start; padding: 1rem 0.5rem; }
.fb-copyright h2, .fb-toc h2, .fb-about h2, .fb-thankyou h2 { font-size: 1.15rem; color: var(--book-accent, #10b981); margin: 0 0 0.75rem; }
.fb-copyright p, .fb-about p, .fb-thankyou p { font-size: 0.82rem; line-height: 1.55; margin: 0 0 0.65rem; }
.fb-muted { font-size: 0.75rem; color: #94a3b8; }
.fb-toc-list { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; }
.fb-toc-section { margin-bottom: 0.75rem; }
.fb-toc-section ul { padding-left: 1rem; margin: 0.25rem 0 0; list-style: disc; }
.fb-toc-section li { margin-bottom: 0.2rem; color: #475569; }

/* Preview upsell (last page for paid preview) */
.fb-upsell {
    text-align: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, #fffef8 0%, #f0fdf4 100%);
}
.fb-upsell h2 {
    font-size: 1.35rem;
    margin: 0 0 0.75rem;
    color: #1e293b;
    line-height: 1.3;
}
.fb-upsell-lead {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 1rem;
}
.fb-upsell-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--book-accent, #10b981);
    margin: 0 0 1rem;
}
.fb-upsell-btn {
    display: inline-block;
    background: var(--book-accent, #10b981);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.fb-upsell-btn:hover { opacity: 0.92; }
.fb-upsell-back { margin-top: 0.5rem; }
.book-flip-page-inner.book-flip-page-upsell { padding: 1rem; }
