/* nav-v2: premium navigation (loaded after main.css + header-bar.css). Remove the <link> in includes/header.php to switch it off. */

/* ---------- Page transitions: native cross-document view transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: gwx-out .16s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: gwx-in .34s cubic-bezier(0,0,.2,1) both; }
@keyframes gwx-out { to { opacity: 0; } }
@keyframes gwx-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes gwx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* the header stays put while only the page content crossfades */
.header-top { view-transition-name: gwx-top; }
.site-nav { view-transition-name: gwx-nav; }
::view-transition-group(gwx-top), ::view-transition-group(gwx-nav) { animation-duration: 0s; }
/* fallback for browsers without view transitions (set by a tiny inline script) */
html.gwx-fb body { animation: gwx-in .3s cubic-bezier(0,0,.2,1) both; }
/* thin loading line while the next page is on its way (old page stays visible) */
html.gwx-loading::before {
  content: ''; position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99999;
  background: #1A9E72; box-shadow: 0 0 10px rgba(61,219,160,.7);
  animation: gwx-bar 6s cubic-bezier(.1,.6,.2,1) forwards; pointer-events: none;
}
@keyframes gwx-bar { to { width: 88%; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html.gwx-fb body { animation: none; }
}

/* ---------- Sliding underline (created by nav-v2.js) ---------- */
.gwx-ind {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0; opacity: 0;
  background: #1A9E72; pointer-events: none;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), width .38s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.gwx-ind.gwx-noanim { transition: none; }

/* ---------- Desktop ---------- */
@media (min-width: 969px) {
  html body .header-top { border-bottom: 1px solid rgba(11,61,46,.06); }
  html body .header-actions .login-link { color: #2f4a40; font-weight: 500; }
  html body .header-actions .login-link:hover { color: #0B3D2E; background: rgba(26,158,114,.08); }
  html body .header-actions .hdr-search { background: #F6FAF8; border-color: #E1EAE5; height: 46px; }
  html body .header-actions .hdr-search:focus-within { background: #fff; }

  html body .site-nav { background: #fff; transition: box-shadow .3s ease; backdrop-filter: none; }
  html.gwx-scrolled body .site-nav { box-shadow: 0 16px 32px -22px rgba(11,61,46,.4); }

  html body .site-nav .nav-inner { position: relative; }
  html body .site-nav .nav-inner .nav-links > li { position: static; }
  html body .site-nav .nav-inner .nav-links > li > a {
    height: var(--nav-h, 66px); padding: 0 16px !important; display: inline-flex; align-items: center;
    font-size: 15.5px !important; font-weight: 500 !important; letter-spacing: -0.005em !important;
    color: #3a5148; border-bottom: 0 !important; transition: color .2s ease;
  }
  html body .site-nav .nav-inner .nav-links > li > a:hover,
  html body .site-nav .nav-inner .nav-links > li:hover > a { color: #0B3D2E; border-bottom: 0 !important; }
  html body .site-nav .nav-inner .nav-links > li > a.active { color: #1A9E72; border-bottom: 0 !important; }
  html body .site-nav .nav-inner .nav-links > li > a.dropdown-trigger::after { opacity: .55; margin-left: 2px; }
  html body .site-nav .nav-inner .nav-links > li.dd-open > a.dropdown-trigger::after { transform: rotate(225deg); margin-top: 1px; }

  /* Mega menu: spans the container, fades and rises in */
  html body .site-nav .nav-inner .nav-links > li > .mega-dropdown {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 4px 28px !important;
    position: absolute !important; top: 100% !important; left: 32px !important; right: 32px !important;
    width: auto !important; min-width: 0 !important; margin-top: -1px;
    padding: 28px 24px 24px !important; background: #fff !important;
    border: 1px solid #E3EBE7 !important; border-top: 2px solid #1A9E72 !important; border-radius: 0 !important;
    box-shadow: 0 44px 80px -34px rgba(11,61,46,.38), 0 14px 28px -16px rgba(11,61,46,.14) !important;
    opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none;
    transition: opacity .2s ease, transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
  }
  html body .site-nav .nav-inner .nav-links > li:hover > .mega-dropdown,
  html body .site-nav .nav-inner .nav-links > li.dd-open > .mega-dropdown {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition-delay: 0s, 0s, 0s;
  }
  html body .site-nav .mega-col { gap: 2px !important; }
  html body .site-nav .mega-item { padding: 14px 8px; cursor: pointer; gap: 6px; }
  html body .site-nav .mega-title { transition: color .2s ease; }
  html body .site-nav .mega-item:hover .mega-title { color: #1A9E72; }
  html body .site-nav .mega-item:hover .mega-link { gap: 10px; }
  html body .site-nav .mega-title { font-size: 15.5px; font-weight: 600; color: #0B3D2E; }
  html body .site-nav .mega-desc { font-size: 14px; line-height: 1.55; color: #5c7168; }
  html body .site-nav .mega-link { font-size: 13px; margin-top: 4px; }
  html body .site-nav .nav-links > li:hover > .mega-dropdown .mega-item,
  html body .site-nav .nav-links > li.dd-open > .mega-dropdown .mega-item { animation: gwx-rise .4s cubic-bezier(.2,.8,.2,1) both; }
  html body .site-nav .mega-col:nth-child(2) .mega-item { animation-delay: .04s !important; }
  html body .site-nav .mega-col:nth-child(3) .mega-item { animation-delay: .08s !important; }

  html body .site-nav .nav-actions a.btn { transition: background .2s ease, box-shadow .2s ease !important; }
  html body .site-nav .nav-actions a.btn:hover { box-shadow: 0 12px 22px -12px rgba(26,158,114,.75) !important; }
  @media (prefers-reduced-motion: reduce) {
    html body .site-nav .nav-links > li > .mega-dropdown { transition: none; }
    html body .site-nav .mega-item { animation: none !important; }
    .gwx-ind { transition: none; }
  }
}

/* ---------- Mobile: full-screen sheet ---------- */
@media (max-width: 968px) {
  html { --gwx-hh: 64px; }
  html.gwx-nav-open { overflow: hidden; }
  html body .header-top { padding: 10px 16px; }
  html body .mobile-toggle {
    width: 44px; height: 44px; border: 1px solid #D9E4DF; border-radius: 0; background: #fff;
    transition: background .2s ease, border-color .2s ease;
  }
  html body .mobile-toggle span { height: 1.5px; background: #0B3D2E; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease, background .2s ease; }
  html body .mobile-toggle.is-open { background: #0B3D2E; border-color: #0B3D2E; }
  html body .mobile-toggle.is-open span { background: #fff; }

  html body .site-nav {
    top: var(--gwx-hh, 64px) !important; background: #fff; backdrop-filter: none;
    max-height: calc(100vh - var(--gwx-hh, 64px)) !important;
    max-height: calc(100dvh - var(--gwx-hh, 64px)) !important;
    overflow-y: auto !important; border-bottom: 0 !important; box-shadow: none !important;
    opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
    transition: opacity .25s ease, transform .32s cubic-bezier(.2,.8,.2,1), visibility 0s linear .32s !important;
    overscroll-behavior: contain;
  }
  html body .site-nav.mobile-open {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    height: calc(100vh - var(--gwx-hh, 64px)); height: calc(100dvh - var(--gwx-hh, 64px));
    transition-delay: 0s !important;
  }
  html body .site-nav .nav-inner { display: flex !important; flex-direction: column !important; min-height: 100%; padding: 8px 20px 24px !important; }
  html body .site-nav .nav-actions { display: contents; }
  html body .site-nav .nav-actions .hdr-search--panel { order: -1; margin: 12px 0 6px !important; width: 100%; }
  html body .site-nav .nav-links { order: 1; margin: 6px 0 24px; }
  html body .site-nav .nav-links > li > a {
    font-size: 22px !important; font-weight: 500 !important; letter-spacing: -0.02em !important;
    padding: 18px 0 !important; color: #10261F; border-bottom: 1px solid #E6EDE9 !important;
    display: flex; align-items: center; justify-content: space-between;
  }
  html body .site-nav .nav-links > li > a.active { color: #1A9E72; border-bottom: 1px solid #E6EDE9 !important; }
  html body .site-nav .nav-links > li > a.dropdown-trigger::after { margin-left: auto; opacity: .6; }
  html body .site-nav .nav-links > li.accordion-open > .mega-dropdown {
    display: block !important; animation: gwx-rise .3s cubic-bezier(.2,.8,.2,1) both;
  }
  html body .site-nav .mega-dropdown { background: transparent; padding: 4px 0 8px 14px; border-left: 2px solid #1A9E72; margin: 6px 0 8px; }
  html body .site-nav .mega-col { gap: 0; margin: 0; }
  html body .site-nav .mega-item { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #EEF3F0; cursor: pointer; }
  html body .site-nav .mega-title { font-size: 17px; font-weight: 500; color: #10261F; }
  html body .site-nav .mega-link { font-size: 14px; white-space: nowrap; }
  html body .site-nav.mobile-open .nav-links > li { animation: gwx-rise .4s cubic-bezier(.2,.8,.2,1) both; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(2) { animation-delay: .03s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(3) { animation-delay: .06s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(4) { animation-delay: .09s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(5) { animation-delay: .12s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(6) { animation-delay: .15s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(7) { animation-delay: .18s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(8) { animation-delay: .21s; }
  html body .site-nav.mobile-open .nav-links > li:nth-child(9) { animation-delay: .24s; }
  html body .site-nav .nav-actions a.btn {
    order: 3; margin-top: auto !important; width: 100% !important; height: 56px !important; min-height: 56px !important;
    font-size: 17px !important; justify-content: center;
  }
  .gwx-ind { display: none; }
  @media (prefers-reduced-motion: reduce) {
    html body .site-nav, html body .site-nav * { animation: none !important; transition-duration: 0s !important; }
  }
}

/* text-up-v1: larger header + menu text */
@media (min-width: 969px) {
  html body .header-top .logo-text strong { font-size: 22px !important; }
  html body .header-top .logo-text span { font-size: 15px !important; line-height: 1.35 !important; }
  html body .header-actions .hdr-search input, html body .header-actions .hdr-search input::placeholder { font-size: 17px !important; }
  html body .header-actions .login-link, html body .header-actions .lang-link, html body .header-actions > a { font-size: 17px !important; }
  html body .site-nav .nav-inner .nav-links > li > a { font-size: 17.5px !important; padding: 0 14px !important; }
  html body .site-nav .nav-actions a.btn { font-size: 17px !important; }
  html body .site-nav .mega-title { font-size: 19px !important; }
  html body .site-nav .mega-desc { font-size: 16.5px !important; line-height: 1.6 !important; }
  html body .site-nav .mega-link { font-size: 15.5px !important; }
}
@media (min-width: 969px) and (max-width: 1180px) {
  html body .header-top .logo-text span { font-size: 13.5px !important; }
  html body .site-nav .nav-inner .nav-links > li > a { font-size: 16px !important; padding: 0 10px !important; }
  html body .site-nav .nav-actions a.btn { font-size: 15.5px !important; }
}
@media (max-width: 968px) {
  html body .header-top .logo-text strong { font-size: 20px !important; }
  html body .site-nav .mega-title { font-size: 18px !important; }
  html body .site-nav .mega-desc { font-size: 16px !important; }
}
/* /text-up-v1 */
