/* ======================================================
   Site Header — White Drives
   ====================================================== */

.wd-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--ink);
    border-bottom: 1px solid transparent;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.wd-header.is-scrolled {
    background: rgba(var(--ink-rgb), .95);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom-color: var(--rule);
    box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .4);
}

.wd-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* ---- Brand (CSS-based lockup — scales crisp on any background) ---- */
.wd-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity .25s ease, transform .3s ease;
}

.wd-header__brand:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.wd-header__brand-mono {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-chip);
    background: linear-gradient(135deg, var(--brand) 0%, var(--ink-soft) 100%);
    border: 1px solid rgba(var(--brass-rgb), .35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 6px 18px -6px rgba(var(--brass-rgb), .3);
}

.wd-header__brand-lockup {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.05;
    gap: 2px;
}

.wd-header__brand-ar {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .01em;
    color: var(--cream);
}

.wd-header__brand-en {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--brass-soft);
}

/* ---- Primary nav ---- */
.wd-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.wd-header__nav-item a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    color: rgba(var(--cream-rgb), .72);
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14.5px;
    letter-spacing: .01em;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: color .25s ease, background .25s ease;
}

.wd-header__nav-item a:hover {
    color: var(--cream);
    background: rgba(var(--brass-rgb), .08);
}

.wd-header__nav-item.is-active a {
    color: var(--brass-soft);
}

.wd-header__nav-item.is-active a::after {
    content: '';
    position: absolute;
    right: 18px;
    left: 18px;
    bottom: 4px;
    height: 1px;
    background: var(--brass);
}

/* ---- Auth / CTA group ---- */
.wd-header__cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wd-header__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all .3s ease;
    border: 1px solid transparent;
    background: transparent;
    line-height: 1;
    white-space: nowrap;
}

.wd-header__btn svg,
.wd-header__btn i {
    font-size: 13px;
    line-height: 1;
}

.wd-header__btn--ghost {
    color: var(--cream);
    border-color: rgba(var(--cream-rgb), .25);
}

.wd-header__btn--ghost:hover {
    border-color: var(--brass);
    color: var(--brass-soft);
    transform: translateY(-1px);
}

.wd-header__btn--solid {
    color: var(--ink-deep);
    background: var(--brass);
    border-color: var(--brass);
}

.wd-header__btn--solid:hover {
    background: var(--cream);
    border-color: var(--cream);
    transform: translateY(-1px);
}

/* ---- User dropdown ---- */
.wd-header__user {
    position: relative;
}

.wd-header__user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(var(--cream-rgb), .15);
    color: var(--cream);
    cursor: pointer;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    transition: all .25s ease;
    text-decoration: none;
}

.wd-header__user-toggle:hover {
    border-color: var(--brass);
}

.wd-header__user-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-circle);
    overflow: hidden;
    border: 1px solid var(--brass);
}

.wd-header__user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wd-header__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: auto;
    min-width: 220px;
    background: var(--bone);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: 0 30px 60px -20px rgba(var(--ink-rgb), .4);
    border: 1px solid rgba(var(--ink-rgb), .08);
}

.wd-header__dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-chip);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.wd-header__dropdown .dropdown-item:hover {
    background: var(--ink);
    color: var(--cream);
}

.wd-header__dropdown .dropdown-item i {
    color: var(--brass);
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.wd-header__dropdown .dropdown-item:hover i {
    color: var(--brass-soft);
}

/* ---- Notifications ---- */
.wd-header__bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-circle);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(var(--cream-rgb), .15);
    color: var(--cream);
    transition: all .25s ease;
    text-decoration: none;
    cursor: pointer;
}

.wd-header__bell:hover {
    border-color: var(--brass);
    color: var(--brass-soft);
}

.wd-header__bell .badge {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--brass);
    border-radius: var(--radius-circle);
}

/* ---- Mobile toggle (hamburger) ---- */
.wd-header__toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-chip);
    border: 1px solid rgba(var(--cream-rgb), .2);
    background: transparent;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.wd-header__toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--cream);
    transition: transform .3s ease, opacity .3s ease;
}

.wd-header.is-open .wd-header__toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.wd-header.is-open .wd-header__toggle span:nth-child(2) {
    opacity: 0;
}

.wd-header.is-open .wd-header__toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ---- Mobile drawer ---- */
@media (max-width: 992px) {
    .wd-header__toggle {
        display: flex;
    }

    .wd-header__inner {
        padding: 0 20px;
        height: 72px;
    }

    .wd-header__brand-mono {
        width: 36px;
        height: 36px;
        font-size: 19px;
        border-radius: var(--radius-sm);
    }

    .wd-header__brand-ar {
        font-size: 16px;
    }

    .wd-header__brand-en {
        font-size: 10px;
        letter-spacing: .28em;
    }

    .wd-header__nav,
    .wd-header__cta {
        position: fixed;
        top: 72px;
        right: 0;
        left: 0;
        z-index: 1029;
        background: var(--ink);
        border-top: 1px solid var(--rule);
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 4px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform .35s ease, opacity .35s ease;
    }

    .wd-header__cta {
        top: auto;
        border-top: none;
        padding: 16px 20px 24px;
        flex-direction: row;
        justify-content: stretch;
        flex-wrap: wrap;
        gap: 10px;
    }

    .wd-header__cta .wd-header__btn {
        flex: 1;
        justify-content: center;
    }

    .wd-header.is-open .wd-header__nav,
    .wd-header.is-open .wd-header__cta {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .wd-header.is-open .wd-header__cta {
        top: auto;
        position: static;
    }

    .wd-header__nav-item a {
        display: block;
        padding: 14px 16px;
        font-size: 16px;
    }

    .wd-header__nav-item.is-active a::after {
        display: none;
    }

    .wd-header__nav-item.is-active a {
        background: rgba(var(--brass-rgb), .08);
    }

    /* When open, swap layout so CTA sits inline under nav (using a wrapper drawer) */
    .wd-header__drawer {
        position: fixed;
        top: 72px;
        right: 0;
        left: 0;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        background: var(--ink);
        border-top: 1px solid var(--rule);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform .35s ease, opacity .35s ease;
    }

    .wd-header.is-open .wd-header__drawer {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .wd-header__drawer .wd-header__nav,
    .wd-header__drawer .wd-header__cta {
        position: static;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        border-top: none;
    }

    .wd-header__drawer .wd-header__nav {
        padding: 20px 20px 8px;
    }

    .wd-header__drawer .wd-header__cta {
        padding: 12px 20px 24px;
    }

    /* Hide dropdowns on mobile (replaced by in-drawer items) */
    .wd-header__user-toggle .wd-header__user-name {
        display: none;
    }
}

@media (max-width: 540px) {
    .wd-header__cta .wd-header__btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}

