/**
 * components/header.css — MJC Fintech Site Header
 *
 * Structure:
 *   .mjc-header — Fixed full-width header bar
 *   .mjc-header__inner — Flex container with logo, nav, hamburger
 *   .mjc-header__logo — Logo link (left)
 *   .mjc-header__nav — Navigation wrapper (center/right)
 *   .mjc-nav__menu — wp_nav_menu output list
 *   .mjc-nav__item — Individual menu item
 *   .mjc-nav__link — Menu link or button
 *   .mjc-dropdown — Submenu (output by walker)
 *   .mjc-header__whatsapp — WhatsApp CTA button
 *   .mjc-header__hamburger — Mobile menu toggle
 *
 * @package MJC_Fintech_Child
 */

/* ===================================================
   MJC HEADER — Base
   =================================================== */

.mjc-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: #ffffff;
	border-bottom: 1px solid #e8f4f8;
	transition: box-shadow 0.3s ease;
}

.mjc-header.scrolled {
	box-shadow: 0 4px 32px rgba(10, 37, 64, 0.10);
}

.mjc-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 64px;
	height: 108px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
}

/* Push page body below fixed header */
body {
	padding-top: 108px;
}

/* ===================================================
   LOGO
   =================================================== */

.mjc-header__logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.mjc-header__logo-img {
	width: 84px;
	height: 80px;
	object-fit: contain;
	display: block;
}

.mjc-header__logo-text {
	display: none;
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 700;
	background: linear-gradient(179deg, #2bbfce 6%, #4ecdcc 94%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	color: transparent;
	white-space: nowrap;
}

/* ===================================================
   NAV WRAPPER
   =================================================== */

.mjc-header__nav {
	display: flex;
	align-items: center;
	gap: 24px;
	flex: 1;
	justify-content: flex-end;
}

/* ===================================================
   wp_nav_menu OUTPUT — .mjc-nav__menu
   =================================================== */

.mjc-nav__menu {
	display: flex;
	align-items: center;
	gap: 40px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ── Top-level items ── */

.mjc-nav__item {
	position: relative;
	list-style: none;
}

/* ── All top-level links and buttons ── */

.mjc-nav__link {
	font-family: var(--font-heading);
	font-size: 14px;
	font-weight: 500;
	color: #364153;
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	line-height: 21px;
	transition: color 0.2s ease;
}

.mjc-nav__link:hover {
	color: #2bbfce;
}

/* ── Active / current page ── */

.mjc-nav__item--current > .mjc-nav__link,
.mjc-nav__item--current > a.mjc-nav__link {
	color: #0a2540;
}

/* ── Chevron on Services parent ── */

.mjc-nav__chevron {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.25s ease;
	color: currentColor;
}

.mjc-nav__item--has-dropdown:hover .mjc-nav__chevron,
.mjc-nav__item--has-dropdown.is-open .mjc-nav__chevron {
	transform: rotate(180deg);
}

/* ===================================================
   DROPDOWN — .mjc-dropdown (output by walker)
   =================================================== */

.mjc-dropdown {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	background: #ffffff;
	border: 1px solid #e8f4f8;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(10, 37, 64, 0.12);
	list-style: none;
	margin: 0;
	padding: 8px 0;
	min-width: 260px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease,
	            transform 0.2s ease,
	            visibility 0.2s ease;
	z-index: 200;
	pointer-events: none;
}

/* Show on hover (desktop) */

.mjc-nav__item--has-dropdown:hover > .mjc-dropdown,
.mjc-nav__item--has-dropdown.is-open > .mjc-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

/* Dropdown links */

.mjc-dropdown .mjc-nav__subitem {
	list-style: none;
}

.mjc-dropdown .mjc-nav__link {
	display: block;
	width: 100%;
	padding: 10px 20px;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 400;
	color: #364153;
	white-space: nowrap;
	transition: color 0.15s ease, background 0.15s ease;
	border-radius: 0;
}

.mjc-dropdown .mjc-nav__link:hover {
	color: #0a2540;
	background: #f5fbfc;
}

.mjc-dropdown .mjc-nav__subitem--current > .mjc-nav__link {
	color: #2bbfce;
	font-weight: 500;
}

/* ===================================================
   WHATSAPP CTA BUTTON
   =================================================== */

.mjc-header__whatsapp {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 37px;
	padding: 0 20px;
	border-radius: 100px;
	font-family: var(--font-heading);
	font-size: 14px;
	font-weight: 500;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	background: linear-gradient(
		174deg,
		#2bbfce 7.7%,
		#1e5f8c 50%,
		#0a2540 92.3%
	);
	box-shadow: 0 4px 24px rgba(43, 191, 206, 0.35);
	transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

.mjc-header__whatsapp:hover {
	opacity: 0.88;
	box-shadow: 0 6px 32px rgba(43, 191, 206, 0.5);
	color: #ffffff;
}

/* ===================================================
   HAMBURGER — Mobile
   =================================================== */

.mjc-header__hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	flex-shrink: 0;
}

.mjc-header__hamburger span {
	display: block;
	width: 24px;
	height: 2px;
	background: #0a2540;
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.mjc-header__hamburger[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.mjc-header__hamburger[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.mjc-header__hamburger[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 1100px) {
	.mjc-header__inner {
		padding: 0 32px;
	}

	.mjc-nav__menu {
		gap: 28px;
	}
}

@media (max-width: 900px) {
	.mjc-header__hamburger {
		display: flex;
	}

	.mjc-header__nav {
		position: fixed;
		top: 108px;
		left: 0;
		right: 0;
		background: #ffffff;
		border-bottom: 1px solid #e8f4f8;
		box-shadow: 0 8px 32px rgba(10, 37, 64, 0.10);
		padding: 16px 24px 24px;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		justify-content: flex-start;
		transform: translateY(-110%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 0.3s ease;
		z-index: 999;
	}

	.mjc-header__nav.is-open {
		transform: translateY(0);
		opacity: 1;
		pointer-events: auto;
	}

	/* Mobile menu list */
	.mjc-nav__menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	.mjc-nav__item {
		border-bottom: 1px solid #f0f4f8;
		width: 100%;
	}

	.mjc-nav__item:last-child {
		border-bottom: none;
	}

	.mjc-nav__link {
		display: flex;
		justify-content: space-between;
		width: 100%;
		padding: 14px 0;
		font-size: 15px;
	}

	/* Mobile dropdown */
	.mjc-dropdown {
		position: static;
		transform: none !important;
		opacity: 1 !important;
		visibility: visible !important;
		box-shadow: none;
		border: none;
		border-radius: 0;
		background: #f8fbfc;
		padding: 0;
		pointer-events: auto;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s ease;
	}

	.mjc-nav__item--has-dropdown.is-open > .mjc-dropdown {
		max-height: 500px;
	}

	.mjc-dropdown .mjc-nav__link {
		padding: 12px 16px;
		font-size: 14px;
	}

	/* WhatsApp button full-width on mobile */
	.mjc-header__whatsapp {
		width: 100%;
		height: 48px;
		margin-top: 16px;
		justify-content: center;
		font-size: 15px;
	}
}

@media (max-width: 480px) {
	.mjc-header__inner {
		padding: 0 16px;
	}
  gap:         var(--space-5);
  list-style:  none;
  margin:      0;
  padding:     0;
}

/* Individual nav links */
.mjc-header__nav-list .menu-item > a,
.mjc-header__nav-list .menu-item > .menu-item-link {
  font-family:    var(--font-body);
  font-size:      var(--text-body);
  font-weight:    var(--fw-medium);
  color:          var(--color-white-muted);
  text-decoration: none;
  padding:        var(--space-2) 0;
  border-bottom:  2px solid transparent;
  transition:
    color         var(--transition-fast),
    border-color  var(--transition-fast);
}

.mjc-header__nav-list .menu-item > a:hover,
.mjc-header__nav-list .menu-item.current-menu-item > a {
  color:        var(--color-white);
  border-color: var(--color-teal);
}

/* Services dropdown parent (has chevron icon in Figma) */
.mjc-header__nav-list .menu-item-has-children > a::after {
  content:      ' ▾';
  font-size:    0.65em;
  opacity:      0.7;
  margin-left:  var(--space-1);
}

/* Dropdown sub-menu */
.mjc-header__nav-list .sub-menu {
  position:         absolute;
  top:              calc(100% + var(--space-2));
  left:             0;
  min-width:        220px;
  background-color: var(--color-navy-mid);
  border:           1px solid var(--color-border-dark);
  border-radius:    var(--radius-md);
  padding:          var(--space-2) 0;
  list-style:       none;
  box-shadow:       var(--shadow-lg);
  opacity:          0;
  visibility:       hidden;
  transform:        translateY(-8px);
  transition:
    opacity    var(--transition-base),
    transform  var(--transition-base),
    visibility var(--transition-base);
  z-index:          var(--z-dropdown);
}

.mjc-header__nav-list .menu-item-has-children {
  position: relative;
}

.mjc-header__nav-list .menu-item-has-children:hover > .sub-menu,
.mjc-header__nav-list .menu-item-has-children:focus-within > .sub-menu {
  opacity:    1;
  visibility: visible;
  transform:  translateY(0);
}

.mjc-header__nav-list .sub-menu li a {
  display:        block;
  padding:        var(--space-3) var(--space-5);
  color:          var(--color-white-muted);
  font-size:      var(--text-sm);
  transition:
    color            var(--transition-fast),
    background-color var(--transition-fast);
}

.mjc-header__nav-list .sub-menu li a:hover {
  color:            var(--color-cyan);
  background-color: rgba(255, 255, 255, 0.04);
}


/* =====================================================
   WHATSAPP CTA BUTTON
   ===================================================== */

.mjc-header__whatsapp {
  /* Inherits .mjc-btn and .mjc-btn--whatsapp from buttons.css */
  flex-shrink: 0;
}


/* =====================================================
   HAMBURGER (Mobile Only)
   ===================================================== */

.mjc-header__hamburger {
  display:          none;
  flex-direction:   column;
  justify-content:  center;
  gap:              5px;
  width:            40px;
  height:           40px;
  background:       transparent;
  border:           none;
  cursor:           pointer;
  padding:          var(--space-2);
  border-radius:    var(--radius-sm);
}

.mjc-header__hamburger-bar {
  display:          block;
  width:            100%;
  height:           2px;
  background-color: var(--color-white);
  border-radius:    var(--radius-pill);
  transition:       transform var(--transition-base), opacity var(--transition-base);
}

/* Animated X state */
.mjc-header--nav-open .mjc-header__hamburger .mjc-header__hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mjc-header--nav-open .mjc-header__hamburger .mjc-header__hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mjc-header--nav-open .mjc-header__hamburger .mjc-header__hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* =====================================================
   RESPONSIVE — MOBILE NAV
   ===================================================== */

@media (max-width: 1024px) {

  .mjc-header__hamburger {
    display: flex;
    order:   1;   /* Appears after nav */
  }

  /* Nav becomes a full-screen panel */
  .mjc-header__nav {
    position:         fixed;
    inset:            100px 0 0 0;  /* Below header */
    flex-direction:   column;
    align-items:      flex-start;
    justify-content:  flex-start;
    gap:              0;
    background-color: var(--color-navy);
    padding:          var(--space-7) var(--container-padding);
    overflow-y:       auto;

    /* Hidden by default */
    opacity:          0;
    visibility:       hidden;
    transform:        translateY(-16px);
    transition:
      opacity    var(--transition-base),
      transform  var(--transition-base),
      visibility var(--transition-base);
  }

  /* Open state */
  .mjc-header--nav-open .mjc-header__nav {
    opacity:    1;
    visibility: visible;
    transform:  translateY(0);
  }

  /* Stack nav items vertically */
  .mjc-header__nav-list {
    flex-direction: column;
    align-items:    flex-start;
    gap:            0;
    width:          100%;
  }

  .mjc-header__nav-list .menu-item {
    width:       100%;
    border-bottom: 1px solid var(--color-border-dark);
  }

  .mjc-header__nav-list .menu-item > a {
    display:  block;
    padding:  var(--space-4) 0;
    font-size: var(--text-body-lg);
  }

  /* Mobile dropdown */
  .mjc-header__nav-list .sub-menu {
    position:  static;
    opacity:   1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: transparent;
    border:    none;
    padding:   0 0 0 var(--space-5);
  }

  /* Move WhatsApp button to bottom of mobile menu */
  .mjc-header__whatsapp {
    margin-top: var(--space-6);
    width:      100%;
    text-align: center;
  }

}
