/* =====================================================================
   دار السحاب — طبقة «التوقيع» (Signature)
   ---------------------------------------------------------------------
   تُحمَّل آخر ملف وتحكم: الترويسة الموحّدة، بانر «فوق السحاب»،
   شريط الثقة والتصفّح السريع، وحركة الواجهة.
   كل العناصر الجديدة ببادئة sx- حتى لا تتصادم مع الطبقات القديمة.
   الألوان مبنية على متغيّرات الهوية (--ink / --dusk / --saffron)
   فتتبع أي تغيير من «لوحة التحكم ← المظهر».
   ===================================================================== */

:root {
    --sx-red: var(--brand-red, #E00000);
    --sx-royal: var(--brand-blue, var(--dusk));
    --sx-ice: #C9D8FF;
    --sx-azure: #5B86FF;
    --sx-ease: cubic-bezier(.2, .8, .2, 1);
    --sx-spring: cubic-bezier(.34, 1.56, .64, 1);
    --sx-header-h: 74px;
    --sx-nav-h: 46px;
}

/* =====================================================================
   1) الشريط العلوي
   ===================================================================== */
.top-bar {
    background: color-mix(in srgb, var(--ink) 78%, #000) !important;
    font-size: 12px; padding-block: 6px !important;
    border-bottom: 0 !important;
}
.top-bar a { display: inline-flex; align-items: center; gap: 6px; color: rgba(226, 234, 255, .8) !important; }
.top-bar a:hover { color: #fff !important; }
.top-bar a i { margin: 0 !important; font-size: 11px; color: var(--sx-ice) !important; opacity: .85; }
.top-bar-right { gap: 22px !important; }

/* =====================================================================
   2) الترويسة الموحّدة — صفّان بدل أربعة
   ===================================================================== */
.header.sx-header {
    background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
    backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .35s var(--sx-ease), transform .45s var(--sx-ease);
}
.header.sx-header.scrolled { box-shadow: 0 20px 40px -32px color-mix(in srgb, var(--ink) 70%, transparent); }

.sx-main {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center; gap: clamp(16px, 2.6vw, 40px);
    height: var(--sx-header-h);
}
.sx-header .logo { flex: none; }
.sx-header .logo .logo-image, .sx-header .logo .brand-logo { height: 54px; }

/* --- البحث الموحّد --- */
.sx-header .sx-search {
    position: relative; display: flex; align-items: center;
    width: 100%; max-width: 660px; justify-self: center;
    height: 50px; min-height: 0; padding-inline: 5px;
    background: var(--surface-2) !important;
    border: 1px solid transparent !important; border-radius: 999px !important;
    transition: background-color .25s, border-color .25s, box-shadow .35s var(--sx-ease);
}
.sx-header .sx-search:hover { border-color: var(--border-strong) !important; }
.sx-header .sx-search:focus-within {
    background: var(--surface) !important; border-color: var(--saffron) !important;
    box-shadow: 0 0 0 4px var(--accent-light), 0 18px 36px -22px color-mix(in srgb, var(--ink) 60%, transparent) !important;
}
.sx-search .cat-menu { position: static; flex: none; }
.sx-header .sx-search .cat-menu-btn {
    height: 40px; min-height: 0; padding-inline: 16px 14px; gap: 9px;
    background: var(--surface) !important; color: var(--text) !important;
    border: 0 !important; border-radius: 999px !important;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent);
    transition: background-color .2s, color .2s;
}
.sx-header .sx-search .cat-menu-btn i:first-child { color: var(--sx-royal) !important; font-size: 13px; }
.sx-header .sx-search .cat-menu-btn .cat-caret { margin-inline-start: 2px; font-size: 9px; opacity: .6; }
.sx-header .sx-search .cat-menu-btn:hover,
.sx-header .sx-search .cat-menu[open] .cat-menu-btn { background: var(--ink) !important; color: #fff !important; }
.sx-header .sx-search .cat-menu-btn:hover i:first-child,
.sx-header .sx-search .cat-menu[open] .cat-menu-btn i:first-child { color: var(--sx-ice) !important; }
[data-theme="dark"] .sx-header .sx-search .cat-menu-btn { background: var(--surface) !important; }
[data-theme="dark"] .sx-header .sx-search .cat-menu-btn i:first-child { color: var(--lilac) !important; }

.sx-search .cat-menu-panel {
    top: calc(100% + 10px); inset-inline-start: 0; width: min(340px, 92vw);
    border-radius: 22px !important; padding: 8px !important;
    transform-origin: top; animation: sx-pop .28s var(--sx-ease);
}
.sx-search .cat-menu-panel a { border-radius: 14px; font-weight: 500; font-size: 14px; transition: background-color .18s, padding .25s var(--sx-ease); }
.sx-search .cat-menu-panel a:hover { background: var(--accent-light); padding-inline-start: 16px; }
.sx-search .cat-menu-panel a i { color: var(--sx-royal); }
[data-theme="dark"] .sx-search .cat-menu-panel a i { color: var(--lilac); }
.sx-search .cat-menu-panel a small {
    min-width: 24px; padding: 1px 7px; border-radius: 99px; text-align: center;
    background: var(--surface-2); font-variant-numeric: tabular-nums;
}
.sx-search .cat-menu-panel .cat-menu-all { border-radius: 14px; border-top: 0; margin-top: 4px; background: var(--surface-2); color: var(--text); font-weight: 600; }
@keyframes sx-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

.sx-search-glyph { flex: none; margin-inline: 14px 0; font-size: 14px; color: var(--text-faint); transition: color .2s; }
.sx-search:focus-within .sx-search-glyph { color: var(--accent); }
.sx-header .sx-search input {
    flex: 1; min-width: 0; height: 100%; padding-inline: 12px;
    border: 0; background: transparent; outline: 0;
    font-family: var(--font-body); font-size: 14.5px; color: var(--text);
}
.sx-header .sx-search input::placeholder { color: var(--text-faint); }
.sx-header .sx-search input:focus, .sx-header .sx-search input:focus-visible { outline: 0 !important; box-shadow: none !important; }
.sx-header .sx-search input::-webkit-search-cancel-button { display: none; }
.sx-header .sx-search > button {
    flex: none; width: 40px; height: 40px; margin: 0; padding: 0;
    display: grid; place-items: center;
    border: 0; border-radius: 50% !important;
    background: var(--ink) !important; color: #fff !important; font-size: 13px; cursor: pointer;
    transition: transform .3s var(--sx-spring), background-color .2s;
}
.sx-header .sx-search > button:hover { background: var(--sx-royal) !important; transform: scale(1.08); }
html[dir="ltr"] .sx-header .sx-search > button i { transform: scaleX(-1); }
[data-theme="dark"] .sx-header .sx-search > button { background: var(--accent) !important; color: var(--bg-color) !important; }
.sx-search .shop-search-results { top: calc(100% + 10px); border-radius: 22px !important; padding: 8px; animation: sx-pop .25s var(--sx-ease); }
.sx-search .ssr-item { border-radius: 14px; }

/* --- أزرار الإجراءات --- */
.sx-header .nav-actions { display: flex; align-items: center; gap: 4px; margin: 0; }
.sx-header .nav-icon-btn {
    width: 44px; height: 44px; border-radius: 50% !important;
    background: transparent !important; border: 1px solid transparent !important; color: var(--text);
    transition: background-color .2s, color .2s, transform .3s var(--sx-spring);
}
.sx-header .nav-icon-btn:hover { background: var(--accent-light) !important; color: var(--accent); transform: translateY(-1px); }
.sx-header .nav-actions .account-shortcut.has-account-name { border-radius: 999px !important; padding-inline: 14px; }
.sx-header .lang-switch-btn { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }

.sx-header .nav-actions .sx-cart {
    position: relative; display: inline-flex !important; align-items: center; gap: 10px;
    width: auto; height: 46px; margin-inline-start: 8px; padding-inline: 18px 8px;
    border: 0 !important; border-radius: 999px !important;
    background: var(--ink) !important; color: #fff !important;
    font-size: 15px; font-weight: 600;
    box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--ink) 90%, transparent);
    transition: transform .3s var(--sx-spring), background-color .2s, box-shadow .3s;
}
.sx-header .nav-actions .sx-cart:hover { background: var(--sx-royal) !important; color: #fff !important; transform: translateY(-2px); box-shadow: 0 16px 28px -14px color-mix(in srgb, var(--sx-royal) 90%, transparent); }
.sx-cart-label { font-size: 13.5px; }
.sx-header .sx-cart .cart-count {
    position: static; inset: auto; display: grid; place-items: center;
    min-width: 30px; width: auto; height: 30px; padding-inline: 8px;
    border: 0 !important; border-radius: 999px; box-shadow: none !important;
    background: #fff !important; color: var(--ink) !important;
    font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sx-header .sx-cart .cart-count.is-empty { opacity: 1; background: rgba(255, 255, 255, .16) !important; color: #fff !important; }
[data-theme="dark"] .sx-header .nav-actions .sx-cart { background: var(--accent) !important; color: var(--bg-color) !important; }
[data-theme="dark"] .sx-header .sx-cart .cart-count { background: var(--bg-color) !important; color: var(--accent) !important; }
[data-theme="dark"] .sx-header .sx-cart .cart-count.is-empty { background: rgba(8, 17, 41, .18) !important; color: var(--bg-color) !important; }

/* --- الصف الثاني: القائمة + تجارب القراءة --- */
.sx-navrow { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.sx-navrow-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--sx-nav-h); }
.sx-quick { display: flex; align-items: center; gap: 2px; min-width: 0; }
.sx-quick a {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 6px 11px; border-radius: 999px;
    font-size: 12.5px; font-weight: 500; color: var(--text-light);
    transition: color .2s, background-color .2s;
}
.sx-quick a i { font-size: 11px; opacity: .7; transition: transform .35s var(--sx-spring), opacity .2s; }
.sx-quick a:hover, .sx-quick a.is-current { color: var(--text); background: var(--surface-2); }
.sx-quick a:hover i { transform: translateY(-1px) rotate(-8deg); opacity: 1; }
.sx-quick a.sx-quick-lead { color: var(--accent); font-weight: 700; background: var(--accent-light); }
.sx-quick a.sx-quick-lead i { opacity: 1; }

@media (min-width: 993px) {
    .sx-header .nav-links { display: flex; align-items: center; gap: 2px; height: 100%; margin: 0; }
    .sx-header .nav-links a {
        position: relative; display: inline-flex; align-items: center; height: 100%;
        padding: 0 13px; border-radius: 0; background: none !important;
        font-size: 14px; font-weight: 500; color: var(--text-light);
        transition: color .2s;
    }
    .sx-header .nav-links a:first-child { padding-inline-start: 0; }
    .sx-header .nav-links a::before { display: none !important; }
    .sx-header .nav-links a::after {
        content: "" !important; display: block !important; position: absolute !important;
        inset: auto 13px -1px 13px !important; width: auto !important; height: 2px !important;
        border-radius: 2px 2px 0 0; background: var(--grad-dusk) !important;
        transform: scaleX(0) !important; transform-origin: center; opacity: 1;
        transition: transform .4s var(--sx-ease) !important;
    }
    .sx-header .nav-links a:first-child::after { inset-inline-start: 0 !important; }
    .sx-header .nav-links a:hover { color: var(--text); }
    .sx-header .nav-links a:hover::after { transform: scaleX(.45) !important; }
    .sx-header .nav-links a.active { color: var(--text); font-weight: 700; }
    .sx-header .nav-links a.active::after { transform: scaleX(1) !important; }
    .sx-header .mobile-menu-btn { display: none !important; }
}
@media (max-width: 1180px) and (min-width: 993px) {
    .sx-quick a:not(.sx-quick-lead) i { display: none; }
    .sx-quick a { padding-inline: 8px; }
    .sx-cart-label { display: none; }
    .sx-header .nav-actions .sx-cart { padding-inline: 16px 8px; }
}

/* --- الموبايل والتابلت --- */
@media (max-width: 992px) {
    :root { --sx-header-h: 62px; }
    .sx-main {
        grid-template-columns: auto 1fr; grid-template-areas: "logo actions" "search search";
        height: auto; row-gap: 10px; padding-block: 10px 12px;
    }
    .sx-header .logo { grid-area: logo; }
    .sx-header .logo .logo-image, .sx-header .logo .brand-logo { height: 44px; }
    .sx-header .nav-actions { grid-area: actions; justify-self: end; margin: 0; }
    .sx-header .sx-search { grid-area: search; max-width: none; height: 46px; }
    .sx-header .sx-search .cat-menu { display: none; }
    .sx-header .sx-search > button { width: 36px; height: 36px; }
    .sx-cart-label { display: none; }
    .sx-header .nav-actions .sx-cart { height: 42px; padding-inline: 14px 6px; gap: 8px; margin-inline-start: 4px; }
    .sx-header .sx-cart .cart-count { min-width: 28px; height: 28px; }
    .sx-header .nav-icon-btn { width: 42px; min-width: 42px; height: 42px; }
    .sx-header .mobile-menu-btn { display: inline-flex !important; }

    .sx-navrow {
        position: absolute; inset: 100% 0 auto; z-index: 5;
        display: none; max-height: calc(100dvh - 150px); overflow-y: auto;
        background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
        box-shadow: 0 30px 50px -24px color-mix(in srgb, var(--ink) 55%, transparent);
    }
    .sx-header.sx-menu-open .sx-navrow { display: block; animation: sx-pop .3s var(--sx-ease); }
    .sx-navrow-inner { display: block; height: auto; padding-block: 12px 18px; }
    .sx-header .nav-links {
        position: static !important; inset: auto !important; display: flex !important; flex-direction: column;
        gap: 2px !important; width: auto; max-height: none; padding: 0 !important; overflow: visible;
        background: none !important; box-shadow: none !important; border: 0 !important;
    }
    .sx-header .nav-links a { width: 100%; padding: 12px 14px; border-radius: 14px; font-size: 15.5px; font-weight: 500; color: var(--text); }
    .sx-header .nav-links a::after, .sx-header .nav-links a::before { display: none !important; }
    .sx-header .nav-links a.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
    .sx-header .mobile-menu-extras { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
    .sx-quick { flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
    .sx-quick a { padding: 9px 14px; font-size: 13px; background: var(--surface-2); }
}
@media (max-width: 420px) {
    .sx-header .account-shortcut span { display: none; }
    .sx-header .nav-actions .account-shortcut.has-account-name { width: 42px; padding: 0; }
}

/* =====================================================================
   3) البانر الرئيسي — «فوق السحاب»
   ===================================================================== */
.sx-hero {
    --mx: 0; --my: 0; --sy: 0;
    --sx-deep: color-mix(in srgb, var(--ink) 58%, #000);
    position: relative; isolation: isolate; overflow: hidden;
    color: #fff;
    background:
        radial-gradient(90% 80% at 12% 8%, color-mix(in srgb, var(--sx-royal) 62%, transparent) 0%, transparent 62%),
        linear-gradient(180deg, var(--sx-deep) 0%, var(--ink) 52%, color-mix(in srgb, var(--sx-royal) 46%, var(--ink)) 100%);
    padding-block: clamp(44px, 5.4vw, 84px) clamp(170px, 17vw, 270px);
}
html[dir="ltr"] .sx-hero { background:
    radial-gradient(90% 80% at 88% 8%, color-mix(in srgb, var(--sx-royal) 62%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, var(--sx-deep) 0%, var(--ink) 52%, color-mix(in srgb, var(--sx-royal) 46%, var(--ink)) 100%); }

.sx-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

/* شفق: توهّجان ناعمان يتنفّسان */
.sx-aurora { position: absolute; border-radius: 50%; will-change: transform; }
.sx-aurora--a {
    width: min(760px, 70vw); aspect-ratio: 1; top: -8%; inset-inline-end: 2%;
    background: radial-gradient(circle, color-mix(in srgb, var(--sx-azure) 58%, transparent) 0%, color-mix(in srgb, var(--sx-azure) 16%, transparent) 42%, transparent 68%);
    animation: sx-breathe 14s ease-in-out infinite alternate;
}
.sx-aurora--b {
    width: min(520px, 60vw); aspect-ratio: 1; bottom: 4%; inset-inline-start: -6%;
    background: radial-gradient(circle, color-mix(in srgb, var(--sx-red) 20%, transparent) 0%, transparent 66%);
    animation: sx-breathe 18s ease-in-out -6s infinite alternate-reverse;
}
@keyframes sx-breathe {
    from { transform: translate3d(-2%, 2%, 0) scale(.94); opacity: .8; }
    to   { transform: translate3d(3%, -3%, 0) scale(1.08); opacity: 1; }
}

/* نجوم: طبقتان تومضان بإيقاعين */
.sx-stars {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.9) 50%, transparent 52%),
        radial-gradient(1px 1px at 38% 62%, rgba(255,255,255,.7) 50%, transparent 52%),
        radial-gradient(1.4px 1.4px at 63% 27%, rgba(201,216,255,.9) 50%, transparent 52%),
        radial-gradient(1px 1px at 84% 74%, rgba(255,255,255,.6) 50%, transparent 52%),
        radial-gradient(1px 1px at 71% 91%, rgba(255,255,255,.55) 50%, transparent 52%),
        radial-gradient(1.2px 1.2px at 27% 88%, rgba(201,216,255,.7) 50%, transparent 52%);
    background-size: 340px 300px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 78%);
            mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 78%);
    animation: sx-twinkle 5.5s ease-in-out infinite alternate;
    translate: calc(var(--mx) * -6px) calc(var(--my) * -6px);
}
.sx-stars--near {
    background-size: 520px 430px; background-position: 140px 60px; opacity: .9;
    animation-duration: 7.5s; animation-delay: -3s;
    translate: calc(var(--mx) * -14px) calc(var(--my) * -12px);
}
@keyframes sx-twinkle { from { opacity: .35; } to { opacity: 1; } }

/* شبكة نقطية خافتة حول المسرح */
.sx-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(42% 60% at 24% 44%, #000 0%, transparent 72%);
            mask-image: radial-gradient(42% 60% at 24% 44%, #000 0%, transparent 72%);
    opacity: .5;
}
html[dir="ltr"] .sx-grid { -webkit-mask-image: radial-gradient(42% 60% at 76% 44%, #000 0%, transparent 72%); mask-image: radial-gradient(42% 60% at 76% 44%, #000 0%, transparent 72%); }

/* ضفاف السحاب — ثلاث طبقات ببارالاكس، الأمامية تذوب في لون الصفحة */
.sx-clouds {
    position: absolute; inset-inline: -8%; bottom: -2px; width: 116%;
    height: clamp(120px, 17vw, 270px); display: block; will-change: transform;
}
.sx-clouds--back {
    fill: var(--sx-ice); opacity: .17;
    bottom: clamp(34px, 5vw, 78px); filter: blur(12px);
    translate: calc(var(--mx) * 10px) calc(var(--sy) * -34px);
    animation: sx-drift 46s ease-in-out infinite alternate;
}
.sx-clouds--mid {
    fill: var(--bg-color); opacity: .42;
    bottom: clamp(12px, 2vw, 34px); filter: blur(5px);
    translate: calc(var(--mx) * 20px) calc(var(--sy) * -18px);
    animation: sx-drift 34s ease-in-out -8s infinite alternate-reverse;
}
.sx-clouds--front {
    fill: var(--bg-color);
    filter: drop-shadow(0 -10px 22px color-mix(in srgb, var(--sx-ice) 34%, transparent));
    translate: calc(var(--mx) * 34px) 0;
    animation: sx-drift 26s ease-in-out -4s infinite alternate;
}
[data-theme="dark"] .sx-clouds--mid { fill: var(--sx-ice); opacity: .12; }
[data-theme="dark"] .sx-clouds--front { filter: drop-shadow(0 -10px 22px color-mix(in srgb, var(--sx-azure) 22%, transparent)); }
@keyframes sx-drift { from { transform: translate3d(-2.4%, 0, 0); } to { transform: translate3d(2.4%, 0, 0); } }

/* --- النص --- */
.sx-hero-grid {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: center; gap: clamp(30px, 5vw, 80px);
}
.sx-hero-copy { translate: 0 calc(var(--sy) * 26px); }
.sx-hero-copy > * { animation: sx-rise .9s var(--sx-ease) both; }
.sx-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 16px 7px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-size: 12.5px; font-weight: 500; color: #E3EBFF; letter-spacing: .01em;
    animation-delay: .05s;
}
.sx-eyebrow-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--sx-red); flex: none; }
.sx-eyebrow-dot::after {
    content: ""; position: absolute; inset: -5px; border-radius: 50%;
    border: 1px solid var(--sx-red); opacity: 0;
    animation: sx-ping 2.6s var(--sx-ease) infinite;
}
@keyframes sx-ping { 0% { transform: scale(.4); opacity: .9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

.sx-hero .sx-title {
    margin: 24px 0 22px; max-width: 13ch;
    font-family: var(--font-display); font-weight: 700; color: #fff;
    font-size: clamp(2.5rem, 1.15rem + 4.5vw, 5.2rem); line-height: 1.24;
    text-wrap: balance; animation: none;
}
.sx-word {
    display: inline-block;
    animation: sx-word-in 1s var(--sx-ease) both;
    animation-delay: calc(.18s + var(--i) * .1s);
}
.lang-en .sx-hero .sx-title { max-width: 17ch; font-size: clamp(2.3rem, 1rem + 3.5vw, 4.2rem); line-height: 1.14; letter-spacing: -.02em; }
@keyframes sx-word-in {
    from { opacity: 0; transform: translate3d(0, .55em, 0) rotate(3deg); filter: blur(12px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}
.sx-word--accent {
    position: relative;
    background: linear-gradient(100deg, #fff 0%, var(--sx-ice) 45%, color-mix(in srgb, var(--sx-azure) 70%, #fff) 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    padding-inline: .04em;
}
.sx-swash { position: absolute; inset: auto 0 -.2em 0; width: 100%; height: .3em; overflow: visible; }
html[dir="rtl"] .sx-swash { transform: scaleX(-1); }
.sx-swash path {
    fill: none; stroke: var(--sx-red); stroke-width: 5; stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: sx-draw 1s var(--sx-ease) 1.15s forwards;
}
@keyframes sx-draw { to { stroke-dashoffset: 0; } }

.sx-lead {
    max-width: 46ch; margin: 0;
    font-size: clamp(15.5px, 1.25vw, 17.5px); line-height: 2; color: rgba(226, 234, 255, .8);
    animation-delay: .62s;
}
.sx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; animation-delay: .76s; }
.sx-btn {
    position: relative; overflow: hidden; isolation: isolate;
    display: inline-flex; align-items: center; gap: 14px;
    height: 58px; border-radius: 999px;
    font-family: var(--font-body); font-size: 15.5px; font-weight: 600; white-space: nowrap;
    transition: transform .35s var(--sx-spring), box-shadow .35s var(--sx-ease), background-color .25s, border-color .25s, color .2s;
}
.sx-btn--primary {
    padding-inline: 28px 8px; background: #fff; color: var(--ink);
    box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--sx-azure) 85%, transparent), inset 0 -2px 0 rgba(8, 27, 82, .08);
}
.sx-btn--primary i {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: var(--ink); color: #fff; font-size: 13px;
    transition: transform .4s var(--sx-spring), background-color .25s;
}
.sx-btn--primary::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--sx-azure) 34%, transparent) 50%, transparent 65%);
    transform: translateX(120%); animation: sx-sheen 5.5s var(--sx-ease) 2.2s infinite;
}
html[dir="ltr"] .sx-btn--primary::after { animation-name: sx-sheen-ltr; transform: translateX(-120%); }
@keyframes sx-sheen { 0% { transform: translateX(120%); } 28%, 100% { transform: translateX(-120%); } }
@keyframes sx-sheen-ltr { 0% { transform: translateX(-120%); } 28%, 100% { transform: translateX(120%); } }
.sx-btn--primary:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 26px 48px -18px color-mix(in srgb, var(--sx-azure) 95%, transparent), inset 0 -2px 0 rgba(8, 27, 82, .08); }
.sx-btn--primary:hover i { background: var(--sx-red); transform: translateX(-4px); }
html[dir="ltr"] .sx-btn--primary i { transform: scaleX(-1); }
html[dir="ltr"] .sx-btn--primary:hover i { transform: scaleX(-1) translateX(-4px); }
.sx-btn--primary:active { transform: translateY(0) scale(.98); }
.sx-btn--ghost {
    padding-inline: 24px; color: #fff;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .24);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sx-btn--ghost i { font-size: 14px; color: var(--sx-ice); transition: transform .4s var(--sx-spring); }
.sx-btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .5); transform: translateY(-3px); }
.sx-btn--ghost:hover i { transform: rotate(-14deg) translateY(-2px); }

/* الأرقام */
.sx-hero .sx-stats {
    display: flex; flex-wrap: nowrap; gap: 0; max-width: 500px;
    margin: clamp(30px, 3.4vw, 46px) 0 0; padding: 0;
    border-top: 1px solid rgba(255, 255, 255, .13);
    animation-delay: .9s;
}
.sx-hero .sx-stats > div { flex: 1 1 0; display: flex; flex-direction: column-reverse; gap: 4px; padding: 18px 0 0; padding-inline-end: 16px; }
.sx-hero .sx-stats > div + div { padding-inline-start: 20px; border-inline-start: 1px solid rgba(255, 255, 255, .13); }
.sx-hero .sx-stats dd {
    margin: 0; background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
    font-family: var(--font-body) !important; font-weight: 700 !important; line-height: 1.1;
    font-size: clamp(1.75rem, 2.5vw, 2.35rem) !important; font-variant-numeric: tabular-nums;
}
.sx-hero .sx-stats dt { font-size: 12.5px; color: rgba(226, 234, 255, .62); }
@keyframes sx-rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }

/* --- المسرح: هالة وكتب تطفو فوق السحاب --- */
.sx-stage { position: relative; margin: 0; display: grid; justify-items: center; translate: 0 calc(var(--sy) * 46px); }
.sx-stage-scene {
    position: relative; width: min(500px, 100%); aspect-ratio: 1 / 1;
    animation: sx-stage-in 1.3s var(--sx-ease) .25s both;
}
@keyframes sx-stage-in { from { opacity: 0; transform: scale(.9) translate3d(0, 30px, 0); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
.sx-halo {
    position: absolute; inset: 7%; border-radius: 50%;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .3) 0%, transparent 34%),
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--sx-azure) 46%, transparent) 0%, color-mix(in srgb, var(--sx-royal) 50%, transparent) 58%, transparent 72%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 0 110px -10px color-mix(in srgb, var(--sx-azure) 70%, transparent);
    translate: calc(var(--mx) * -10px) calc(var(--my) * -10px);
    animation: sx-halo 9s ease-in-out infinite alternate;
}
@keyframes sx-halo { from { transform: scale(.97); } to { transform: scale(1.03); } }
.sx-ring { position: absolute; border-radius: 50%; }
.sx-ring--a { inset: -1%; border: 1px solid rgba(255, 255, 255, .1); animation: sx-spin 90s linear infinite reverse; }
.sx-ring--b { inset: 1%; border: 1px dashed rgba(255, 255, 255, .22); animation: sx-spin 70s linear infinite; }
.sx-ring::before { content: ""; position: absolute; border-radius: 50%; }
.sx-ring--a::before { width: 9px; height: 9px; top: 14.6%; left: 14.6%; margin: -4.5px; background: var(--sx-red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sx-red) 24%, transparent), 0 0 18px var(--sx-red); }
.sx-ring--b::before { width: 7px; height: 7px; top: -3.5px; left: 50%; margin-left: -3.5px; background: #fff; box-shadow: 0 0 16px 2px rgba(255, 255, 255, .9); }
@keyframes sx-spin { to { transform: rotate(360deg); } }

.sx-book { position: absolute; display: block; will-change: transform; }
.sx-book .book-object { width: 100% !important; display: block; }
.sx-book--hero {
    z-index: 3; width: 43%; top: 50%; left: 50%;
    translate: calc(-50% + var(--mx) * 14px) calc(-54% + var(--my) * 10px);
    animation: sx-float 7s ease-in-out infinite;
}
.sx-book--hero .book-object { filter: drop-shadow(0 34px 38px rgba(2, 8, 40, .55)); }
.sx-book--a, .sx-book--b { z-index: 1; width: 30%; filter: brightness(.8) saturate(.88); transition: filter .5s var(--sx-ease); }
.sx-book--a { top: 27%; left: 8%; rotate: -11deg; translate: calc(var(--mx) * 26px) calc(var(--my) * 18px); animation: sx-float 8s ease-in-out -2.5s infinite; }
.sx-book--b { top: 24%; right: 6%; rotate: 10deg; translate: calc(var(--mx) * 22px) calc(var(--my) * 16px); animation: sx-float 9s ease-in-out -5s infinite; }
.sx-stage-scene:hover .sx-book--a, .sx-stage-scene:hover .sx-book--b { filter: brightness(.95) saturate(1); }
@keyframes sx-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -14px, 0); } }

/* سحابة تحت الكتب */
.sx-puff {
    position: absolute; z-index: 4; inset: auto 4% 5% 4%; height: 24%; pointer-events: none;
    background:
        radial-gradient(38% 62% at 22% 62%, rgba(255, 255, 255, .78), transparent 70%),
        radial-gradient(42% 74% at 50% 54%, rgba(255, 255, 255, .86), transparent 70%),
        radial-gradient(36% 60% at 78% 64%, rgba(255, 255, 255, .72), transparent 70%),
        radial-gradient(60% 46% at 50% 86%, color-mix(in srgb, var(--sx-ice) 70%, transparent), transparent 72%);
    filter: blur(12px); opacity: .88;
    translate: calc(var(--mx) * 30px) 0;
    animation: sx-puff 11s ease-in-out infinite alternate;
}
@keyframes sx-puff { from { transform: translate3d(-3%, 0, 0) scale(1); } to { transform: translate3d(3%, -4%, 0) scale(1.05); } }

/* بطاقة «كتاب الشهر» الزجاجية */
.sx-tag {
    position: absolute; z-index: 5; inset: auto auto 3% 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; row-gap: 1px;
    min-width: 236px; max-width: min(300px, 78%);
    padding: 14px 14px 14px 18px; border-radius: 22px; text-align: start;
    background: color-mix(in srgb, var(--sx-deep) 62%, transparent);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: 0 30px 50px -24px rgba(0, 4, 30, .8), inset 0 1px 0 rgba(255, 255, 255, .14);
    translate: calc(var(--mx) * 18px) calc(var(--my) * 12px);
    animation: sx-rise 1s var(--sx-ease) 1.05s both;
    transition: border-color .3s, background-color .3s;
}
html[dir="rtl"] .sx-tag { inset: auto 0 3% auto; padding: 14px 18px 14px 14px; }
.sx-tag:hover { border-color: rgba(255, 255, 255, .36); }
.sx-tag-seal { grid-column: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--sx-ice); letter-spacing: .02em; }
.sx-tag-seal i { font-size: 9px; color: #FFD27A; }
.sx-tag-title {
    grid-column: 1; font-family: var(--font-literary); font-size: 1.3rem; font-weight: 700; line-height: 1.5; color: #fff !important;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.sx-tag-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sx-tag-author { grid-column: 1; font-size: 12.5px; color: rgba(226, 234, 255, .68); }
.sx-tag-go {
    grid-column: 2; grid-row: 1 / span 3;
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: #fff; color: var(--ink) !important; font-size: 13px;
    transition: transform .4s var(--sx-spring), background-color .25s, color .25s;
}
html[dir="ltr"] .sx-tag-go i { transform: scaleX(-1); }
.sx-tag:hover .sx-tag-go { background: var(--sx-red); color: #fff !important; transform: scale(1.08) rotate(-8deg); }

@media (max-width: 992px) {
    .sx-hero { padding-block: 36px clamp(150px, 26vw, 210px); }
    .sx-hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .sx-hero-copy { display: grid; justify-items: center; text-align: center; }
    .sx-hero .sx-title { margin-inline: auto; max-width: 14ch; }
    .sx-cta { justify-content: center; }
    .sx-hero .sx-stats { width: 100%; text-align: start; }
    .sx-stage-scene { width: min(400px, 92%); }
    .sx-tag, html[dir="rtl"] .sx-tag { position: relative; inset: auto; margin-top: -26px; max-width: 320px; width: 100%; }
    .sx-aurora--a { inset-inline-end: -20%; top: 34%; }
}
@media (max-width: 560px) {
    .sx-hero .sx-title { font-size: clamp(2.2rem, 10.4vw, 2.9rem); margin-block: 18px 16px; }
    .sx-cta { width: 100%; gap: 10px; }
    .sx-btn { height: 54px; font-size: 15px; }
    .sx-btn--primary { flex: 1 1 auto; justify-content: space-between; padding-inline: 22px 7px; }
    .sx-btn--primary i { width: 40px; height: 40px; }
    .sx-btn--ghost { flex: 1 1 auto; justify-content: center; padding-inline: 18px; }
    .sx-hero .sx-stats > div { padding-inline-end: 8px; }
    .sx-hero .sx-stats > div + div { padding-inline-start: 12px; }
    .sx-hero .sx-stats dt { font-size: 11.5px; }
}

/* =====================================================================
   4) شريط الثقة + التصفّح السريع (يطفو على حافة البانر)
   ===================================================================== */
.sx-assure {
    position: relative; z-index: 3;
    margin-top: clamp(-104px, -7.4vw, -58px);
    padding-bottom: clamp(18px, 3vw, 36px);
}
.sx-trust {
    --gx: 50%; --gy: 50%;
    position: relative; isolation: isolate; overflow: hidden;
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--border); border-radius: 26px;
    box-shadow: 0 36px 70px -36px color-mix(in srgb, var(--ink) 55%, transparent), 0 2px 6px -2px color-mix(in srgb, var(--ink) 10%, transparent);
}
.sx-trust::before { /* ضوء يتبع المؤشر */
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(260px circle at var(--gx) var(--gy), color-mix(in srgb, var(--sx-azure) 16%, transparent), transparent 70%);
    opacity: 0; transition: opacity .4s;
}
.sx-trust:hover::before { opacity: 1; }
.sx-trust-item { position: relative; display: flex; align-items: center; gap: 15px; min-width: 0; padding: 24px clamp(16px, 2vw, 26px); }
.sx-trust-item + .sx-trust-item::before {
    content: ""; position: absolute; inset-block: 24%; inset-inline-start: 0; width: 1px;
    background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
}
.sx-trust-icon {
    flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px;
    background: var(--accent-light); color: var(--sx-royal); font-size: 18px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sx-royal) 12%, transparent);
    transition: transform .45s var(--sx-spring), background-color .3s, color .3s, box-shadow .3s;
}
[data-theme="dark"] .sx-trust-icon { color: var(--lilac); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sx-trust-item:hover .sx-trust-icon {
    background: var(--ink); color: #fff; transform: translateY(-3px) rotate(-8deg);
    box-shadow: 0 14px 22px -12px color-mix(in srgb, var(--ink) 90%, transparent);
}
[data-theme="dark"] .sx-trust-item:hover .sx-trust-icon { background: var(--accent); color: var(--bg-color); }
.sx-trust-copy { min-width: 0; }
.sx-trust-copy h3 { margin: 0 0 2px; font-family: var(--font-body); font-size: 14.5px; font-weight: 700; line-height: 1.5; color: var(--text); }
.sx-trust-copy p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--text-light); }

.sx-browse { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.sx-browse-label { flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-light); }
.sx-browse-label i { color: var(--sx-royal); }
[data-theme="dark"] .sx-browse-label i { color: var(--lilac); }
.sx-browse-track { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.sx-pill {
    display: inline-flex; align-items: center; gap: 10px; flex: none;
    height: 46px; padding-inline: 6px 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap;
    transition: transform .35s var(--sx-spring), border-color .25s, box-shadow .3s var(--sx-ease), background-color .25s, color .25s;
}
.sx-pill-icon {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent-light); color: var(--sx-royal); font-size: 13px;
    transition: background-color .25s, color .25s, transform .4s var(--sx-spring);
}
[data-theme="dark"] .sx-pill-icon { color: var(--lilac); }
.sx-pill small { font-size: 11.5px; font-weight: 600; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.sx-pill:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: 0 16px 26px -18px color-mix(in srgb, var(--ink) 70%, transparent); }
.sx-pill:hover .sx-pill-icon { background: var(--ink); color: #fff; transform: rotate(-10deg) scale(1.06); }
[data-theme="dark"] .sx-pill:hover .sx-pill-icon { background: var(--accent); color: var(--bg-color); }
.sx-pill--all { padding-inline: 20px 16px; gap: 10px; background: var(--ink); border-color: var(--ink); color: #fff; }
.sx-pill--all i { font-size: 11px; transition: transform .3s var(--sx-ease); }
.sx-pill--all:hover { background: var(--sx-royal); border-color: var(--sx-royal); color: #fff; }
html[dir="rtl"] .sx-pill--all:hover i { transform: translateX(-4px); }
html[dir="ltr"] .sx-pill--all i { transform: scaleX(-1); }
[data-theme="dark"] .sx-pill--all { background: var(--accent); border-color: var(--accent); color: var(--bg-color); }
[data-theme="dark"] .sx-pill--all:hover { background: #fff; border-color: #fff; color: var(--bg-color); }

@media (max-width: 992px) {
    .sx-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sx-trust-item:nth-child(3)::before { display: none; }
    .sx-trust-item:nth-child(n+3) { border-top: 1px solid var(--border); }
    .sx-browse { flex-direction: column; align-items: stretch; gap: 12px; }
    .sx-browse-track {
        flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
        margin-inline: calc(var(--sx-bleed, 18px) * -1); padding: 4px var(--sx-bleed, 18px) 10px;
    }
    .sx-browse-track::-webkit-scrollbar { display: none; }
    .sx-pill { scroll-snap-align: start; }
}
@media (max-width: 560px) {
    .sx-assure { margin-top: -64px; }
    .sx-trust { border-radius: 22px; }
    .sx-trust-item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 16px; }
    .sx-trust-item:nth-child(even)::before { inset-block: 18%; }
    .sx-trust-icon { width: 44px; height: 44px; border-radius: 14px; font-size: 16px; }
    .sx-trust-copy h3 { font-size: 13.5px; }
    .sx-trust-copy p { font-size: 12px; }
}

/* =====================================================================
   5) لمسات عامة على الرئيسية
   ===================================================================== */
/* السطر التمهيدي فوق العنوان دائماً (كان يلتصق بالعنوان في بعض الأقسام) */
.section-head > div:first-child:not(.section-head-copy) { display: grid; gap: 8px; justify-items: start; }

/* خط العنوان يُرسم عند ظهور القسم */
.section-head::after { transform: scaleX(0); transform-origin: right center; transition: transform .9s var(--sx-ease) .15s; }
html[dir="ltr"] .section-head::after { transform-origin: left center; }
.section-head.sx-seen::after, .no-sx .section-head::after { transform: scaleX(1); }

/* =====================================================================
   6) احترام تقليل الحركة
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    .sx-hero *, .sx-hero *::before, .sx-hero *::after { animation: none !important; }
    .sx-swash path { stroke-dashoffset: 0; }
    .section-head::after { transform: scaleX(1); transition: none; }
}
.reduced-motion .sx-hero *, .reduced-motion .sx-hero *::before, .reduced-motion .sx-hero *::after { animation: none !important; }
.reduced-motion .sx-swash path { stroke-dashoffset: 0; }
.reduced-motion .section-head::after { transform: scaleX(1); transition: none; }

@media print { .sx-sky, .sx-navrow { display: none !important; } }

/* إيقاف الحركات المستمرة عندما يخرج البانر من الشاشة (توفير للبطارية) */
.sx-hero.sx-paused *, .sx-hero.sx-paused *::before, .sx-hero.sx-paused *::after { animation-play-state: paused !important; }

/* #####################################################################
   الجزء الثاني — المود على الموقع كله + تطبيق الويب (PWA)
   ##################################################################### */
:root {
    --sx-deep: color-mix(in srgb, var(--ink) 58%, #000);
    /* حافة سحاب قابلة للتكرار: تُستخدم قناعاً فتأخذ لون الصفحة في الوضعين */
    --sx-cloud-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 44'%3E%3Cg%3E%3Ccircle cx='0' cy='44' r='30'/%3E%3Ccircle cx='62' cy='47' r='24'/%3E%3Ccircle cx='128' cy='44' r='36'/%3E%3Ccircle cx='200' cy='49' r='26'/%3E%3Ccircle cx='262' cy='44' r='40'/%3E%3Ccircle cx='338' cy='48' r='28'/%3E%3Ccircle cx='404' cy='44' r='34'/%3E%3Ccircle cx='480' cy='44' r='30'/%3E%3C/g%3E%3C/svg%3E");
    --sx-sky:
        radial-gradient(60% 100% at 12% -10%, color-mix(in srgb, var(--sx-azure) 46%, transparent) 0%, transparent 62%),
        radial-gradient(36% 80% at 96% 118%, color-mix(in srgb, var(--sx-red) 15%, transparent) 0%, transparent 66%),
        linear-gradient(180deg, var(--sx-deep) 0%, var(--ink) 58%, color-mix(in srgb, var(--sx-royal) 44%, var(--ink)) 100%);
    --sx-starfield:
        radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.9) 50%, transparent 52%),
        radial-gradient(1px 1px at 38% 62%, rgba(255,255,255,.7) 50%, transparent 52%),
        radial-gradient(1.4px 1.4px at 63% 27%, rgba(201,216,255,.9) 50%, transparent 52%),
        radial-gradient(1px 1px at 84% 74%, rgba(255,255,255,.6) 50%, transparent 52%),
        radial-gradient(1.2px 1.2px at 27% 88%, rgba(201,216,255,.7) 50%, transparent 52%);
}

/* =====================================================================
   7) زر تثبيت التطبيق
   ===================================================================== */
[data-pwa-install][hidden] { display: none !important; }
.sx-standalone [data-pwa-install] { display: none !important; }
.sx-header .nav-icon-btn.sx-install {
    width: auto; gap: 9px; padding-inline: 6px 14px; margin-inline-end: 6px;
    border-radius: 999px !important;
    background: var(--accent-light) !important; color: var(--accent);
    font-family: var(--font-body); font-size: 12.5px; font-weight: 600; white-space: nowrap;
    animation: sx-install-in .6s var(--sx-spring) both;
}
.sx-header .nav-icon-btn.sx-install:hover { background: var(--ink) !important; color: #fff; }
.sx-install i {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--sx-royal); color: #fff; font-size: 11px;
    animation: sx-install-pulse 2.8s var(--sx-ease) 1s 3;
}
[data-theme="dark"] .sx-install i { background: var(--accent); color: var(--bg-color); }
.sx-header .sx-install:hover i { background: #fff; color: var(--ink); }
@keyframes sx-install-in { from { opacity: 0; transform: scale(.7); } }
@keyframes sx-install-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sx-royal) 55%, transparent); }
    60%, 100% { box-shadow: 0 0 0 12px transparent; }
}
@media (max-width: 1320px) {
    .sx-install span { display: none; }
    .sx-header .nav-icon-btn.sx-install { width: 44px; padding: 0; margin-inline-end: 0; justify-content: center; }
}
@media (max-width: 992px) { .sx-header .nav-icon-btn.sx-install { width: 42px; } .sx-install i { width: 28px; height: 28px; } }
.sx-install-foot { margin-inline-end: 8px; }
.sx-install-foot i { margin-inline-end: 4px; }

/* ورقة تعليمات iOS (لا يوجد فيه حدث تثبيت مباشر) */
.sx-sheet {
    position: fixed; inset: 0; z-index: 2147483500; display: grid; align-items: end; justify-items: center;
    padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--sx-deep) 62%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s linear .3s;
}
.sx-sheet.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.sx-sheet-card {
    position: relative; width: min(420px, 100%); padding: 26px 22px 20px; text-align: center;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 28px;
    box-shadow: 0 40px 80px -30px rgba(0, 6, 40, .7);
    transform: translateY(40px); transition: transform .45s var(--sx-ease);
}
.sx-sheet.is-open .sx-sheet-card { transform: none; }
.sx-sheet-close { position: absolute; top: 12px; inset-inline-end: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; }
.sx-sheet-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 14px 24px -12px rgba(0, 6, 40, .6); }
.sx-sheet-card h2 { margin: 14px 0 16px; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.6; }
.sx-sheet-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: start; }
.sx-sheet-card li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); font-size: 14px; font-weight: 500; }
.sx-sheet-card li span { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface); color: var(--sx-royal); }
[data-theme="dark"] .sx-sheet-card li span { color: var(--lilac); }

/* عند الفتح كتطبيق: واجهة أنظف + مساحات آمنة للنوتش */
.sx-standalone .top-bar { display: none !important; }
.sx-standalone .header.sx-header { padding-top: env(safe-area-inset-top); }
.sx-standalone body { overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
.sx-standalone .footer-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* =====================================================================
   8) بانرات الصفحات الداخلية — سماء واحدة للموقع كله
   ===================================================================== */
.page-banner-creative,
.reader-hero,
.about-hero,
.error-page {
    position: relative; isolation: isolate; overflow: hidden;
    background-color: var(--ink) !important;
    background-image: var(--sx-sky) !important;
    background-size: auto !important; background-position: 0 0 !important;
    color: #fff; border: 0 !important;
}
/* لو رفع الأدمن صورة للبانر تبقى ظاهرة تحت السماء */
.page-banner-creative {
    background-image: var(--sx-sky), var(--cms-page-header-image, linear-gradient(transparent, transparent)) !important;
    background-size: auto, auto, auto, cover !important; background-position: 0 0, 0 0, 0 0, center !important;
    background-blend-mode: normal, normal, multiply, normal;
    min-height: 0; padding: clamp(54px, 6vw, 84px) 0 clamp(84px, 8vw, 112px) !important;
}
.page-banner-creative::before,
.reader-hero::before,
.about-hero::before,
.error-page::before {
    content: "" !important; position: absolute; inset: 0 !important; z-index: -1; pointer-events: none;
    width: auto !important; height: auto !important; transform: none; border-radius: 0;
    background: var(--sx-starfield) !important; background-size: 340px 300px !important; opacity: 1 !important;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 86%);
            mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 86%);
    animation: sx-twinkle 6s ease-in-out infinite alternate !important;
}
.page-banner-creative::after,
.reader-hero::after,
.about-hero::after,
.error-page::after {
    content: "" !important; position: absolute !important; inset: auto 0 -1px 0 !important; z-index: 1;
    width: auto !important; height: 44px !important; font-size: 0 !important;
    transform: none !important; border-radius: 0 !important; opacity: 1 !important; pointer-events: none;
    background: var(--bg-color) !important;
    -webkit-mask: var(--sx-cloud-mask) repeat-x 50% 100% / 480px 44px;
            mask: var(--sx-cloud-mask) repeat-x 50% 100% / 480px 44px;
}
.page-banner-creative > .container, .reader-hero > .container, .about-hero > .container, .error-page > .container { position: relative; z-index: 2; }
.page-banner-creative > .container > *, .reader-hero > .container > *, .about-hero > .container > * { animation: sx-rise .8s var(--sx-ease) both; }
.page-banner-creative > .container > :nth-child(2), .reader-hero > .container > :nth-child(2), .about-hero > .container > :nth-child(2) { animation-delay: .08s; }
.page-banner-creative > .container > :nth-child(3), .reader-hero > .container > :nth-child(3), .about-hero > .container > :nth-child(3) { animation-delay: .16s; }
.page-banner-creative > .container > :nth-child(n+4), .reader-hero > .container > :nth-child(n+4), .about-hero > .container > :nth-child(n+4) { animation-delay: .24s; }

/* بانرات «تجارب القراءة» وصفحة «من نحن»: كانت فاتحة مسطّحة */
.reader-hero { padding: clamp(50px, 6vw, 80px) 0 clamp(84px, 8vw, 108px) !important; }
.reader-hero h1, .about-hero h1, .error-page h1 { color: #fff !important; font-family: var(--font-display); }
.reader-hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem) !important; line-height: 1.35 !important; margin: 12px 0 14px !important; }
.reader-hero p, .about-hero p, .about-hero .about-lead, .error-page .error-text { color: rgba(226, 234, 255, .8) !important; }
.reader-hero .eyebrow-ornament, .about-hero .eyebrow-ornament, .page-banner-creative .eyebrow-ornament { color: var(--sx-ice) !important; }
.reader-hero .eyebrow-ornament::before, .about-hero .eyebrow-ornament::before { background: var(--sx-red) !important; border-radius: 50%; transform: none; }
.about-hero { padding: clamp(60px, 7vw, 104px) 0 clamp(92px, 9vw, 124px) !important; }
.about-hero .cloud-ornament { color: #fff !important; opacity: .07 !important; }
.about-hero .about-logo { filter: drop-shadow(0 18px 24px rgba(0, 6, 40, .55)); }

/* 404 */
.error-page { display: block !important; min-height: 0 !important; padding: clamp(60px, 8vw, 110px) 0 clamp(96px, 10vw, 130px) !important; }
.error-page .error-cloud { color: #fff !important; opacity: .16 !important; }
.error-page .error-code {
    background: linear-gradient(180deg, #fff 10%, var(--sx-ice) 55%, color-mix(in srgb, var(--sx-azure) 80%, transparent) 100%) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    color: transparent !important; -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 20px 40px color-mix(in srgb, var(--sx-azure) 60%, transparent));
    animation: sx-float 6s ease-in-out infinite;
}
.error-page .btn { background: #fff !important; border-color: #fff !important; color: var(--ink) !important; }
.error-page .btn.btn-outline { background: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .28) !important; color: #fff !important; }
.error-page .btn.btn-outline:hover { background: rgba(255, 255, 255, .16) !important; }

/* صفحة النشر + صفحة الكتاب: نفس درجات السماء */
.publish-hero {
    background:
        radial-gradient(60% 100% at 88% -10%, color-mix(in srgb, var(--sx-azure) 34%, transparent) 0%, transparent 62%),
        linear-gradient(90deg, color-mix(in srgb, var(--sx-deep) 97%, transparent) 0%, color-mix(in srgb, var(--ink) 88%, transparent) 48%, color-mix(in srgb, var(--ink) 40%, transparent) 100%),
        var(--cms-publish-header-image, url('../images/publishing-hero-v2.webp')) left center / cover no-repeat !important;
}
.publish-hero h1 em { color: var(--sx-ice) !important; }

/* حقول البحث داخل البانرات */
.page-banner-creative .books-banner-search-form { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); transition: border-color .25s, background-color .25s, box-shadow .3s; }
.page-banner-creative .books-banner-search-form:focus-within { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .5); box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.page-banner-creative .books-banner-search-btn { background: #fff !important; color: var(--ink) !important; box-shadow: none !important; }

/* =====================================================================
   9) التذييل — حافة سحاب ناعمة بدل الأقواس
   ===================================================================== */
.footer { background: linear-gradient(180deg, var(--ink) 0%, var(--sx-deep) 100%) !important; }
.footer::before {
    height: 44px !important; background: var(--bg-color) !important; transform: scaleY(-1);
    -webkit-mask: var(--sx-cloud-mask) repeat-x 50% 100% / 480px 44px;
            mask: var(--sx-cloud-mask) repeat-x 50% 100% / 480px 44px;
}

/* =====================================================================
   10) كروت الكتب — أدوات «الرف والمقارنة» تظهر عند الحاجة فقط
   ===================================================================== */
.book-card .reader-book-actions { border-top: 0 !important; margin-top: 6px !important; padding: 6px 4px 0 !important; gap: 6px !important; flex-wrap: nowrap !important; }
.book-card .reader-book-actions select,
.book-card .reader-book-actions button {
    min-height: 34px !important; padding: 5px 12px !important; border-radius: 999px !important;
    font-size: 11.5px !important; background-color: var(--surface-2) !important; border-color: transparent !important; color: var(--text-light) !important;
    transition: background-color .2s, color .2s, border-color .2s;
}
.book-card .reader-book-actions select:hover, .book-card .reader-book-actions button:hover { background-color: var(--surface) !important; border-color: var(--border-strong) !important; color: var(--text) !important; }
.book-card .reader-book-actions button[aria-pressed="true"] { background-color: var(--ink) !important; color: #fff !important; }
@media (hover: hover) and (pointer: fine) {
    .book-card .reader-book-actions { opacity: 0; transform: translateY(-6px); transition: opacity .3s var(--sx-ease), transform .35s var(--sx-ease); }
    .book-card:hover .reader-book-actions, .book-card:focus-within .reader-book-actions { opacity: 1; transform: none; }
}

/* =====================================================================
   11) تماسك عام
   ===================================================================== */
.reader-path, .author-card, .value-item { transition: transform .4s var(--sx-ease), box-shadow .4s var(--sx-ease), border-color .3s; }
.reader-path:hover, .author-card:hover, .value-item:hover { transform: translateY(-4px); box-shadow: 0 26px 46px -30px color-mix(in srgb, var(--ink) 60%, transparent); }
.reader-path.featured { background: var(--sx-sky), var(--ink) !important; border-color: transparent !important; }

/* =====================================================================
   12) ضبط الاستجابة
   ===================================================================== */
@media (max-width: 992px) {
    .page-banner-creative { padding: 40px 0 76px !important; }
    .reader-hero { padding: 38px 0 74px !important; }
    .page-banner-creative::after, .reader-hero::after, .about-hero::after, .error-page::after, .footer::before {
        height: 30px !important;
        -webkit-mask-size: 330px 30px; mask-size: 330px 30px;
    }
}
@media (max-width: 560px) {
    .page-banner-creative h1, .page-banner-creative .books-banner-title, .cartpage-banner-title { font-size: clamp(1.9rem, 8.4vw, 2.4rem) !important; }
    .book-card .reader-book-actions { flex-wrap: wrap !important; }
}
@media (prefers-reduced-motion: reduce) {
    .page-banner-creative::before, .reader-hero::before, .about-hero::before, .error-page::before, .error-page .error-code, .sx-install, .sx-install i { animation: none !important; }
    .page-banner-creative > .container > *, .reader-hero > .container > *, .about-hero > .container > * { animation: none !important; }
}

/* مدخلات الملفات المخفية في صفحة النشر كانت تسبّب تمريراً أفقياً على الموبايل */
.publish-upload { position: relative; overflow: hidden; }
.publish-upload input[type="file"] { inset: 0; width: 100%; height: 100%; }

/* #####################################################################
   13) مجسّم الكتاب — ستايل عصري (Modern Paperback)
   ---------------------------------------------------------------------
   • غلاف نظيف بزوايا ناعمة ولمعة ضوء بيضاء بدل اللمعة الهولوجرامية الذهبية
   • كعب بلون الغلاف نفسه (من صورة الغلاف عبر --cover) بلا إطار ذهبي ولا نص
   • ورق أبيض نقي بدل الورق الكريمي المخطّط
   • ميل أهدأ وظل طافٍ ناعم
   • أغلفة مؤقتة (للكتب بلا صورة) بألوان جريئة وخط حديث بلا إطار كلاسيكي
   ##################################################################### */
:root {
    --book-holo-sheen: linear-gradient(112deg, transparent 30%, rgba(255, 255, 255, .0) 38%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, .0) 62%, transparent 70%);
}
.book-object {
    --book-depth: clamp(9px, 1.1vw, 16px);
    --book-y: -15deg;
    --book-x: 2deg;
    --book-r: 5px;
    transition: transform .6s var(--sx-ease), filter .5s ease !important;
}
.book-object--sm { --book-depth: clamp(5px, .7vw, 9px); --book-r: 3px; }
.book-object--md { --book-depth: clamp(9px, 1.05vw, 15px); }
.book-object--xl { --book-depth: clamp(14px, 1.7vw, 24px); --book-y: -13deg; --book-x: 2deg; --book-r: 7px; }
.book-object::before { content: none !important; }

/* ظل طافٍ ناعم وواسع */
.book-object::after {
    bottom: -9% !important; left: 4% !important; right: 2% !important; height: 11% !important;
    background: radial-gradient(ellipse at center, rgba(8, 20, 60, .42) 0%, rgba(8, 20, 60, .16) 50%, transparent 74%) !important;
    filter: blur(12px) !important;
    transform: translateZ(-40px) scaleX(1.05) !important;
}

/* الوجه */
.book-volume-front, .book-volume-back { border-radius: 2px var(--book-r) var(--book-r) 2px !important; }
.book-volume-front {
    background: #e9edf5 !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .1),
        0 1px 1px rgba(8, 20, 60, .1),
        8px 14px 26px -10px rgba(8, 20, 60, .38),
        18px 34px 50px -22px rgba(8, 20, 60, .42) !important;
}
.book-volume-front > img { background: #e9edf5 !important; }
/* لمعة ضوء واحدة نظيفة تتبع المؤشر */
.book-volume-front::before { mix-blend-mode: soft-light !important; background-size: 260% 260% !important; }
/* ثنية الكعب: خط ضوء رفيع بدل التجعيد الداكن */
.book-volume-front::after {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, .22) 0%, rgba(255, 255, 255, .22) 1.2%, rgba(0, 0, 0, .1) 2.8%, transparent 6%,
        transparent 92%, rgba(255, 255, 255, .08) 100%) !important;
}
.book-volume-back { background: #dfe5f0 !important; box-shadow: none !important; }

/* الكعب: امتداد لصورة الغلاف */
.book-volume-spine {
    top: 0 !important; bottom: 0 !important;
    border: 0 !important; border-radius: 2px 0 0 2px;
    background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .08) 55%, rgba(255, 255, 255, .12)), var(--cover, linear-gradient(#1b2b55, #1b2b55)) left center / auto 100% no-repeat, #1b2b55 !important;
    box-shadow: none !important;
}
.book-volume-spine > span { display: none !important; }

/* الورق: أبيض نقي بخطوط خفيفة جداً */
.book-volume-pages {
    top: 1% !important; bottom: 1% !important;
    background: repeating-linear-gradient(90deg, #ffffff 0 1.5px, #eef1f6 1.5px 2.5px) !important;
    border-block: 0 !important; box-shadow: inset 0 0 6px rgba(8, 20, 60, .12) !important;
}
.book-volume-top, .book-volume-bottom {
    background: repeating-linear-gradient(0deg, #ffffff 0 1.5px, #eef1f6 1.5px 2.5px) !important;
    border-inline: 0 !important;
}

/* وضعيات العرض: ميل أهدأ وحركة أنعم */
.book-card .book-cover .book-object { transform: perspective(1100px) rotateX(2deg) rotateY(-15deg) !important; }
.book-card:hover .book-cover .book-object,
html[dir="ltr"] .book-card:hover .book-cover .book-object {
    transform: perspective(1100px) translateY(-8px) rotateX(1deg) rotateY(-24deg) scale(1.025) !important;
    box-shadow: none !important; --glare-opacity: .9;
}
.spotlight-cover .book-object { transform: perspective(1400px) rotateX(2deg) rotateY(-16deg) !important; }
.spotlight-cover:hover .book-object { transform: perspective(1400px) translateY(-8px) rotateX(1deg) rotateY(-25deg) !important; --glare-opacity: .9; }
.reader-result-cover .book-object { transform: perspective(1000px) rotateY(-15deg) rotateX(2deg) !important; }
.reader-result-card:hover .book-object { transform: perspective(1000px) rotateY(-24deg) translateY(-4px) !important; }
.sx-book--hero .book-object { filter: drop-shadow(0 30px 34px rgba(2, 8, 40, .5)) !important; }

/* لوحة الكارت خلف الكتاب: مستطيل ناعم بدل القوس الكلاسيكي، وبلا نقش */
.book-card .book-cover {
    border-radius: 26px !important;
    padding: 30px 19% 34px !important;
    border-color: transparent !important;
    background: linear-gradient(165deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 100%) !important;
    transition: background-color .4s, box-shadow .5s var(--sx-ease) !important;
}
.book-card .book-cover::after { background-image: none !important; }
.book-card .book-cover::before {
    background: radial-gradient(90% 70% at 50% 100%, color-mix(in srgb, var(--sx-azure) 34%, transparent), transparent 70%), linear-gradient(165deg, color-mix(in srgb, var(--sx-royal) 14%, var(--surface-2)), var(--surface-2)) !important;
}
.book-card:hover .book-cover { box-shadow: 0 30px 50px -34px color-mix(in srgb, var(--ink) 70%, transparent); }
[data-theme="dark"] .book-card .book-cover { background: linear-gradient(165deg, var(--surface-2), var(--surface)) !important; }
.book-card .book-ribbon, html[dir="rtl"] .book-card .book-ribbon, html[dir="ltr"] .book-card .book-ribbon {
    top: 12px !important; inset-inline-start: 12px !important; transform: none !important;
}
@media (max-width: 560px) {
    .book-card .book-cover { border-radius: 20px !important; padding: 22px 15% 26px !important; }
}

/* ---------- الأغلفة المؤقتة (كتاب بلا صورة غلاف) ---------- */
.gen-cover {
    padding: 0 !important; overflow: hidden; isolation: isolate;
    background: linear-gradient(155deg, var(--c2), var(--c1)) !important;
}
.gen-cover--ink    { --c1: #0A1436; --c2: #1F3FD1; --fg: #FFFFFF; --pop: #7FA2FF; }
.gen-cover--wine   { --c1: #E5383B; --c2: #FF7A59; --fg: #FFFFFF; --pop: #FFD0B8; }
.gen-cover--forest { --c1: #0B7A6B; --c2: #19C3A0; --fg: #FFFFFF; --pop: #B9FBE6; }
.gen-cover--sky    { --c1: #2F6BFF; --c2: #5CC8FF; --fg: #FFFFFF; --pop: #DDF3FF; }
.gen-cover--sand   { --c1: #FFC83D; --c2: #FFE58A; --fg: #14213D; --pop: #FF7A59; }
.gen-cover--plum   { --c1: #5B2EE5; --c2: #B26BFF; --fg: #FFFFFF; --pop: #FFC6F3; }
/* أشكال هندسية: قرص كبير + حلقة */
.gen-cover::before {
    content: ""; position: absolute; z-index: -1; width: 92%; aspect-ratio: 1; top: -22%; inset-inline-end: -30%;
    border-radius: 50%; background: color-mix(in srgb, var(--pop) 62%, transparent);
}
.gen-cover::after {
    content: ""; position: absolute; z-index: -1; width: 46%; aspect-ratio: 1; top: 30%; inset-inline-start: -14%;
    border-radius: 50%; border: clamp(3px, .5vw, 7px) solid color-mix(in srgb, var(--fg) 26%, transparent);
}
.gen-cover-frame {
    position: absolute; inset: 0; border: 0 !important; outline: 0 !important;
    display: flex !important; flex-direction: column; align-items: flex-start !important; justify-content: flex-end !important;
    text-align: start !important; gap: .35em !important; padding: 11% 10% 10% !important;
}
.gen-cover-mark { display: none !important; }
.gen-cover-title, .book-object .gen-cover-title {
    font-family: var(--font-body) !important; font-weight: 800 !important; line-height: 1.28 !important; letter-spacing: -.01em;
    -webkit-line-clamp: 4;
}
.gen-cover-author { font-family: var(--font-body); font-weight: 500; font-size: .74em !important; opacity: .9 !important; }
.gen-cover-house {
    position: absolute; top: 9%; inset-inline-start: 10%; margin: 0 !important;
    font-family: var(--font-body) !important; font-weight: 700; font-size: .5em !important; letter-spacing: .02em !important; opacity: .85 !important;
    max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
    .book-card:hover .book-cover .book-object, .spotlight-cover:hover .book-object { transform: perspective(1100px) rotateX(2deg) rotateY(-15deg) !important; }
}

/* المجسّم يأخذ نسبة الغلاف الحقيقية (--ar من الخادم): طولي أو مربّع بلا قصّ */
.book-object { aspect-ratio: var(--ar, 2 / 3) !important; }
.book-volume-front > img { object-fit: cover; }
/* لوحة الكارت بارتفاع ثابت والكتاب في منتصفها، فتتساوى الكروت مهما اختلف مقاس الغلاف */
.book-card .book-cover { display: grid !important; align-items: center; aspect-ratio: 1 / 1.16; }
.book-card .book-cover .book-cover-link { display: block; min-width: 0; }
.reader-result-cover .book-object { height: auto !important; }

/* #####################################################################
   14) حركة المرور على كارت الكتاب
   ---------------------------------------------------------------------
   كان الكارت كله يرتفع بظل مستطيل فيظهر كإطار مقصوص حول محتواه.
   الآن الكارت ثابت، والحركة موزّعة على عناصره:
   اللوحة تتوهّج وترتفع قليلاً · الكتاب يطفو ويميل مع المؤشر ·
   أزرار النظرة السريعة تنزلق بالتتابع · شريط «رفّي / قارن» زجاجي يصعد
   من أسفل اللوحة (بدل مساحة فارغة محجوزة تحت كل كارت) · العنوان والسلة يستجيبان.
   ##################################################################### */
.book-card, .book-card:hover, .book-card:focus-within {
    transform: none !important; box-shadow: none !important;
    background: transparent !important; border-color: transparent !important;
}
.book-card { position: relative; container-type: inline-size; transition: none !important; }

/* اللوحة: توهّج سماوي + حلقة ضوء + ارتفاع خفيف */
.book-card .book-cover {
    transition: transform .6s var(--sx-ease), box-shadow .6s var(--sx-ease) !important;
    box-shadow: inset 0 0 0 1px transparent, 0 0 0 0 transparent;
}
.book-card .book-cover::before {
    opacity: 0; transition: opacity .6s var(--sx-ease) !important;
    background:
        radial-gradient(80% 60% at 50% 108%, color-mix(in srgb, var(--sx-azure) 42%, transparent), transparent 70%),
        radial-gradient(60% 50% at 18% 0%, color-mix(in srgb, var(--sx-royal) 16%, transparent), transparent 70%),
        linear-gradient(165deg, color-mix(in srgb, var(--sx-royal) 10%, var(--surface-2)), var(--surface-2)) !important;
}
.book-card .book-cover::after { /* خط ضوء يمرّ على اللوحة مرة واحدة */
    content: "" !important; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) !important;
    transform: translateX(-70%); border-radius: inherit;
}
[data-theme="dark"] .book-card .book-cover::after { background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .1) 50%, transparent 65%) !important; }

.book-card .book-title { transition: color .3s var(--sx-ease); }
.book-card .book-footer { transition: border-color .4s var(--sx-ease); }
.book-card .add-to-cart-btn { transition: transform .45s var(--sx-spring), background-color .3s, color .3s, box-shadow .4s var(--sx-ease) !important; }
.book-card .book-ribbon { transition: transform .5s var(--sx-spring); }

@media (hover: hover) and (pointer: fine) {
    .book-card:hover .book-cover, .book-card:focus-within .book-cover {
        transform: translateY(-6px);
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--sx-azure) 34%, transparent),
            0 34px 50px -36px color-mix(in srgb, var(--sx-royal) 85%, transparent) !important;
    }
    .book-card:hover .book-cover::before, .book-card:focus-within .book-cover::before { opacity: 1 !important; }
    .book-card:hover .book-cover::after { animation: sx-plate-sheen .9s var(--sx-ease) .05s both; }
    .book-card:hover .book-title, .book-card:focus-within .book-title { color: var(--accent); }
    .book-card:hover .book-footer { border-top-color: color-mix(in srgb, var(--sx-azure) 55%, transparent) !important; }
    .book-card:hover .add-to-cart-btn:not(.is-disabled):not(.is-success) {
        background: var(--sx-royal) !important; color: #fff !important; transform: scale(1.08);
        box-shadow: 0 14px 22px -12px color-mix(in srgb, var(--sx-royal) 90%, transparent);
    }
    .book-card .add-to-cart-btn:not(.is-disabled):hover { transform: scale(1.14) rotate(-10deg) !important; }
    .book-card:hover .book-ribbon { transform: translateY(-2px) scale(1.05) !important; }

    /* أزرار «نظرة سريعة / مفضلة»: تنزلق بالتتابع */
    .book-card .book-quick-actions { opacity: 1 !important; transform: none !important; pointer-events: none; }
    .book-card .quick-btn {
        opacity: 0; transform: translateX(14px) scale(.8);
        transition: opacity .35s var(--sx-ease), transform .5s var(--sx-spring), background-color .2s, color .2s !important;
    }
    html[dir="ltr"] .book-card .quick-btn { transform: translateX(-14px) scale(.8); }
    .book-card:hover .quick-btn, .book-card:focus-within .quick-btn { opacity: 1; transform: none !important; pointer-events: auto; }
    .book-card:hover .quick-btn:nth-child(2), .book-card:focus-within .quick-btn:nth-child(2) { transition-delay: .07s; }
    .book-card .quick-btn:hover { background: var(--ink) !important; color: #fff !important; transform: scale(1.1) !important; }
    .book-card .quick-btn.is-active { opacity: 1; transform: none; }
}
@keyframes sx-plate-sheen { 0% { opacity: 0; transform: translateX(-70%); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(70%); } }

/* شريط «رفّي / قارن»: زجاجي فوق أسفل اللوحة بدل مساحة محجوزة تحت الكارت */
@supports (width: 1cqw) {
    @media (hover: hover) and (pointer: fine) {
        .book-card .reader-book-actions {
            position: absolute; z-index: 6; inset-inline: 10px;
            top: calc(116cqw - 54px); /* اللوحة بنسبة 1 / 1.16 من عرض الكارت */
            margin: 0 !important; padding: 5px !important; gap: 5px !important;
            border-radius: 999px; border: 1px solid color-mix(in srgb, var(--surface) 70%, transparent) !important;
            background: color-mix(in srgb, var(--surface) 74%, transparent);
            backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
            box-shadow: 0 14px 26px -16px color-mix(in srgb, var(--ink) 80%, transparent);
            opacity: 0; transform: translateY(12px) scale(.96); pointer-events: none;
            transition: opacity .35s var(--sx-ease), transform .5s var(--sx-spring) !important;
        }
        .book-card:hover .reader-book-actions, .book-card:focus-within .reader-book-actions {
            opacity: 1; transform: translateY(-6px) scale(1); pointer-events: auto; transition-delay: .08s !important;
        }
        .book-card .reader-book-actions select,
        .book-card .reader-book-actions button { background-color: transparent !important; min-height: 32px !important; color: var(--text) !important; }
        .book-card .reader-book-actions select:hover,
        .book-card .reader-book-actions button:hover { background-color: var(--surface) !important; border-color: transparent !important; }
    }
}

@media (prefers-reduced-motion: reduce) {
    .book-card .book-cover, .book-card .quick-btn, .book-card .reader-book-actions, .book-card .add-to-cart-btn { transition: none !important; }
    .book-card:hover .book-cover { transform: none; }
    .book-card:hover .book-cover::after { animation: none; }
}

/* أزرار النظرة السريعة أعلى قليلاً حتى لا تلامس الشريط الزجاجي */
@media (hover: hover) and (pointer: fine) { .book-card .book-quick-actions { top: 38% !important; } }

/* #####################################################################
   15) الخط: Cairo بدل الخط الأدبي (Amiri) في كل الموقع
   ---------------------------------------------------------------------
   عناوين الكتب والاقتباسات والنبذات كانت بخط نسخي كلاسيكي؛ صارت Cairo
   (حديث، متغيّر الوزن) ليتماشى مع الأغلفة العصرية. المقاسات مضبوطة عليه
   لأنه أعرض وأعلى من Amiri عند نفس الحجم.
   ##################################################################### */
:root, [data-theme="dark"] {
    --font-literary: 'Cairo', 'Readex Pro', 'Tajawal', system-ui, sans-serif;
}

/* عنوان الكتاب في الكروت */
.book-card .book-title {
    font-family: var(--font-literary) !important; font-weight: 700 !important;
    font-size: 1.04rem !important; line-height: 1.6 !important; min-height: 3.2em !important;
    letter-spacing: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-category { font-size: 11.5px !important; }

/* البانر وكتاب الشهر */
.sx-tag-title { font-size: 1.08rem !important; font-weight: 700; line-height: 1.6; }
.opening-book-title, .sky-opening .opening-book-title { font-size: 1.35rem !important; line-height: 1.6; }
.spotlight-author { font-size: 1.08rem !important; font-weight: 600; }
.spotlight-desc { font-size: 1rem !important; line-height: 2.05 !important; font-weight: 400; }

/* آراء القرّاء والاقتباسات */
.quote-card blockquote { font-size: 1.06rem !important; line-height: 2 !important; font-weight: 500; }
.quote-card::before { font-family: Georgia, 'Times New Roman', serif !important; }
.reader-editorial-quote blockquote { font-family: var(--font-literary) !important; font-weight: 600 !important; line-height: 1.9 !important; }
.qs-controls textarea { font-size: 1rem !important; line-height: 1.9 !important; }

/* صفحات «اختار كتابك» والعيّنة والمؤلف */
.reader-result-title { font-family: var(--font-literary) !important; font-weight: 700 !important; font-size: 1.12rem !important; line-height: 1.6 !important; }
.sample-sheet article, .sample-sheet article p { font-family: var(--font-literary) !important; line-height: 2.1 !important; }

/* أرقام الفصول خلف عناوين الأقسام */
.section-head-copy::before { font-family: var(--font-literary); font-weight: 800; }

@media (max-width: 560px) {
    .book-card .book-title { font-size: .95rem !important; line-height: 1.55 !important; }
    .reader-result-title { font-size: 1rem !important; }
}

/* =====================================================================
   16) توقيع المطوّر في أسفل التذييل
   ===================================================================== */
.footer-copy { display: block; }
.sx-credit {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
    margin: 16px 0 0; padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: 12.5px; color: rgba(226, 234, 255, .5);
}
.sx-credit-label { letter-spacing: .02em; }
.sx-credit-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 8px; background: var(--sx-red); transform: rotate(45deg); border-radius: 1px; vertical-align: middle; }
.sx-credit-name {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    font-weight: 700; font-size: 13.5px; color: #fff !important; text-decoration: none;
    background: linear-gradient(var(--sx-ice), var(--sx-ice)) no-repeat 100% 100% / 0 1px;
    padding-bottom: 2px; transition: background-size .4s var(--sx-ease), color .25s;
}
html[dir="ltr"] .sx-credit-name { background-position: 0 100%; }
.sx-credit-name i { font-size: 9.5px; opacity: .6; transition: transform .35s var(--sx-spring), opacity .25s; }
.sx-credit-name:hover { color: var(--sx-ice) !important; background-size: 100% 1px; }
.sx-credit-name:hover i { opacity: 1; transform: translate(-2px, -2px); }
html[dir="ltr"] .sx-credit-name:hover i { transform: translate(2px, -2px); }
.sx-credit-in {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #fff !important; font-size: 12px;
    transition: background-color .25s, border-color .25s, transform .35s var(--sx-spring);
}
.sx-credit-in:hover { background: #0A66C2; border-color: #0A66C2; transform: translateY(-2px) rotate(-6deg); }
@media print { .sx-credit { display: none; } }
/* الشريط السفلي الثابت في الموبايل كان يغطي آخر التذييل (حقوق النشر والتوقيع) */
@media (max-width: 992px) {
    .footer { padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; }
    .sx-credit { gap: 8px; }
}

/* #####################################################################
   17) صفحة الكتاب — ترتيب شامل
   ---------------------------------------------------------------------
   • عمودان متوازنان: الغلاف + أدوات العرض | البيانات + بطاقة الشراء
   • أدوات عرض الغلاف (3D / الغلاف / الصفحات / تكبير) كشريط زجاجي مرتّب
   • أزرار المفضلة والمشاركة والاقتباس دوائر في صف واحد (حتى على الموبايل)
   • شريط «رفّي / قارن / اسأل سحاب» كبطاقة أنيقة
   • تبويبات أقسام الصفحة بدل نص متلاصق
   ##################################################################### */
.book-immersive-header { padding: clamp(36px, 4.6vw, 64px) 0 clamp(44px, 5.4vw, 76px) !important; }
.book-immersive-header::after { background: linear-gradient(180deg, color-mix(in srgb, var(--sx-deep) 78%, transparent), color-mix(in srgb, var(--ink) 92%, transparent)) !important; opacity: 1 !important; }
.book-immersive-inner {
    grid-template-columns: minmax(250px, 340px) minmax(0, 640px) !important;
    gap: clamp(32px, 5vw, 76px) !important; align-items: start !important; justify-content: center;
}

/* ---- عمود الغلاف ---- */
.book-hero-cover { max-width: none !important; margin: 0 !important; display: grid; justify-items: center; gap: 22px; }
.book-hero-cover .book-stage { width: 100%; display: grid; place-items: center; padding: 6px 8% 10px; }
.book-hero-cover .book-object { width: min(300px, 100%) !important; margin: 0 !important; }
.book-view-tools { display: grid; justify-items: center; gap: 12px; width: 100%; }
.book-view-tools[hidden] { display: none !important; }
.book-view-presets {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.book-view-presets button {
    min-width: 40px; height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid transparent; background: transparent; color: rgba(226, 234, 255, .82);
    font: 600 12.5px/1 var(--font-body); cursor: pointer; white-space: nowrap;
    transition: background-color .25s, color .25s, transform .3s var(--sx-spring);
}
.book-view-presets button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.book-view-presets button[aria-pressed="true"] { background: #fff !important; border-color: #fff !important; color: var(--ink) !important; }
.book-view-presets button[data-book-zoom] { padding: 0; width: 36px; min-width: 36px; }
.book-rotation { display: grid; justify-items: center; gap: 8px; width: min(240px, 80%); }
.book-rotation span { font-size: 11.5px; color: rgba(226, 234, 255, .6); letter-spacing: .01em; }
.book-rotation input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
    background: rgba(255, 255, 255, .2); outline-offset: 6px; cursor: pointer;
}
.book-rotation input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .16), 0 4px 10px rgba(0, 6, 40, .5); transition: transform .25s var(--sx-spring);
}
.book-rotation input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 255, 255, .16); }
.book-rotation input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }

/* ---- عمود البيانات ---- */
.book-hero-info { min-width: 0; }
.book-hero-cat {
    display: inline-flex; align-items: center; height: 32px; padding-inline: 14px !important; border-radius: 999px !important;
    background: rgba(255, 255, 255, .1) !important; border: 1px solid rgba(255, 255, 255, .18); color: var(--sx-ice) !important;
    font-size: 12.5px; font-weight: 600; transition: background-color .25s, color .25s;
}
.book-hero-cat:hover { background: #fff !important; color: var(--ink) !important; }
.book-hero-info h1 {
    margin: 16px 0 10px !important; color: #fff !important;
    font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.1rem) !important; line-height: 1.35 !important; text-wrap: balance;
}
.book-hero-author { display: inline-flex !important; align-items: center; gap: 9px; margin-bottom: 20px !important; font-size: 16px !important; font-weight: 500; color: rgba(226, 234, 255, .86) !important; }
.book-hero-author i { color: var(--sx-ice) !important; font-size: 13px; }
.book-hero-author:hover { color: #fff !important; }

.book-hero-meta { gap: 8px !important; margin-bottom: 22px !important; }
.bhm-item {
    display: inline-grid !important; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 0;
    min-width: 0 !important; width: auto !important; padding: 9px 14px 9px 16px !important; text-align: start !important;
    background: rgba(255, 255, 255, .07) !important; border: 1px solid rgba(255, 255, 255, .13) !important; border-radius: 14px !important;
    transition: background-color .25s, transform .3s var(--sx-ease) !important;
}
.bhm-item:hover { transform: translateY(-2px) !important; background: rgba(255, 255, 255, .12) !important; }
.bhm-item i { grid-row: 1 / span 2; margin: 0 !important; font-size: 15px !important; color: var(--sx-ice) !important; }
.bhm-item span { font-size: 13.5px !important; font-weight: 700 !important; line-height: 1.5; color: #fff !important; }
.bhm-item small { grid-column: 2; font-size: 10.5px; line-height: 1.3; color: rgba(226, 234, 255, .58); }

/* ---- بطاقة الشراء ---- */
.book-hero-buy {
    padding: 22px clamp(18px, 2vw, 26px) !important; border-radius: 24px !important;
    background: rgba(255, 255, 255, .07) !important; border: 1px solid rgba(255, 255, 255, .15) !important;
    backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 30px 50px -34px rgba(0, 6, 40, .9), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.book-hero-price { margin-bottom: 14px !important; }
.book-hero-price .price-on-request { color: #fff !important; font-size: 1.25rem !important; font-weight: 700; }
.book-hero-price .price-on-request::before { background: var(--sx-red) !important; }
.book-hero-price .price-now { color: #fff !important; font-family: var(--font-body) !important; font-size: 2rem !important; }

.book-hero-actions { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 10px !important; margin: 0 0 16px !important; }
.book-hero-actions .add-to-cart-form { flex: 1 1 280px; width: auto !important; display: flex; flex-wrap: nowrap !important; gap: 10px !important; }
.book-hero-actions .qty-picker { flex: none; height: 52px; }
.book-hero-actions .btn-buy {
    flex: 1 1 auto; min-height: 52px; padding: 0 22px !important; white-space: nowrap; gap: 10px;
    background: #fff !important; border-color: #fff !important; color: var(--ink) !important; font-weight: 700;
    box-shadow: 0 16px 30px -16px color-mix(in srgb, var(--sx-azure) 90%, transparent) !important;
}
.book-hero-actions .btn-buy:hover { background: var(--sx-ice) !important; border-color: var(--sx-ice) !important; }
.book-hero-actions .btn-icon-only {
    flex: none !important; width: 52px !important; height: 52px !important; min-height: 0; padding: 0 !important; border-radius: 50% !important;
    background: rgba(255, 255, 255, .06) !important; border: 1px solid rgba(255, 255, 255, .22) !important; color: #fff !important;
    transition: background-color .25s, border-color .25s, transform .35s var(--sx-spring) !important;
}
.book-hero-actions .btn-icon-only:hover { background: rgba(255, 255, 255, .16) !important; border-color: rgba(255, 255, 255, .5) !important; transform: translateY(-2px); }
.book-hero-actions .btn-icon-only.is-active { color: #ff6b6b !important; border-color: #ff6b6b !important; }
.book-hero-buy .preview-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--sx-ice); font-weight: 600; font-size: 14px; }

.book-assurances {
    display: flex !important; flex-wrap: wrap; gap: 8px 18px !important; margin: 0 !important; padding: 16px 0 0 !important; list-style: none;
    border-top: 1px solid rgba(255, 255, 255, .12);
}
.book-assurances li { font-size: 12.5px !important; gap: 8px !important; color: rgba(226, 234, 255, .74) !important; }
.book-assurances i { width: auto !important; font-size: 12px; color: var(--sx-ice) !important; }

/* ---- ما تحت البانر ---- */
.book-reader-details::before { display: none !important; }
.book-reader-strip {
    position: relative; z-index: 2; margin-top: -26px; padding: 14px 18px !important; gap: 12px !important; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
    box-shadow: 0 26px 46px -34px color-mix(in srgb, var(--ink) 60%, transparent);
}
.book-reader-strip .reader-book-actions { display: flex !important; align-items: center; gap: 10px !important; flex: 1 1 320px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
.book-reader-strip .reader-book-actions label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.book-reader-strip .reader-book-actions label > span { margin: 0 !important; white-space: nowrap; font-size: 12.5px !important; font-weight: 600; color: var(--text-light); }
.book-reader-strip .reader-book-actions select,
.book-reader-strip .reader-book-actions button {
    min-height: 44px; border-radius: 999px !important; padding: 8px 16px !important; font-size: 13px !important;
    background-color: var(--surface-2) !important; border: 1px solid transparent !important; color: var(--text) !important;
    transition: border-color .2s, background-color .2s;
}
.book-reader-strip .reader-book-actions select { flex: 1; min-width: 0; max-width: 300px; }
.book-reader-strip .reader-book-actions select:hover, .book-reader-strip .reader-book-actions button:hover { border-color: var(--border-strong) !important; background-color: var(--surface) !important; }
.book-reader-strip .reader-book-actions button { white-space: nowrap; cursor: pointer; }
.book-reader-strip .reader-book-actions button[aria-pressed="true"] { background-color: var(--ink) !important; color: #fff !important; }
.book-reader-strip > .btn { min-height: 44px !important; padding-inline: 18px !important; font-size: 13px !important; white-space: nowrap; }

.book-section-nav {
    display: flex; align-items: center; gap: 4px; margin: 26px 0 0; padding-bottom: 0;
    border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.book-section-nav::-webkit-scrollbar { display: none; }
.book-section-nav a {
    position: relative; flex: none; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-light); white-space: nowrap;
    transition: color .2s;
}
.book-section-nav a::after {
    content: ""; position: absolute; inset: auto 16px -1px 16px; height: 2px; border-radius: 2px 2px 0 0;
    background: var(--grad-dusk); transform: scaleX(0); transition: transform .4s var(--sx-ease);
}
.book-section-nav a:hover { color: var(--text); }
.book-section-nav a:hover::after { transform: scaleX(1); }
.book-section-nav a:first-child { padding-inline-start: 0; }
.book-section-nav a:first-child::after { inset-inline-start: 0; }

.book-reader-details .section-space { padding-block: clamp(36px, 4.6vw, 64px) !important; }
.book-reader-details .section-title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem) !important; margin-bottom: 20px; }
.reader-author-story, .reader-audience { border-radius: 22px !important; margin: 22px 0 0 !important; padding: clamp(20px, 2.6vw, 32px) !important; }
.reader-author-story h2, .reader-audience h2 { font-size: clamp(1.25rem, 2vw, 1.6rem) !important; margin: 8px 0 10px !important; }
.book-description { border-radius: 22px !important; }
.book-description .rich-content { font-size: 16px; line-height: 2.1; max-width: 78ch; }
.description-tools button { border-radius: 999px !important; padding: 7px 14px !important; }

/* ---- الاستجابة ---- */
@media (max-width: 992px) {
    .book-immersive-inner { grid-template-columns: 1fr !important; gap: 26px !important; }
    .book-hero-cover .book-object { width: min(230px, 62vw) !important; }
    .book-hero-info { display: grid; justify-items: center; text-align: center; }
    .book-hero-meta { justify-content: center; }
    .book-hero-buy { width: 100%; text-align: start; }
    .book-rotation span { display: none; }
}
@media (max-width: 560px) {
    .book-immersive-header { padding: 26px 0 46px !important; }
    .book-hero-actions .add-to-cart-form { flex: 1 1 100%; }
    .book-hero-actions .btn-buy { padding: 0 14px !important; font-size: 15px; }
    /* الثلاثة في صف واحد متساوٍ بدل ثلاثة صفوف */
    .book-hero-actions .btn-icon-only { flex: 1 1 0 !important; width: auto !important; height: 48px !important; border-radius: 999px !important; }
    .book-assurances { flex-direction: column; gap: 8px !important; }
    .book-reader-strip { margin-top: -20px; padding: 12px !important; border-radius: 18px; }
    .book-reader-strip .reader-book-actions { flex: 1 1 100% !important; flex-wrap: wrap; }
    .book-reader-strip .reader-book-actions label { flex: 1 1 100%; }
    .book-reader-strip .reader-book-actions select { max-width: none; }
    .book-reader-strip .reader-book-actions button, .book-reader-strip > .btn { flex: 1 1 0; justify-content: center; text-align: center; }
    .book-section-nav a { padding: 11px 12px; font-size: 13.5px; }
}

/* رسالة ترحيب المساعد كانت تغطي عنوان الكتاب والمحتوى على الموبايل؛ الزر نفسه يبقى ظاهراً */
@media (max-width: 640px) { .sahab-tip { display: none !important; } }

/* #####################################################################
   18) عارض الغلاف في صفحة الكتاب: التدوير + العرض المكبّر
   ---------------------------------------------------------------------
   السكربت (book-volume.js) يضبط --viewer-y / --viewer-x، لكن لم تكن هناك
   قاعدة تستخدمهما، فالأزرار والسلايدر لم يحرّكوا الكتاب. والنافذة المكبّرة
   لم يكن لها أي تنسيق فظهر الكتاب على الجنب وزر الإغلاق بشكل خام.
   ##################################################################### */
.book-hero-cover .book-stage .book-object,
.book-hero-cover:hover .book-stage .book-object,
.book-volume-dialog .book-object {
    transform: perspective(1500px) rotateX(var(--viewer-x, 2deg)) rotateY(var(--viewer-y, -18deg)) !important;
    transition: transform .5s var(--sx-ease) !important;
    animation: none !important;
}
.book-hero-cover .book-stage { touch-action: pan-y; }
.book-hero-cover:hover img { transform: none !important; }

.book-volume-dialog {
    position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0; overflow: hidden; color: #fff;
    background: var(--sx-sky), var(--ink);
}
.book-volume-dialog[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; animation: sx-dialog-in .4s var(--sx-ease); }
.book-volume-dialog::backdrop { background: color-mix(in srgb, var(--sx-deep) 80%, transparent); }
.book-volume-dialog::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: var(--sx-starfield); background-size: 340px 300px; opacity: .8;
    -webkit-mask-image: linear-gradient(180deg, #000 0 45%, transparent 85%); mask-image: linear-gradient(180deg, #000 0 45%, transparent 85%);
}
.book-volume-dialog .book-stage {
    position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0;
    padding: clamp(64px, 9dvh, 96px) 24px 12px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.book-volume-dialog .book-stage.is-dragging { cursor: grabbing; }
.book-volume-dialog .book-stage.is-dragging .book-object { transition: none !important; }
.book-volume-dialog .book-object {
    --book-depth: clamp(20px, 3.2dvh, 34px);
    height: min(68dvh, 700px) !important; width: auto !important; max-width: 76vw; margin: 0 !important;
    filter: drop-shadow(0 40px 46px rgba(0, 6, 40, .6));
}
.book-volume-dialog .book-object img { pointer-events: none; -webkit-user-drag: none; }
.book-volume-close {
    position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); inset-inline-end: 16px;
    display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .24); color: #fff; font-size: 17px; cursor: pointer;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: background-color .25s, color .25s, transform .35s var(--sx-spring);
}
.book-volume-close:hover { background: #fff; color: var(--ink); transform: rotate(90deg); }
.book-volume-close:focus-visible { outline: 2px solid #fff !important; outline-offset: 3px; }
.book-volume-hint {
    position: relative; z-index: 1; margin: 0 0 max(22px, env(safe-area-inset-bottom)); padding: 8px 16px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
    font-size: 12.5px; color: rgba(226, 234, 255, .8);
}
@keyframes sx-dialog-in { from { opacity: 0; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) {
    .book-hero-cover .book-stage .book-object, .book-volume-dialog .book-object { transition: none !important; }
    .book-volume-dialog[open] { animation: none; }
}

/* الشاشات الطولية (موبايل): مقاس الكتاب المكبّر يتبع العرض حتى لا يُقصّ من الأطراف */
@media (max-aspect-ratio: 4/5) {
    .book-volume-dialog .book-object { width: min(66vw, 420px) !important; height: auto !important; max-width: none; }
    .book-volume-dialog .book-stage { padding-inline: 12px; }
}
