@import url("https://fonts.googleapis.com/css2?family=Poiret+One&display=swap");

:root {
  --line: #1d2633;
}

.mega-header {
  position: relative;
  z-index: 30;
  width: min(1760px, calc(100% - 2rem));
  margin: 1.2rem auto 0.8rem;
  padding: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.mega-header,
.mega-header .nav-link,
.mega-header .nav-btn,
.mega-header .mobile-link,
.mega-header .mobile-accordion,
.mega-header .mobile-panel a,
.mega-header .mobile-call,
.mega-header .call-pill,
.mega-header .phone-text {
  font-family: "Poiret One", "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-shell {
  border: 1px solid rgba(30, 40, 58, 0.85);
  border-radius: 30px;
  min-height: 92px;
  padding: 0.55rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  background:
    radial-gradient(circle at 50% 92%, rgba(18, 109, 222, 0.24), transparent 36%),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 60px,
      rgba(255, 255, 255, 0.017) 61px,
      transparent 62px
    ),
    linear-gradient(165deg, rgba(17, 20, 26, 0.96), rgba(4, 6, 9, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 44px rgba(0, 0, 0, 0.48);
  position: relative;
  overflow: visible;
}

.nav-shell::before,
.nav-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.nav-shell::before {
  top: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(22, 125, 255, 0.45),
    rgba(26, 142, 255, 0.9),
    rgba(22, 125, 255, 0.45)
  );
}

.nav-shell::after {
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(137, 79, 255, 0.2),
    rgba(175, 102, 255, 0.6),
    rgba(137, 79, 255, 0.2)
  );
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  grid-column: 1;
}

.brand-mark {
  width: 118px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 14px rgba(7, 123, 255, 0.2));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2vw, 2rem);
  grid-column: 2;
}

.nav-link,
.nav-btn {
  color: #f0f2f6;
  text-decoration: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: clamp(1rem, 1.24vw, 2rem);
  line-height: 1;
  cursor: pointer;
  transition: color 220ms ease;
  padding: 0;
}

/* Menu trigger as button: opens dropdown only; use "All Services" / "All Synergy" link to go to page */
button.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.nav-link.active,
.nav-btn.active,
.nav-link:hover,
.nav-btn:hover {
  color: #1490ff;
}

.nav-item {
  position: relative;
}

/* Invisible bridge so hover is kept when moving from trigger to dropdown */
.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.caret {
  font-size: 0.9em;
  color: #1490ff;
}

.dropdown {
  position: absolute;
  top: calc(100% + 0.22rem);
  left: 0;
  min-width: 304px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 12, 0.97);
  box-shadow: 0 18px 38px rgba(2, 7, 16, 0.72);
  padding: 0.72rem;
  display: grid;
  gap: 0.12rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 50;
}

.dropdown a,
.submenu-toggle {
  color: #e8eef7;
  text-decoration: none;
  padding: 0.58rem 0.42rem;
  border-radius: 8px;
  font-size: 0.96rem;
  line-height: 1.3;
}

.dropdown a:hover,
.submenu-toggle:hover {
  background: rgba(20, 144, 255, 0.12);
  color: #4fb2ff;
}

.nav-item.open > .dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


.submenu-wrap {
  position: relative;
}

.submenu-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
}

.submenu {
  position: absolute;
  left: calc(100% + 0.2rem);
  bottom: 0;
  min-width: 270px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.98);
  padding: 0.6rem;
  display: grid;
  gap: 0.22rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 51;
}

.submenu-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 14px;
  height: 100%;
}

.submenu-wrap.open > .submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.global-top-btn {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(20, 144, 255, 0.55);
  background: linear-gradient(155deg, rgba(17, 35, 64, 0.95), rgba(8, 16, 28, 0.98));
  color: #e7f1ff;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 120;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.global-top-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(101, 184, 255, 0.85);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
}

.global-top-btn:focus-visible {
  outline: 2px solid #66b8ff;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover > .dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .submenu-wrap:hover > .submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  grid-column: 3;
  justify-self: end;
}

.header-search-inline {
  width: clamp(160px, 14vw, 260px);
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(31, 112, 230, 0.5);
  background: rgba(6, 11, 20, 0.9);
  color: #eaf3ff;
  padding: 0 0.95rem;
  font-family: "Poiret One", "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.header-search-inline::placeholder {
  color: #8ca3c8;
}

.header-search-inline:focus {
  outline: none;
  border-color: rgba(46, 148, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(26, 128, 245, 0.22);
  background: rgba(8, 15, 28, 0.98);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: #e7ebf3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn[aria-label="Search"] {
  display: none;
}

.grid-icon {
  width: 24px;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.grid-icon i {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
}

.call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 999px;
  padding: 0.32rem 0.95rem 0.32rem 0.32rem;
  text-decoration: none;
  color: #d8dee8;
  border: 1px solid rgba(14, 90, 210, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 123, 255, 0.18);
  background: rgba(9, 12, 18, 0.82);
}

.call-badge {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: #d6e9ff;
  background: linear-gradient(145deg, #0e71d8, #0058b8);
  border: 1px solid rgba(130, 193, 255, 0.6);
}

.phone-text {
  font-size: clamp(1rem, 1.35vw, 2rem);
  font-weight: 700;
  white-space: nowrap;
}

.mobile-toggle {
  display: none;
  border: 1px solid rgba(50, 116, 201, 0.45);
  background: rgba(10, 12, 17, 0.8);
  color: #e9eff8;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.35rem;
}

.mobile-menu {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(8, 10, 13, 0.97);
  display: grid;
  gap: 0.4rem;
  transform-origin: top center;
}

.mobile-menu[hidden] {
  display: none !important;
}

.mobile-menu.open {
  animation: mobileMenuIn 220ms ease both;
}

.mobile-menu.closing {
  animation: mobileMenuOut 220ms ease both;
}

.mobile-link,
.mobile-accordion,
.mobile-panel a {
  color: #eff4fd;
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.3;
}

.mobile-link,
.mobile-accordion {
  border: 0;
  background: transparent;
  padding: 0.62rem 0.35rem;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.mobile-accordion {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-panel {
  display: grid;
  gap: 0.2rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 260ms ease;
}

.mobile-panel a {
  padding: 0.45rem 0.35rem 0.45rem 1rem;
  color: #ced8ea;
}

.mobile-call {
  margin-top: 0.5rem;
  border: 1px solid rgba(43, 138, 255, 0.48);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
  text-decoration: none;
  color: #e7f2ff;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 1040px) {
  .mega-header {
    margin-top: 0.8rem;
    width: calc(100% - 1.2rem);
    padding: 0;
  }

  .nav-shell {
    min-height: 78px;
    padding: 0.5rem 0.8rem;
    grid-template-columns: auto 1fr auto;
  }

  .brand-mark {
    width: 95px;
    height: 54px;
  }

  .desktop-nav {
    display: none;
  }

  .header-search-inline {
    display: none;
  }

  .call-pill {
    padding: 0.24rem 0.65rem 0.24rem 0.24rem;
    gap: 0.58rem;
  }

  .call-badge {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .phone-text {
    font-size: 1.2rem;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    right: 0;
    margin-top: 0;
    max-height: min(72vh, 560px);
    overflow: auto;
    z-index: 32;
    box-shadow: 0 24px 44px rgba(2, 8, 18, 0.72);
  }

  .mobile-link,
  .mobile-accordion {
    padding: 0.78rem 0.42rem;
    font-size: 1rem;
  }

  .mobile-panel a {
    padding: 0.56rem 0.42rem 0.56rem 1rem;
    font-size: 0.96rem;
  }
}

@media (max-width: 740px) {
  .mega-header {
    margin: 0.45rem 0 0.62rem;
    width: calc(100% - 0.7rem);
    padding-left: max(0.35rem, env(safe-area-inset-left));
    padding-right: max(0.35rem, env(safe-area-inset-right));
  }

  .nav-shell {
    min-height: 66px;
    border-radius: 18px;
    padding: 0.34rem 0.48rem;
    gap: 0.45rem;
  }

  .brand-mark {
    width: 68px;
    height: 38px;
  }

  .nav-actions {
    gap: 0.24rem;
  }

  .icon-btn[aria-label="Open apps"] {
    display: none;
  }

  .icon-btn[aria-label="Search"] {
    display: inline-flex;
  }

  .icon-btn {
    width: 31px;
    height: 31px;
    font-size: 1.2rem;
  }

  .call-pill {
    padding: 0.14rem;
    border-radius: 999px;
  }

  .call-badge {
    width: 38px;
    height: 38px;
    font-size: 1.02rem;
  }

  .phone-text {
    display: none;
  }

  .mobile-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 11px;
    background: rgba(10, 20, 35, 0.95);
    border-color: rgba(56, 140, 255, 0.55);
  }

  .mobile-menu {
    border-radius: 16px;
    padding: 0.64rem;
    max-height: min(74vh, 520px);
  }
}

@media (max-width: 480px) {
  .mega-header {
    margin: 0.35rem 0 0.5rem;
    width: calc(100% - 0.5rem);
    padding: 0;
  }

  .nav-shell {
    min-height: 62px;
    border-radius: 14px;
    padding: 0.3rem 0.42rem;
    gap: 0.34rem;
  }

  .brand-mark {
    width: 60px;
    height: 33px;
  }

  .icon-btn[aria-label="Search"] {
    width: 28px;
    height: 28px;
    font-size: 1.02rem;
  }

  .call-badge {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .mobile-toggle {
    width: 34px;
    height: 34px;
  }

  .mobile-menu {
    left: -0.1rem;
    right: -0.1rem;
    border-radius: 14px;
    padding: 0.55rem;
  }
}

@keyframes mobileMenuIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobileMenuOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}
