/* ============================================================
   CO Nav Menu – DTC-Style Navigation
   ============================================================ */

/* ── Resets & Focus ─────────────────────────────────────────── */

.dtc-nav-menu-wrapper a,
.dtc-nav-menu-wrapper button,
.dtc-hamburger,
.dtc-mobile-toggle,
.dtc-mobile-row > a,
.dtc-mobile-sub a {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.dtc-hamburger:focus,
.dtc-mobile-toggle:focus,
.dtc-nav-menu a:focus {
  outline: none;
}

.dtc-hamburger:focus-visible,
.dtc-mobile-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.dtc-nav-menu a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: -2px;
}

/* ── Wrapper ────────────────────────────────────────────────── */

.dtc-nav-menu-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

/* ── Desktop Nav ────────────────────────────────────────────── */

.dtc-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.dtc-nav-menu > li {
  position: relative;
}

/* Nav items – borderless by default, bordered box on hover/open */
.dtc-nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

/* Hover state – bordered rectangle (matches dropdown card border) */
.dtc-nav-menu > li > a:hover,
.dtc-nav-menu > li:hover > a,
.dtc-nav-menu > li:focus-within > a {
  border-color: rgba(255, 255, 255, 0.28);
  background-color: rgba(13, 30, 61, 0.6);
}

/* When dropdown is open – hide bottom border so item merges with card */
.dtc-nav-menu > li.dtc-has-children:hover > a,
.dtc-nav-menu > li.dtc-has-children:focus-within > a {
  border-bottom-color: #0d1e3d;
  background-color: #0d1e3d;
}

/* Dropdown chevron */
.dtc-nav-menu .dtc-arrow {
  transition: transform 0.45s ease;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.75;
}

.dtc-nav-menu > li:hover > a .dtc-arrow,
.dtc-nav-menu > li:focus-within > a .dtc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* CTA button (e.g. "Book a Demo") – add CSS class "nav-cta" in WP Menus */
.dtc-nav-menu > li.nav-cta > a {
  background-color: #2563c8;
  border-color: #2563c8 !important;
  border-bottom-color: #2563c8 !important;
  padding-right: 18px;
  gap: 10px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.dtc-nav-menu > li.nav-cta > a:hover,
.dtc-nav-menu > li.nav-cta:hover > a {
  background-color: #1a4fa8;
  border-color: #1a4fa8 !important;
  border-bottom-color: #1a4fa8 !important;
}

/* Bridge – fills gap so hover isn't lost moving to dropdown */
.dtc-nav-menu > li.dtc-has-children::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 4px;
}

/* ── Dropdown Panel ─────────────────────────────────────────── */

.dtc-sub-menu {
  position: absolute;
  top: calc(100% - 1px); /* overlap by 1px to connect with item border */
  left: 0;
  min-width: 230px;
  background-color: #0d1e3d;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top: none; /* seamless connection with open nav item */
  list-style: none;
  margin: 0;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 999999;
}

.dtc-nav-menu > li:hover > .dtc-sub-menu,
.dtc-nav-menu > li:focus-within > .dtc-sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Dropdown items – text left, arrow right */
.dtc-sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.dtc-sub-menu li a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.07);
}

/* Right-pointing arrow on each dropdown item */
.dtc-sub-menu li a .dtc-item-arrow {
  flex-shrink: 0;
  opacity: 0.5;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.dtc-sub-menu li a:hover .dtc-item-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Right-align last dropdown to prevent off-screen overflow */
.dtc-nav-menu > li:last-child > .dtc-sub-menu {
  left: auto;
  right: 0;
}

/* Grandchildren – stacked inline beneath parent */
.dtc-sub-menu--deep {
  position: static;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
  border: none;
  background: transparent;
  padding: 0 0 4px 12px;
}

.dtc-sub-menu--deep li a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  padding: 6px 20px;
}

.dtc-sub-menu--deep li a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* ── Hamburger ──────────────────────────────────────────────── */

.dtc-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 35px;
  height: 35px;
  cursor: pointer;
  background: #4094D1;
  border: 1px solid #4094D1;
  padding: 0;
  z-index: 1010;
  position: relative;
  transition: border-color 0.2s ease;
  padding: 10px!important;
  border-radius: 4px!important;
  touch-action: manipulation;
}

.dtc-hamburger:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

.dtc-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #ffffff;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    width 0.22s ease;
  transform-origin: center;
}

.dtc-hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.dtc-hamburger.is-active span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.dtc-hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Mode ─────────────────────────────────────────────── */

.dtc-nav-menu-wrapper.dtc-mobile-mode .dtc-desktop-nav {
  display: none;
}

.dtc-nav-menu-wrapper.dtc-mobile-mode .dtc-hamburger {
  display: flex;
}

/* ── Mobile Overlay ─────────────────────────────────────────── */

.dtc-mobile-overlay {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #0a1628;
  z-index: 99999;
  flex-direction: column;
  justify-content: center;
  padding: 80px 48px 48px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    visibility 0.4s ease;
  pointer-events: none;
}

.dtc-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Mobile nav list */
.dtc-mobile-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 640px;
}

/* Each top-level item – stagger-in on open */
.dtc-mobile-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.38s ease,
    transform 0.38s ease;
  transition-delay: calc(var(--item-index, 0) * 0.07s + 0.18s);
}

.dtc-mobile-overlay.is-open .dtc-mobile-item {
  opacity: 1;
  transform: translateY(0);
}

/* Row: link + toggle */
.dtc-mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dtc-mobile-row > a {
  flex: 1;
  display: block;
  padding: 22px 0;
  color: #ffffff;
  text-decoration: none;
  font-size: 40px;
  font-weight: 700!important;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  transition: opacity 0.3s ease;
}

.dtc-mobile-row > a:hover,
.dtc-mobile-row > a:focus-visible {
  opacity: 0.65;
}

.dtc-mobile-row > a:active {
  opacity: 0.4;
}

/* + toggle button */
.dtc-mobile-toggle {
  flex-shrink: 0;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
  transition:
    border-color 0.3s ease,
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.dtc-mobile-toggle:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

.dtc-mobile-toggle.is-open {
  transform: rotate(45deg);
}

/* Sub-menu accordion */
.dtc-mobile-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dtc-mobile-sub.is-open {
  max-height: 800px;
}

.dtc-mobile-sub li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  text-decoration: none;
  font-size: 14px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-left: 0;
  transition: color 0.2s ease;
}

.dtc-mobile-sub li a:hover,
.dtc-mobile-sub li a:focus-visible {
  color: #ffffff;
}

.dtc-mobile-sub li a:active {
  opacity: 0.5;
}

.dtc-mobile-sub li:last-child {
  margin-bottom: 16px;
}

/* Arrow inside mobile sub-items */
.dtc-mobile-sub li a .dtc-item-arrow {
  opacity: 1;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.dtc-mobile-sub li a:hover .dtc-item-arrow {
  opacity: 0.85;
}

/* ============================================================
   DTC reference treatment
   These overrides match the attached sticky blue navigation mockup.
   ============================================================ */

.dtc-nav-menu-wrapper {
  --dtc-navy: #203c60;
  --dtc-panel: rgba(31, 58, 93, 0.88);
  --dtc-panel-strong: rgba(31, 58, 93, 0.96);
  --dtc-border: rgba(71, 150, 209, 0.66);
  --dtc-border-soft: rgba(118, 177, 221, 0.36);
  --dtc-glow: rgba(45, 154, 224, 0.42);
  --dtc-cta: #2877b8;
  width: 100%;
  min-height: 62px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 99999;
}

.dtc-desktop-nav {
  width: auto;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.dtc-nav-menu {
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2vw, 32px);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.dtc-nav-menu > li {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.dtc-nav-menu > li > a {
  width: auto;
  min-height: auto;
  justify-content: center;
  padding: 0;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.dtc-nav-menu > li:first-child > a {
  border-left: 0 !important;
}

.dtc-nav-menu > li > a:hover,
.dtc-nav-menu > li:hover > a,
.dtc-nav-menu > li:focus-within > a {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.dtc-nav-menu > li.dtc-has-children:hover > a,
.dtc-nav-menu > li.dtc-has-children:focus-within > a {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.dtc-nav-menu > li.dtc-has-children::after {
  height: 14px;
}

.dtc-nav-menu .dtc-arrow {
  width: 11px;
  height: 7px;
  opacity: 0.95;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.dtc-sub-menu {
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  width: max-content;
  max-width: 320px;
  padding: 0;
  background: var(--dtc-panel-strong);
  border: 1px solid var(--dtc-border);
  border-radius: 5px;
  box-shadow: none;
  overflow: hidden;
  transform: translateY(-3px);
}

.dtc-sub-menu li a {
  min-height: 43px;
  padding: 0 18px;
  border-top: 0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  background: transparent;
}

.dtc-sub-menu li:first-child > a {
  border-top-color: transparent;
}

.dtc-sub-menu li a:hover {
  background: rgba(45, 96, 143, 0.58);
}

.dtc-sub-menu li a .dtc-item-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.95;
}

.dtc-sub-menu--deep {
  padding: 0;
  border-radius: 0;
}

.dtc-nav-menu > li.nav-cta {
  min-width: 0;
  margin-left: clamp(28px, 5vw, 96px);
  align-items: center;
  padding: 0;
}

.dtc-nav-menu > li.nav-cta > a {
  min-height: 38px;
  justify-content: center;
  gap: 13px;
  padding: 0 14px 0 20px;
  background: var(--dtc-cta);
  border: 1px solid rgba(77, 158, 217, 0.72) !important;
  border-radius: 5px;
  box-shadow: 0 0 12px rgba(40, 119, 184, 0.36);
}

.dtc-nav-menu > li.nav-cta > a::after {
  content: '>';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(20, 94, 157, 0.78);
  font-size: 18px;
  line-height: 1;
}

.dtc-nav-menu > li.nav-cta > a:hover,
.dtc-nav-menu > li.nav-cta:hover > a {
  background: #1f6aa7;
  border-color: rgba(99, 180, 235, 0.9) !important;
}

@media (max-width: 1180px) {
  .dtc-nav-menu > li {
    min-width: 0;
  }

  .dtc-nav-menu > li > a {
    padding: 0;
    font-size: 11px;
  }
}

@media (max-width: 1200px) {
  .dtc-nav-menu-wrapper {
    min-height: 52px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    justify-content: inherit;
    padding: 0;
    position: relative;
    overflow: visible;
  }

  .dtc-desktop-nav {
    display: none;
  }

  .dtc-hamburger {
    display: flex;
    width: 44px;
    height: 44px;
    border-color: var(--dtc-border);
    border-radius: 5px;
    background: #4094d1;;
    background-image: none!important;
  }

  .dtc-mobile-overlay {
    position: fixed;
    top: var(--dtc-overlay-top, 52px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    min-height: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    background: #0000008c;
    justify-content: flex-start;
    padding: 22px max(24px, env(safe-area-inset-right)) 32px
      max(24px, env(safe-area-inset-left));
    z-index: 99999;
    transition:
      opacity 0.28s ease,
      transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s ease;
  }

  .dtc-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dtc-mobile-nav {
  max-width: none;
  max-height: calc(100vh - 120px)!important;
  overflow-y: auto!important;
  -webkit-overflow-scrolling: touch;
}

  .dtc-mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .dtc-mobile-item {
    border-bottom: 0;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 0.24s ease,
      transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--item-index, 0) * 0.035s + 0.08s);
  }

  .dtc-mobile-overlay.is-open .dtc-mobile-item {
    opacity: 1;
    transform: translateY(0);
  }

  .dtc-mobile-row {
    min-height: 50px;
  }

  .dtc-mobile-row > a {
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
  }

  .dtc-mobile-toggle {
    width: 32px;
    height: 32px;
    border: 0;
    color: #ffffff;
    background: transparent;
  }

  .dtc-mobile-toggle .dtc-arrow {
    display: block;
    width: 10px;
    height: 6px;
    color: #ffffff;
    opacity: 1;
    transition: transform 0.25s ease;
  }

  .dtc-mobile-toggle.is-open {
    transform: none;
  }

  .dtc-mobile-toggle.is-open .dtc-arrow {
    transform: rotate(180deg);
  }

  /* Glass panel, matching the .dtc-glass-card idiom in custom-code.css.
     Two deliberate omissions, both load-bearing:
     - No backdrop-filter. The drawer behind this is opaque (#0b121d), and blurring
       a flat colour returns the same flat colour - it would cost paint and do nothing.
     - The hairline is an inset shadow, not a border. This list collapses via
       max-height:0 + overflow:hidden, and a border (or vertical padding, or margin)
       still occupies layout at zero height - it would show a sliver under every
       COLLAPSED item. Inset shadows paint nothing at zero height. */
  .dtc-mobile-sub {
    padding: 0 10px;
    background: linear-gradient(
      180deg,
      rgba(64, 148, 209, 0.13) 0%,
      rgba(34, 58, 92, 0.13) 100%
    );
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(64, 148, 209, 0.32);
    transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .dtc-mobile-sub li a {
    min-height: 40px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
  }

  /* Brand-tint the affordance so it reads with the hairline rather than as grey noise. */
  .dtc-mobile-sub li a .dtc-item-arrow {
    color: #4094d1;
  }

  .dtc-mobile-sub li:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  .dtc-nav-menu-wrapper {
    min-height: 52px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    justify-content: inherit;
    padding: 0;
  }

  .dtc-hamburger {
    width: 35px;
    height: 35px;
    border-color: var(--dtc-border);
    border-radius: 5px;
    background: #4094d1;;
    padding: 10px!important;
    background-image: none!important;
  }

  .dtc-mobile-overlay {
    position: fixed;
    top: var(--dtc-overlay-top, 52px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    min-height: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    background: #0b121d;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    transition:
      opacity 0.28s ease,
      transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s ease;
  }

  .dtc-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) and (prefers-reduced-motion: reduce) {
  .dtc-mobile-overlay,
  .dtc-mobile-item,
  .dtc-mobile-sub,
  .dtc-mobile-toggle .dtc-arrow {
    transition: none;
  }
}
