/* ==========================================================
   header.css — الهيدر (sticky مستقل عن الهيرو)
   ========================================================== */
:root {
  --ebmnt1-header-background-color: var(--ebmnt1-color-white);
  --ebmnt1-header-border-color: var(--ebmnt1-color-border-neutral);
  --ebmnt1-header-scrolled-shadow-color: var(--ebmnt1-color-shadow);
  --ebmnt1-header-logo-text-color: var(--ebmnt1-color-secondary);
  --ebmnt1-header-logo-icon-color: var(--ebmnt1-color-white);
  --ebmnt1-header-logo-icon-gradient: linear-gradient(160deg, var(--ebmnt1-color-primary-light), var(--ebmnt1-color-primary));
  --ebmnt1-header-link-color: var(--ebmnt1-color-secondary);
  --ebmnt1-header-link-hover-color: var(--ebmnt1-color-primary);
  --ebmnt1-header-link-underline-color: var(--ebmnt1-color-primary);
  --ebmnt1-header-chevron-color: var(--ebmnt1-color-text-body);
  --ebmnt1-header-dropdown-background-color: var(--ebmnt1-color-white);
  --ebmnt1-header-dropdown-border-color: var(--ebmnt1-color-border-neutral);
  --ebmnt1-header-dropdown-shadow-color: var(--ebmnt1-color-shadow);
  --ebmnt1-header-dropdown-item-hover-background-color: var(--ebmnt1-color-surface-tint);
  --ebmnt1-header-dropdown-icon-color: var(--ebmnt1-color-primary);
  --ebmnt1-header-circle-button-border-color: var(--ebmnt1-color-border-violet);
  --ebmnt1-header-circle-button-icon-color: var(--ebmnt1-color-primary);
  --ebmnt1-header-circle-button-hover-background-color: var(--ebmnt1-color-primary);
  --ebmnt1-header-circle-button-hover-icon-color: var(--ebmnt1-color-white);
  --ebmnt1-header-burger-icon-color: var(--ebmnt1-color-secondary);
  --ebmnt1-header-burger-border-color: var(--ebmnt1-color-border-neutral);
  --ebmnt1-header-overlay-background-color: var(--ebmnt1-color-overlay-dark);
  --ebmnt1-header-aside-background-color: var(--ebmnt1-color-white);
  --ebmnt1-header-aside-border-color: var(--ebmnt1-color-border-neutral);
  --ebmnt1-header-close-icon-color: var(--ebmnt1-color-secondary);

  --ebmnt1-header-aside-width: min(85%, 20rem);
  --ebmnt1-header-dropdown-width: 17rem;
  --ebmnt1-header-z-index: 1000;
}

.ebmnt1-header {
  position: sticky;
  top: 0;
  z-index: var(--ebmnt1-header-z-index);
  width: 100%;
}

/* ---------- Bar (parent) + inner ---------- */
.ebmnt1-header__bar {
  width: 100%;
  display: flex;
  background-color: var(--ebmnt1-header-background-color);
  border-block-end: 1px solid var(--ebmnt1-header-border-color);
  transition: box-shadow var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

.ebmnt1-header.ebmnt1-is-scrolled .ebmnt1-header__bar {
  box-shadow: 0 8px 24px var(--ebmnt1-header-scrolled-shadow-color);
}

.ebmnt1-header__bar-inner {
  width: var(--ebmnt1-container-gutter);
  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: 1rem;
}

/* ---------- Logo ---------- */
.ebmnt1-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  font-weight: 700;
  color: var(--ebmnt1-header-logo-text-color);
}

.ebmnt1-header__logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background-image: var(--ebmnt1-header-logo-icon-gradient);
  color: var(--ebmnt1-header-logo-icon-color);
  font-size: 1rem;
}

/* ---------- Menu (parent) : overlay on mobile ---------- */
.ebmnt1-header__menu {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  justify-content: flex-start;
  background-color: var(--ebmnt1-header-overlay-background-color);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing),
    visibility var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

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

/* ---------- Menu (inner) : aside on mobile ---------- */
.ebmnt1-header__menu-inner {
  position: relative;
  width: var(--ebmnt1-header-aside-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  overflow-y: auto;
  background-color: var(--ebmnt1-header-aside-background-color);
  border-inline-end: 1px solid var(--ebmnt1-header-aside-border-color);
  transform: translateX(100%);
  transition: transform var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

.ebmnt1-header__menu.ebmnt1-is-open .ebmnt1-header__menu-inner {
  transform: translateX(0);
}

.ebmnt1-header__aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-block-end: 1px solid var(--ebmnt1-header-aside-border-color);
}

.ebmnt1-header__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--ebmnt1-header-burger-border-color);
  border-radius: 50%;
  color: var(--ebmnt1-header-close-icon-color);
}

.ebmnt1-header__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-inline: 1rem;
}

.ebmnt1-header__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 0.5rem;
  font-size: var(--ebmnt1-font-size-item-title);
  font-weight: 600;
  color: var(--ebmnt1-header-link-color);
  transition: color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

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

.ebmnt1-header__chevron {
  font-size: 0.65em;
  color: var(--ebmnt1-header-chevron-color);
  transition: transform var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

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

/* Dropdown (accordion on mobile) */
.ebmnt1-header__dropdown {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

.ebmnt1-header__item.ebmnt1-is-open > .ebmnt1-header__dropdown {
  grid-template-rows: 1fr;
}

.ebmnt1-header__dropdown-list {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ebmnt1-header__dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: var(--ebmnt1-font-size-body);
  font-weight: 500;
  color: var(--ebmnt1-header-link-color);
  transition: background-color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing),
    color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

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

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

.ebmnt1-header__aside-cta {
  display: flex;
  padding: 1rem;
}

.ebmnt1-header__aside-cta .ebmnt1-btn {
  width: 100%;
}

/* ---------- Actions ---------- */
.ebmnt1-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ebmnt1-header__cta {
  display: none;
}

.ebmnt1-header__circle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 3.125rem;
  height: 3.125rem;
  border: 1px solid var(--ebmnt1-header-circle-button-border-color);
  border-radius: 50%;
  color: var(--ebmnt1-header-circle-button-icon-color);
  transition: background-color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing),
    color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

.ebmnt1-header__circle:hover {
  background-color: var(--ebmnt1-header-circle-button-hover-background-color);
  color: var(--ebmnt1-header-circle-button-hover-icon-color);
}

.ebmnt1-header__burger {
  position: relative;
  z-index: 1002;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ebmnt1-header-burger-border-color);
  border-radius: 12px;
  font-size: 1.2rem;
  color: var(--ebmnt1-header-burger-icon-color);
  background-color: var(--ebmnt1-header-background-color);
}

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

.ebmnt1-header__burger[aria-expanded="true"] .ebmnt1-header__burger-open {
  display: none;
}

.ebmnt1-header__burger[aria-expanded="true"] .ebmnt1-header__burger-close {
  display: inline;
}

@media (min-width: 425px) {
  .ebmnt1-header__circle {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .ebmnt1-header__cta {
    display: inline-flex;
  }

  .ebmnt1-header__aside-cta {
    display: none;
  }

  .ebmnt1-header__menu-inner {
    --ebmnt1-header-aside-width: 24rem;
  }
}

/* ---------- Desktop (>=1024): inline menu ---------- */
@media (min-width: 1024px) {
  .ebmnt1-header__burger,
  .ebmnt1-header__aside-head {
    display: none;
  }

  .ebmnt1-header__menu {
    position: static;
    z-index: auto;
    flex: 1;
    justify-content: center;
    background-color: transparent;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .ebmnt1-header__menu-inner {
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    overflow: visible;
    background-color: transparent;
    border: 0;
    transform: none;
    transition: none;
  }

  .ebmnt1-header__list {
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    padding-inline: 0;
  }

  .ebmnt1-header__item {
    position: relative;
  }

  .ebmnt1-header__link {
    width: auto;
    min-height: var(--ebmnt1-header-height);
    padding: 0;
    font-size: var(--ebmnt1-font-size-body);
  }

  .ebmnt1-header__link::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ebmnt1-header-link-underline-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
  }

  .ebmnt1-header__link:hover::after,
  .ebmnt1-header__link.ebmnt1-is-active::after {
    transform: scaleX(1);
  }

  .ebmnt1-header__dropdown {
    position: absolute;
    top: calc(100% - 0.75rem);
    inset-inline-start: 50%;
    width: var(--ebmnt1-header-dropdown-width);
    display: block;
    padding: 0.5rem;
    border: 1px solid var(--ebmnt1-header-dropdown-border-color);
    border-radius: var(--ebmnt1-radius-card);
    background-color: var(--ebmnt1-header-dropdown-background-color);
    box-shadow: 0 18px 40px var(--ebmnt1-header-dropdown-shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translate(50%, 10px);
    transition: opacity 0.25s var(--ebmnt1-transition-easing), transform 0.25s var(--ebmnt1-transition-easing),
      visibility 0.25s var(--ebmnt1-transition-easing);
  }

  [dir="ltr"] .ebmnt1-header__dropdown {
    transform: translate(-50%, 10px);
  }

  .ebmnt1-header__item:hover > .ebmnt1-header__dropdown,
  .ebmnt1-header__item:focus-within > .ebmnt1-header__dropdown,
  .ebmnt1-header__item.ebmnt1-is-open > .ebmnt1-header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(50%, 0);
  }

  .ebmnt1-header__item:hover > .ebmnt1-header__link .ebmnt1-header__chevron,
  .ebmnt1-header__item:focus-within > .ebmnt1-header__link .ebmnt1-header__chevron {
    transform: rotate(180deg);
  }

  .ebmnt1-header__dropdown-list {
    overflow: visible;
  }

  .ebmnt1-header__dropdown-link {
    padding: 0.7rem 0.85rem;
  }
}
