/* ==========================================================================
   XLORD — رأس الموقع
   يُحمّل على كل الصفحات ويستبدل سلوك .page-header القديم.
   ========================================================================== */

.xnav {
    --n-red: #B30C20;
    --n-red-hot: #d10c24;
    --n-ground: oklch(0.995 0.002 22);
    --n-line: oklch(0.90 0.007 22);
    --n-ink: oklch(0.21 0.014 22);
    --n-ink-dim: oklch(0.44 0.012 22);

    /* القديم كان absolute فوق السلايدر، وكان يتداخل مع المحتوى.
       sticky يبقيه في التدفق فلا يحتاج أي صفحة حشوة تعويضية. */
    position: sticky !important;
    top: 0;
    z-index: 900;
    background: var(--n-ground);
    border-bottom: 1px solid var(--n-line);
    font-family: "Tajawal", sans-serif;
    transition: background .3s ease, border-color .3s ease;
}

.xnav * {
    border-radius: 0;
}

.xnav-row {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 36px);
    height: clamp(68px, 7vw, 86px);
}

/* ---------- الشعار ---------- */

.xnav-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* الشعار أبيض (مصمّم لخلفية داكنة) فيختفي على الهيدر الفاتح.
   التحويل يجعله علامة سوداء نظيفة. الأفضل رفع نسخة داكنة من
   الشعار واستبدال المسار، وعندها تُحذف هذه القاعدة. */
.xnav-logo img {
    height: clamp(38px, 4.2vw, 52px);
    width: auto;
    filter: brightness(0);
    transition: height .3s ease, opacity .25s ease;
}

.xnav-logo:hover img {
    opacity: .75;
}

/* ---------- القائمة ---------- */

.xnav-menu {
    flex: 1 1 auto;
    min-width: 0;
}

.xnav-list {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 30px);
    list-style: none;
    margin: 0;
    padding: 0;
}

.xnav-list > li {
    position: relative;
}

.xnav-list > li > a {
    position: relative;
    display: block;
    padding: 10px 0;
    color: var(--n-ink-dim);
    font-size: clamp(.9rem, 1.1vw, 1rem);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: color .25s ease;
}

.xnav-list > li > a:after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--n-red-hot);
    transition: width .35s cubic-bezier(.22, 1, .36, 1);
}

.xnav-list > li > a:hover,
.xnav-list > li.current-menu-item > a {
    color: var(--n-ink);
}

.xnav-list > li > a:hover:after,
.xnav-list > li.current-menu-item > a:after {
    width: 100%;
}

/* قوائم فرعية */
.xnav-list .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--n-ground);
    border: 1px solid var(--n-line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .28s cubic-bezier(.22, 1, .36, 1);
}

.xnav-list > li:hover .sub-menu,
.xnav-list > li:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.xnav-list .sub-menu a {
    display: block;
    padding: 9px 16px;
    color: var(--n-ink-dim);
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.xnav-list .sub-menu a:hover {
    background: oklch(0.21 0.011 22);
    color: var(--n-ink);
}

/* ---------- الأدوات ---------- */

.xnav-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.1vw, 14px);
}

.xnav-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--n-ink-dim);
    font-size: 1.05rem;
    border: 1px solid transparent;
    text-decoration: none;
    transition: color .25s ease, border-color .25s ease;
}

.xnav-icon:hover {
    color: var(--n-ink);
    border-color: var(--n-line);
}

.xnav-badge {
    position: absolute;
    top: 3px;
    inset-inline-end: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--n-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.xnav-cta {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 clamp(16px, 1.8vw, 26px);
    background: var(--n-red);
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: background .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}

.xnav-cta:hover {
    background: var(--n-red-hot);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- زر القائمة للجوال ---------- */

.xnav .xnav-burger {
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    background: none;
    border: 1px solid var(--n-line);
    color: var(--n-ink);
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color .25s ease, color .25s ease;
}

.xnav .xnav-burger:hover {
    border-color: var(--n-red-hot);
}

/* ==========================================================================
   تجاوز قواعد القالب القديمة
   ========================================================================== */

.page-container.home-page-container .xnav,
.page-container.inner-page-container .xnav {
    position: sticky;
    top: 0;
    background: var(--n-ground);
}

/* حشوة الهيرو وارتفاعه كانا يُضبطان هنا من زمن الرأس العائم.
   انتقلا الى home.css حيث يتبعان نوع الشريحة، وبقاؤهما هنا كان
   يتغلّب عليه بتخصيص أعلى (.home-page-container .xh-hero) فيعيد
   الفراغ العلوي فوق شريحة البانر. */

/* ==========================================================================
   الشاشات الصغيرة
   ========================================================================== */

@media (max-width: 1100px) {
    .xnav-cta {
        display: none;
    }
}

@media (max-width: 991px) {

    /* القائمة الأفقية تختفي لصالح الدرج الجانبي الموجود */
    .xnav-menu {
        display: none;
    }

    .xnav .xnav-burger {
        display: grid;
    }

    .xnav-row {
        justify-content: space-between;
    }

    .xnav-actions {
        margin-inline-start: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xnav * {
        transition-duration: .01ms !important;
    }
}
