/* ==========================================================
   header.css — هيدر sticky مستقل + قائمة الموبايل (aside) + dropdown
   ========================================================== */
:root {
    --ebmnt1-header-bg: var(--ebmnt1-color-secondary);
    --ebmnt1-header-border: var(--ebmnt1-color-glass);
    --ebmnt1-header-shadow: var(--ebmnt1-color-shadow);
    --ebmnt1-header-link-color: var(--ebmnt1-color-white);
    --ebmnt1-header-link-hover-color: var(--ebmnt1-color-helper);
    --ebmnt1-header-link-underline: var(--ebmnt1-color-helper);
    --ebmnt1-header-link-font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
    --ebmnt1-header-logo-text-color: var(--ebmnt1-color-white);
    --ebmnt1-header-logo-text-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
    --ebmnt1-header-logo-mark-bg: var(--ebmnt1-color-primary);
    --ebmnt1-header-logo-mark-icon: var(--ebmnt1-color-white);
    --ebmnt1-header-burger-icon: var(--ebmnt1-color-white);
    --ebmnt1-header-burger-bg: var(--ebmnt1-color-glass);
    --ebmnt1-header-panel-bg: var(--ebmnt1-color-secondary);
    --ebmnt1-header-panel-border: var(--ebmnt1-color-glass-border);
    --ebmnt1-header-panel-width: min(82vw, 20rem);
    --ebmnt1-header-overlay-bg: transparent;
    --ebmnt1-header-dropdown-bg: var(--ebmnt1-color-secondary);
    --ebmnt1-header-dropdown-border: var(--ebmnt1-color-glass-border);
    --ebmnt1-header-dropdown-item-hover-bg: var(--ebmnt1-color-glass);
    --ebmnt1-header-dropdown-icon-color: var(--ebmnt1-color-helper);
    --ebmnt1-header-divider: var(--ebmnt1-color-glass);
}

.ebmnt1-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background-color: var(--ebmnt1-header-bg);
    border-bottom: 1px solid var(--ebmnt1-header-border);
    transition: box-shadow var(--ebmnt1-layout-transition);
}

.ebmnt1-header.ebmnt1-is-scrolled {
    box-shadow: 0 0.5rem 1.5rem var(--ebmnt1-header-shadow);
}

.ebmnt1-header__master {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--ebmnt1-header-bg);
    animation: ebmnt1HeaderIn 0.6s ease backwards;
}

.ebmnt1-header__inner {
    width: calc(100% - var(--ebmnt1-layout-inner-gutter));
    max-width: var(--ebmnt1-layout-max-width);
    min-height: var(--ebmnt1-layout-header-height);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.ebmnt1-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
}

.ebmnt1-header__logo-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ebmnt1-header-logo-mark-icon);
    background-color: var(--ebmnt1-header-logo-mark-bg);
}

.ebmnt1-header__logo-text {
    font-size: var(--ebmnt1-header-logo-text-size);
    font-weight: 700;
    color: var(--ebmnt1-header-logo-text-color);
}

/* ---------- burger ---------- */
.ebmnt1-header__burger {
    position: relative;
    z-index: 3;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--ebmnt1-header-burger-icon);
    background-color: var(--ebmnt1-header-burger-bg);
    border-radius: 50%;
}

.ebmnt1-header__burger-close {
    display: none;
}

.ebmnt1-header.ebmnt1-is-open .ebmnt1-header__burger-open {
    display: none;
}

.ebmnt1-header.ebmnt1-is-open .ebmnt1-header__burger-close {
    display: inline-block;
}

/* ---------- nav = الحاوية الأب (تتحول لطبقة شفافة على الموبايل) ---------- */
.ebmnt1-nav {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-start;
    background-color: var(--ebmnt1-header-overlay-bg);
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--ebmnt1-layout-transition), visibility var(--ebmnt1-layout-transition);
}

.ebmnt1-header.ebmnt1-is-open .ebmnt1-nav {
    visibility: visible;
    opacity: 1;
}

.ebmnt1-nav__panel {
    width: var(--ebmnt1-header-panel-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    padding: 5rem 1.5rem 1.5rem;
    overflow-y: auto;
    background-color: var(--ebmnt1-header-panel-bg);
    border-inline-end: 1px solid var(--ebmnt1-header-panel-border);
    box-shadow: 0 0 2rem var(--ebmnt1-header-shadow);
    transform: translateX(100%);
    transition: transform 0.4s ease;
}

.ebmnt1-header.ebmnt1-is-open .ebmnt1-nav__panel {
    transform: translateX(0);
}

.ebmnt1-nav__list {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.ebmnt1-nav__item {
    border-bottom: 1px solid var(--ebmnt1-header-divider);
}

.ebmnt1-nav__link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 0.85em 0;
    font-size: var(--ebmnt1-header-link-font-size);
    font-weight: 600;
    color: var(--ebmnt1-header-link-color);
    text-align: start;
    transition: color var(--ebmnt1-layout-transition);
}

.ebmnt1-nav__link:hover,
.ebmnt1-nav__link.ebmnt1-is-active {
    color: var(--ebmnt1-header-link-hover-color);
}

.ebmnt1-nav__chevron {
    font-size: 0.75em;
    transition: transform var(--ebmnt1-layout-transition);
}

.ebmnt1-nav__item--dropdown.ebmnt1-is-open .ebmnt1-nav__chevron {
    transform: rotate(180deg);
}

/* dropdown على الموبايل = accordion */
.ebmnt1-nav__dropdown {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--ebmnt1-layout-transition);
}

.ebmnt1-nav__item--dropdown.ebmnt1-is-open .ebmnt1-nav__dropdown {
    grid-template-rows: 1fr;
}

.ebmnt1-nav__dropdown-list {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ebmnt1-nav__dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.7em 0.5em;
    font-size: 0.95rem;
    color: var(--ebmnt1-color-text-muted-on-dark);
    border-radius: 0.6rem;
    transition: color var(--ebmnt1-layout-transition), background-color var(--ebmnt1-layout-transition);
}

.ebmnt1-nav__dropdown-link i {
    width: 1.25rem;
    text-align: center;
    color: var(--ebmnt1-header-dropdown-icon-color);
}

.ebmnt1-nav__dropdown-link:hover {
    color: var(--ebmnt1-color-white);
    background-color: var(--ebmnt1-header-dropdown-item-hover-bg);
}

.ebmnt1-nav__cta {
    align-self: stretch;
}

@keyframes ebmnt1HeaderIn {
    from { opacity: 0; transform: translateY(-1rem); }
    to { opacity: 1; transform: none; }
}

/* ---------- 1024+ : هيدر أفقي ---------- */
@media (min-width: 1024px) {
    .ebmnt1-header__burger {
        display: none;
    }

    .ebmnt1-nav {
        position: static;
        inset: auto;
        flex: 1;
        justify-content: space-between;
        align-items: center;
        gap: 1em;
        visibility: visible;
        opacity: 1;
        background-color: transparent;
    }

    .ebmnt1-nav__panel {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1em;
        padding: 0;
        overflow: visible;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        transform: none;
    }

    .ebmnt1-nav__list {
        flex: 1;
        flex-direction: row;
        justify-content: center;
        gap: 2em;
    }

    .ebmnt1-nav__item {
        position: relative;
        border-bottom: 0;
    }

    .ebmnt1-nav__link {
        position: relative;
        width: auto;
        padding: 1.6em 0;
    }

    .ebmnt1-nav__link::after {
        content: "";
        position: absolute;
        inset-inline-start: 0;
        bottom: 1.1em;
        width: 0;
        height: 2px;
        background-color: var(--ebmnt1-header-link-underline);
        transition: width var(--ebmnt1-layout-transition);
    }

    .ebmnt1-nav__link:hover::after,
    .ebmnt1-nav__link.ebmnt1-is-active::after {
        width: 100%;
    }

    .ebmnt1-nav__close {
        display: none;
    }

    .ebmnt1-nav__dropdown {
        position: absolute;
        inset-inline-start: 0;
        top: 100%;
        min-width: 15rem;
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.6rem);
        background-color: var(--ebmnt1-header-dropdown-bg);
        border: 1px solid var(--ebmnt1-header-dropdown-border);
        border-radius: 1rem;
        box-shadow: 0 1rem 2rem var(--ebmnt1-header-shadow);
        transition: opacity var(--ebmnt1-layout-transition), transform var(--ebmnt1-layout-transition), visibility var(--ebmnt1-layout-transition);
    }

    .ebmnt1-nav__dropdown-list {
        padding: 0.5rem;
        overflow: visible;
    }

    .ebmnt1-nav__item--dropdown:hover .ebmnt1-nav__dropdown,
    .ebmnt1-nav__item--dropdown:focus-within .ebmnt1-nav__dropdown,
    .ebmnt1-nav__item--dropdown.ebmnt1-is-open .ebmnt1-nav__dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .ebmnt1-nav__item--dropdown:hover .ebmnt1-nav__chevron {
        transform: rotate(180deg);
    }

    .ebmnt1-nav__cta {
        align-self: auto;
    }
}
