/* ══════════════════════════════════════════════
   MUTEKI GROUP — HEADER / NAVBAR
   Glassmorphism nav · Logo · Links · Mobile Menu
   ══════════════════════════════════════════════ */

/* ── Site Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 66px;
  z-index: 1000;
  transition: box-shadow 0.25s, background 0.25s;
}

/* ── Main Nav Bar ── */
.main-navigation {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 48px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s, box-shadow 0.25s;
}

.site-header.scrolled .main-navigation {
  background: rgba(255,255,255,0.97);
  box-shadow: var(--shadow-md);
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--indigo);
  border-radius: 9px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px var(--indigo-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.logo-mark:hover {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 6px 22px rgba(91,79,232,0.4);
}
.logo-mark svg {
  width: 18px;
  height: 18px;
}

.logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.4px;
}

/* ── Nav Links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0 28px;
}

.nav-links > li > a {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sub);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.nav-links > li > a:hover,
.nav-links > li > a.current {
  color: var(--ink);
  background: var(--bg3);
}

/* ── Nav Right Actions ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--indigo);
  border: 1.5px solid var(--border-i);
  background: var(--indigo-soft);
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, border-color 0.15s;
}
.nav-pill:hover {
  background: #E0DDFF;
  border-color: var(--indigo-light);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--indigo);
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 9px;
  box-shadow: 0 2px 0 #3D32C4, 0 6px 20px var(--indigo-glow);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.nav-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.4s;
}
.nav-cta:hover::before {
  left: 100%;
}
.nav-cta:hover {
  background: var(--indigo-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #3D32C4, 0 12px 32px rgba(91,79,232,0.38);
}
.nav-cta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   LANGUAGE SWITCHER DROPDOWN
   ══════════════════════════════════════ */
.lang-switcher {
  position: relative;
  z-index: 1001;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--indigo);
  border: 1.5px solid var(--border-i);
  background: var(--indigo-soft);
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.lang-current:hover {
  background: #E0DDFF;
  border-color: var(--indigo-light);
}
.lang-current img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
}
.lang-code {
  font-weight: 700;
}
.lang-caret {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.lang-switcher.is-open .lang-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* ── Dropdown Panel ── */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}
.lang-switcher.is-open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Language Options ── */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.15s;
  color: var(--ink);
}
.lang-option:hover {
  background: #f8f9fb;
  color: var(--ink);
}
.lang-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.lang-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
}
.lang-slug {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   MEGA MENU (SERVICES) — Redesigned
   ══════════════════════════════════════ */
.has-mega-menu {
  position: static !important;
}

.has-mega-menu .menu-caret {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: middle;
  margin-top: -2px;
  transition: transform 0.25s ease;
  opacity: 0.7;
}

.has-mega-menu:hover .menu-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* ── Dropdown Wrapper ── */
.mega-menu-wrapper {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s;
  z-index: 990;
  pointer-events: none;
}

.has-mega-menu:hover .mega-menu-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Inner Card (full-width bg, centered content) ── */
.mega-menu-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: transparent;
  padding: 32px 0;
}

/* ── 4-Column Grid ── */
.mega-menu-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 24px;
}

.mega-col {
  position: relative;
}

/* Faint vertical dividers between columns */
.mega-col:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #f1f5f9;
}

/* ── Column Headers ── */
.mega-col .col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.mega-col .col-header .icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mega-col .col-header .icon-wrapper svg {
  width: 14px;
  height: 14px;
}

/* ── Color Themes ── */
/* Core Services — Indigo */
.theme-core .col-header { color: #5a45ff; }
.theme-core .icon-wrapper { background-color: #f0edff; }
.theme-core .icon-wrapper svg { fill: #5a45ff; }
.theme-core hr { border: 0; height: 2px; background-color: #5a45ff; margin-bottom: 20px; }

/* Mobile App Dev — Emerald */
.theme-mobile .col-header { color: #10b981; }
.theme-mobile .icon-wrapper { background-color: #e6f8f3; }
.theme-mobile .icon-wrapper svg { fill: #10b981; }
.theme-mobile hr { border: 0; height: 2px; background-color: #10b981; margin-bottom: 20px; }

/* Web Development — Amber */
.theme-web .col-header { color: #d97706; }
.theme-web .icon-wrapper { background-color: #fef3c7; }
.theme-web .icon-wrapper svg { fill: #d97706; stroke: #d97706; }
.theme-web hr { border: 0; height: 2px; background-color: #fbbf24; margin-bottom: 20px; }

/* AI Services — Violet */
.theme-ai .col-header { color: #8b5cf6; }
.theme-ai .icon-wrapper { background-color: #f3e8ff; }
.theme-ai .icon-wrapper svg { fill: transparent; stroke: #8b5cf6; stroke-width: 2; }
.theme-ai hr { border: 0; height: 2px; background-color: #8b5cf6; margin-bottom: 20px; }

/* ── Link Lists ── */
.mega-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-list li {
  margin-bottom: 14px;
}

.mega-list a {
  text-decoration: none;
  color: #475569;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
  padding: 0;
  background: none;
}

.mega-list a:hover {
  color: #0f172a;
  background: none;
  transform: none;
}

/* ── Badges ── */
.mega-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 8px;
}

.badge-new {
  background-color: #f0edff;
  color: #5a45ff;
}

.badge-hot {
  background-color: #ffe4e6;
  color: #e11d48;
}

/* ── Footer: View All + Industries ── */
.mega-menu-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.mega-btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5a45ff;
  border: 1px solid #5a45ff;
  background: transparent;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.mega-btn-view-all:hover {
  background-color: #f0edff;
  color: #5a45ff;
  transform: none;
}

/* Industries */
.mega-industries-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.mega-industries-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mega-industry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mega-tag {
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  text-decoration: none;
  background-color: #ffffff;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.mega-tag:hover {
  border-color: #cbd5e1;
  color: #0f172a;
  background: none;
  transform: none;
}

/* ══════════════════════════════════════
   MOBILE HAMBURGER MENU
   ══════════════════════════════════════ */

/* Hamburger Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 8px;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1002;
}
.menu-toggle:hover {
  background: var(--bg3);
}

.menu-toggle .hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: absolute;
  left: 8px;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
              opacity 0.2s,
              top 0.3s cubic-bezier(0.16,1,0.3,1);
}
.menu-toggle .hamburger-line:nth-child(1) { top: 10px; }
.menu-toggle .hamburger-line:nth-child(2) { top: 17px; }
.menu-toggle .hamburger-line:nth-child(3) { top: 24px; }

/* X animation when open */
.menu-toggle.is-active .hamburger-line:nth-child(1) {
  top: 17px;
  transform: rotate(45deg);
}
.menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-active .hamburger-line:nth-child(3) {
  top: 17px;
  transform: rotate(-45deg);
}

/* ── Mobile Drawer ── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  padding: 32px 28px 40px;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
              opacity 0.25s;
  overflow-y: auto;
}
.mobile-drawer.is-open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-drawer .mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 28px;
}

/* Strip default list styles from wp_nav_menu output */
.mobile-drawer .mobile-nav-links ul,
.mobile-drawer .mobile-nav-links li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-drawer .mobile-nav-links a {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}
.mobile-drawer .mobile-nav-links a:hover,
.mobile-drawer .mobile-nav-links a.current {
  background: var(--bg3);
  color: var(--indigo);
}

/* Mobile Mega Menu Accordion Overrides */
.mobile-drawer .has-mega-menu {
  position: relative !important;
}
.mobile-drawer .has-mega-menu > a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}
.mobile-drawer .has-mega-menu > a .menu-caret {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
  margin: 0;
}
.mobile-drawer .has-mega-menu.is-expanded > a .menu-caret {
  transform: rotate(180deg);
}

.mobile-drawer .mega-menu-wrapper {
  position: static;
  opacity: 1;
  visibility: hidden;
  display: none;
  transform: none;
  box-shadow: none;
  background: transparent;
  border: none;
  padding: 0 0 16px 16px;
  pointer-events: auto;
}
.mobile-drawer .has-mega-menu.is-expanded .mega-menu-wrapper {
  display: block;
  visibility: visible;
}

.mobile-drawer .mega-menu-inner {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
.mobile-drawer .mega-menu-columns {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  border-left: 2px solid var(--border-i);
  padding-left: 16px;
  border-bottom: none;
  margin-bottom: 12px;
}
.mobile-drawer .mega-col::after {
  display: none;
}
.mobile-drawer .mega-col .col-header {
  font-size: 12px;
  margin-bottom: 8px;
}
.mobile-drawer .mega-col hr {
  height: 1px;
  margin-bottom: 10px;
}
.mobile-drawer .mega-list {
  gap: 4px;
}
.mobile-drawer .mega-list li {
  margin-bottom: 4px;
}
.mobile-drawer .mega-list a {
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ink);
  background: none;
}
.mobile-drawer .mega-list a:hover {
  background: none;
  color: var(--indigo);
}
.mobile-drawer .mega-badge {
  font-size: 10px;
  padding: 2px 5px;
}
.mobile-drawer .mega-menu-footer {
  flex-direction: column;
  gap: 12px;
  padding-left: 16px;
}
.mobile-drawer .mega-btn-view-all {
  font-size: 12.5px;
  padding: 6px 12px;
}
.mobile-drawer .mega-industries-wrapper {
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer .mega-industry-tags {
  gap: 6px;
}
.mobile-drawer .mega-tag {
  font-size: 11px;
  padding: 4px 10px;
}

.mobile-drawer .mobile-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.mobile-drawer .mobile-cta .nav-cta {
  justify-content: center;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
}

/* ── Overlay ── */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,45,0.3);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}
.menu-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════ */

/* Tablet */
@media (max-width: 960px) {
  .main-navigation {
    padding: 0 28px;
  }
  .nav-links {
    display: none;
  }
  .nav-right .nav-cta {
    display: none;
  }
  .nav-right .nav-pill {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .site-header {
    height: 56px;
  }
  .main-navigation {
    padding: 0 16px;
  }
  .mobile-drawer {
    top: 56px;
  }
  .logo-mark {
    width: 30px;
    height: 30px;
  }
  .logo-name {
    font-size: 16px;
  }
  .nav-cta {
    padding: 7px 14px;
    font-size: 12px;
  }
  .nav-pill {
    padding: 4px 10px;
    font-size: 11px;
  }
}

/* ======================================
   RTL (ARABIC) SUPPORT
   ====================================== */
html[dir="rtl"] .nav-logo {
  margin-right: 0;
  margin-left: auto;
}

html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

html[dir="rtl"] .has-mega-menu .menu-caret {
  margin-left: 0;
  margin-right: 4px;
}

html[dir="rtl"] .mega-col:not(:last-child)::after {
  right: auto;
  left: -20px;
}

html[dir="rtl"] .menu-toggle {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .menu-toggle .hamburger-line {
  left: auto;
  right: 8px;
}

html[dir="rtl"] .mobile-drawer .mega-menu-columns {
  border-left: none;
  border-right: 2px solid var(--border-i);
  padding-left: 0;
  padding-right: 16px;
}

html[dir="rtl"] .mobile-drawer .mega-menu-footer {
  padding-left: 0;
  padding-right: 16px;
}

html[dir="rtl"] .mobile-drawer .mega-menu-wrapper {
  padding: 0 16px 16px 0;
}

html[dir="rtl"] .nav-cta::before {
  left: auto;
  right: -100%;
}

html[dir="rtl"] .nav-cta:hover::before {
  left: auto;
  right: 100%;
}

html[dir="rtl"] .mega-badge {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .mega-btn-view-all svg {
  transform: rotate(180deg);
}
html[dir="rtl"] .nav-cta::before {
  transition: right 0.4s;
}

/* ======================================
   Fixing Brand & UI Elements for RTL
   ====================================== */
/* Keep Brand Logo LTR so the icon stays on the left of the text */
html[dir="rtl"] .nav-logo {
  direction: ltr;
}

/* Keep the language switcher pill LTR so it reads [Flag] AR [Caret] */
html[dir="rtl"] .lang-current {
  direction: ltr;
}

/* Flip the arrow inside the Contact Us CTA button to point left */
html[dir="rtl"] .nav-cta svg {
  transform: rotate(180deg);
}

/* Ensure dropdown options text is aligned correctly */
html[dir="rtl"] .lang-dropdown {
  text-align: right;
}

/* Keep English strings in language dropdown LTR */
html[dir="rtl"] .lang-option {
  direction: ltr;
  justify-content: flex-end;
}
