/* ================================================================
   MAKREO — Site Header  (header.css  v2.0)
   Scoped under .mk-header so nothing bleeds into page content.
   Depends: Font Awesome 5 (already loaded by the theme)
   ================================================================ */

/* ── Custom properties ────────────────────────────────────────── */
:root {
  --mk-hdr-bg            : #ffffff;
  --mk-hdr-border        : #e7ecf5;
  --mk-hdr-shadow        : 0 4px 24px rgba(15, 23, 42, 0.08);
  --mk-hdr-shadow-soft   : 0 2px 10px rgba(15, 23, 42, 0.06);
  --mk-hdr-height        : 64px;
  --mk-hdr-height-mob    : 62px;
  --mk-hdr-z             : 99000;

  --mk-brand-color       : #1f2a44;
  --mk-nav-text          : #27324b;
  --mk-nav-hover         : #2757d6;
  --mk-nav-active        : #2757d6;
  --mk-nav-fs            : 15px;
  --mk-nav-fw            : 600;

  --mk-accent            : #2757d6;
  --mk-accent-purple     : #7c3aed;

  --mk-drop-bg           : #ffffff;
  --mk-drop-border       : #e7ecf5;
  --mk-drop-shadow       : 0 20px 48px rgba(15, 23, 42, 0.13);
  --mk-drop-radius       : 14px;
  --mk-drop-row-hover    : #f4f7ff;
  --mk-drop-text         : #27324b;
  --mk-drop-text-hover   : #2757d6;

  --mk-pill-border       : #d8dfeb;
  --mk-transition        : 0.18s ease;
  --mk-drawer-w          : 300px;
  --mk-backdrop          : rgba(15, 23, 42, 0.45);
}

/* ════════════════════════════════════════════════════════════════
   1. HEADER SHELL
   ════════════════════════════════════════════════════════════════ */
.mk-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--mk-hdr-z);
  background: var(--mk-hdr-bg);
  border-bottom: 1px solid var(--mk-hdr-border);
  box-shadow: none;
  transition: box-shadow var(--mk-transition);
}

/* Shadow appears only after user scrolls */
.mk-header.is-scrolled {
  box-shadow: var(--mk-hdr-shadow);
}

/* Theme CSS sets .page-wrapper overflow:hidden (including responsive.css), which blocks sticky behavior. */
.page-wrapper {
  overflow: visible !important;
}

/* Preserve horizontal clipping at viewport level instead of wrapper level. */
html,
body {
  overflow-x: hidden;
}

/* Fixed header needs page offset to avoid overlapping first section content. */
body {
  padding-top: var(--mk-hdr-height);
}

/* Offset for sticky-header anchor jumps from About submenu links */
#our-clients,
#media-spotlight {
  scroll-margin-top: 92px;
}

.mk-header__container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 22px;
}

.mk-header__inner {
  display: flex;
  align-items: center;
  height: var(--mk-hdr-height);
  gap: 16px;
}

/* ════════════════════════════════════════════════════════════════
   2. BRAND / LOGO
   ════════════════════════════════════════════════════════════════ */
.mk-header__brand {
  flex-shrink: 0;
}

.mk-header__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none !important;
  outline-offset: 4px;
}

.mk-header__logo {
  height: 42px;
  width: auto;
  max-width: 100%;
  display: block;
}

/* ════════════════════════════════════════════════════════════════
   3. DESKTOP NAVIGATION  (flex centre)
   ════════════════════════════════════════════════════════════════ */
.mk-header__nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

/* ── Nav list ────────────────────────────────────────────────── */
.mk-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mk-nav__item {
  position: relative;
}

/* ── Nav link ────────────────────────────────────────────────── */
.mk-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  color: #1a1f2e;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 4px;
  background: transparent;
  border: none;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--mk-transition), background var(--mk-transition);
}

.mk-nav__link:hover,
.mk-nav__item.is-active > .mk-nav__link {
  color: #1a5ec4;
  background: transparent;
}

/* Active indicator underline */
.mk-nav__item.is-active > .mk-nav__link {
  position: relative;
}
.mk-nav__item.is-active > .mk-nav__link::after {
  content: none;
  position: absolute;
  bottom: -2px;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--mk-accent);
}

/* ── Chevron icon ────────────────────────────────────────────── */
.mk-nav__chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  pointer-events: none;
  transition: transform var(--mk-transition);
}

.mk-nav__item:hover > .mk-nav__link .mk-nav__chevron,
.mk-nav__item.is-open > .mk-nav__link .mk-nav__chevron {
  transform: rotate(180deg);
}

/* ════════════════════════════════════════════════════════════════
   4. DROPDOWN BASE
   ════════════════════════════════════════════════════════════════ */
.mk-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: calc(var(--mk-hdr-z) + 20);
  background: var(--mk-drop-bg);
  border: 1px solid var(--mk-drop-border);
  border-radius: var(--mk-drop-radius);
  box-shadow: var(--mk-drop-shadow);

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity     var(--mk-transition),
    visibility  var(--mk-transition),
    transform   var(--mk-transition);
}

/* Keep hover continuity between menu link and dropdown panel. */
.mk-dropdown::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

/* Visible — hover (desktop) or .is-open (JS / keyboard) */
@media (min-width: 993px) {
  .mk-nav__item:hover > .mk-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.mk-nav__item.is-open > .mk-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Simple dropdown (Services, About) ───────────────────────── */
.mk-dropdown--simple {
  min-width: 220px;
  padding: 8px 0;
  list-style: none;
  margin: 0;
}

.mk-dropdown--simple > li { margin: 0; padding: 0; }

.mk-dropdown--simple > li > a {
  display: block;
  padding: 10px 18px;
  color: var(--mk-drop-text) !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background var(--mk-transition), color var(--mk-transition);
}

.mk-dropdown--simple > li:first-child > a {
  border-radius: calc(var(--mk-drop-radius) - 1px) calc(var(--mk-drop-radius) - 1px) 0 0;
}
.mk-dropdown--simple > li:last-child > a {
  border-radius: 0 0 calc(var(--mk-drop-radius) - 1px) calc(var(--mk-drop-radius) - 1px);
}

.mk-dropdown--simple > li > a:hover {
  background: var(--mk-drop-row-hover);
  color: var(--mk-drop-text-hover) !important;
}

/* ── Mega dropdown (Industries) ──────────────────────────────── */
.mk-dropdown--mega {
  min-width: 560px;
  overflow: hidden;
  padding: 0;
}

.mk-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  background: #f8faff;
  border-bottom: 1px solid var(--mk-drop-border);
  border-radius: calc(var(--mk-drop-radius) - 1px) calc(var(--mk-drop-radius) - 1px) 0 0;
}

.mk-dropdown__head-label {
  font-size: 11px;
  font-weight: 700;
  color: #5b6a8a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mk-dropdown__view-all {
  font-size: 13px;
  font-weight: 700;
  color: var(--mk-accent) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--mk-transition);
}
.mk-dropdown__view-all:hover { opacity: 0.75; }

.mk-dropdown__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.mk-dropdown__grid > li { margin: 0; }

.mk-dropdown__grid > li > a {
  display: block;
  padding: 9px 18px;
  color: var(--mk-drop-text) !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--mk-transition), color var(--mk-transition);
}

.mk-dropdown__grid > li > a:hover {
  background: var(--mk-drop-row-hover);
  color: var(--mk-drop-text-hover) !important;
}

/* ════════════════════════════════════════════════════════════════
   5. RIGHT ACTION BUTTONS
   ════════════════════════════════════════════════════════════════ */
.mk-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Subscription text link */
.mk-action__sub {
  color: var(--mk-accent-purple);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  padding: 7px 13px;
  border: 1.5px solid rgba(124, 58, 237, .3);
  border-radius: 20px;
  transition: opacity var(--mk-transition), border-color var(--mk-transition), background var(--mk-transition);
}
.mk-action__sub:hover {
  opacity: 1;
  background: rgba(124, 58, 237, .06);
  border-color: rgba(124, 58, 237, .5);
}

/* Phone pill */
.mk-action__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--mk-pill-border);
  border-radius: 999px;
  color: var(--mk-nav-text) !important;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color var(--mk-transition), box-shadow var(--mk-transition);
}
.mk-action__phone i { font-size: 12px; flex-shrink: 0; }
.mk-action__phone:hover {
  border-color: var(--mk-accent);
  box-shadow: 0 6px 20px rgba(39, 87, 214, 0.12);
}

/* Icon buttons (search, hamburger) */
.mk-action__icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--mk-pill-border);
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none !important;
  color: var(--mk-nav-text);
  font-size: 15px;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
  transition: border-color var(--mk-transition), box-shadow var(--mk-transition),
              background var(--mk-transition);
}
.mk-action__icon-btn:hover {
  border-color: var(--mk-accent);
  box-shadow: 0 6px 20px rgba(39, 87, 214, 0.10);
}

/* Hamburger bars */
.mk-hamburger-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.mk-hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--mk-nav-text);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.22s ease, width 0.22s ease;
}

/* Animated X state */
.mk-header__hamburger[aria-expanded="true"] .mk-hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mk-header__hamburger[aria-expanded="true"] .mk-hamburger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.mk-header__hamburger[aria-expanded="true"] .mk-hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Only show hamburger on mobile; hidden on desktop */
.mk-header__hamburger { display: none; }

/* Phone icon sizing fix (fa-phone may render slightly different) */
.mk-action__phone i { font-size: 13px; flex-shrink: 0; line-height: 1; }

/* ════════════════════════════════════════════════════════════════
   6. SEARCH OVERLAY
   ════════════════════════════════════════════════════════════════ */
.mk-search-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--mk-hdr-z) + 100);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 96px;
  padding-left: 16px;
  padding-right: 16px;

  /* Hidden */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.mk-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mk-search-overlay__box {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.18);
  transform: translateY(-10px);
  transition: transform 0.22s ease;
}

.mk-search-overlay.is-open .mk-search-overlay__box {
  transform: translateY(0);
}

.mk-search-overlay__label {
  font-size: 11px;
  font-weight: 700;
  color: #5b6a8a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.mk-search-overlay__form {
  display: flex;
  gap: 10px;
}

.mk-search-overlay__input {
  flex: 1 1 auto;
  padding: 13px 16px;
  border: 2px solid var(--mk-drop-border);
  border-radius: 10px;
  font-size: 16px;
  color: var(--mk-nav-text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--mk-transition);
  min-width: 0;
}
.mk-search-overlay__input:focus { border-color: var(--mk-accent); }

.mk-search-overlay__btn {
  flex-shrink: 0;
  padding: 13px 22px;
  background: var(--mk-accent);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity var(--mk-transition);
}
.mk-search-overlay__btn:hover { opacity: 0.88; }

.mk-search-overlay__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--mk-drop-border);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--mk-nav-text);
  transition: background var(--mk-transition);
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.mk-search-overlay__close:hover { background: #f0f4ff; }

.mk-search-overlay__hint {
  margin-top: 10px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.mk-search-suggest {
  list-style: none;
  margin: 10px 0 0;
  padding: 6px;
  border: 1px solid #dfe6f5;
  border-radius: 10px;
  background: #fff;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.mk-search-suggest.is-open { display: block; }

.mk-search-suggest__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none !important;
  color: #1f2a44 !important;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.mk-search-suggest__item:hover,
.mk-search-suggest__item.is-active {
  background: #eef3ff;
  color: #2757d6 !important;
}

.mk-search-suggest__type {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5f6f95;
}

.mk-search-suggest__mark {
  background: #fff2a8;
  color: inherit;
  padding: 0;
}

.mk-search-suggest__item--cta {
  font-weight: 700;
  border-top: 1px solid #e7ecf5;
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════════
   7. MOBILE DRAWER
   ════════════════════════════════════════════════════════════════ */
.mk-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: calc(var(--mk-hdr-z) + 50);
  pointer-events: none;
}

.mk-mobile-nav.is-open { pointer-events: auto; }

/* Backdrop */
.mk-mobile-nav__backdrop {
  position: absolute;
  inset: 0;
  background: var(--mk-backdrop);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mk-mobile-nav.is-open .mk-mobile-nav__backdrop { opacity: 1; }

/* Slide-in drawer */
.mk-mobile-nav__drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--mk-drawer-w);
  max-width: calc(100vw - 48px);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 8px 0 40px rgba(15, 23, 42, 0.12);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.mk-mobile-nav.is-open .mk-mobile-nav__drawer { transform: translateX(0); }

/* Drawer head */
.mk-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mk-drop-border);
  flex-shrink: 0;
}

.mk-mobile-nav__logo img {
  height: 40px;
  width: auto;
}

.mk-mobile-nav__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--mk-drop-border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mk-nav-text);
  font-size: 13px;
  padding: 0;
  transition: background var(--mk-transition);
}
.mk-mobile-nav__close:hover { background: #f4f7ff; }

/* Nav list */
.mk-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1 1 auto;
}

.mk-mnav__item {
  border-bottom: 1px solid var(--mk-drop-border);
}
.mk-mnav__item:last-child { border-bottom: none; }

/* Row: link + optional accordion toggle */
.mk-mnav__row {
  display: flex;
  align-items: stretch;
}

.mk-mnav__link {
  flex: 1 1 auto;
  display: block;
  padding: 14px 20px;
  color: var(--mk-nav-text) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: color var(--mk-transition);
}
.mk-mnav__link:hover,
.mk-mnav__link.is-active {
  color: var(--mk-accent) !important;
}

/* Accordion toggle */
.mk-mnav__toggle {
  flex-shrink: 0;
  width: 48px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--mk-drop-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  padding: 0;
  transition: color var(--mk-transition), background var(--mk-transition);
}
.mk-mnav__toggle svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.mk-mnav__toggle[aria-expanded="true"] { color: var(--mk-accent); }
.mk-mnav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.mk-mnav__toggle:hover { background: #f4f7ff; color: var(--mk-accent); }

/* Accordion panel */
.mk-mnav__panel {
  display: none;
  background: #f8faff;
  border-top: 1px solid var(--mk-drop-border);
}
.mk-mnav__panel.is-open { display: block; }

.mk-mnav__sublist {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.mk-mnav__sublist > li > a {
  display: block;
  padding: 11px 20px 11px 34px;
  color: #4a5568 !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: color var(--mk-transition), border-color var(--mk-transition),
              background var(--mk-transition);
}

.mk-mnav__sublist > li > a:hover {
  color: var(--mk-accent) !important;
  border-left-color: var(--mk-accent);
  background: #eef3ff;
}

/* Drawer footer */
.mk-mobile-nav__footer {
  flex-shrink: 0;
  padding: 20px;
  border-top: 1px solid var(--mk-drop-border);
}

.mk-mobile-nav__phone {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mk-nav-text) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  margin-bottom: 16px;
}

.mk-mobile-nav__social {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-mobile-nav__social li a {
  width: 36px;
  height: 36px;
  border: 1px solid var(--mk-drop-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mk-nav-text) !important;
  text-decoration: none !important;
  font-size: 14px;
  transition: border-color var(--mk-transition), color var(--mk-transition);
}
.mk-mobile-nav__social li a:hover {
  border-color: var(--mk-accent);
  color: var(--mk-accent) !important;
}

/* ════════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1060px) {
  .mk-header__inner { gap: 16px; }
  .mk-nav__link { padding: 8px 10px; font-size: 16px; }
  .mk-action__sub { display: none; }
}

@media (max-width: 992px) {
  body { padding-top: var(--mk-hdr-height-mob); }
  .mk-header__inner    { height: var(--mk-hdr-height-mob); gap: 10px; }
  .mk-header__nav      { display: none; }          /* desktop nav hidden on mobile */
  .mk-header__hamburger{ display: inline-flex; }   /* hamburger button shown */
  .mk-action__sub      { display: none; }
  .mk-action__phone span { display: none; }        /* phone: icon only */
  .mk-action__phone      { padding: 9px 12px; border-radius: 10px; }
}

@media (max-width: 480px) {
  .mk-header__container { padding: 0 16px; }
  .mk-action__phone     { display: none; }
}
