/* ══════════════════════════════════════════════════
   BOOK PAGE — LITERARY CLASSICAL v4
   Platform palette: cyan #4FD1FF · purple #A855F7 · blue #3B82F6
   ══════════════════════════════════════════════════ */

:root {
    --bk-cyan:   #4FD1FF;
    --bk-purple: #A855F7;
    --bk-blue:   #3B82F6;
    --bk-bg:     #F8F9FC;
    --bk-paper:  #ffffff;
    --bk-ink:    #111111;
    --bk-mute:   #666666;
    --bk-line:   #ECEEF5;
    --bk-grad:   linear-gradient(135deg, var(--bk-cyan) 0%, var(--bk-purple) 60%, var(--bk-blue) 100%);
    --bk-grad-soft: linear-gradient(135deg, rgba(79,209,255,.10) 0%, rgba(168,85,247,.10) 60%, rgba(59,130,246,.10) 100%);
}

/* ── Page ───────────────────────────────────────── */
body { background: var(--bk-bg); }
.dark-mode body { background: #0b0f1a; }

main.book-page { max-width: none; margin: 0; padding: 0; }

/* ── Breadcrumb ─────────────────────────────────── */
.bk-breadcrumb {
    direction: rtl;
    overflow: hidden;
    margin-bottom: 1.2rem;
}
.bk-bc-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    overflow: hidden;
}
.bk-breadcrumb a, .bk-breadcrumb span {
    font-family: 'Cairo', sans-serif;
    font-size: .92rem; font-weight: 600;
    color: #94a3b8; text-decoration: none;
    display: inline-flex; align-items: center; gap: 3px;
    transition: color .18s; flex-shrink: 0;
}
.bk-breadcrumb a:hover { color: var(--bk-purple); }
.bk-breadcrumb .bk-bc-sep {
    display: inline-flex; align-items: center;
    color: #a0aec0;
    user-select: none; margin: 0 2px;
    flex-shrink: 0;
}
.bk-breadcrumb .bk-bc-sep svg { width: 13px; height: 13px; stroke-width: 2.8; }
.dark-mode .bk-breadcrumb .bk-bc-sep { color: #3d4f6e; }
.bk-breadcrumb .bk-bc-current {
    color: var(--bk-purple); font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0; flex-shrink: 1;
}
.bk-breadcrumb svg { flex-shrink: 0; opacity: .55; }
.dark-mode .bk-breadcrumb a,
.dark-mode .bk-breadcrumb span { color: #475569; }
.dark-mode .bk-breadcrumb .bk-bc-sep { color: #1e293b; }
.dark-mode .bk-breadcrumb .bk-bc-current { color: #c4b5fd; }
.dark-mode .bk-breadcrumb a:hover { color: #c4b5fd; }

/* ══════════════════════════════════════════════════
   HERO  —  ساحة الكتاب
   ══════════════════════════════════════════════════ */
.bk-hero {
    position: relative;
    padding: 6rem 2rem 3rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 15%, rgba(79,209,255,.14), transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(168,85,247,.14), transparent 45%),
        var(--bk-bg);
}
.dark-mode .bk-hero {
    background:
        radial-gradient(circle at 85% 15%, rgba(79,209,255,.08), transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(168,85,247,.08), transparent 45%),
        #0b0f1a;
}

.bk-hero-inner {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
}

/* ── Cover ──────────────────────────────────────── */
.bk-cover-wrap {
    position: sticky;
    top: 5.5rem;
    background: transparent;
}
.bk-cover {
    width: 100%; display: block;
    aspect-ratio: 3/4;
    background: transparent;
    box-shadow: none;
    transition: transform .35s ease;
}
.bk-cover:hover { transform: translateY(-6px); }
.dark-mode .bk-cover { box-shadow: none; }

/* Mobile cover price badge */
.bk-mob-top { display: none; }
.bk-price-badge {
    display: none;
    position: absolute;
    top: -14px; left: -14px;
    background: var(--bk-grad);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: .82rem; font-weight: 800;
    padding: 6px 14px;
    border-radius: 50px;
    box-shadow: 0 6px 18px rgba(168,85,247,.45);
    white-space: nowrap;
    z-index: 2;
}

/* ══════════════════════════════════════════════════
   INFO COLUMN  —  new vertical rhythm
   ══════════════════════════════════════════════════ */
.bk-info {
    padding-top: .25rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}
.bk-author-link  { order: 1; margin-bottom: 0 !important; }
.bk-meta-row     { order: 2; }
.bk-title-row    { order: 3; margin-bottom: 0 !important; }
.bk-stats-card   { order: 4; }
#descWrap        { order: 5; }
.bk-actions      { order: 6; margin-bottom: 0 !important; }
.bk-publisher    { order: 7; }
.bk-info .bk-hr  { display: none !important; }

/* Author link — hidden */
.bk-author-link,
.bk-author-link.show { display: none !important; }
.bk-author-av {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bk-grad);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.dark-mode .bk-author-link {
    color: #c4b5fd;
    background: rgba(168,85,247,.12);
    border-color: rgba(168,85,247,.28);
}

/* Title */
.bk-title-row {
    display: block;
    padding-bottom: 0;
    position: relative;
}
.bk-title {
    font-family: 'Amiri', serif;
    font-size: 3rem; font-weight: 700;
    color: var(--bk-ink); margin: 0;
    line-height: 1.15;
    letter-spacing: -.01em;
}
.dark-mode .bk-title { color: #f5f3ff; }

/* Price — only shown inside actions bar now */
.bk-price-row {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 .2rem;
    margin: 0;
}
.bk-price-row::before {
    content: 'السعر';
    font-family: 'Cairo', sans-serif;
    font-size: .7rem;
    font-weight: 600;
    color: var(--bk-mute);
    margin-left: .5rem;
    opacity: .75;
}
.bk-price-val {
    font-family: 'Cairo', sans-serif;
    font-size: 1.85rem; font-weight: 900;
    line-height: 1;
    background: var(--bk-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════════════
   STATS CARD  —  rating + readers/downloads
   ══════════════════════════════════════════════════ */
.bk-stats-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1rem 1.4rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, rgba(79,209,255,.06), rgba(168,85,247,.06));
    border: 1px solid var(--bk-line);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.dark-mode .bk-stats-card {
    background: linear-gradient(135deg, rgba(79,209,255,.05), rgba(168,85,247,.05));
    border-color: rgba(255,255,255,.07);
}

.bk-rating {
    display: flex; align-items: center; gap: .5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--bk-line);
    flex-wrap: nowrap;
}
.dark-mode .bk-rating { border-color: rgba(255,255,255,.08); }
.bk-rate-stars { display: flex; direction: ltr; gap: 1px; }
.bk-rate-stars span { font-size: 1.05rem; }
.bk-rate-full  { color: #f5b942; }
.bk-rate-empty { color: #d1d5db; }
.bk-rate-val {
    font-family: 'Cairo', sans-serif;
    font-size: 1.15rem; font-weight: 800; color: var(--bk-ink);
}
.bk-rate-sep { display: none; }
.bk-rate-count {
    font-family: 'Cairo', sans-serif;
    font-size: .75rem; color: var(--bk-mute); font-weight: 600;
    white-space: nowrap;
}
.dark-mode .bk-rate-empty { color: rgba(255,255,255,.15); }
.dark-mode .bk-rate-val   { color: #f9fafb; }
.dark-mode .bk-rate-count { color: #9ca3af; }

.bk-stats {
    display: flex; align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    font-family: 'Cairo', sans-serif; font-size: .82rem;
    color: var(--bk-mute); margin: 0;
    flex-wrap: wrap;
}
.bk-stat-n   {
    font-family: 'Cairo', sans-serif;
    font-weight: 900; color: var(--bk-blue);
    font-size: 1.05rem;
    display: block;
}
.bk-stat-lbl { font-weight: 500; font-size: .72rem; }
.bk-stat-dot { display: none; }
.dark-mode .bk-stats   { color: #94a3b8; }
.dark-mode .bk-stat-n  { color: #93c5fd; }

/* ── Divider with ornament ──────────────────────── */
.bk-hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bk-line) 20%, var(--bk-line) 80%, transparent);
    margin: 1.2rem 0;
    position: relative;
}
.bk-hr::after {
    content: '❖';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bk-bg);
    padding: 0 12px;
    color: var(--bk-purple);
    font-size: .7rem;
    opacity: .5;
}
.dark-mode .bk-hr {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.08) 20%, rgba(255,255,255,.08) 80%, transparent);
}
.dark-mode .bk-hr::after { background: #0b0f1a; color: #a78bfa; }

/* ══════════════════════════════════════════════════
   DESCRIPTION  —  quote card "صفحة من الكتاب"
   ══════════════════════════════════════════════════ */
#descWrap.bk-quote-card,
#descWrap {
    position: relative;
    padding: 1.6rem 2rem 1.4rem;
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(168,85,247,.04);
}
.dark-mode #descWrap,
.dark-mode #descWrap.bk-quote-card {
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.07);
    box-shadow: none;
}

.bk-desc {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 1rem;
    line-height: 2;
    color: #2d3748;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
    font-style: italic;
}
.bk-desc.expanded { -webkit-line-clamp: unset; overflow: visible; }
.bk-desc-more {
    display: block; margin-top: .8rem; padding: 0;
    border: none; background: none;
    color: var(--bk-purple);
    font-family: 'Cairo', sans-serif;
    font-size: .85rem; font-weight: 700;
    cursor: pointer; transition: opacity .2s;
}
.bk-desc-more:hover { opacity: .7; }
.dark-mode .bk-desc { color: #cbd5e1; }
.dark-mode .bk-desc-more { color: #c4b5fd; }

/* ── Metadata tags ──────────────────────────────── */
.bk-meta-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 0; }
.bk-meta-item {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: .8rem; font-weight: 600;
    background: rgba(168,85,247,.06);
    color: var(--bk-purple);
    border: 1px solid rgba(168,85,247,.18);
    transition: all .2s;
}
.bk-meta-item:hover {
    background: rgba(168,85,247,.10);
    transform: translateY(-1px);
}
.bk-meta-item svg { width: 12px; height: 12px; opacity: .65; flex-shrink: 0; }
.dark-mode .bk-meta-item {
    background: rgba(168,85,247,.12);
    color: #c4b5fd;
    border-color: rgba(168,85,247,.28);
}

/* ══════════════════════════════════════════════════
   ACTION BAR  —  price + buy + download + share
   ══════════════════════════════════════════════════ */
.bk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    padding: 1rem 1.2rem;
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(168,85,247,.04);
    align-items: center;
}
.dark-mode .bk-actions {
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.07);
    box-shadow: none;
}
.bk-actions-top {
    display: flex; gap: .7rem; align-items: center;
    flex: 1;
    min-width: 220px;
}
.bk-actions .bk-price-row { margin-left: auto; }
.bk-dl { width: 100%; justify-content: center; }
.bk-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .55rem; padding: .95rem 1.8rem;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: .95rem; font-weight: 700;
    cursor: pointer; transition: all .2s;
    text-decoration: none; border: none;
    line-height: 1; white-space: nowrap;
}
.bk-btn:hover { transform: translateY(-2px); }
.bk-btn svg { width: 17px; height: 17px; }

.bk-buy {
    background: var(--bk-grad);
    color: #fff;
    box-shadow: 0 6px 20px rgba(168,85,247,.32);
    flex: 1;
    position: relative;
    overflow: hidden;
}
.bk-buy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.18) 50%, rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    transition: transform .6s;
}
.bk-buy:hover::before { transform: translateX(100%); }
.bk-buy:hover { box-shadow: 0 10px 28px rgba(168,85,247,.45); }
.bk-buy > * { position: relative; z-index: 1; }

.bk-dl {
    background: transparent;
    color: var(--bk-purple);
    border: 1.5px solid rgba(168,85,247,.4);
}
.bk-dl:hover {
    background: rgba(168,85,247,.06);
    border-color: var(--bk-purple);
}
/* Download جنب الـ Share — لما مفيش زر شراء */
.bk-dl-inline {
    background: transparent;
    color: var(--bk-purple);
    border: 1.5px solid rgba(168,85,247,.4);
    flex: 1;
}
.bk-dl-inline:hover {
    background: rgba(168,85,247,.06);
    border-color: var(--bk-purple);
}
.dark-mode .bk-dl-inline { color: #c4b5fd; border-color: rgba(168,85,247,.5); }
.dark-mode .bk-dl-inline:hover { background: rgba(168,85,247,.1); }

.bk-share {
    background: transparent;
    color: var(--bk-mute);
    border: 1.5px solid var(--bk-line);
    padding: .95rem;
}
.bk-share:hover {
    border-color: var(--bk-purple);
    color: var(--bk-purple);
    background: rgba(168,85,247,.04);
}
.dark-mode .bk-buy { box-shadow: 0 6px 24px rgba(168,85,247,.4); }
.dark-mode .bk-dl  { color: #c4b5fd; border-color: rgba(168,85,247,.5); }
.dark-mode .bk-dl:hover { background: rgba(168,85,247,.1); }
.dark-mode .bk-share { color: #9ca3af; border-color: rgba(255,255,255,.15); }
.dark-mode .bk-share:hover { border-color: rgba(168,85,247,.6); color: #c4b5fd; }

/* ── Publisher ──────────────────────────────────── */
.bk-publisher { margin-top: .5rem; }
.bk-publisher a {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--bk-mute);
    font-family: 'Cairo', sans-serif;
    font-size: .82rem; font-weight: 600;
    text-decoration: none;
    padding: .4rem .9rem;
    border: 1px solid var(--bk-line);
    border-radius: 50px;
    background: var(--bk-paper);
    transition: all .2s;
}
.bk-publisher a:hover {
    color: var(--bk-purple);
    border-color: rgba(168,85,247,.3);
    background: rgba(168,85,247,.04);
}
.dark-mode .bk-publisher a {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.1);
    color: #9ca3af;
}

/* ══════════════════════════════════════════════════
   BODY  —  المحتوى السفلي
   ══════════════════════════════════════════════════ */
.bk-body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem;
    display: flex; flex-direction: column; gap: 1.5rem;
}
#addReviewSection { text-align: center; padding: .5rem 0 1rem; }

/* ── Cards ──────────────────────────────────────── */
.bk-card {
    background: var(--bk-paper);
    border-radius: 20px;
    padding: 2.2rem 2.5rem;
    border: 1px solid var(--bk-line);
    box-shadow: 0 1px 3px rgba(0,0,0,.02), 0 8px 24px rgba(168,85,247,.05);
    position: relative;
    overflow: hidden;
}
.dark-mode .bk-card {
    background: #111827;
    border-color: rgba(255,255,255,.07);
    box-shadow: none;
}

/* Section heading */
.bk-h2 {
    font-family: 'Amiri', serif;
    font-size: 1.55rem; font-weight: 700;
    color: var(--bk-ink);
    margin: 0 0 1.5rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--bk-line);
    position: relative;
}
.dark-mode .bk-h2 { color: #f9fafb; border-color: rgba(255,255,255,.07); }

/* ══════════════════════════════════════════════════
   REVIEWS  —  بطاقات شهادات أدبية
   ══════════════════════════════════════════════════ */
#reviewsSection { display: none; }
#reviewsSection.visible { display: block; }

.reviews-chat {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
@keyframes rcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.rc-row {
    animation: rcFadeIn .35s ease both;
    display: block;
}
.rc-row > .rc-avatar { display: none; }

.rc-bubble {
    position: relative;
    padding: 1.6rem 1.4rem 1.3rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(168,85,247,.03), rgba(79,209,255,.03));
    border: 1px solid var(--bk-line);
    color: var(--bk-ink);
    transition: all .25s ease;
    overflow: hidden;
}
.rc-bubble::before {
    content: '\201D';
    position: absolute;
    top: -8px; right: 14px;
    font-family: 'Amiri', serif;
    font-size: 3.5rem;
    color: var(--bk-purple);
    opacity: .18;
    line-height: 1;
    pointer-events: none;
}
.rc-bubble:hover {
    border-color: rgba(168,85,247,.3);
    box-shadow: 0 8px 24px rgba(168,85,247,.08);
    transform: translateY(-2px);
}
.dark-mode .rc-bubble {
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.07);
    color: #f3f4f6;
}
.dark-mode .rc-bubble::before { color: #c4b5fd; opacity: .25; }

.rc-bubble .rc-meta {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; flex-wrap: nowrap;
}
.rc-bubble .rc-avatar-inline {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(168,85,247,.18);
}
.rc-name {
    font-family: 'Cairo', sans-serif;
    font-size: .92rem; font-weight: 800; line-height: 1.2;
    color: var(--bk-ink);
    display: block;
}
.rc-country {
    font-size: .76rem; opacity: .7;
    line-height: 1.2; color: var(--bk-mute);
    display: block;
    margin-top: 2px;
}
.dark-mode .rc-name    { color: #f3f4f6; }
.dark-mode .rc-country { color: #8e8e93; }

.rc-stars {
    display: flex; gap: 2px; margin-bottom: 10px;
    direction: ltr; justify-content: flex-start;
}
.rc-stars span { font-size: .9rem; }
.rc-stars .star-full, .rc-stars .star-half { color: #f5b942; }
.rc-stars .star-empty { color: #d2d2d7; }
.dark-mode .rc-stars .star-empty { color: rgba(255,255,255,.15); }

.rc-text {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: .92rem;
    line-height: 1.9;
    margin: 0;
    color: #3d3d3d;
    font-style: italic;
}
.dark-mode .rc-text { color: #cbd5e1; }

.rc-rating-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .72rem; font-weight: 700; margin-top: 10px;
    padding: 3px 9px; border-radius: 20px;
    background: rgba(245,185,66,.10);
    color: #92400e;
}
.dark-mode .rc-rating-badge { color: #fbbf24; background: rgba(245,185,66,.12); }

/* ══════════════════════════════════════════════════
   STICKY MOBILE BUY BAR
   ══════════════════════════════════════════════════ */
.bk-sticky-buy {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 900;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--bk-line);
    padding: .75rem 1rem;
    box-shadow: 0 -8px 24px rgba(0,0,0,.08);
    direction: rtl;
}
.bk-sticky-buy-inner {
    display: flex; align-items: center; gap: .8rem;
    max-width: 600px; margin: 0 auto;
}
.bk-sticky-cover {
    width: 42px; height: 56px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.bk-sticky-info { flex: 1; min-width: 0; }
.bk-sticky-title {
    font-family: 'Cairo', sans-serif;
    font-size: .82rem; font-weight: 700;
    color: var(--bk-ink);
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bk-sticky-price {
    font-family: 'Cairo', sans-serif;
    font-size: .9rem; font-weight: 800;
    background: var(--bk-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bk-sticky-btn {
    background: var(--bk-grad);
    color: #fff;
    border: none;
    padding: .7rem 1.4rem;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: .88rem; font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(168,85,247,.35);
    transition: transform .2s;
}
.bk-sticky-btn:active { transform: scale(.96); }
.dark-mode .bk-sticky-buy {
    background: rgba(15,23,42,.96);
    border-color: rgba(255,255,255,.08);
}
.dark-mode .bk-sticky-title { color: #f3f4f6; }

/* ══════════════════════════════════════════════════
   REVIEW MODAL
   ══════════════════════════════════════════════════ */
#reviewModal {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center; justify-content: center; padding: 1rem;
}
#reviewModal.rm-open { display: flex; }
.rm-box {
    background: #fff;
    border-radius: 24px;
    padding: 2rem 2rem 1.8rem;
    width: 100%; max-width: 480px;
    position: relative;
    animation: rmIn .32s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 24px 60px rgba(0,0,0,.2);
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}
@keyframes rmIn { from { opacity:0; transform:translateY(26px) scale(.96); } to { opacity:1; transform:none; } }
.dark-mode .rm-box { background: #1c2333; color: #f5f5f7; }

.rm-close { position: absolute; top:14px; left:16px; background:none; border:none; font-size:1.3rem; cursor:pointer; color:#8e8e93; line-height:1; transition:color .2s; }
.rm-close:hover { color:#ef4444; }
.rm-title {
    font-family: 'Amiri', serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--bk-ink);
    margin: 0 0 4px;
    position: relative;
    padding-bottom: 12px;
}
.dark-mode .rm-title { color: #f5f5f7; }

.rm-star-lbl { font-size: .82rem; font-weight: 600; color: #6e6e73; display: block; margin: 1rem 0 5px; }
.dark-mode .rm-star-lbl { color: #8e8e93; }

.rm-stars { display: flex; flex-direction: row-reverse; gap: 3px; direction: ltr; margin-bottom: 1rem; }
.rm-stars input { display: none; }
.rm-stars label { font-size: 2rem; color: #e8e8ed; cursor: pointer; transition: color .15s, transform .15s; line-height: 1; user-select: none; }
.dark-mode .rm-stars label { color: rgba(255,255,255,.15); }
.rm-stars label:hover, .rm-stars label:hover ~ label, .rm-stars input:checked ~ label { color: #f5b942; }
.rm-stars label:hover { transform: scale(1.18); }

.rm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.rm-field { display: flex; flex-direction: column; gap: 4px; }
.rm-field label { font-size: .79rem; font-weight: 600; color: #6e6e73; }
.dark-mode .rm-field label { color: #8e8e93; }
.rm-field input, .rm-field textarea {
    font-family: 'Cairo', sans-serif;
    font-size: .88rem;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1.5px solid var(--bk-line);
    background: #f5f5f7;
    color: var(--bk-ink);
    outline: none; resize: none; direction: rtl;
    transition: border-color .2s, box-shadow .2s;
}
.rm-field input:focus, .rm-field textarea:focus {
    border-color: var(--bk-purple);
    box-shadow: 0 0 0 3px rgba(168,85,247,.12);
}
.dark-mode .rm-field input, .dark-mode .rm-field textarea {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: #f5f5f7;
}
.rm-full { margin-bottom: 14px; }
.rm-notice {
    display: flex; align-items: flex-start; gap: 9px;
    background: rgba(245,185,66,.08);
    border: 1px solid rgba(245,185,66,.3);
    border-radius: 10px;
    padding: 10px 13px;
    margin: 12px 0 4px;
    font-size: .8rem; line-height: 1.55;
    color: #92400e; font-weight: 600;
}
.dark-mode .rm-notice { color: #fbbf24; border-color: rgba(245,185,66,.22); }
.rm-notice svg { flex-shrink: 0; margin-top: 1px; color: #f59e0b; }
.rm-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: var(--bk-grad);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: .98rem; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .15s;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(168,85,247,.3);
}
.rm-submit:hover { opacity: .92; transform: translateY(-1px); }
.rm-success {
    display: none;
    align-items: center; gap: 9px;
    background: rgba(34,197,94,.07);
    border: 1px solid rgba(34,197,94,.22);
    border-radius: 10px;
    padding: 12px 15px;
    margin-top: 12px;
    font-size: .87rem;
    color: #16a34a; font-weight: 600;
}
.dark-mode .rm-success { color: #4ade80; }

/* ══════════════════════════════════════════════════
   SHARE TOAST
   ══════════════════════════════════════════════════ */
.share-toast {
    position: fixed; bottom: 5rem; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: .7rem 1.3rem;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: .85rem; font-weight: 600;
    display: flex; align-items: center; gap: .5rem;
    opacity: 0; transition: all .3s;
    pointer-events: none; z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════
   SKELETON  —  loading state
   ══════════════════════════════════════════════════ */
@keyframes sk-shimmer {
    0%   { background-position: -900px 0; }
    100% { background-position:  900px 0; }
}
.bk-sk-screen {
    position: fixed; inset: 0;
    z-index: 1500;
    overflow: hidden;
    background: var(--bk-bg);
    transition: opacity .45s ease;
}
.dark-mode .bk-sk-screen { background: #0b0f1a; }
.bk-sk-screen.sk-done { opacity: 0; pointer-events: none; }
.bk-sk-screen .sk-el {
    border-radius: 8px;
    background: linear-gradient(90deg, #ece4f8 25%, #f5eeff 50%, #ece4f8 75%);
    background-size: 1800px 100%;
    animation: sk-shimmer 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
.dark-mode .bk-sk-screen .sk-el {
    background: linear-gradient(90deg, #14213a 25%, #1c2f4a 50%, #14213a 75%);
    background-size: 1800px 100%;
}
.bk-sk-header {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid rgba(168,85,247,.08);
}
.dark-mode .bk-sk-header { background: #0c1220; }
.bk-sk-hero {
    padding: 4rem 2rem 3rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    align-items: flex-start;
    max-width: 1180px;
    margin: 0 auto;
}
.bk-sk-cover { aspect-ratio: 3/4; width: 100%; border-radius: 4px 12px 12px 4px; }
.bk-sk-right { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.bk-sk-author { display: flex; align-items: center; gap: 9px; }
.bk-sk-screen .sk-av   { border-radius: 50%; width: 26px; height: 26px; }
.bk-sk-screen .sk-name { height: 13px; width: 90px; }
.bk-sk-screen .sk-t1   { height: 42px; width: 82%; }
.bk-sk-screen .sk-t2   { height: 36px; width: 52%; margin-top: -4px; }
.bk-sk-screen .sk-stars { height: 18px; width: 155px; }
.bk-sk-stats { display: flex; align-items: center; gap: 12px; }
.bk-sk-screen .sk-pill { height: 20px; width: 78px; border-radius: 20px; }
.bk-sk-desc  { display: flex; flex-direction: column; gap: 9px; }
.bk-sk-screen .sk-ln       { height: 13px; }
.bk-sk-screen .sk-ln.w100  { width: 100%; }
.bk-sk-screen .sk-ln.w88   { width: 88%;  }
.bk-sk-screen .sk-ln.w72   { width: 72%;  }
.bk-sk-screen .sk-ln.w58   { width: 58%;  }
.bk-sk-meta { display: flex; gap: 8px; }
.bk-sk-screen .sk-tag { height: 28px; width: 95px; border-radius: 20px; }
.bk-sk-btns { display: flex; gap: 10px; margin-top: 4px; }
.bk-sk-screen .sk-btn { height: 48px; flex: 1; max-width: 270px; border-radius: 12px; }
.bk-sk-screen .sk-bsm { height: 48px; width: 48px; border-radius: 12px; }
.bk-sk-body { padding: 2rem 2rem 4rem; max-width: 1180px; margin: 0 auto; }
.bk-sk-card {
    background: #ffffff;
    border: 1px solid var(--bk-line);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(168,85,247,.05);
}
.dark-mode .bk-sk-card { background: #111827; border-color: rgba(255,255,255,.07); box-shadow: none; }
.bk-sk-screen .sk-ch { height: 22px; width: 210px; margin-bottom: 22px; }
.bk-sk-reviews { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-sk-rv { display: flex; align-items: flex-start; gap: 10px; }
.bk-sk-rv.rr { flex-direction: row-reverse; }
.bk-sk-rv .sk-av { width: 38px; height: 38px; }
.bk-sk-screen .sk-bubble { height: 90px; flex: 1; border-radius: 14px; }

/* ══════════════════════════════════════════════════
   DOWNLOAD MODAL animations
   ══════════════════════════════════════════════════ */
@keyframes modalIn {
    from { opacity:0; transform:translateY(30px) scale(0.95); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progressFill { from { width: 0%; } to { width: 100%; } }

/* ══════════════════════════════════════════════════
   AUTHOR CARD  —  عن الكاتب
   ══════════════════════════════════════════════════ */
.bka-inner {
    display: flex; align-items: flex-start; gap: 1.4rem;
}
.bka-photo {
    width: 80px; height: 80px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--bk-line);
    box-shadow: 0 4px 14px rgba(168,85,247,.14);
}
.bka-init {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--bk-grad);
    align-items: center; justify-content: center;
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.bka-info { flex: 1; }
.bka-name {
    font-family: 'Cairo', sans-serif;
    font-size: 1.05rem; font-weight: 800;
    color: var(--bk-ink); margin-bottom: .2rem;
}
.dark-mode .bka-name { color: #f9fafb; }
.bka-role {
    font-family: 'Cairo', sans-serif;
    font-size: .78rem; font-weight: 600;
    color: var(--bk-mute); margin-bottom: .7rem;
}
.dark-mode .bka-role { color: #94a3b8; }
.bka-bio {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: .9rem; line-height: 1.9;
    color: #4a5568; margin: 0 0 1rem;
}
.dark-mode .bka-bio { color: #cbd5e1; }
.bka-link {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .5rem 1.1rem;
    border-radius: 50px;
    background: var(--bk-grad-soft);
    color: var(--bk-purple);
    font-family: 'Cairo', sans-serif;
    font-size: .83rem; font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(168,85,247,.2);
    transition: all .2s;
}
.bka-link:hover {
    background: rgba(168,85,247,.12);
    transform: translateY(-1px);
    border-color: rgba(168,85,247,.4);
}
.dark-mode .bka-link { color: #c4b5fd; border-color: rgba(168,85,247,.35); }

/* ══════════════════════════════════════════════════
   MORE BOOKS  —  كتب أخرى للكاتب
   ══════════════════════════════════════════════════ */
.bkm-scroll {
    display: flex; gap: 1rem;
    overflow-x: auto; padding-bottom: .6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(168,85,247,.3) transparent;
    -webkit-overflow-scrolling: touch;
}
.bkm-scroll::-webkit-scrollbar { height: 5px; }
.bkm-scroll::-webkit-scrollbar-track { background: transparent; }
.bkm-scroll::-webkit-scrollbar-thumb { background: rgba(168,85,247,.3); border-radius: 10px; }
.bkm-item {
    flex-shrink: 0;
    width: 110px;
    text-decoration: none;
    display: block;
    transition: transform .2s;
}
.bkm-item:hover { transform: translateY(-4px); }
.bkm-cover {
    width: 110px; height: 148px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.bkm-cover-fb {
    width: 110px; height: 148px;
    border-radius: 8px;
    align-items: center; justify-content: center;
    font-family: 'Amiri', serif;
    font-size: .78rem; font-weight: 700;
    color: #fff; text-align: center;
    padding: .5rem; line-height: 1.5;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.bkm-title {
    font-family: 'Cairo', sans-serif;
    font-size: .74rem; font-weight: 700;
    color: var(--bk-ink);
    margin: .55rem 0 .2rem;
    text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark-mode .bkm-title { color: #e2e8f0; }
.bkm-stars {
    font-size: .67rem; color: #f5b942;
    text-align: center; display: block;
    font-family: 'Cairo', sans-serif; font-weight: 600;
}

/* ══════════════════════════════════════════════════
   MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    main.book-page { padding: 0 1rem; max-width: 100%; }

    .bk-breadcrumb { padding: .7rem 0; margin-bottom: .6rem; }
    .bk-bc-inner   { padding: 0; }
    .bk-breadcrumb a, .bk-breadcrumb span { font-size: .72rem; font-weight: 500; }
    .bk-breadcrumb .bk-bc-current { font-size: .72rem; }
    .bk-breadcrumb .bk-bc-sep svg { width: 10px; height: 10px; }
    .bk-hero {
        padding: 5.5rem 1rem 1.5rem;
    }
    .bk-hero-inner {
        display: block;
    }

    .bk-mob-top {
        display: block;
        text-align: center;
        margin: .4rem 0 .5rem;
    }
    .bk-mob-top .bk-title {
        font-family: 'Amiri', serif;
        font-size: 1.75rem !important;
        margin: 0 !important;
        flex: unset !important;
        line-height: 1.3;
        text-align: center;
    }

    .bk-cover-wrap {
        position: relative !important;
        top: auto !important;
        width: 210px;
        margin: 0 auto 2rem;
    }
    .bk-cover {
        box-shadow: none;
    }
    .bk-cover:hover { transform: none; }

    .bk-hero {
        background: var(--bk-bg);
    }
    .dark-mode .bk-hero {
        background: #0b0f1a;
    }

    .bk-price-badge {
        display: flex;
        align-items: center; justify-content: center;
    }

    .bk-info {
        padding: 0;
        gap: 1.1rem;
    }
    .bk-author-link { align-self: center; }
    .bk-meta-row    { justify-content: center; }
    .bk-title-row   { display: none !important; }

    .bk-stats-card {
        grid-template-columns: 1fr;
        gap: .8rem;
        padding: .9rem 1rem;
    }
    .bk-rating {
        padding: 0 0 .8rem;
        border-left: none;
        border-bottom: 1px solid var(--bk-line);
        justify-content: center;
    }
    .dark-mode .bk-rating { border-color: rgba(255,255,255,.08); }
    .bk-stats { justify-content: center; }

    #descWrap { padding: 1.4rem 1.2rem 1.2rem; }
    .bk-desc  { text-align: right; font-size: .95rem; line-height: 1.9; }
    .bk-desc-more { margin: .6rem auto 0; }

    .bk-actions {
        padding: .9rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    .bk-actions .bk-price-row {
        margin: 0 auto .2rem;
        justify-content: center;
    }
    .bk-actions-top { width: 100%; min-width: 0; }
    .bk-dl          { width: 100%; justify-content: center; }

    .bk-body { padding: .5rem 1rem 6rem; max-width: 100%; }
    .bk-card { padding: 1.6rem 1.3rem; border-radius: 16px; }
    .bk-h2   { font-size: 1.3rem; }

    .reviews-chat { grid-template-columns: 1fr; }
    .rm-row       { grid-template-columns: 1fr; }
    .rm-box       { padding: 1.5rem 1.2rem 1.4rem; }

    .bka-inner { flex-direction: column; align-items: center; text-align: center; }
    .bka-link  { margin: 0 auto; }
    .bkm-item  { width: 90px; }
    .bkm-cover, .bkm-cover-fb { width: 90px; height: 122px; }

    /* Sticky buy bar shows on mobile */
    .bk-sticky-buy { display: block; }
    body { padding-bottom: 80px; }

    .bk-sk-hero { grid-template-columns: 1fr; padding: 3rem 1rem 2rem; gap: 1.5rem; }
    .bk-sk-left   { max-width: 185px; margin: 0 auto; }
    .bk-sk-right  { align-items: center; }
    .bk-sk-screen .sk-t1 { width: 88%; }
    .bk-sk-screen .sk-t2 { width: 62%; }
    .bk-sk-stats  { justify-content: center; }
    .bk-sk-meta   { justify-content: center; }
    .bk-sk-btns   { width: 100%; }
    .bk-sk-screen .sk-btn { max-width: none; }
    .bk-sk-body   { padding: 1.5rem 1rem 3rem; }
    .bk-sk-reviews { grid-template-columns: 1fr; }
    .share-toast { bottom: 6.5rem; }
}
