/* ============================================================
   AELAANY — HEADER CSS
   Sticky, transparent → solid, dropdown, language switcher
   ============================================================ */

/* ── Elementor Header Wrapper ───────────────────────────── */
.e-header,
#site-header,
.elementor-location-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

/* Header always solid — transparent effect removed for reliability */
.e-header,
.elementor-location-header {
  background: var(--clr-primary-dark);
}

/* Solid state — on scroll OR inner pages */
.header-solid .e-header,
.header-solid .elementor-location-header,
.e-header.scrolled,
.elementor-location-header.scrolled {
  background: var(--clr-primary-dark);
  box-shadow: var(--shadow-header);
}

/* Compensate for fixed header */
body {
  padding-top: 80px;
}

/* Compensate for WordPress admin bar */
.admin-bar .e-header,
.admin-bar .elementor-location-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .e-header,
  .admin-bar .elementor-location-header {
    top: 46px;
  }
}

/* ── Nav Container ──────────────────────────────────────── */
.aelaany-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  gap: 24px;
}

/* ── Logo ───────────────────────────────────────────────── */
.aelaany-logo {
  flex-shrink: 0;
}

.aelaany-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* ── Primary Nav Menu ───────────────────────────────────── */
.aelaany-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.aelaany-menu > li {
  position: relative;
}

.aelaany-menu > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-white);
  border-radius: var(--radius-btn);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.aelaany-menu > li > a:hover,
.aelaany-menu > li.current-menu-item > a {
  background: rgba(255, 255, 255, 0.12);
  color: var(--clr-white);
}

/* Dropdown arrow */
.aelaany-menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.aelaany-menu > li.menu-item-has-children:hover > a::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* ── Dropdown Menu ──────────────────────────────────────── */
.aelaany-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--clr-white);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  border: 1px solid var(--clr-border);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 100;
}

body.lang-ar .aelaany-menu .sub-menu {
  left: auto;
  right: 0;
}

.aelaany-menu > li:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.aelaany-menu .sub-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-text-dark);
  border-radius: 8px;
  transition: var(--transition-fast);
}

.aelaany-menu .sub-menu li a:hover {
  background: var(--clr-bg-light);
  color: var(--clr-primary);
}

.aelaany-menu .sub-menu li a .menu-icon {
  width: 32px;
  height: 32px;
  background: var(--clr-bg-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  flex-shrink: 0;
}

/* ── Header Right (Lang + CTA) ──────────────────────────── */
.aelaany-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Language Switcher ──────────────────────────────────── */
.aelaany-lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.aelaany-lang-switcher a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition-fast);
  border-radius: var(--radius-pill);
}

.aelaany-lang-switcher a.active,
.aelaany-lang-switcher a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--clr-white);
}

.lang-flag {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── CTA Button ─────────────────────────────────────────── */
.aelaany-header-cta {
  background: var(--gradient-main);
  color: var(--clr-white) !important;
  padding: 10px 22px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
  transition: var(--transition);
}

.aelaany-header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27, 79, 216, 0.5);
  color: var(--clr-white) !important;
}

/* ── Mobile Menu Toggle ─────────────────────────────────── */
.aelaany-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: none;
  width: 42px;
  height: 42px;
}

.aelaany-mobile-toggle span {
  display: block;
  height: 2px;
  background: var(--clr-white);
  border-radius: 2px;
  transition: var(--transition);
}

.aelaany-mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.aelaany-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}
.aelaany-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu — hidden on desktop ────────────────────── */
.aelaany-mobile-menu {
  display: none;
}

/* ── Mobile Navigation ──────────────────────────────────── */
@media (max-width: 1024px) {
  .aelaany-menu,
  .aelaany-header-right .aelaany-lang-switcher,
  .aelaany-header-cta {
    display: none;
  }

  .aelaany-mobile-toggle {
    display: flex;
  }

  /* Mobile menu panel */
  .aelaany-mobile-menu {
    display: block;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--clr-primary-dark);
    z-index: 9998;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  body.lang-ar .aelaany-mobile-menu {
    transform: translateX(100%);
  }

  .aelaany-mobile-menu.open {
    transform: translateX(0);
  }

  .aelaany-mobile-menu ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .aelaany-mobile-menu ul a {
    display: block;
    padding: 14px 16px;
    color: var(--clr-white);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-fast);
  }

  .aelaany-mobile-menu ul a:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .aelaany-mobile-menu .sub-menu {
    padding-left: 16px;
    margin-top: 4px;
  }

  body.lang-ar .aelaany-mobile-menu .sub-menu {
    padding-left: 0;
    padding-right: 16px;
  }

  .aelaany-mobile-menu .sub-menu a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
  }

  /* Language + CTA at bottom of mobile menu */
  .aelaany-mobile-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .aelaany-mobile-footer .aelaany-lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    align-self: flex-start;
  }

  .aelaany-mobile-footer .aelaany-header-cta {
    display: block;
    text-align: center;
    padding: 14px;
  }
}

/* Breadcrumb (inner pages) */
.aelaany-breadcrumb {
  padding: 12px 0;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.7);
}

.aelaany-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}

.aelaany-breadcrumb a:hover {
  color: var(--clr-white);
}

.aelaany-breadcrumb .sep {
  margin: 0 6px;
}

.aelaany-breadcrumb .current {
  color: var(--clr-white);
}
