/* ==========================================================
   header — sticky + شريط تنقل بشكل Ribbon + قائمة جانبية في الموبايل
   الهيكلية: bar (master) > bar-inner (inner) > logo / nav (parent overlay) > nav-inner
   ========================================================== */

:root {
    --ebmnt1-header-background: var(--ebmnt1-color-white);
    --ebmnt1-header-border-color: var(--ebmnt1-color-helper-pink-soft);
    --ebmnt1-header-shadow-color: var(--ebmnt1-color-shadow);
    --ebmnt1-header-logo-text-color: var(--ebmnt1-color-helper-purple);
    --ebmnt1-header-ribbon-start: var(--ebmnt1-color-helper-lavender);
    --ebmnt1-header-ribbon-end: var(--ebmnt1-color-helper-purple);
    --ebmnt1-header-ribbon-fold-color: var(--ebmnt1-color-helper-purple-deep);
    --ebmnt1-header-ribbon-tail-color: var(--ebmnt1-color-helper-purple);
    --ebmnt1-header-link-color: var(--ebmnt1-color-white);
    --ebmnt1-header-link-icon-color: var(--ebmnt1-color-white);
    --ebmnt1-header-link-divider-color: rgba(255, 255, 255, 0.28);
    --ebmnt1-header-link-active-background: rgba(255, 255, 255, 0.22);
    --ebmnt1-header-link-hover-background: rgba(255, 255, 255, 0.16);
    --ebmnt1-header-dropdown-background: var(--ebmnt1-color-white);
    --ebmnt1-header-dropdown-link-color: var(--ebmnt1-color-helper-purple);
    --ebmnt1-header-dropdown-link-icon-color: var(--ebmnt1-color-primary);
    --ebmnt1-header-dropdown-link-hover-background: var(--ebmnt1-color-helper-pink-soft);
    --ebmnt1-header-dropdown-border-color: var(--ebmnt1-color-helper-pink-soft);
    --ebmnt1-header-burger-background: var(--ebmnt1-color-helper-pink-soft);
    --ebmnt1-header-burger-icon-color: var(--ebmnt1-color-primary);
    --ebmnt1-header-overlay-background: var(--ebmnt1-color-overlay);
    --ebmnt1-header-aside-background: var(--ebmnt1-color-helper-purple);
    --ebmnt1-header-aside-close-background: rgba(255, 255, 255, 0.18);
    --ebmnt1-header-aside-close-icon-color: var(--ebmnt1-color-white);
    --ebmnt1-header-aside-submenu-background: rgba(255, 255, 255, 0.12);
    --ebmnt1-header-font-size-link: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
    --ebmnt1-header-font-size-logo: clamp(0.9rem, 0.8rem + 0.5vw, 1.2rem);
}

.ebmnt1-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    display: flex;
}

.ebmnt1-header__bar {
    width: 100%;
    display: flex;
    background-color: var(--ebmnt1-header-background);
    border-bottom: 3px dashed var(--ebmnt1-header-border-color);
    box-shadow: 0 0.5em 1.2em -0.8em var(--ebmnt1-header-shadow-color);
}

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

/* ---------- logo ---------- */

.ebmnt1-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    color: var(--ebmnt1-header-logo-text-color);
    font-size: var(--ebmnt1-header-font-size-logo);
    font-weight: 700;
    line-height: 1.2;
}

.ebmnt1-header__logo-image {
    width: clamp(2.8rem, 2.4rem + 1.6vw, 3.8rem);
    height: auto;
    transition: transform 0.4s ease;
}

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

/* ---------- burger ---------- */

.ebmnt1-header__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    background-color: var(--ebmnt1-header-burger-background);
    color: var(--ebmnt1-header-burger-icon-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.ebmnt1-header__burger i {
    color: var(--ebmnt1-header-burger-icon-color);
}

.ebmnt1-header__burger:hover {
    transform: scale(1.08) rotate(-6deg);
}

/* ---------- nav (parent) — في الموبايل يتحول لطبقة شفافة بعرض الشاشة ---------- */

.ebmnt1-header__nav {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: flex-start;
    background-color: var(--ebmnt1-header-overlay-background);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ---------- nav-inner (inner) — في الموبايل يصبح aside ---------- */

.ebmnt1-header__nav-inner {
    width: min(20rem, 86vw);
    height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.2em;
    padding: 1.2em;
    background-color: var(--ebmnt1-header-aside-background);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: default;
}

.ebmnt1-header__nav.ebmnt1-is-open .ebmnt1-header__nav-inner {
    transform: none;
}

.ebmnt1-header__nav-close {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background-color: var(--ebmnt1-header-aside-close-background);
    color: var(--ebmnt1-header-aside-close-icon-color);
    font-size: 1.2rem;
}

.ebmnt1-header__nav-close i {
    color: var(--ebmnt1-header-aside-close-icon-color);
}

.ebmnt1-header__menu {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.ebmnt1-header__item {
    position: relative;
    display: flex;
    flex-direction: column;
}

.ebmnt1-header__link {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.7em 0.9em;
    border-radius: 0.9em;
    color: var(--ebmnt1-header-link-color);
    font-size: var(--ebmnt1-header-font-size-link);
    font-weight: 600;
    transition: background-color 0.25s ease;
    width: 100%;
    text-align: start;
}

.ebmnt1-header__link i {
    color: var(--ebmnt1-header-link-icon-color);
}

.ebmnt1-header__link:hover,
.ebmnt1-header__item.ebmnt1-is-open > .ebmnt1-header__link {
    background-color: var(--ebmnt1-header-link-hover-background);
}

.ebmnt1-header__link.ebmnt1-is-active {
    background-color: var(--ebmnt1-header-link-active-background);
}

.ebmnt1-header__caret {
    margin-inline-start: auto;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.ebmnt1-header__item.ebmnt1-is-open .ebmnt1-header__caret {
    transform: rotate(180deg);
}

/* dropdown الخدمات — في الموبايل accordion */

.ebmnt1-header__submenu {
    display: none;
    flex-direction: column;
    gap: 0.2em;
    margin-top: 0.3em;
    padding: 0.4em;
    border-radius: 0.9em;
    background-color: var(--ebmnt1-header-aside-submenu-background);
}

.ebmnt1-header__item.ebmnt1-is-open > .ebmnt1-header__submenu {
    display: flex;
}

.ebmnt1-header__sublink {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.55em 0.8em;
    border-radius: 0.7em;
    color: var(--ebmnt1-header-link-color);
    font-size: calc(var(--ebmnt1-header-font-size-link) * 0.92);
    transition: background-color 0.25s ease;
}

.ebmnt1-header__sublink i {
    color: var(--ebmnt1-header-link-icon-color);
    width: 1.2em;
    text-align: center;
}

.ebmnt1-header__sublink:hover {
    background-color: var(--ebmnt1-header-link-hover-background);
}

.ebmnt1-header__cta {
    margin-top: auto;
}

/* ---------- desktop ---------- */

@media (min-width: 1024px) {
    .ebmnt1-header__burger,
    .ebmnt1-header__nav-close {
        display: none;
    }

    .ebmnt1-header__nav {
        position: static;
        flex: 1;
        justify-content: flex-end;
        align-items: center;
        gap: 1em;
        background-color: transparent;
        opacity: 1;
        visibility: visible;
    }

    .ebmnt1-header__nav-inner {
        width: auto;
        height: auto;
        overflow: visible;
        flex-direction: row;
        align-items: center;
        gap: 1em;
        padding: 0;
        background-color: transparent;
        transform: none;
        transition: none;
        flex: 1;
        justify-content: flex-end;
    }

    /* الـ Ribbon */
    .ebmnt1-header__menu {
        position: relative;
        isolation: isolate;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        padding: 0.25em 0.6em;
        border-radius: 0.9em;
        background: linear-gradient(180deg, var(--ebmnt1-header-ribbon-start), var(--ebmnt1-header-ribbon-end));
        box-shadow: 0 0.3em 0 -0.05em var(--ebmnt1-header-ribbon-fold-color);
    }

    /* .ebmnt1-header__menu::before,
    .ebmnt1-header__menu::after {
        content: "";
        position: absolute;
        top: 0.55em;
        z-index: -1;
        width: 1.5em;
        height: 100%;
        background-color: var(--ebmnt1-header-ribbon-tail-color);
        background-repeat: no-repeat;
    } */

    /* ذيل الشريط: شكل سمكة (swallowtail) ضحل + مثلث طيّة داكن أسفل الشريط */
    .ebmnt1-header__menu::before {
        right: -1.05em;
        background-image: linear-gradient(to top right, var(--ebmnt1-header-ribbon-fold-color) 50%, transparent 50%);
        background-size: 0.55em 0.55em;
        background-position: left bottom;
        clip-path: polygon(0 0, 100% 0, 80% 50%, 100% 100%, 0 100%);
    }

    .ebmnt1-header__menu::after {
        left: -1.05em;
        background-image: linear-gradient(to top left, var(--ebmnt1-header-ribbon-fold-color) 50%, transparent 50%);
        background-size: 0.55em 0.55em;
        background-position: right bottom;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 20% 50%);
    }

    .ebmnt1-header__item + .ebmnt1-header__item::before {
        content: "";
        position: absolute;
        inset-block: 25%;
        inset-inline-start: 0;
        width: 1px;
        background-color: var(--ebmnt1-header-link-divider-color);
    }

    .ebmnt1-header__link {
        width: auto;
        padding: 0.65em 1.1em;
        border-radius: 0.7em;
    }

    .ebmnt1-header__cta {
        margin-top: 0;
    }

    /* dropdown حقيقي */
    .ebmnt1-header__submenu {
        position: absolute;
        top: 100%;
        inset-inline-start: 0;
        z-index: 10;
        display: flex;
        min-width: 16rem;
        margin-top: 0.6em;
        padding: 0.6em;
        background-color: var(--ebmnt1-header-dropdown-background);
        border: 2px solid var(--ebmnt1-header-dropdown-border-color);
        box-shadow: 0 1em 2em -0.8em var(--ebmnt1-header-shadow-color);
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.6em);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    }

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

    .ebmnt1-header__item--dropdown:hover .ebmnt1-header__caret {
        transform: rotate(180deg);
    }

    .ebmnt1-header__sublink {
        color: var(--ebmnt1-header-dropdown-link-color);
    }

    .ebmnt1-header__sublink i {
        color: var(--ebmnt1-header-dropdown-link-icon-color);
    }

    .ebmnt1-header__sublink:hover {
        background-color: var(--ebmnt1-header-dropdown-link-hover-background);
    }
}
