/* هيدر موحّد — شريط كلاسيكي بعرض كامل بدون فراغات */

.header-top-row--campaign {
    padding: clamp(8px, 1.5vw, 14px) 4% clamp(10px, 2vw, 16px);
    border-bottom: none;
}

.header-hero-band {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(14px, 2.5vw, 22px);
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding: clamp(14px, 2.4vw, 20px) clamp(16px, 3vw, 24px);
    border-radius: 20px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.03) 38%, rgba(8, 28, 48, 0.55) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    box-sizing: border-box;
}

[dir="ltr"] .header-hero-band {
    flex-direction: row-reverse;
}

.header-hero-core {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-brand-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}

.header-brand-row .header-campaign-title {
    flex: 1 1 200px;
    margin: 0;
    text-align: start;
    font-size: clamp(1.05rem, 2.4vw, 1.55rem);
    line-height: 1.25;
}

.header-hero-divider {
    height: 1px;
    margin: 2px 0 4px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.28) 20%,
        rgba(255, 255, 255, 0.28) 80%,
        transparent 100%
    );
}

.header-campaign-headline {
    margin: 0;
    font-size: clamp(0.95rem, 1.75vw, 1.28rem);
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    letter-spacing: -0.01em;
}

.header-campaign-tagline {
    margin: 0 0 6px;
    font-size: clamp(0.74rem, 1.25vw, 0.88rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    max-width: 56ch;
}

.header-campaign-action-strip {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: clamp(10px, 2vw, 18px);
    margin-bottom: 4px;
}

.header-campaign-door-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 14px;
    padding: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.header-campaign-door-aside:hover,
.header-campaign-door-aside:focus-visible {
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.4);
}

.header-campaign-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    align-self: center;
}

.header-cta {
    font-family: inherit;
    font-size: clamp(0.76rem, 1.15vw, 0.84rem);
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: none;
}

.header-cta--primary {
    background: linear-gradient(135deg, #e0334f 0%, #c41e3a 50%, #9e1830 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(196, 30, 58, 0.38);
}

.header-cta--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(196, 30, 58, 0.48);
}

.header-cta--ghost {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.62);
}

.header-cta--ghost:hover {
    background: rgba(255, 255, 255, 0.13);
}

.header-campaign-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 16px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.header-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 72px;
    min-width: 64px;
    text-align: center;
}

.header-stat strong {
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.header-stat span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.35;
}

/* جانب الشركاء / الباب */
.header-hero-rail {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
    align-self: center;
}

.header-hero-rail[hidden] {
    display: none !important;
}

.header-showcase-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

.header-showcase-chip--partners {
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(52, 211, 153, 0.4);
}

.header-showcase-chip--doors {
    color: #e0f2fe;
    background: rgba(0, 168, 255, 0.16);
    border-color: rgba(56, 189, 248, 0.4);
}

.header-showcase-card {
    padding: 5px;
    border-radius: 14px;
    background: rgba(6, 18, 32, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.header-showcase-card--partners {
    border-color: rgba(52, 211, 153, 0.3);
}

.header-showcase-card--doors {
    border-color: rgba(56, 189, 248, 0.32);
}

@media (min-width: 901px) {
    .header-hero-band {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@media (max-width: 900px) {
    .header-hero-band {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    [dir="ltr"] .header-hero-band {
        flex-direction: column;
    }

    .header-hero-rail--partners {
        order: 2;
        flex-direction: row;
        justify-content: center;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-hero-core {
        order: 1;
    }

    .header-brand-row .header-campaign-title {
        text-align: center;
        flex: 1 1 100%;
    }

    .header-brand-row {
        justify-content: center;
    }

    .header-campaign-tagline {
        max-width: none;
        text-align: center;
    }

    .header-campaign-headline {
        text-align: center;
    }

    .header-campaign-action-strip {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .header-campaign-cta {
        width: 100%;
        justify-content: center;
    }

    .header-campaign-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-top-row--campaign {
        display: none;
    }

    .header-campaign-action-strip {
        gap: 12px;
    }

    .header-campaign-door-aside {
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
    }

    .header-campaign-cta {
        flex-direction: column;
        width: 100%;
    }

    .header-cta {
        width: 100%;
        text-align: center;
    }

    .header-main-row {
        padding: 6px 4% 8px;
        min-height: 52px;
    }

    .logo-container img,
    .site-logo-img {
        width: 52px;
        height: 52px;
        max-width: 52px;
    }
}

@media (max-width: 400px) {
    .header-stat {
        flex: 1 1 30%;
        min-width: 56px;
    }
}

/* ============================================================
   الهيدر السينمائي — خلفية حية من صور نبراس
   Ken Burns + وشاح كحلي + شفق ذهبي/أزرق + شعاع ضوء + غبار ذهبي
   ============================================================ */

.header-cinematic,
.hero-cinematic {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

header > .header-top-row,
header > .header-main-row {
    position: relative;
    z-index: 1;
}

/* --- شرائح صور نبراس مع حركة Ken Burns --- */
.header-cinematic-slides {
    position: absolute;
    inset: 0;
}

.header-cinematic-slide {
    position: absolute;
    inset: -7%;
    width: 114%;
    height: 114%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2.2s ease-in-out;
    will-change: transform, opacity;
}

.header-cinematic-slide.is-active {
    opacity: 0.92;
}

.header-cinematic-slide[data-kb="0"].is-active {
    animation: headerKenburnsA 17s ease-in-out forwards;
}

.header-cinematic-slide[data-kb="1"].is-active {
    animation: headerKenburnsB 17s ease-in-out forwards;
}

.header-cinematic-slide[data-kb="2"].is-active {
    animation: headerKenburnsC 17s ease-in-out forwards;
}

@keyframes headerKenburnsA {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1.8%, -1.4%); }
}

@keyframes headerKenburnsB {
    0% { transform: scale(1.1) translate(1.6%, 0.8%); }
    100% { transform: scale(1) translate(0, 0); }
}

@keyframes headerKenburnsC {
    0% { transform: scale(1.02) translate(-1.2%, 1%); }
    100% { transform: scale(1.14) translate(1.4%, -1%); }
}

/* --- وشاح كحلي يحفظ وضوح النصوص ويعطي عمقاً فاخراً --- */
.header-cinematic-veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(5, 20, 36, 0.18) 0%, rgba(5, 20, 36, 0.55) 78%, rgba(4, 16, 30, 0.82) 100%),
        linear-gradient(168deg, rgba(6, 23, 40, 0.86) 0%, rgba(10, 36, 60, 0.6) 42%, rgba(5, 19, 35, 0.9) 100%);
}

/* --- شفق متموج — ذهب نبراس وأزرقها --- */
.header-cinematic-aurora {
    position: absolute;
    width: 56%;
    height: 130%;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.32;
    mix-blend-mode: screen;
    will-change: transform;
}

.header-cinematic-aurora--gold {
    top: -42%;
    inset-inline-start: -10%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.55) 0%, rgba(212, 175, 55, 0) 62%);
    animation: headerAuroraGold 21s ease-in-out infinite alternate;
}

.header-cinematic-aurora--blue {
    bottom: -52%;
    inset-inline-end: -12%;
    background: radial-gradient(circle, rgba(0, 168, 255, 0.5) 0%, rgba(0, 168, 255, 0) 64%);
    animation: headerAuroraBlue 27s ease-in-out infinite alternate;
}

@keyframes headerAuroraGold {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(9%, 7%, 0) scale(1.16); }
    100% { transform: translate3d(-5%, 3%, 0) scale(0.94); }
}

@keyframes headerAuroraBlue {
    0% { transform: translate3d(0, 0, 0) scale(1.05); }
    50% { transform: translate3d(-8%, -6%, 0) scale(0.92); }
    100% { transform: translate3d(5%, -2%, 0) scale(1.18); }
}

/* --- شعاع ضوء يمسح الهيدر بأناقة --- */
.header-cinematic-ray {
    position: absolute;
    top: -55%;
    inset-inline-start: -45%;
    width: 34%;
    height: 220%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 38%,
        rgba(255, 244, 214, 0.14) 50%,
        rgba(255, 255, 255, 0.05) 62%,
        transparent 100%
    );
    transform: rotate(10deg);
    animation: headerRaySweep 9.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes headerRaySweep {
    0%, 18% { transform: translateX(-30vw) rotate(10deg); opacity: 0; }
    32% { opacity: 1; }
    62%, 100% { transform: translateX(135vw) rotate(10deg); opacity: 0; }
}

[dir="rtl"] .header-cinematic-ray {
    animation-name: headerRaySweepRtl;
}

@keyframes headerRaySweepRtl {
    0%, 18% { transform: translateX(30vw) rotate(-10deg); opacity: 0; }
    32% { opacity: 1; }
    62%, 100% { transform: translateX(-135vw) rotate(-10deg); opacity: 0; }
}

/* --- غبار ذهبي متصاعد --- */
.header-cinematic-particles {
    position: absolute;
    inset: 0;
}

.header-cinematic-particle {
    position: absolute;
    bottom: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 233, 168, 0.95) 0%, rgba(212, 175, 55, 0) 72%);
    opacity: 0;
    animation: headerParticleFloat var(--dur, 9s) linear infinite;
    will-change: transform, opacity;
}

@keyframes headerParticleFloat {
    0% { transform: translate3d(0, 0, 0); opacity: 0; }
    10% { opacity: 0.9; }
    80% { opacity: 0.5; }
    100% { transform: translate3d(var(--sway, 0px), calc(-1 * var(--rise, 140px)), 0); opacity: 0; }
}

/* --- خيط ذهبي مضيء أسفل الهيدر --- */
.header-cinematic-baseline {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.85) 18%,
        rgba(255, 233, 168, 0.95) 50%,
        rgba(212, 175, 55, 0.85) 82%,
        transparent 100%
    );
    background-size: 220% 100%;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
    animation: headerBaselineShimmer 6.5s ease-in-out infinite alternate;
}

@keyframes headerBaselineShimmer {
    0% { background-position: 0% 0; opacity: 0.75; }
    100% { background-position: 100% 0; opacity: 1; }
}

/* ============================================================
   خلفية الصفحة الديناميكية — أورورا هادئة خلف كل الأقسام
   ============================================================ */

body::before {
    content: '';
    position: fixed;
    inset: -12%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 12% 6%, rgba(13, 40, 64, 0.07) 0%, transparent 62%),
        radial-gradient(760px 520px at 88% 26%, rgba(212, 175, 55, 0.08) 0%, transparent 64%),
        radial-gradient(1000px 720px at 46% 96%, rgba(0, 168, 255, 0.06) 0%, transparent 60%),
        radial-gradient(620px 460px at 70% 64%, rgba(13, 40, 64, 0.05) 0%, transparent 58%);
    animation: nebrasAmbientDrift 42s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes nebrasAmbientDrift {
    0% { transform: translate3d(-1.4%, -1%, 0) scale(1); }
    50% { transform: translate3d(0.6%, 0.8%, 0) scale(1.05); }
    100% { transform: translate3d(1.6%, -0.5%, 0) scale(1.02); }
}

/* --- موبايل: أداء أولاً --- */
@media (max-width: 768px) {
    .header-cinematic-ray,
    .header-cinematic-particles {
        display: none;
    }

    .header-cinematic-aurora {
        filter: blur(42px);
        opacity: 0.26;
    }
}

/* --- احترام تفضيل تقليل الحركة --- */
@media (prefers-reduced-motion: reduce) {
    .header-cinematic-slide,
    .header-cinematic-slide.is-active,
    .header-cinematic-aurora,
    .header-cinematic-ray,
    .header-cinematic-particle,
    .header-cinematic-baseline,
    body::before {
        animation: none !important;
    }

    .header-cinematic-slide.is-active {
        transform: scale(1.04);
    }
}
