/* =====================================================================================================
   Da-Ag Global Logistics - top bar (logo, links, log in, sign up, menu button), one design for phone, tablet and laptop

   The aim is a bar that feels expensive and alive, not busy:
   - phone:   a slim bar that gets out of the way (it slides up as you read and returns the moment you scroll back), a glowing
              "Sign up" pill, and a round menu button whose three bars squeeze and pop under the thumb
   - tablet:  the same links in a compact glass capsule, tuned so nothing is cramped at 768-1100px
   - laptop:  logo left, links in a centred glass capsule with a white pill that glides to whatever you point at, the page you are on
              kept lit, a "Log in" menu, and a gradient "Sign up" whose arrow leans forward on hover
   - everywhere: a thin red-to-blue line under the bar fills as you read the page, the bar tightens as you scroll, and the
              "Track" link carries a tiny pulsing dot (tracking really is live)
   Everything is switched off or reduced for people who ask their phone for less motion. All rules start with #mainNav so they win
   over each page's older inline styles.
   ===================================================================================================== */

/* keep the bar pinned: 'clip' hides sideways overflow like 'hidden' did, but does not turn the body into a scroll container */
html, body { overflow-x: clip; }

#mainNav {
  --nv-navy: #002868; --nv-navy-deep: #001a45; --nv-red: #bf0a30; --nv-blue-soft: #eef3ff;
  --nv-ease: cubic-bezier(.22, 1, .36, 1); --nv-spring: cubic-bezier(.34, 1.56, .64, 1);
  position: sticky; top: 0; z-index: 200;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(20px) saturate(190%); backdrop-filter: blur(20px) saturate(190%);
  border-bottom: 0; box-shadow: 0 1px 0 rgba(0, 40, 104, .06), 0 10px 30px rgba(0, 20, 70, .05);
  transition: transform .45s var(--nv-ease), box-shadow .3s ease, background .3s ease;
  animation: nvIn .7s var(--nv-ease) backwards;
}
@keyframes nvIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
#mainNav::after { /* a soft hairline of colour along the bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 40, 104, .2) 20%, rgba(191, 10, 48, .22) 50%, rgba(0, 40, 104, .2) 80%, transparent);
}
#mainNav.dgl-compact { background: rgba(255, 255, 255, .92); box-shadow: 0 1px 0 rgba(0, 40, 104, .06), 0 14px 38px rgba(0, 20, 70, .13); }
#mainNav.dgl-hidden { transform: translateY(-105%); box-shadow: none; }

/* reading progress */
#mainNav .nav-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 2; }
#mainNav.dgl-compact .nav-progress { opacity: 1; }
#mainNav .nav-progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #bf0a30, #ff5b7a 45%, #2f7bff); box-shadow: 0 0 12px rgba(255, 91, 122, .6); will-change: transform; }

#mainNav .nav-inner { max-width: 1360px; margin: 0 auto; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; transition: padding .35s var(--nv-ease); }
#mainNav.dgl-compact .nav-inner { padding-top: 6px; padding-bottom: 6px; }

/* ---- logo ----------------------------------------------------------------------------------------------------- */
#mainNav .nav-logo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; flex-shrink: 0; border-radius: 14px; padding: 2px 4px; transition: transform .35s var(--nv-spring); -webkit-tap-highlight-color: transparent; }
#mainNav .nav-logo img { height: 48px; width: auto; display: block; transition: height .35s var(--nv-ease), filter .3s; }
#mainNav.dgl-compact .nav-logo img { height: 40px; }
#mainNav .nav-logo:hover { transform: translateY(-1px) scale(1.03); }
#mainNav .nav-logo:hover img { filter: drop-shadow(0 6px 10px rgba(0, 40, 104, .25)); }
#mainNav .nav-logo:active { transform: scale(.95); }
#mainNav .nav-logo::after { /* one quick shine across the logo when it is pointed at */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg); pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
}
#mainNav .nav-logo:hover::after { animation: nvShine .9s ease; }
@keyframes nvShine { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }
#mainNav .nav-tagline { font-size: .5rem; letter-spacing: .2em; font-weight: 800; color: var(--nv-red); text-transform: uppercase; background: rgba(191, 10, 48, .07); padding: 3px 10px; border-radius: 99px; white-space: nowrap; transition: background .25s; }
#mainNav .nav-logo:hover .nav-tagline { background: rgba(191, 10, 48, .13); }

/* ---- links: a glass capsule with a pill that glides ------------------------------------------------------------ */
#mainNav .nav-center {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; flex: 0 1 auto; padding: 4px;
  background: rgba(238, 243, 255, .78); border: 1px solid rgba(0, 40, 104, .08); border-radius: 99px;
  box-shadow: inset 0 1px 2px rgba(0, 40, 104, .05);
}
#mainNav .nav-pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 99px; pointer-events: none; opacity: 0; z-index: 0;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 40, 104, .16), 0 1px 0 rgba(255, 255, 255, .9) inset;
  transition: transform .42s var(--nv-spring), width .42s var(--nv-spring), opacity .25s ease;
}
#mainNav .nav-pill.on { opacity: 1; }
#mainNav .nav-link {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 99px; background: none;
  font-size: .8rem; font-weight: 650; letter-spacing: .005em; color: #1e3a6e; text-decoration: none; transition: color .25s ease; -webkit-tap-highlight-color: transparent;
}
#mainNav .nav-link:hover, #mainNav .nav-link:focus-visible { background: none; color: var(--nv-navy); }
#mainNav .nav-link.active { color: var(--nv-navy); font-weight: 800; }
#mainNav .nav-link:focus-visible, #mainNav .nav-cta:focus-visible, #mainNav .nav-mobile-btn:focus-visible, #mainNav .nav-logo:focus-visible, #mainNav .dgl-login > summary:focus-visible { outline: 3px solid #ffb703; outline-offset: 2px; }
/* a tiny live dot on "Track" */
#mainNav .nav-link[href*="tracking"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: nvLive 2.2s ease-out infinite; }
@keyframes nvLive { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }

/* ---- right side ------------------------------------------------------------------------------------------------ */
#mainNav .nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#mainNav .dgl-login > summary { border: 1px solid rgba(0, 40, 104, .14); background: rgba(255, 255, 255, .7); color: var(--nv-navy); padding: 8px 14px; font-weight: 750; transition: background .25s, border-color .25s, transform .25s var(--nv-spring); }
#mainNav .dgl-login > summary:hover, #mainNav .dgl-login[open] > summary { background: #fff; border-color: rgba(0, 40, 104, .3); transform: translateY(-1px); }
#mainNav .dgl-login > summary:active { transform: scale(.96); }

#mainNav .nav-cta {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 99px; border: 0;
  background: linear-gradient(135deg, #0a3a8f 0%, #002868 55%, #001a45 100%); color: #fff;
  font-size: .8rem; font-weight: 750; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 40, 104, .34), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .3s var(--nv-spring), box-shadow .3s ease, background .3s ease; -webkit-tap-highlight-color: transparent;
}
#mainNav .nav-cta::before { /* a gentle sheen that sweeps across now and then */
  content: ""; position: absolute; top: 0; bottom: 0; left: -45%; width: 30%; transform: skewX(-20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent); animation: nvSheen 5s ease-in-out 2s infinite;
}
@keyframes nvSheen { 0% { left: -45%; } 30%, 100% { left: 140%; } }
#mainNav .nav-cta::after { /* an arrow drawn in CSS, so it works even if the icon font is slow */
  content: ""; width: 7px; height: 7px; margin-left: -1px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .3s var(--nv-spring);
}
#mainNav .nav-cta i { font-size: .95rem; }
#mainNav .nav-cta:hover { background: linear-gradient(135deg, #e11d48 0%, #bf0a30 55%, #8c0722 100%); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(191, 10, 48, .42), inset 0 1px 0 rgba(255, 255, 255, .3); }
#mainNav .nav-cta:hover::after { transform: translateX(3px) rotate(45deg); }
#mainNav .nav-cta:active { transform: translateY(0) scale(.95); }

/* ---- the round menu button (phone) ------------------------------------------------------------------------------ */
#mainNav .nav-mobile-btn {
  position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 40, 104, .12); background: var(--nv-blue-soft); color: var(--nv-navy);
  cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 40, 104, .14); transition: transform .3s var(--nv-spring), background .25s, box-shadow .25s;
}
#mainNav .nav-mobile-btn.has-bars > i { display: none; }
#mainNav .nav-mobile-btn .nb { position: relative; display: block; width: 18px; height: 14px; }
#mainNav .nav-mobile-btn .nb i { position: absolute; left: 0; height: 2.5px; border-radius: 3px; background: currentColor; transition: width .35s var(--nv-spring), transform .35s var(--nv-spring); }
#mainNav .nav-mobile-btn .nb i:nth-child(1) { top: 0; width: 18px; }
#mainNav .nav-mobile-btn .nb i:nth-child(2) { top: 5.75px; width: 12px; }
#mainNav .nav-mobile-btn .nb i:nth-child(3) { top: 11.5px; width: 18px; }
#mainNav .nav-mobile-btn:active { transform: scale(.88); background: #dfe9ff; }
#mainNav .nav-mobile-btn:active .nb i:nth-child(2) { width: 18px; }
#mainNav .nav-mobile-btn.pop .nb i { animation: nvBar .5s var(--nv-spring) both; }
#mainNav .nav-mobile-btn.pop .nb i:nth-child(2) { animation-delay: .06s; }
#mainNav .nav-mobile-btn.pop .nb i:nth-child(3) { animation-delay: .12s; }
@keyframes nvBar { from { opacity: 0; transform: translateX(-8px) scaleX(.4); } to { opacity: 1; transform: none; } }

/* ---- laptop and tablet: the three-column bar (logo | links | actions) --------------------------------------------- */
@media (min-width: 769px) {
  #mainNav .nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; }
  #mainNav .nav-logo { justify-self: start; flex-direction: row; gap: 11px; }
  #mainNav .nav-tagline { background: none; padding: 0; font-size: .54rem; letter-spacing: .16em; line-height: 1.4; white-space: normal; max-width: 6.4em; text-align: left; }
  #mainNav .nav-logo:hover .nav-tagline { background: none; }
  #mainNav .nav-right { justify-self: end; }
  #mainNav .nav-mobile-btn { display: none; }
}
/* tablet: a little tighter so five links, Log in and Sign up sit comfortably */
@media (min-width: 769px) and (max-width: 1099px) {
  #mainNav .nav-inner { padding-left: 18px; padding-right: 18px; gap: 10px; }
  #mainNav .nav-tagline { display: none; }
  #mainNav .nav-link { padding: 8px 11px; font-size: .76rem; }
  #mainNav .nav-cta { padding: 9px 15px; font-size: .76rem; }
  #mainNav .dgl-login > summary { padding: 8px 11px; font-size: .76rem; }
}
/* large laptops and desktops: more room, a touch more presence */
@media (min-width: 1280px) {
  #mainNav .nav-link { padding: 9px 18px; font-size: .84rem; }
  #mainNav .nav-cta { padding: 11px 24px; font-size: .84rem; }
}

/* ---- phone: slim bar ----------------------------------------------------------------------------------------------- */
@media (max-width: 768px) {
  #mainNav .nav-inner { padding: 8px 16px; gap: 10px; }
  #mainNav .nav-logo { flex-direction: row; gap: 9px; padding: 0; }
  #mainNav .nav-logo img { height: 40px; }
  #mainNav.dgl-compact .nav-logo img { height: 34px; }
  #mainNav .nav-tagline { background: none; padding: 0; font-size: .5rem; letter-spacing: .14em; line-height: 1.35; white-space: normal; max-width: 6.2em; text-align: left; }
  #mainNav .nav-center { display: none; }
  #mainNav .nav-right { gap: 9px; }
  #mainNav .nav-cta { padding: 9px 15px; font-size: .78rem; }
  #mainNav .nav-cta::after { display: none; }
  #mainNav .nav-mobile-btn { display: inline-flex; }
}
@media (max-width: 380px) { #mainNav .nav-tagline { display: none; } #mainNav .nav-cta { padding: 9px 13px; } }

@media (prefers-reduced-motion: reduce) {
  #mainNav, #mainNav .nav-inner, #mainNav .nav-logo, #mainNav .nav-logo img, #mainNav .nav-pill, #mainNav .nav-cta, #mainNav .nav-mobile-btn, #mainNav .nav-mobile-btn .nb i { transition-duration: .01ms !important; animation: none !important; }
  #mainNav .nav-cta::before, #mainNav .nav-link[href*="tracking"]::after, #mainNav .nav-logo:hover::after { animation: none !important; }
  #mainNav.dgl-hidden { transform: none; box-shadow: 0 1px 0 rgba(0, 40, 104, .06), 0 10px 30px rgba(0, 20, 70, .05); }
}
