/* ===================================================
   Site navbar — shared, consistent, responsive
   Loaded after ote-hero.css so these rules win.
   =================================================== */

.header {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 1320px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  box-shadow:
    0 6px 24px rgba(15, 40, 80, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0 10px;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    border-radius 0.25s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(236, 242, 250, 0.98);
  box-shadow:
    0 6px 22px rgba(15, 40, 80, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.header.is-open {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.99);
}

/*
  Neutralize page-level .container overrides (e.g. .page-contact .container)
  so logo/nav/CTA sit in the exact same place on every page.
*/
header.header > .container,
body[class*="page-"] header.header > .container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
}

.header .nav {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  column-gap: 16px;
  width: 100%;
  min-height: 60px;
  height: 60px;
}

.header .logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  min-width: 0;
  z-index: 2;
  justify-self: start;
  grid-column: 1;
}

.header .logo-icon {
  height: 48px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.header .logo-text {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #0a1628;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  height: 48px;
  margin: 0;
  padding: 0;
}

.header .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-self: center;
  grid-column: 2;
}

.header .nav-link {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #0a1628;
  padding: 8px 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
}

.header .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2.5px;
  background: #0a94db;
  border-radius: 2px;
  transition: width 0.25s ease;
}

.header .nav-link:hover,
.header .nav-link.active {
  color: #0a94db;
}

.header .nav-link:hover::after,
.header .nav-link.active::after {
  width: 100%;
}

.header .has-dropdown {
  position: relative;
}

/* Keep hover alive while moving from trigger into the menu */
.header .has-dropdown::after {
  content: "";
  position: absolute;
  left: -28px;
  right: -28px;
  top: calc(100% - 6px);
  height: 28px;
  z-index: 1099;
}

.header .dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: min(440px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease 0.12s,
    transform 0.18s ease 0.12s,
    visibility 0s linear 0.3s;
  z-index: 1100;
  list-style: none;
  margin: 0;
}

.header .dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(226, 232, 240, 0.7);
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 3px 0 0 0;
}

/* Invisible hit-area above the panel so the cursor never drops hover */
.header .dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
}

.header .has-dropdown:hover .dropdown,
.header .has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 0.16s ease 0s,
    transform 0.16s ease 0s,
    visibility 0s linear 0s;
}

.header .dropdown li + li {
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.header .dropdown li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #0a1628;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.header .dropdown li a:hover {
  background: rgba(10, 148, 219, 0.06);
}

.header .dropdown-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(10, 148, 219, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0a94db;
}

.header .dropdown-icon svg {
  width: 20px;
  height: 20px;
}

.header .dropdown-text {
  flex: 1;
  min-width: 0;
}

.header .dropdown-title {
  font-weight: 700;
  font-size: 14px;
  color: #0a1628;
  display: block;
  margin-bottom: 2px;
}

.header .dropdown-desc {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 400;
  display: block;
}

.header .dropdown-chevron {
  flex-shrink: 0;
  color: #c0c8d4;
}

.header .btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  background: #0a94db;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 10px 10px 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  justify-self: end;
  grid-column: 3;
}

.header .btn-nav:hover {
  background: #0880bf;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 148, 219, 0.3);
}

.header .btn-nav .btn-arrow-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.header .mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  flex-shrink: 0;
  justify-self: end;
  grid-column: 3;
}

.header .mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #0a1628;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.header .mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header .mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.header .mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header .nav-mobile-cta {
  display: none;
}

/* Dim page behind open mobile menu */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: rgba(7, 18, 36, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

/* ---------- Compact desktop / large tablet ---------- */
@media (max-width: 1180px) {
  .header .nav {
    grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
    column-gap: 12px;
  }

  .header .nav-links {
    gap: 18px;
  }

  .header .nav-link {
    font-size: 14px;
  }

  .header .btn-nav {
    padding: 9px 8px 9px 16px;
    font-size: 13px;
  }
}

@media (max-width: 1100px) {
  .header .nav {
    grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  }

  .header .logo-text {
    font-size: 15.5px;
  }

  .header .nav-links {
    gap: 14px;
  }

  .header .dropdown {
    left: 0;
    transform: translateX(0) translateY(8px);
  }

  .header .has-dropdown:hover .dropdown,
  .header .has-dropdown:focus-within .dropdown {
    transform: translateX(0) translateY(0);
  }

  .header .dropdown::before {
    left: 28px;
  }
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 1024px) {
  .header {
    top: max(10px, env(safe-area-inset-top, 0px));
    width: calc(100% - 24px);
    max-width: none;
    padding: 0 4px;
    border-radius: 22px;
  }

  .header.is-open {
    border-radius: 22px;
  }

  body[class*="page-"] header.header > .container,
  header.header > .container {
    padding: 0 10px !important;
  }

  .header .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    min-height: 56px;
    height: 56px;
  }

  .header .logo {
    grid-column: 1;
    grid-row: 1;
  }

  .header .mobile-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .header .nav-links {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: stretch;
  }

  .header .logo-icon {
    height: 42px;
    max-width: 46px;
  }

  .header .logo-text {
    font-size: 14.5px;
    letter-spacing: -0.02em;
    height: 42px;
    display: inline-flex !important; /* never hide brand on mobile */
  }

  .header .mobile-toggle {
    display: inline-flex;
  }

  .header .btn-nav {
    display: none;
  }

  .header .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: -4px;
    right: -4px;
    max-height: min(78vh, calc(100dvh - 88px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 14px 18px;
    margin: 0;
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 40, 80, 0.16);
    z-index: 1001;
  }

  .header .nav-links.open {
    display: flex;
  }

  .header .nav-links > li {
    width: 100%;
  }

  .header .nav-link {
    display: flex;
    width: 100%;
    padding: 14px 4px;
    font-size: 16px;
    border-bottom: 1px solid #e8eef5;
    white-space: normal;
  }

  .header .nav-link::after {
    display: none;
  }

  .header .has-dropdown::after {
    display: none;
  }

  .header .has-dropdown > .nav-link {
    justify-content: space-between;
  }

  .header .has-dropdown > .nav-link svg {
    transition: transform 0.2s ease;
  }

  .header .has-dropdown.open > .nav-link svg {
    transform: rotate(180deg);
  }

  .header .has-dropdown .dropdown {
    position: static;
    left: auto;
    transform: none;
    min-width: 0;
    max-width: none;
    width: 100%;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    box-shadow: none;
    border: none;
    background: transparent;
    backdrop-filter: none;
    padding: 0 0 8px 6px;
    margin: 0;
  }

  .header .has-dropdown.open .dropdown {
    display: block;
  }

  .header .dropdown::before {
    display: none;
  }

  .header .dropdown li + li {
    border-top: none;
  }

  .header .dropdown li a {
    padding: 10px 6px;
    border-radius: 10px;
    border-bottom: 1px solid #eef2f7;
    gap: 10px;
  }

  .header .dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .header .dropdown-icon svg {
    width: 16px;
    height: 16px;
  }

  .header .dropdown-title {
    font-size: 13.5px;
  }

  .header .dropdown-desc {
    font-size: 12px;
  }

  .header .dropdown-chevron {
    display: none;
  }

  .header .nav-mobile-cta {
    display: block;
    padding-top: 14px;
  }

  .header .nav-mobile-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border-radius: 999px;
    background: #0a94db;
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }
}

@media (max-width: 480px) {
  .header {
    top: max(8px, env(safe-area-inset-top, 0px));
    width: calc(100% - 16px);
    padding: 0 2px;
  }

  body[class*="page-"] header.header > .container,
  header.header > .container {
    padding: 0 8px !important;
  }

  .header .nav {
    min-height: 52px;
    height: 52px;
  }

  .header .logo {
    gap: 5px;
    max-width: none;
  }

  .header .logo-icon {
    height: 38px;
    max-width: 42px;
  }

  .header .logo-text {
    font-size: 13.5px;
    letter-spacing: -0.02em;
    height: 38px;
  }

  .header .nav-links {
    left: -2px;
    right: -2px;
    padding: 8px 12px 16px;
  }

  .header .nav-link {
    font-size: 15px;
    padding: 13px 2px;
  }
}

@media (max-width: 360px) {
  .header .logo-text {
    font-size: 12.5px;
  }
}
