/**
 * Mokawala Global Header - Production CSS
 * Version: 2.0 (MOK-P2-FACTORY-002)
 * Mobile-First, Accessible, Zero Layout Shift, Native RTL/LTR
 */

:root {
  --mkw-hdr-primary: #ea580c;
  --mkw-hdr-primary-dark: #c2410c;
  --mkw-hdr-slate-900: #0f172a;
  --mkw-hdr-slate-800: #1e293b;
  --mkw-hdr-slate-700: #334155;
  --mkw-hdr-slate-600: #475569;
  --mkw-hdr-slate-500: #64748b;
  --mkw-hdr-slate-400: #94a3b8;
  --mkw-hdr-slate-200: #e2e8f0;
  --mkw-hdr-slate-100: #f1f5f9;
  --mkw-hdr-slate-50: #f8fafc;
}

/* 1. MICRO TRUST BAR (ROW 1) */
.mkw-topbar {
  background: var(--mkw-hdr-slate-900);
  color: var(--mkw-hdr-slate-400);
  font-size: 12px;
  line-height: 1.2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1002;
}

.mkw-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mkw-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mkw-pulse-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: mkwPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes mkwPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.mkw-topbar-trust-text {
  color: #cbd5e1;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.mkw-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mkw-topbar-wa-link {
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.mkw-topbar-wa-link:hover {
  color: #4ade80;
  text-decoration: underline;
}

.mkw-topbar-phone {
  color: var(--mkw-hdr-slate-400);
  font-family: inherit;
  font-weight: 500;
}

.mkw-topbar-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* 2. MAIN GLOBAL HEADER (ROW 2) */
.mkw-header {
  background: #ffffff;
  border-bottom: 1px solid var(--mkw-hdr-slate-200);
  position: relative;
  z-index: 1001;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mkw-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mkw-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mkw-logo-link {
  display: block;
  text-decoration: none;
}

.mkw-logo-img {
  height: 42px;
  width: auto;
  max-width: 185px;
  display: block;
  object-fit: contain;
}

.mkw-desktop-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.mkw-nav-list {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.mkw-nav-item {
  position: relative;
  list-style: none;
}

.mkw-nav-link {
  color: var(--mkw-hdr-slate-800);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mkw-nav-link:hover,
.mkw-nav-item:hover > .mkw-nav-link {
  color: var(--mkw-hdr-primary);
  background-color: var(--mkw-hdr-slate-50);
}

.mkw-chevron-icon {
  transition: transform 0.2s ease;
  display: inline-block;
  opacity: 0.7;
}

.mkw-nav-item:hover .mkw-chevron-icon {
  transform: rotate(180deg);
}

.mkw-dropdown-menu {
  position: absolute;
  top: 100%;
  inset-inline-start: -10px;
  width: 480px;
  background: #ffffff;
  border: 1px solid var(--mkw-hdr-slate-200);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1010;
}

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

.mkw-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mkw-dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mkw-dropdown-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mkw-hdr-slate-500);
  padding: 4px 8px;
  border-bottom: 1px solid var(--mkw-hdr-slate-100);
  margin-bottom: 4px;
}

.mkw-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.mkw-dropdown-item:hover {
  background-color: var(--mkw-hdr-slate-50);
}

.mkw-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--mkw-hdr-slate-900);
  margin-bottom: 2px;
}

.mkw-dropdown-item:hover .mkw-item-title {
  color: var(--mkw-hdr-primary);
}

.mkw-item-desc {
  font-size: 11px;
  color: var(--mkw-hdr-slate-500);
  line-height: 1.3;
}

/* 3. HEADER ACTIONS */
.mkw-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.mkw-lang-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--mkw-hdr-slate-100);
  border: 1px solid var(--mkw-hdr-slate-200);
  border-radius: 6px;
  padding: 3px 5px;
}

.mkw-lang-btn {
  color: var(--mkw-hdr-slate-600);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.mkw-lang-btn:hover {
  color: var(--mkw-hdr-slate-900);
}

.mkw-lang-btn.active {
  background: #ffffff;
  color: var(--mkw-hdr-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mkw-lang-sep {
  color: var(--mkw-hdr-slate-300);
  font-size: 11px;
}

.mkw-header-cta {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.mkw-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.38);
}

.mkw-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--mkw-hdr-slate-200);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  padding: 9px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: background-color 0.15s;
}

.mkw-mobile-toggle:hover {
  background: var(--mkw-hdr-slate-100);
}

.mkw-bar {
  width: 22px;
  height: 2px;
  background: var(--mkw-hdr-slate-800);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 4. SLIDE-IN MOBILE DRAWER */
.mkw-mobile-drawer {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.25);
  z-index: 99999;
  visibility: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  display: flex;
  flex-direction: column;
}

[dir="rtl"] .mkw-mobile-drawer {
  transform: translateX(-100%);
  box-shadow: 8px 0 30px rgba(15, 23, 42, 0.25);
}

.mkw-mobile-drawer.open {
  visibility: visible !important;
  transform: translateX(0) !important;
}

.mkw-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mkw-hdr-slate-200);
}

.mkw-drawer-logo {
  height: 32px;
  width: auto;
}

.mkw-drawer-close {
  background: var(--mkw-hdr-slate-100);
  border: none;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--mkw-hdr-slate-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.mkw-drawer-close:hover {
  background: var(--mkw-hdr-slate-200);
}

.mkw-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mkw-drawer-cta-top {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 12px 18px;
  font-size: 14.5px;
}

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

.mkw-mobile-nav li a {
  display: block;
  padding: 10px 12px;
  color: var(--mkw-hdr-slate-800);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
}

.mkw-mobile-nav li a:hover,
.mkw-mobile-nav li a:focus {
  background: var(--mkw-hdr-slate-100);
  color: var(--mkw-hdr-primary);
}

.mkw-drawer-group-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--mkw-hdr-slate-500);
  letter-spacing: 0.05em;
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--mkw-hdr-slate-100);
}

.mkw-drawer-subnav {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[dir="rtl"] .mkw-drawer-subnav {
  padding: 0 10px 0 0;
}

.mkw-drawer-subnav li a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mkw-hdr-slate-600);
  padding: 8px 10px;
}

.mkw-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--mkw-hdr-slate-200);
  background: var(--mkw-hdr-slate-50);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mkw-drawer-langs {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.mkw-drawer-langs a {
  color: var(--mkw-hdr-slate-600);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
}

.mkw-drawer-langs a.active {
  background: var(--mkw-hdr-primary);
  color: #ffffff;
}

.mkw-drawer-wa-btn {
  background: #22c55e;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  display: block;
}

.mkw-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.mkw-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 5. RESPONSIVE BREAKPOINTS */
@media (max-width: 1199px) and (min-width: 992px) {
  .mkw-nav-list {
    gap: 10px;
  }
  .mkw-nav-link {
    font-size: 13.5px;
    padding: 6px 4px;
  }
  .mkw-header-cta {
    font-size: 12.5px;
    padding: 8px 14px;
  }
  .mkw-logo-img {
    height: 38px;
  }
}

@media (max-width: 991px) {
  .mkw-desktop-nav {
    display: none !important;
  }
  .mkw-mobile-toggle {
    display: flex !important;
  }
  .mkw-header-inner {
    height: 60px;
  }
  .mkw-logo-img {
    height: 34px;
  }
  .mkw-topbar-left {
    max-width: 65%;
  }
  .mkw-topbar-trust-text {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mkw-topbar-phone {
    display: none;
  }
  .mkw-topbar-sep {
    display: none;
  }
}

@media (max-width: 520px) {
  .mkw-topbar-inner {
    justify-content: center;
  }
  .mkw-topbar-right {
    display: none;
  }
  .mkw-topbar-trust-text {
    text-align: center;
  }
  .mkw-header-cta {
    padding: 6px 10px;
    font-size: 12px;
  }
  .mkw-header-actions .mkw-lang-switcher {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mkw-mobile-drawer,
  .mkw-drawer-backdrop,
  .mkw-dropdown-menu,
  .mkw-header-cta,
  .mkw-pulse-dot {
    animation: none !important;
    transition: none !important;
  }
}
