/* ================================================================
   IAP2 Canada – Header CSS (v2 – WA Compatible)
   Replaces previous header_css.css in site CSS file.
   Key changes: !important overrides, CSS-only chevron + hamburger,
   span-safe logo, aggressive overflow fix targeting actual WA classes.
   ================================================================ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --purple-deep:  #1B1464;
  --purple-main:  #333192;
  --purple-mid:   #444199;
  --purple-light: #EEEDF8;
  --orange:       #F15C22;
  --orange-light: #FEF0E9;
  --charcoal:     #1B1464;
  --text-main:    #222222;
  --text-muted:   #555555;
  --border:       #E2E1EF;
  --white:        #FFFFFF;
  --max-w:        1200px;
  --ff-display:   'Sora', sans-serif;
  --ff-body:      'Inter', sans-serif;
}

/* ── WA Overflow Fix ───────────────────────────────────────────── */
/* Targets actual class names from live page source — lets mega
   menus escape gadget containers and enables position:sticky */
.zoneHeaderOuter,
.zoneHeader,
.zoneHeaderInner,
.WaPlaceHolder,
.WaPlaceHolderHeader,
.WaGadgetOnly,
.WaGadgetContent,
.gadgetStyleBody,
.gadgetContentEditableArea,
.gadgetContainer,
.gadgetContainerSimple { overflow: visible !important; }

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* ── Utility Bar ───────────────────────────────────────────────── */
.util-bar {
  background: #1B1464 !important;
  padding: 7px 0;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
}
.util-bar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 36px;
}
.util-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  letter-spacing: .04em;
}
.util-right { display: flex; align-items: center; }
.util-bar a {
  color: rgba(255,255,255,.75) !important;
  transition: color .2s;
  margin-left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  text-decoration: none !important;
}
.util-bar a:hover { color: #F15C22 !important; }

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E1EF;
  position: sticky;
  top: 0;
  z-index: 9000;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  font-family: 'Inter', sans-serif;
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 68px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 36px;
  gap: 4px;
  background: #FFFFFF !important;
}

/* ── Logo ──────────────────────────────────────────────────────── */
/* Handles both <a class="nav-logo"> and bare <span class="logo-text">
   in case WA strips the anchor wrapper again */
.nav-logo {
  font-family: 'Sora', sans-serif !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  color: #333192 !important;
  letter-spacing: -.3px;
  white-space: nowrap;
  text-decoration: none !important;
  flex-shrink: 0;
}
.logo-text {
  font-family: 'Sora', sans-serif !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  color: #333192 !important;
  letter-spacing: -.3px;
  white-space: nowrap;
  display: inline-block;
}
.nav-logo em,
.logo-text em { color: #F15C22 !important; font-style: normal !important; }

/* ── Nav Links ─────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  list-style: none;
  height: 68px;
  margin: 0 0 0 20px;
  padding: 0;
}
.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.nav-link {
  padding: 0 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #222222 !important;
  cursor: pointer;
  height: 100%;
  display: inline-flex !important;
  align-items: center;
  transition: color .2s;
  white-space: nowrap;
  border-bottom: 3px solid transparent !important;
  text-decoration: none !important;
  background: transparent !important;
}
.nav-item:hover .nav-link {
  color: #333192 !important;
  border-bottom-color: #F15C22 !important;
}

/* CSS chevron — replaces stripped SVG */
.nav-item .nav-link::after {
  content: '▾';
  font-size: 11px;
  margin-left: 4px;
  display: inline-block;
  transition: transform .25s;
  line-height: 1;
  color: inherit;
}
.nav-item:hover .nav-link::after { transform: rotate(180deg); }

/* ── Standard Dropdown ─────────────────────────────────────────── */
.dropdown {
  position: absolute !important;
  top: 100%;
  left: 0;
  background: #FFFFFF !important;
  border: 1px solid #E2E1EF !important;
  border-top: 3px solid #333192 !important;
  border-radius: 0 0 10px 10px;
  min-width: 210px;
  box-shadow: 0 10px 36px rgba(0,0,0,.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 9001;
  padding: 6px 0;
}
.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block !important;
  padding: 9px 20px !important;
  font-size: 13.5px !important;
  color: #222222 !important;
  transition: background .15s, color .15s, padding-left .15s;
  text-decoration: none !important;
  background: transparent !important;
  border: none !important;
}
.dropdown a:hover {
  background: #FEF0E9 !important;
  color: #F15C22 !important;
  padding-left: 26px !important;
}

/* ── Mega Menu ─────────────────────────────────────────────────── */
.mega {
  position: absolute !important;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #FFFFFF !important;
  border: 1px solid #E2E1EF !important;
  border-top: 3px solid #333192 !important;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 14px 48px rgba(0,0,0,.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 9001;
  padding: 28px 28px 20px;
  display: grid;
  gap: 4px 28px;
  white-space: normal;
}
.nav-item:hover .mega {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.mega-3 { grid-template-columns: repeat(3, 1fr); min-width: 680px; }
.mega-2 { grid-template-columns: repeat(2, 1fr); min-width: 440px; }
.mega-col h4 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #F15C22 !important;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E2E1EF;
}
.mega-col a {
  display: block !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  color: #222222 !important;
  border-radius: 6px;
  transition: all .15s;
  text-decoration: none !important;
  background: transparent !important;
  border: none !important;
}
.mega-col a:hover {
  background: #FEF0E9 !important;
  color: #F15C22 !important;
  padding-left: 16px !important;
}

/* ── Nav CTAs ──────────────────────────────────────────────────── */
.nav-ctas {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-outline {
  border: 1.5px solid #333192 !important;
  color: #333192 !important;
  padding: 7px 16px !important;
  border-radius: 7px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block !important;
  background: transparent !important;
  text-decoration: none !important;
}
.btn-outline:hover { background: #333192 !important; color: #FFFFFF !important; }
.btn-fill {
  background: #333192 !important;
  color: #FFFFFF !important;
  padding: 7px 18px !important;
  border-radius: 7px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block !important;
  border: 1.5px solid #333192 !important;
  text-decoration: none !important;
}
.btn-fill:hover { background: #1B1464 !important; border-color: #1B1464 !important; color: #FFFFFF !important; }

/* ── Hamburger — CSS only, no child elements needed ────────────── */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  margin-left: auto;
  background: transparent !important;
  border: none !important;
  color: transparent !important;
  font-size: 0 !important;
  position: relative;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}
/* Middle line + top/bottom via box-shadow */
.hamburger::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 2px;
  background: #222222;
  border-radius: 2px;
  box-shadow: 0 -7px 0 #222222, 0 7px 0 #222222;
  transition: transform .3s, box-shadow .3s;
}
/* Second diagonal for X close state */
.hamburger::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  width: 24px;
  height: 2px;
  background: #222222;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .3s, transform .3s;
}
.hamburger.open::before {
  transform: translateY(-50%) rotate(45deg);
  box-shadow: none;
}
.hamburger.open::after { opacity: 1; }

/* ── Mobile Nav ────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 75px;
  left: 0;
  right: 0;
  background: #FFFFFF !important;
  z-index: 8999;
  padding: 16px 0 32px;
  box-shadow: 0 16px 40px rgba(0,0,0,.15);
  overflow-y: auto;
  max-height: calc(100vh - 75px);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block !important;
  padding: 11px 24px !important;
  font-size: 14.5px !important;
  color: #222222 !important;
  border-bottom: 1px solid #E2E1EF !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  background: transparent !important;
}
.mobile-nav a.sub {
  padding-left: 40px !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  color: #555555 !important;
}
.mobile-nav a:hover { color: #333192 !important; background: #EEEDF8 !important; }
.mobile-section-head {
  padding: 13px 24px 5px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #444199 !important;
  font-weight: 700;
  background: #EEEDF8 !important;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links,
  .nav-ctas { display: none !important; }
  .hamburger { display: flex !important; }
  .util-bar .wrap,
  .nav-inner { padding: 0 22px; }
}

/* ── Header Full-Width Fix ─────────────────────────────────────── */
/* Removes WA container_12 width cap so util-bar and navbar
   bleed edge-to-edge. Inner content stays centered via .wrap
   and .nav-inner which already have max-width + padding. */
.zoneHeaderOuter,
.zoneHeaderOuter .zoneHeader,
.zoneHeaderOuter .container_12,
.zoneHeaderOuter .zoneHeaderInner {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ── Zone Gap Fixes ────────────────────────────────────────────── */

/* Removes the 20px top padding WA injects above the util-bar */
#id_Header > div:first-child,
.WaPlaceHolderHeader > div:first-child { padding-top: 0 !important; }

/* Hides the WA theme colour-strip zone between navbar and content */
.zoneHeader1Outer { display: none !important; }

/* Removes white gap at the top of the content zone */
#id_Header2 { background-color: transparent !important; }
#id_Header2 > div:first-child { padding-top: 0 !important; }
