/* ========================================
   Header Partial CSS
   Extracted from styles.css — contains ONLY the styles needed by
   partials/header.hbs (alert banner + site header). No global resets
   (no *, body, a, html selectors) so it can be safely loaded on pages
   that already have their own base styles (e.g. best-alternative.hbs).
   ======================================== */

/* Neutralize the host page's body padding-top (best-alternative.css adds
   50px for Avada's sticky-header offset). Our partial provides its own
   spacing for the fixed alert banner via .site-header padding-top, so the
   page-level offset would double-stack and create a visible gap above
   the nav. */
body {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* CSS variables required by the header partial */
:root {
  --primary: #2a41e8;
  --primary-hover: #1e33c9;
  --dark: #000000;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --font-heading: 'Jost', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --alert-banner-height: 37px;
}

/* ========================================
   Alert Banner
   ======================================== */
.alert-banner {
  background: #fff7ed;
  color: #7c2d12;
  text-align: center;
  padding: 8px 20px;
  cursor: pointer;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #fde0c4;
  margin: 0;
}

.alert-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.alert-banner__text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7c2d12;
}

.alert-banner__text::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.alert-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f59e0b;
  color: #1f1500;
  padding: 4px 12px;
  border: 1px solid #d97706;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: background 0.15s, transform 0.12s;
}

.alert-banner:hover .alert-banner__btn {
  background: #fbbf24;
  transform: translateY(-1px);
}

/* ========================================
   Header — clean SaaS, sticky, light
   ======================================== */
.site-header {
  background-color: var(--white);
  background-image: none !important;
  position: relative;
  z-index: 999;
  padding: calc(var(--alert-banner-space, 0px) + 8px) 24px 8px;
  margin-top: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

/* The alert banner is position:fixed (out of flow), so it would overlap the
   header. --alert-banner-space defaults to 0 (no banner). It is only set to
   the banner height when a banner element actually precedes the header, so
   commenting/removing the banner collapses the reserved space automatically —
   at every breakpoint, because all .site-header padding rules use this var. */
.alert-banner + .site-header {
  --alert-banner-space: var(--alert-banner-height);
}

/* Visually hide the "Skip to content" accessibility link (keep it for screen
   readers / keyboard focus). Without this it renders as visible text and adds
   blank space above the header on self-styled pages. */
.skip-link,
.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus,
.screen-reader-text:focus {
  position: fixed !important;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  margin: 0;
  clip: auto;
  background: var(--white);
  color: var(--primary, #2a41e8);
  border-radius: 6px;
  z-index: 100000;
}

/* Defensive scope reset — neutralize any inherited padding/margin/list-style/font
   from the host page's CSS so the header renders as designed. */
.alert-banner,
.alert-banner *,
.alert-banner *::before,
.alert-banner *::after,
.site-header,
.site-header *,
.site-header *::before,
.site-header *::after {
  box-sizing: border-box;
}

.site-header ul,
.site-header ol,
.site-header li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header p {
  margin: 0;
}

.site-header a {
  text-decoration: none;
}

.header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  height: 74px;
  gap: 30px;
}

.header__logo {
  flex-shrink: 0;
}

.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header__logo-img {
  width: 40px;
  height: 40px;
  display: block;
}

.header__brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.main-nav__list {
  display: flex;
  list-style: none;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
}

.main-nav__item {
  position: relative;
}

.main-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gray-600);
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 9px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

.main-nav__link:hover {
  color: var(--primary);
  background-color: rgba(42, 65, 232, 0.06);
}

.main-nav__leading {
  color: var(--primary);
  font-size: 12px;
}

.main-nav__link--login {
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 11px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--gray-200);
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s;
}

.main-nav__link--login:hover {
  border-color: var(--primary);
  background: rgba(42, 65, 232, 0.04);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--gray-200);
}

.main-nav__link--login:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--gray-200);
}

.main-nav__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: rgba(42, 65, 232, 0.10);
  color: var(--primary);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-arrow {
  font-size: 9px;
  color: var(--gray-600);
  transition: transform 0.2s;
  margin-left: 2px;
}

.main-nav__link:hover .nav-arrow {
  color: var(--primary);
}

/* Dropdown */
.site-header .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 260px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
  padding: 8px;
  list-style: none;
  z-index: 1000;
  margin-top: 6px;
}

.site-header .dropdown li a {
  display: block;
  padding: 9px 14px;
  color: var(--gray-800);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.site-header .dropdown li a:hover {
  background: rgba(42, 65, 232, 0.06);
  color: var(--primary);
}

.has-dropdown:hover > .dropdown {
  display: block;
}

.has-dropdown:hover > .main-nav__link .nav-arrow {
  transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  transform: none;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 22px;
  z-index: 1000;
  min-width: 800px;
  max-width: min(1100px, calc(100vw - 32px));
}

.mega-menu__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.mega-menu__heading {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-decoration: none;
}

.mega-menu__column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu__column li a {
  display: block;
  padding: 6px 8px;
  font-size: 13.5px;
  color: var(--gray-800);
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.mega-menu__column li a:hover {
  color: var(--primary);
  background: rgba(42, 65, 232, 0.05);
}

.has-mega-menu:hover > .mega-menu {
  display: block;
}

.header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
}

/* Button base — scoped to header so it doesn't conflict with page buttons */
.site-header .btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.site-header .btn--primary {
  background: var(--primary);
  color: var(--white);
}

.site-header .btn--primary:hover {
  background: var(--primary-hover);
  color: var(--white);
}

.header__cta .btn--primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-family: var(--font-heading);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    0 4px 0 #1e33c9,
    0 6px 14px rgba(42, 65, 232, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.header__cta .btn--primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    0 5px 0 #1e33c9,
    0 9px 18px rgba(42, 65, 232, 0.38);
}

.header__cta .btn--primary:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 1px 0 #1e33c9,
    0 2px 4px rgba(42, 65, 232, 0.20);
}

.header__mobile-cta {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ========================================
   Responsive — Header only
   ======================================== */
@media (max-width: 992px) {
  .site-header {
    padding: calc(var(--alert-banner-space, 0px) + 8px) 20px 0;
    z-index: 9998;
  }

  .header__inner {
    gap: 16px;
  }

  .header__mobile-cta {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 9px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: 9px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.30),
      0 3px 0 #1e33c9,
      0 4px 10px rgba(42, 65, 232, 0.32);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }

  .header__mobile-cta:hover {
    color: #fff;
  }

  .header__mobile-cta:active {
    transform: translateY(2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.20),
      0 1px 0 #1e33c9,
      0 1px 2px rgba(42, 65, 232, 0.20);
  }

  .mobile-menu-toggle {
    display: flex;
    margin-left: 0;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: calc(var(--alert-banner-height) + 80px);
    left: 12px;
    right: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.15);
    padding: 12px;
    z-index: 9999;
    max-height: calc(100vh - var(--alert-banner-height) - 100px);
    overflow-y: auto;
  }

  .main-nav.active {
    display: block;
  }

  .main-nav__list {
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
  }

  .main-nav__link {
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
    background: transparent;
  }

  .has-dropdown.is-open > .dropdown,
  .has-mega-menu.is-open > .mega-menu {
    display: block;
  }

  .has-dropdown.is-open > .main-nav__link .nav-arrow,
  .has-mega-menu.is-open > .main-nav__link .nav-arrow {
    transform: rotate(180deg);
  }

  .site-header .dropdown,
  .mega-menu {
    position: static;
    box-shadow: none;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    min-width: auto;
    transform: none;
    padding: 6px;
    margin: 4px 0;
  }

  .site-header .dropdown li a,
  .mega-menu__column li a {
    color: var(--gray-800);
  }

  .site-header .dropdown li a:hover,
  .mega-menu__column li a:hover {
    color: var(--primary);
    background: rgba(42, 65, 232, 0.08);
  }

  .mega-menu__inner {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .header__cta {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --alert-banner-height: 33px;
  }

  .alert-banner {
    font-size: 13px;
    padding: 8px 12px;
  }

  .site-header {
    padding: calc(var(--alert-banner-space, 0px) + 6px) 14px 0;
  }

  .mega-menu__inner {
    grid-template-columns: 1fr;
  }
}
