/* ==========================================================================
   ebmnt1-header.css  -  Navigation (sticky + dropdown + burger/aside على الموبايل)
   ========================================================================== */

:root {
    /* colors */
    --ebmnt1-header-bg-color: var(--ebmnt1-color-neutral-white);
    --ebmnt1-header-border-color: var(--ebmnt1-color-helper-grey-border);
    --ebmnt1-header-shadow-color: var(--ebmnt1-color-black-alpha-10);
    --ebmnt1-header-logo-icon-bg-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-logo-icon-color: var(--ebmnt1-color-primary);
    --ebmnt1-header-logo-text-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-logo-sub-text-color: var(--ebmnt1-color-helper-grey-dark);
    --ebmnt1-header-link-text-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-link-hover-text-color: var(--ebmnt1-color-helper-purple-deep);
    --ebmnt1-header-caret-icon-color: var(--ebmnt1-color-helper-grey-medium);
    --ebmnt1-header-burger-bg-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-burger-icon-color: var(--ebmnt1-color-neutral-white);
    --ebmnt1-header-overlay-bg-color: var(--ebmnt1-color-black-alpha-20);
    --ebmnt1-header-panel-bg-color: var(--ebmnt1-color-neutral-white);
    --ebmnt1-header-panel-shadow-color: var(--ebmnt1-color-black-alpha-20);
    --ebmnt1-header-close-bg-color: var(--ebmnt1-color-helper-grey-light);
    --ebmnt1-header-close-icon-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-toggle-bg-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-toggle-icon-color: var(--ebmnt1-color-neutral-white);
    --ebmnt1-header-dropdown-bg-color: var(--ebmnt1-color-neutral-white);
    --ebmnt1-header-dropdown-shadow-color: var(--ebmnt1-color-black-alpha-20);
    --ebmnt1-header-dropdown-link-text-color: var(--ebmnt1-color-helper-grey);
    --ebmnt1-header-dropdown-link-hover-text-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-dropdown-link-hover-bg-color: var(--ebmnt1-color-helper-grey-light);
    --ebmnt1-header-dropdown-title-text-color: var(--ebmnt1-color-neutral-black);
    --ebmnt1-header-dropdown-line-color: var(--ebmnt1-color-helper-grey-border);
    --ebmnt1-header-dropdown-dot-color: var(--ebmnt1-color-helper-grey-dark);
    --ebmnt1-header-actions-divider-color: var(--ebmnt1-color-helper-grey-border);

    /* sizes */
    --ebmnt1-header-logo-icon-size: 2.5rem;
    --ebmnt1-header-logo-font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem);
    --ebmnt1-header-logo-sub-font-size: clamp(0.62rem, 0.6rem + 0.1vw, 0.72rem);
    --ebmnt1-header-link-font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
    --ebmnt1-header-dropdown-link-font-size: clamp(0.92rem, 0.9rem + 0.15vw, 1rem);
    --ebmnt1-header-dropdown-title-font-size: 0.78rem;
    --ebmnt1-header-burger-size: 2.75rem;
    --ebmnt1-header-toggle-size: 2rem;
    --ebmnt1-header-panel-width: min(86%, 21rem);
    --ebmnt1-header-panel-gap: 1.25em;
    --ebmnt1-header-dropdown-min-width: 15.5rem;
    --ebmnt1-header-dropdown-radius: 1rem;
}

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

.ebmnt1-header.is-scrolled {
    box-shadow: 0 0.6rem 1.6rem var(--ebmnt1-header-shadow-color);
}

.ebmnt1-header__master {
    width: 100%;
    display: flex;
}

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

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

.ebmnt1-header__logo-icon {
    width: var(--ebmnt1-header-logo-icon-size);
    height: var(--ebmnt1-header-logo-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    background-color: var(--ebmnt1-header-logo-icon-bg-color);
    color: var(--ebmnt1-header-logo-icon-color);
    transition: transform var(--ebmnt1-transition-medium);
}

.ebmnt1-header__logo:hover .ebmnt1-header__logo-icon {
    transform: rotate(-12deg) scale(1.08);
}

.ebmnt1-header__logo-text {
    display: flex;
    flex-direction: column;
    font-size: var(--ebmnt1-header-logo-font-size);
    font-weight: 700;
    line-height: 1;
    color: var(--ebmnt1-header-logo-text-color);
}

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

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

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

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

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

/* ---------- nav: الأب = overlay شفاف بعرض كامل / الابن = aside ---------- */
.ebmnt1-nav {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    justify-content: flex-start;
    background-color: var(--ebmnt1-header-overlay-bg-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--ebmnt1-transition-fast), visibility 0s linear 0.3s;
}

.ebmnt1-nav.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.ebmnt1-nav__panel {
    width: var(--ebmnt1-header-panel-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--ebmnt1-header-panel-gap);
    padding: 1.25em;
    overflow-y: auto;
    background-color: var(--ebmnt1-header-panel-bg-color);
    box-shadow: 0 0 2.5rem var(--ebmnt1-header-panel-shadow-color);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ebmnt1-nav.is-open .ebmnt1-nav__panel {
    transform: none;
}

.ebmnt1-nav__close {
    align-self: flex-end;
    width: var(--ebmnt1-header-burger-size);
    height: var(--ebmnt1-header-burger-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--ebmnt1-header-close-bg-color);
    color: var(--ebmnt1-header-close-icon-color);
    transition: transform var(--ebmnt1-transition-medium);
}

.ebmnt1-nav__close:hover {
    transform: rotate(90deg);
}

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

.ebmnt1-nav__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
}

.ebmnt1-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: var(--ebmnt1-header-link-font-size);
    font-weight: 500;
    color: var(--ebmnt1-header-link-text-color);
    transition: color var(--ebmnt1-transition-fast);
}

.ebmnt1-nav__link:hover {
    color: var(--ebmnt1-header-link-hover-text-color);
}

.ebmnt1-nav__caret {
    display: none;
    font-size: 0.8em;
    color: var(--ebmnt1-header-caret-icon-color);
}

.ebmnt1-nav__toggle {
    width: var(--ebmnt1-header-toggle-size);
    height: var(--ebmnt1-header-toggle-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    background-color: var(--ebmnt1-header-toggle-bg-color);
    color: var(--ebmnt1-header-toggle-icon-color);
    font-size: 0.8rem;
}

.ebmnt1-nav__toggle i {
    transition: transform var(--ebmnt1-transition-fast);
}

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

/* dropdown (موبايل = accordion) */
.ebmnt1-nav__dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease;
}

.ebmnt1-nav__item.is-open .ebmnt1-nav__dropdown {
    max-height: 30rem;
}

.ebmnt1-nav__dropdown-title {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: var(--ebmnt1-header-dropdown-title-font-size);
    font-weight: 700;
    color: var(--ebmnt1-header-dropdown-title-text-color);
}

.ebmnt1-nav__dropdown-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--ebmnt1-header-dropdown-line-color);
}

.ebmnt1-nav__dropdown-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background-color: var(--ebmnt1-header-dropdown-dot-color);
}

.ebmnt1-nav__dropdown-link {
    display: block;
    padding: 0.6em 0.9em;
    border-radius: 0.5rem;
    font-size: var(--ebmnt1-header-dropdown-link-font-size);
    font-weight: 600;
    color: var(--ebmnt1-header-dropdown-link-text-color);
    transition: color var(--ebmnt1-transition-fast), background-color var(--ebmnt1-transition-fast), transform var(--ebmnt1-transition-fast);
}

.ebmnt1-nav__dropdown-link:hover {
    color: var(--ebmnt1-header-dropdown-link-hover-text-color);
    background-color: var(--ebmnt1-header-dropdown-link-hover-bg-color);
    transform: translateX(-0.3rem);
}

/* الأزرار داخل القائمة (موبايل) */
.ebmnt1-nav__actions {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    padding-top: 1em;
    border-top: 1px solid var(--ebmnt1-header-actions-divider-color);
}

.ebmnt1-nav__actions .ebmnt1-btn {
    width: 100%;
}

/* أزرار الهيدر (ديسكتوب) */
.ebmnt1-header__actions {
    display: none;
}

/* ---------- 768 ---------- */
@media (min-width: 768px) {
    :root {
        --ebmnt1-header-logo-icon-size: 2.75rem;
    }
}

/* ---------- 1024: نظهر القائمة الأفقية + dropdown منبثق ---------- */
@media (min-width: 1024px) {
    .ebmnt1-header__burger,
    .ebmnt1-nav__close,
    .ebmnt1-nav__actions,
    .ebmnt1-nav__toggle,
    .ebmnt1-nav__dropdown-title {
        display: none;
    }

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

    .ebmnt1-header__actions .ebmnt1-btn {
        --ebmnt1-btn-padding-block: 0.6em;
        --ebmnt1-btn-padding-inline: 1.1em;
    }

    .ebmnt1-nav {
        position: static;
        flex: 1;
        justify-content: center;
        background-color: transparent;
        opacity: 1;
        visibility: visible;
    }

    .ebmnt1-nav__panel {
        width: auto;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 0;
        overflow: visible;
        background-color: transparent;
        box-shadow: none;
        transform: none;
    }

    .ebmnt1-nav__list {
        flex-direction: row;
        align-items: center;
        gap: 2.25em;
    }

    .ebmnt1-nav__link {
        font-size: var(--ebmnt1-header-link-font-size);
        font-weight: 700;
    }

    .ebmnt1-nav__caret {
        display: inline;
    }

    .ebmnt1-nav__item--has-dropdown {
        position: relative;
    }

    .ebmnt1-nav__dropdown {
        position: absolute;
        top: calc(100% + 1.1rem);
        inset-inline-start: 50%;
        translate: 50% 0;
        min-width: var(--ebmnt1-header-dropdown-min-width);
        max-height: none;
        padding: 0.75em;
        overflow: visible;
        border-radius: var(--ebmnt1-header-dropdown-radius);
        background-color: var(--ebmnt1-header-dropdown-bg-color);
        box-shadow: 0 1.2rem 3rem var(--ebmnt1-header-dropdown-shadow-color);
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.75rem);
        transition: opacity var(--ebmnt1-transition-fast), transform var(--ebmnt1-transition-medium), visibility 0s linear 0.25s;
    }

    .ebmnt1-nav__dropdown::before {
        content: "";
        position: absolute;
        inset-inline: 0;
        top: -1.2rem;
        height: 1.2rem;
    }

    .ebmnt1-nav__item--has-dropdown:hover .ebmnt1-nav__dropdown,
    .ebmnt1-nav__item--has-dropdown:focus-within .ebmnt1-nav__dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition-delay: 0s;
    }

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

    .ebmnt1-nav__caret {
        transition: transform var(--ebmnt1-transition-fast);
    }
}
