/* ============================================
   Leads-Style Navigation Styles
   ============================================ */

:root {
  --site-header-height: 72px;
}

@media (max-width: 900px) {
  :root {
    --site-header-height: 60px;
  }
}

/* Base header styling for Leads nav */
.site-header.leads-nav {
  background: #fff;
  box-shadow: none;
  border-bottom: 1px solid #e5e5e5;
  transition: transform 0.4s ease;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1001;
}

/* Darken the white SVG logo on the white nav background */
body.leadsonline .site-header.leads-nav .logo img {
  filter: brightness(0);
}

/* Slide main header up when scrolled */
.site-header.leads-nav.scrolled {
  transform: translateY(-100%);
  pointer-events: none;
}

/* Keep main nav sticky when type filter is active (product nav is hidden) */
body.resources-type-filter .site-header.leads-nav.scrolled {
  transform: translateY(0);
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Add padding to body for fixed header */
body.leadsonline {
  padding-top: 72px;
}

/* Product navigation bar */
.product-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #F5F9FF;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Show product nav bar when scrolled */
.product-nav-bar.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.product-nav-wrap {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.product-nav-logo img {
  height: 32px;
  width: auto;
}

.resources-product-logo {
  height: 32px;
  width: auto;
  filter: brightness(0);
}

.product-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-nav-btn {
  font-size: 0.875rem;
  padding: 8px 20px;
  white-space: nowrap;
}

/* Spacing between logo and nav items */
.site-header.leads-nav .main-nav {
  margin-left: 56px;
}

/* Gap between nav items */
.site-header.leads-nav .main-nav ul {
  gap: 1.4rem;
}

/* Language toggle — strip native browser button appearance */
.site-header.leads-nav .lang-dropdown__toggle {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
  transform: none;
  overflow: visible;
}

.site-header.leads-nav .lang-dropdown__toggle:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
  opacity: 0.8;
}

.site-header.leads-nav .lang-dropdown__toggle:focus-visible {
  outline: 2px solid #00aaff;
  outline-offset: 2px;
  box-shadow: none;
}

/* Nav dropdown trigger with arrow */
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
}

.mega-menu-parent:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Active state underline for nav items */
.site-header.leads-nav .main-nav > ul > li > a {
  position: relative;
  color: #1e1f21;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-header.leads-nav .main-nav > ul > li > a:hover {
  color: #1e1f21;
  border-bottom: none;
}

.site-header.leads-nav .main-nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3575e2;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.site-header.leads-nav .main-nav > ul > li:hover > a::after,
.site-header.leads-nav .main-nav > ul > li.active > a::after {
  transform: scaleX(1);
}

/* Mega menu parent positioning */
.site-header.leads-nav .mega-menu-parent {
  position: relative;
}

/* Register Now li alignment */
.site-header.leads-nav .main-nav > ul > li:has(.nav-register-link) {
  display: flex;
  align-items: center;
}

/* Asana-style mega menu dropdown */
.leads-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 700px;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 3000;
  margin-top: 4px;
}

.mega-menu-parent:hover .leads-mega-menu,
.mega-menu-parent.mega-menu-open .leads-mega-menu {
  opacity: 1;
  visibility: visible;
}

/* Mega menu columns container */
.leads-mega-menu .mega-menu-columns {
  display: flex;
  padding: 40px 48px 32px;
  gap: 48px;
}

/* Individual column */
.leads-mega-menu .mega-menu-col {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Column header (category title) */
.mega-menu-col-header {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1e1f21;
  margin-bottom: 16px;
  text-transform: uppercase;
}

/* Prevent global h3 color overrides (e.g. .leadsonline h3 { color: #fff }) from bleeding into the mega menu */
.leads-mega-menu .mega-menu-col-header {
  color: #1e1f21;
  margin: 0 0 16px 0;
}

/* Divider line under header */
.mega-menu-col-divider {
  width: 100%;
  height: 1px;
  background: #d1d1d1;
  margin-bottom: 20px;
  display: block;
}

/* Menu links */
.leads-mega-menu .mega-menu-link {
  display: block;
  color: #1e1f21;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  margin: 0 -16px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
  background: none;
  opacity: 1;
  visibility: visible;
}

.leads-mega-menu .mega-menu-link:hover {
  color: #1e1f21;
  background: #f9f9f9;
  box-shadow: none;
}

/* Remove icons from links for cleaner look */
.leads-mega-menu .mega-menu-link img {
  display: none;
}

/* Mega menu footer */
.mega-menu-footer {
  display: flex;
  align-items: center;
  padding: 20px 48px;
  background: #f9f8f8;
  border-top: 1px solid #e5e5e5;
  border-radius: 0 0 8px 8px;
  gap: 0;
}

.leads-mega-menu .mega-menu-footer .mega-menu-footer-link,
.mega-menu-footer a.mega-menu-footer-link {
  color: #6d6e6f;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0 24px;
  transition: color 0.15s ease;
}

.mega-menu-footer-link:first-child {
  padding-left: 0;
}

.leads-mega-menu .mega-menu-footer .mega-menu-footer-link:hover,
.mega-menu-footer a.mega-menu-footer-link:hover {
  color: #1e1f21;
}

.mega-menu-footer-divider {
  width: 1px;
  height: 16px;
  background: #d1d1d1;
}

/* Hide old mega menu styles on leads nav */
.site-header.leads-nav .mega-menu-heading,
.site-header.leads-nav .mega-menu-underline {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .leads-mega-menu {
    min-width: 600px;
  }
  
  .leads-mega-menu .mega-menu-columns {
    padding: 32px 32px 24px;
    gap: 32px;
  }
  
  .mega-menu-footer {
    padding: 16px 32px;
  }
}

@media (max-width: 900px) {
  body.leadsonline {
    padding-top: 60px;
  }

  /* Switch desktop nav to hamburger mode at 900px */
  .site-header.leads-nav .main-nav {
    display: none;
  }

  body.leadsonline .site-header.leads-nav .nav-toggle {
    display: block;
    width: 44px;
    height: 44px;
    color: #1e1f21;
    opacity: 1;
    visibility: visible;
  }

  .site-header.leads-nav .nav-cta .btn {
    display: none;
  }

  .product-nav-wrap {
    padding: 12px 0;
    padding-left: 24px;
    padding-right: 24px;
  }

  .product-nav-logo img {
    height: 28px;
  }

  .product-nav-actions {
    gap: 8px;
  }

  .product-nav-btn {
    font-size: 0.8rem;
    padding: 6px 16px;
  }

  /* Hide Download Brochure button on smaller mobile screens */
  @media (max-width: 640px) {
    .product-nav-btn.btn-outline {
      display: none;
    }
  }

  .leads-mega-menu {
    position: fixed;
    top: var(--site-header-height, 72px);
    left: 0;
    right: 0;
    transform: none;
    min-width: 100%;
    border-radius: 0;
    max-height: calc(100vh - var(--site-header-height, 72px));
    overflow-y: auto;
  }

  .leads-mega-menu .mega-menu-columns {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }

  .leads-mega-menu .mega-menu-col {
    min-width: 100%;
  }

  .leads-mega-menu .mega-menu-col {
    padding-top: 16px;
    border-top: 2px solid #e5e5e5;
  }

  .leads-mega-menu .mega-menu-col:first-child {
    border-top: none;
    padding-top: 0;
  }

  .leads-mega-menu .mega-menu-col-header {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
  }

  .leads-mega-menu .mega-menu-col-divider {
    display: block;
    margin-bottom: 14px;
  }

  .leads-mega-menu .mega-menu-link {
    font-size: 0.95rem;
    padding: 10px 8px;
  }

  .mega-menu-footer {
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
    align-items: flex-start;
  }

  .mega-menu-footer-divider {
    display: none;
  }

  .mega-menu-footer-link {
    padding: 8px 0;
  }
}

/* ============================================
   Mobile Menu — Fixed positioning & backdrop
   ============================================ */

.mobile-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 999;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
}

@media (max-width: 900px) {
  .mobile-menu {
    top: 60px;
    max-height: calc(100vh - 60px);
  }
}

/* ============================================
   Mobile Menu — Category (details/summary)
   ============================================ */

.mobile-menu-category {
  margin: 0;
}

.mobile-menu-category__summary {
  background: #f8f9fa;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 16px;
  color: #002855;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.mobile-menu-category__summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-category__summary::marker {
  display: none;
}

.mobile-menu-category__summary::after {
  content: '▼';
  font-size: 12px;
  transition: transform 0.3s ease;
}

.mobile-menu-category[open] .mobile-menu-category__summary::after {
  transform: rotate(180deg);
}

.mobile-menu-category__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 20px;
  background: #fafafa;
}

.mobile-menu-column {
  flex: 1;
}

.mobile-menu-column h4 {
  font-size: 14px;
  font-weight: 800;
  color: #002855;
  margin: 0 0 12px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #d1d1d1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-menu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-column li {
  border: none;
  padding: 0;
}

.mobile-menu-column a {
  display: block;
  padding: 8px 0;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.mobile-menu-column a:hover {
  color: #0056b3;
}

.mobile-menu .btn {
  display: block;
  margin: 16px auto;
  width: calc(100% - 40px);
  text-align: center;
}

/* ---- Register Now nav link ---- */
.site-header.leads-nav .main-nav > ul > li > a.nav-register-link {
  color: #3B9FFF;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 0;
  position: relative;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.site-header.leads-nav .nav-register-link:hover {
  color: #7FC3FF;
}

.site-header.leads-nav .nav-register-link::after {
  background: #3B9FFF;
}

.mobile-nav-register {
  display: block;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3B9FFF;
  text-decoration: none;
}

.mobile-nav-register:hover {
  color: #7FC3FF;
}

/* White nav override (register page) */
.register-page .site-header.leads-nav .nav-register-link {
  color: rgba(255, 255, 255, 0.9);
}

.register-page .site-header.leads-nav .nav-register-link:hover {
  color: #fff;
}
