/* ==========================================================================
   Astra Jordan - Modern Responsive Header Navigation System
   Optimized for Desktop, Tablet, Mobile, and RTL/LTR Support
   ========================================================================== */

/* Modern Reset & Scoped Container Defaults */
.astra-modern-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999999 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(128, 157, 176, 0.18) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
  direction: inherit;
}

.astra-modern-header.scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08) !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

.astra-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Brand / Logo */
.astra-nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.astra-nav-brand:hover {
  transform: translateY(-1px);
}

.astra-nav-logo {
  height: 48px;
  width: auto;
  max-width: 230px;
  object-fit: contain;
}

/* Desktop Navigation Menu */
.astra-desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.astra-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.astra-nav-link:hover,
.astra-nav-item.active .astra-nav-link {
  background: rgba(128, 157, 176, 0.12);
  color: #809db0;
}

/* Dropdown Container & Menu */
.astra-nav-item {
  position: relative;
}

.astra-dropdown-caret {
  width: 15px;
  height: 15px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.astra-nav-item:hover .astra-dropdown-caret,
.astra-nav-item.dropdown-open .astra-dropdown-caret {
  transform: rotate(180deg);
}

.astra-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 260px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(128, 157, 176, 0.16);
  padding: 8px;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000000;
}

/* Positioning based on document direction */
[dir="rtl"] .astra-dropdown-menu,
.astra-dropdown-menu[dir="rtl"] {
  right: 0;
  left: auto;
}

[dir="ltr"] .astra-dropdown-menu,
.astra-dropdown-menu[dir="ltr"],
:root:not([dir="rtl"]) .astra-dropdown-menu {
  left: 0;
  right: auto;
}

.astra-nav-item:hover .astra-dropdown-menu,
.astra-nav-item.dropdown-open .astra-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.astra-dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #34495e;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.astra-dropdown-link:hover {
  background: rgba(128, 157, 176, 0.1);
  color: #809db0;
  padding-inline-start: 20px;
}

.astra-dropdown-link .ext-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(128, 157, 176, 0.15);
  color: #809db0;
}

/* Header Action Tools (Language Switcher) */
.astra-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.astra-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(128, 157, 176, 0.1);
  border: 1px solid rgba(128, 157, 176, 0.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 700;
}

.astra-lang-switcher a {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.astra-lang-switcher a:hover {
  color: #809db0;
}

.astra-lang-switcher .active-lang {
  color: #809db0;
  font-weight: 800;
}

.astra-lang-switcher .divider {
  color: #ccc;
  font-weight: 400;
}

/* Mobile Hamburger Toggle Button */
.astra-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  color: #2c3e50;
  transition: background 0.2s ease;
}

.astra-mobile-toggle:hover {
  background: rgba(128, 157, 176, 0.12);
}

.astra-hamburger-icon {
  width: 28px;
  height: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.astra-hamburger-icon span {
  display: block;
  height: 2.5px;
  width: 100%;
  background-color: #2c3e50;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.astra-mobile-toggle.is-active .astra-hamburger-icon span:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}

.astra-mobile-toggle.is-active .astra-hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.astra-mobile-toggle.is-active .astra-hamburger-icon span:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* Mobile Off-Canvas Drawer & Overlay - Absolute Highest Priority Foreground (z-index: 2147483647) */
.astra-mobile-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease !important;
  z-index: 2147483646 !important;
}

.astra-mobile-backdrop.is-active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.astra-mobile-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  width: 330px !important;
  max-width: 85vw !important;
  background: #ffffff !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.3) !important;
  z-index: 2147483647 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
}

/* Off-screen default LTR */
.astra-mobile-drawer,
.astra-mobile-drawer[dir="ltr"],
[dir="ltr"] .astra-mobile-drawer {
  left: 0 !important;
  right: auto !important;
  transform: translateX(-100%);
}

/* Off-screen default RTL */
.astra-mobile-drawer[dir="rtl"],
.astra-mobile-drawer.is-rtl,
[dir="rtl"] .astra-mobile-drawer,
body[data-dir="rtl"] .astra-mobile-drawer {
  right: 0 !important;
  left: auto !important;
  transform: translateX(100%);
}

/* Active State: Overrides translateX for BOTH RTL & LTR */
.astra-mobile-drawer.is-active,
.astra-mobile-drawer[dir="rtl"].is-active,
.astra-mobile-drawer[dir="ltr"].is-active,
.astra-mobile-drawer.is-rtl.is-active,
[dir="rtl"] .astra-mobile-drawer.is-active,
[dir="ltr"] .astra-mobile-drawer.is-active,
body[data-dir="rtl"] .astra-mobile-drawer.is-active {
  transform: translateX(0) !important;
}

.astra-drawer-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(128, 157, 176, 0.15);
}

.astra-drawer-close {
  background: transparent;
  border: none;
  font-size: 26px;
  color: #777;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.astra-drawer-close:hover {
  background: #f0f4f8;
  color: #333;
}

.astra-mobile-menu {
  list-style: none;
  padding: 18px 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.astra-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 600;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.astra-mobile-link:hover,
.astra-mobile-link.active {
  background: rgba(128, 157, 176, 0.12);
  color: #809db0;
}

.astra-mobile-submenu {
  list-style: none;
  padding: 0 0 0 18px;
  margin: 4px 0 0 0;
  display: none;
  flex-direction: column;
  gap: 4px;
}

[dir="rtl"] .astra-mobile-submenu,
.astra-mobile-drawer[dir="rtl"] .astra-mobile-submenu {
  padding: 0 18px 0 0;
}

.astra-mobile-submenu.is-open {
  display: flex !important;
}

.astra-mobile-sublink {
  display: block;
  padding: 11px 18px;
  font-size: 15.5px;
  font-weight: 500;
  color: #555555;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.astra-mobile-sublink:hover {
  background: rgba(128, 157, 176, 0.08);
  color: #809db0;
}

.astra-drawer-footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid rgba(128, 157, 176, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
  .astra-desktop-nav {
    display: none !important;
  }

  .astra-mobile-toggle {
    display: flex !important;
  }

  .astra-nav-container {
    height: 72px;
    padding: 0 18px;
  }

  .astra-nav-logo {
    height: 42px;
  }
}