/* ============================================
   Header / Nav
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;

  background: transparent;

  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}


/* Pages without a hero always have dark navbar */
body.no-hero .site-header {
  background-color: var(--navy-900);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}


/* Give content room for fixed navbar */
body.no-hero main {
  padding-top: 80px;
}


/* Pages with hero become dark after scrolling */
.site-header.scrolled {
  background-color: var(--navy-900);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}


.header-inner {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 80px;
}


/* ============================================
   Logo
   ============================================ */

.logo {
  display: flex;
  align-items: center;

  margin-right: auto;
  margin-top: 10px;
}


.logo img {
  display: block;

  width: 145px;
  height: auto;
}


.logo:hover {
  text-decoration: none;
}


/* ============================================
   Navigation
   ============================================ */

.site-nav {
  position: relative;
}


.nav-list {
  display: flex;
  align-items: center;

  gap: 40px;

  margin: 0 10px 0 0;
  padding: 0;

  list-style: none;
}


.nav-list a {
  display: inline-block;

  padding: 6px 0;

  color: rgba(255, 255, 255, 0.85);

  font-size: 0.95rem;
  font-weight: 500;

  border-bottom: 2px solid transparent;

  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}


.nav-list a:hover {
  color: #fff;

  text-decoration: none;

  border-bottom-color: var(--blue-400);
}


.nav-list a.is-active {
  color: #fff;

  border-bottom-color: var(--blue-500);
}


.nav-list>li>a.is-active,
.nav-dropdown-toggle.is-active {
  color: var(--blue-400);
}


.dropdown-menu a.is-active {
  color: var(--blue-500);

  font-weight: 600;

  background-color: var(--fog);
}


/* ============================================
   Header Actions
   ============================================ */

.header-actions {
  display: flex;
  align-items: center;

  gap: 18px;

  margin-left: 20px;
}


.header-phone {
  color: #fff;

  font-size: 0.9rem;
  font-weight: 600;

  white-space: nowrap;
}


.header-phone:hover {
  color: var(--blue-400);

  text-decoration: none;
}


/* Header Buttons */

.header-actions .btn-primary {
  padding: 8px 16px;

  color: #fff;

  font-size: 0.85rem;
  line-height: 1.2;

  white-space: nowrap;

  background: var(--blue-500);

  border-color: var(--blue-500);
  border-radius: 3px;
}


.header-actions .btn-primary:hover {
  color: #fff;

  background: var(--navy-800);

  border-color: var(--navy-800);
}


/* ============================================
   Mobile Menu Button
   ============================================ */

.nav-toggle {
  display: none;

  width: 38px;
  height: 38px;

  padding: 7px;

  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 5px;

  background: transparent;

  border: none;

  cursor: pointer;
}


.nav-toggle span:not(.sr-only) {
  display: block;

  width: 24px;
  height: 2px;

  background: #fff;

  border-radius: 2px;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}


/* Hamburger -> X */

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}


.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}


.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================
   Navigation Dropdown - DESKTOP
   ============================================ */

.nav-dropdown {
  position: relative;
}


/* Invisible bridge for desktop hover */
.nav-dropdown::after {
  content: "";

  position: absolute;

  top: 100%;
  left: 0;
  right: 0;

  height: 15px;
}


.nav-dropdown-toggle {
  display: flex;
  align-items: center;

  gap: 6px;
}


.dropdown-arrow {
  font-size: 0.8rem;
  line-height: 1;

  transition: transform 0.2s ease;
}


/* Desktop Dropdown Menu */

.dropdown-menu {
  position: absolute;

  top: calc(100% + 15px);
  left: 50%;

  transform:
    translateX(-50%) translateY(-5px);

  min-width: 230px;

  margin: 0;
  padding: 8px 0;

  list-style: none;

  background: var(--navy-900);

  border:
    1px solid rgba(255, 255, 255, 0.1);

  border-radius: 6px;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;

  z-index: 1100;
}


/* Show desktop dropdown */

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;

  transform:
    translateX(-50%) translateY(0);
}


/* Rotate desktop arrow */

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown:focus-within .dropdown-arrow {
  transform: rotate(180deg);
}


/* Dropdown Links */

.dropdown-menu li {
  margin: 0;
}


.dropdown-menu a {
  display: block;

  padding: 11px 18px;

  color: rgba(255, 255, 255, 0.85);

  font-size: 0.9rem;
  font-weight: 500;

  white-space: nowrap;

  border-bottom: none;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}


.dropdown-menu a:hover,
.dropdown-menu a.is-active {
  color: #fff;

  background:
    rgba(255, 255, 255, 0.07);

  border-bottom: none;

  text-decoration: none;
}


/* =========================================================
   TABLET / MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 768px) {

  .site-header {
    background-color: var(--navy-900);
  }


  .header-inner {
    min-height: 70px;
    height: 70px;

    display: flex;
    align-items: center;

    padding-left: 14px;
    padding-right: 14px;
  }


  /* ==========================================
     Hamburger first
     ========================================== */

  .site-nav {
    order: 1;

    margin-right: 8px;
  }


  .nav-toggle {
    display: flex;

    position: relative;

    z-index: 1200;

    width: 36px;
    height: 36px;

    padding: 6px;
  }


  /* ==========================================
     Smaller logo after hamburger
     ========================================== */

  .logo {
    display: flex;

    order: 2;

    align-items: center;

    margin: 0 auto 0 0;
  }


  .logo img {
    width: 85px;
    height: auto;
  }


  /* ==========================================
     Header Buttons
     ========================================== */

  .header-actions {
    order: 3;

    display: flex;
    align-items: center;

    gap: 8px;

    margin-left: 8px;
  }


  .header-phone {
    display: none;
  }


  .header-actions .btn,
  .header-actions .btn-primary {
    padding: 8px 10px;

    font-size: 0.72rem;
    line-height: 1.15;

    white-space: nowrap;
  }


  /* ==========================================
     Main Mobile Menu
     ========================================== */

  .nav-list {
    position: fixed;

    top: 70px;
    left: 0;
    right: 0;

    width: 100%;

    margin: 0;
    padding: 0;

    display: flex;

    flex-direction: column;
    align-items: stretch;

    gap: 0;

    background: rgba(5, 14, 34, 0.98);

    max-height: 0;

    overflow: hidden;

    transition: max-height 0.3s ease;

    box-shadow:
      0 8px 20px rgba(0, 0, 0, 0.18);
  }


  .nav-list.is-open {
    max-height: calc(100vh - 70px);

    overflow-y: auto;
  }


  .nav-list>li {
    width: 100%;

    border-top:
      1px solid rgba(255, 255, 255, 0.08);
  }


  .nav-list>li:first-child {
    border-top: none;
  }


  .nav-list>li>a {
    display: flex;

    align-items: center;
    justify-content: space-between;

    width: 100%;

    padding: 14px 20px;

    color: rgba(255, 255, 255, 0.9);

    border-bottom: none;
  }


  .nav-list>li>a:hover,
  .nav-list>li>a.is-active {
    color: #fff;

    background:
      rgba(255, 255, 255, 0.05);

    border-bottom: none;
  }


  /* ==========================================
     SOLUTIONS - MOBILE ONLY
     ========================================== */

  .nav-dropdown {
    width: 100%;
  }

  /* Remove desktop hover bridge */
  .nav-dropdown::after {
    display: none;
  }


  /*
     Hide dropdown completely on mobile.
     Solutions acts like a normal link.
  */
  .nav-dropdown>.dropdown-menu,
  .nav-dropdown:hover>.dropdown-menu,
  .nav-dropdown:focus-within>.dropdown-menu,
  .nav-dropdown.is-open>.dropdown-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  .nav-dropdown .dropdown-arrow {
    display: none !important;
  }


  /* Hide dropdown arrow */
  .nav-dropdown .dropdown-arrow {
    display: none;
  }


  /* Solutions link same appearance as other links */
  .nav-dropdown-toggle {
    display: flex;

    align-items: center;
    justify-content: flex-start;

    width: 100%;

    padding: 14px 20px;

    color: rgba(255, 255, 255, 0.9);

    border-bottom: none;

    cursor: pointer;
  }


  .nav-dropdown-toggle:hover,
  .nav-dropdown-toggle.is-active {
    color: #fff;

    background:
      rgba(255, 255, 255, 0.05);

    border-bottom: none;
  }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .header-inner {
    padding-left: 8px;
    padding-right: 8px;
  }


  /* Hamburger */

  .site-nav {
    margin-right: 4px;
  }


  .nav-toggle {
    width: 32px;
    height: 32px;

    padding: 4px;
  }


  .nav-toggle span:not(.sr-only) {
    width: 20px;
  }


  /* Smaller logo */

  .logo img {
    width: 65px;
  }


  /* Header buttons */

  .header-actions {
    gap: 5px;

    margin-left: 5px;
  }


  .header-actions .btn,
  .header-actions .btn-primary {
    padding: 7px;

    font-size: 0.62rem;
  }


  /* Menu links */

  .nav-list>li>a {
    padding: 13px 16px;
  }


  .nav-dropdown-toggle {
    padding: 13px 16px;
  }
}