/* ==========================================================================
   GSI Custom Header
   ========================================================================== */

/* Hide Divi's default header completely */
#main-header,
#top-header,
.et_slide_in_menu_container {
  display: none !important;
}

/* Adjust Divi's page container — remove default header padding */
#page-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ---------- Header Base ---------- */

.gsi-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #20323f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition:
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.gsi-header.is-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.gsi-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 80px;
}

/* Push page content below fixed header */
#et-main-area {
  padding-top: 80px;
}

/* ---------- Logo ---------- */

.gsi-header__logo {
  flex: 0 0 auto;
}

.gsi-header__logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.gsi-header__logo img {
  height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* ---------- Center Nav ---------- */

.gsi-header__nav-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.gsi-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gsi-nav li {
  position: relative;
}

.gsi-nav li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.gsi-nav li a:hover {
  color: #ffa67a;
}

.gsi-nav li.current-menu-item > a,
.gsi-nav li.current-menu-ancestor > a {
  color: #fff;
}

/* --- Dropdown Arrow --- */

.gsi-nav > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
  margin-left: 6px;
  vertical-align: 2px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.gsi-nav > li.menu-item-has-children:hover > a::after {
  transform: rotate(-135deg);
  border-right-color: #ffa67a;
  border-bottom-color: #ffa67a;
}

/* --- Dropdown Submenu --- */

.gsi-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #20323f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  z-index: 100;
}

.gsi-nav li:hover > .sub-menu {
  display: block;
}

.gsi-nav .sub-menu li a {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 300;
}

.gsi-nav .sub-menu li a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Right Nav ---------- */

.gsi-header__nav-right {
  flex: 0 0 auto;
}

.gsi-nav--right {
  gap: 0.5rem;
}

/* Right nav items as pill buttons */
.gsi-nav--right > li > a {
  background: #fff;
  color: #192833;
  border-radius: 50px;
  padding: 4px 24px;
}

.gsi-nav--right > li > a:hover {
  background: #fff;
  opacity: 0.9;
  color: #192833;
}

/* Book a Demo — last item */
.gsi-nav--right > li:last-child > a {
  background: #ffa67a;
  color: #192833;
}

.gsi-nav--right > li:last-child > a:hover {
  background: #e8915e;
  color: #192833;
}

/* ---------- Hamburger ---------- */

.gsi-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.gsi-hamburger__line {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Hamburger active state — X shape */
.gsi-header__hamburger[aria-expanded='true'] .gsi-hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.gsi-header__hamburger[aria-expanded='true'] .gsi-hamburger__line:nth-child(2) {
  opacity: 0;
}

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

/* ---------- Mobile Menu Drawer ---------- */

.gsi-mobile-menu {
  display: none;
  background: #20323f;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem 2rem;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.gsi-mobile-menu.is-open {
  display: block;
}

.gsi-mobile-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gsi-mobile-nav li a {
  display: block;
  padding: 0.75rem 0;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 300;
}

.gsi-mobile-nav li a:hover {
  color: #ffa67a;
}

.gsi-mobile-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
}

.gsi-mobile-nav .sub-menu li a {
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile secondary nav — pill buttons matching desktop */
.gsi-mobile-nav--secondary {
  margin-top: 1rem;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gsi-mobile-nav--secondary > li > a {
  background: #fff;
  color: #20323f;
  border-radius: 50px;
  padding: 4px 24px;
  text-align: center;
}

.gsi-mobile-nav--secondary > li > a:hover {
  background: #ffffff;
  color: #192833;
}

.gsi-mobile-nav--secondary > li:last-child > a {
  background: #ffa67a;
  color: #fff;
}

.gsi-mobile-nav--secondary > li:last-child > a:hover {
  background: #e8915e;
  color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .gsi-header__nav-center,
  .gsi-header__nav-right {
    display: none;
  }

  .gsi-header__hamburger {
    display: flex;
  }

  .gsi-header__inner {
    height: 64px;
  }

  #et-main-area {
    padding-top: 64px;
  }

  .gsi-header__logo img {
    height: 40px;
  }
}
