/* ================================================================
   NAWIS MARINE — PREMIUM HEADER v3
   Inspired by Cummins: two-tier, glassmorphic, mega-menu
   ================================================================ */

/* Superfish injects ::after carets via inline JS styles; suppress them
   so our custom mega-menu chevrons are the only indicators. */
#masthead .sf-with-ul::after,
#masthead .sf-arrows .sf-with-ul::after,
#masthead a.sf-with-ul::after,
.sf-menu a.sf-with-ul::after {
  display: none !important;
  content: none !important;
  border: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---------------------------------------------------------------
   0. CSS CUSTOM PROPERTIES (header-scope)
   --------------------------------------------------------------- */
:root {
  --hdr-height: 72px;
  --hdr-top-height: 36px;
  --hdr-total: calc(var(--hdr-top-height) + var(--hdr-height));
  --hdr-bg: #ffffff;
  --hdr-bg-glass: rgba(255, 255, 255, 0.92);
  --hdr-ink: #0c1a2e;
  --hdr-ink-2: #1e293b;
  --hdr-ink-3: #475569;
  --hdr-muted: #64748b;
  --hdr-brand: #0b57d0;
  --hdr-brand-hover: #1a66e0;
  --hdr-brand-ghost: rgba(11, 87, 208, 0.07);
  --hdr-cyan: #06b6d4;
  --hdr-border: #e8ecf2;
  --hdr-border-soft: rgba(0, 0, 0, 0.06);
  --hdr-radius: 12px;
  --hdr-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hdr-dur: 0.28s;
  --hdr-font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --hdr-font-display: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --hdr-shadow: 0 4px 24px -4px rgba(12, 26, 46, 0.08);
  --hdr-shadow-mega: 0 20px 48px -8px rgba(12, 26, 46, 0.13);
  --hdr-container: 1340px;
}

/* ---------------------------------------------------------------
   1. TOP UTILITY BAR
   --------------------------------------------------------------- */
.nw-topbar {
  position: relative;
  z-index: 1001;
  height: var(--hdr-top-height);
  background: var(--hdr-ink);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--hdr-font);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: height var(--hdr-dur) var(--hdr-ease),
              opacity var(--hdr-dur) var(--hdr-ease);
}

.nw-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--hdr-container);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 28px);
  gap: 16px;
}

.nw-topbar__left,
.nw-topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nw-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color var(--hdr-dur) var(--hdr-ease);
  white-space: nowrap;
}

.nw-topbar__item:hover {
  color: #fff;
}

.nw-topbar__item svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  flex-shrink: 0;
}

.nw-topbar__sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
}

/* Hide topbar on scroll */
body.header-scrolled .nw-topbar {
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------
   2. MAIN HEADER SHELL
   --------------------------------------------------------------- */
#masthead.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--hdr-border);
  box-shadow: none;
  transition: background-color 0.4s var(--hdr-ease),
              box-shadow 0.4s var(--hdr-ease),
              border-color 0.4s var(--hdr-ease);
  font-family: var(--hdr-font);
}

body.header-scrolled #masthead.site-header {
  background: var(--hdr-bg-glass);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: var(--hdr-shadow);
  border-color: transparent;
}

/* Container */
#masthead .nw-header {
  width: 100%;
  max-width: var(--hdr-container);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 28px);
}

#masthead .nw-header__inner {
  min-height: var(--hdr-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* ---------------------------------------------------------------
   3. BRAND / LOGO
   --------------------------------------------------------------- */
#masthead .nw-header__brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px;
  text-decoration: none;
}

#masthead .nw-header__brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

#masthead .nw-header__brand img {
  width: auto;
  max-height: 38px;
  transition: opacity var(--hdr-dur) var(--hdr-ease);
}

#masthead .nw-header__brand:hover img {
  opacity: 0.85;
}

#masthead .nw-header__title {
  color: var(--hdr-ink);
  text-decoration: none;
  font-family: var(--hdr-font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------
   4. DESKTOP NAVIGATION
   --------------------------------------------------------------- */
#masthead .nw-header__nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#masthead .nw-menu,
#masthead .nw-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#masthead .nw-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center; /* Center align to fill empty space and bring menus closer */
}

/* Top-level items */
#masthead .nw-menu > li {
  position: relative;
}

/* Extend hover zone on parent items so mouse can travel to mega menu */
#masthead .nw-menu > li.menu-item-has-children {
  padding-bottom: 18px;
  margin-bottom: -18px;
}

#masthead .nw-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hdr-ink-2);
  text-decoration: none;
  font-family: var(--hdr-font);
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  white-space: nowrap;
  position: relative;
  transition: color var(--hdr-dur) var(--hdr-ease),
              background-color var(--hdr-dur) var(--hdr-ease);
}

/* Animated underline indicator */
#masthead .nw-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--hdr-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s var(--hdr-ease);
}

#masthead .nw-menu > li > a:hover::after,
#masthead .nw-menu > li.current-menu-item > a::after,
#masthead .nw-menu > li.current-menu-ancestor > a::after {
  transform: scaleX(1);
}

/* 
 * CRITICAL FIX FOR TRANSLATIONS:
 * When GTranslate is active, Google adds the 'translated-ltr' class to the HTML.
 * We compress the menu slightly ONLY when translated so it fits long Spanish/German words,
 * while keeping the original Turkish version big, readable, and close to the center.
 */
html.translated-ltr #masthead .nw-header__inner {
  gap: 12px;
}
html.translated-ltr #masthead .nw-menu > li > a {
  padding: 10px 8px;
  font-size: 0.83rem;
  letter-spacing: -0.01em;
}
html.translated-ltr #masthead .nw-menu > li > a::after {
  left: 8px;
  right: 8px;
}

/* Compress menu only on very small desktops (1081px - 1280px) to prevent overlap */
@media (min-width: 1081px) and (max-width: 1280px) {
  #masthead .nw-header__inner {
    gap: 12px;
  }
  #masthead .nw-menu > li > a {
    padding: 10px 10px;
    font-size: 0.84rem;
    letter-spacing: -0.01em;
  }
  #masthead .nw-menu > li > a::after {
    left: 10px;
    right: 10px;
  }
}

#masthead .nw-menu > li > a:hover {
  color: var(--hdr-brand);
  background: transparent;
}

#masthead .nw-menu > li.current-menu-item > a,
#masthead .nw-menu > li.current-menu-ancestor > a {
  color: var(--hdr-brand);
}

/* Kill ALL parent-theme dropdown arrows — every possible selector */
#masthead .sf-with-ul::after,
#masthead .nw-menu .sf-with-ul::after,
#masthead .nw-menu a.sf-with-ul::after,
#masthead .sf-arrows .sf-with-ul::after,
#masthead .sf-arrows ul .sf-with-ul::after,
#masthead .nw-menu .caret,
#masthead .nw-menu .sf-sub-indicator,
#masthead .nw-menu > li > a > .caret,
#masthead .nw-menu > li > a > .sub-arrow,
#masthead .nw-menu > li > a > i,
#masthead .nw-menu > li > a > svg,
#masthead .nw-menu > li > button,
#masthead .nw-menu .dropdown-toggle,
#masthead .nw-menu > li.menu-item-has-children > a > span.caret {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: none !important;
  content: none !important;
  visibility: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

/* Small clean chevron on parent items */
#masthead .nw-menu > li.menu-item-has-children > a {
  padding-right: 20px;
}
#masthead .nw-menu > li.menu-item-has-children > a::before {
  content: '' !important;
  display: block !important;
  position: absolute;
  right: 6px;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translateY(-50%);
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  opacity: 0.5;
  transition: transform 0.25s var(--hdr-ease), opacity 0.25s;
}
#masthead .nw-menu > li.menu-item-has-children:hover > a::before {
  transform: translateY(-50%) rotate(180deg);
  opacity: 0.8;
}

/* ---------------------------------------------------------------
   5. MEGA MENU (Desktop ≥ 1081px)
   --------------------------------------------------------------- */
/* Hide mega menu preview strictly on mobile */
#masthead .nw-mega-preview-pane {
  display: none !important;
}

@media (min-width: 1081px) {
  /* Parent li is static so sub-menu positions relative to #masthead */
  #masthead .nw-menu > li.menu-item-has-children {
    position: static !important;
  }

  #masthead .nw-menu > li > .sub-menu {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    transform: none !important;
    width: 100% !important;
    display: none !important;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0;
    padding: 0;
    border-radius: 0 0 14px 14px;
    background: var(--hdr-bg);
    border: none;
    border-top: 1px solid var(--hdr-border);
    box-shadow: var(--hdr-shadow-mega);
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
  }

  #masthead .nw-menu > li:hover > .sub-menu,
  #masthead .nw-menu > li:focus-within > .sub-menu {
    display: grid !important;
    opacity: 1;
    pointer-events: auto;
  }

  /* ---- Mega menu columns (Level 2 items) ---- */
  #masthead .nw-menu > li > .sub-menu > li {
    padding: 24px 24px 20px;
    border-right: 1px solid var(--hdr-border);
    transition: background-color var(--hdr-dur) var(--hdr-ease);
  }

  #masthead .nw-menu > li > .sub-menu > li:last-child {
    border-right: none;
  }

  #masthead .nw-menu > li > .sub-menu > li:hover {
    background: #f8fafc;
  }

  /* ---- Mega menu dynamic preview pane ---- */
  #masthead .nw-mega-preview-pane {
    display: flex !important; /* Override mobile hide */
    position: absolute;
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    width: 360px; /* Premium wide appearance */
    background: var(--hdr-bg);
    box-shadow: -15px 0 40px rgba(0,0,0,0.08); /* Soft shadow bleeding onto the menus */
    border-left: 1px solid var(--hdr-border);
    border-right: none;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 10;
    
    /* Starts hidden and slides in from the right */
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.3s var(--hdr-ease), transform 0.3s var(--hdr-ease), visibility 0.3s;
    pointer-events: none;
    will-change: transform, opacity; /* Hardware acceleration */
  }
  
  /* Left side variant: Docks to the left if hovering a right-side menu item */
  #masthead .nw-mega-preview-pane.is-left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--hdr-border);
    box-shadow: 15px 0 40px rgba(0,0,0,0.08); /* Shadow bleeds to the right */
    transform: translateX(-20px); /* Slides in from the left */
  }
  
  #masthead .nw-mega-preview-pane.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }
  
  .nw-mega-preview-img-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #f1f5f9; /* skeleton bg */
    overflow: hidden;
  }

  /* Skeleton Shimmer Effect while image loads from network */
  @keyframes nwShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  .nw-mega-preview-img-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: nwShimmer 1.5s infinite linear;
    z-index: 0;
  }

  .nw-mega-preview-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.4s var(--hdr-ease), transform 0.4s var(--hdr-ease);
    will-change: transform, opacity; /* Hardware acceleration */
    z-index: 1;
  }

  .nw-mega-preview-img-wrapper img.active {
    opacity: 1;
    transform: scale(1);
  }
  
  /* Overlay gradient so text is readable */
  .nw-mega-preview-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.1) 60%, transparent 100%);
    pointer-events: none;
  }

  .nw-mega-preview-title {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    color: #fff;
    font-family: var(--hdr-font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .nw-mega-preview-title.active {
    opacity: 1;
    transform: translateY(0);
  }

  /* Column heading link */
  #masthead .nw-menu > li > .sub-menu > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--hdr-border);
    color: var(--hdr-ink);
    text-decoration: none;
    font-family: var(--hdr-font-display);
    font-size: 0.78rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color var(--hdr-dur) var(--hdr-ease),
                border-color var(--hdr-dur) var(--hdr-ease);
  }

  /* Remove pseudo-elements from mega menu child links */
  #masthead .nw-menu > li > .sub-menu > li > a::before,
  #masthead .nw-menu > li > .sub-menu > li > a::after {
    display: none !important;
    content: none !important;
  }

  #masthead .nw-menu > li > .sub-menu > li:hover > a {
    color: var(--hdr-brand);
    border-bottom-color: var(--hdr-brand);
  }

  /* ---- Sub-items (Level 3) ---- */
  #masthead .nw-menu > li > .sub-menu > li > .sub-menu {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
  }

  #masthead .nw-menu > li > .sub-menu > li > .sub-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hdr-ink-3);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.4;
    font-weight: 500;
    padding: 7px 8px;
    border-radius: 8px;
    transition: color var(--hdr-dur) var(--hdr-ease),
                background-color var(--hdr-dur) var(--hdr-ease);
  }

  /* Remove pseudo-elements from level 3 links too */
  #masthead .nw-menu > li > .sub-menu > li > .sub-menu > li > a::before,
  #masthead .nw-menu > li > .sub-menu > li > .sub-menu > li > a::after {
    display: none !important;
    content: none !important;
  }

  #masthead .nw-menu > li > .sub-menu > li > .sub-menu > li > a:hover {
    color: var(--hdr-brand);
    background: var(--hdr-brand-ghost);
  }
}

/* ---------------------------------------------------------------
   6. HEADER ACTIONS (Search + CTA)
   --------------------------------------------------------------- */
.nw-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: 6px;
}

/* Search toggle */
.nw-header__search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hdr-border);
  border-radius: 10px;
  background: transparent;
  color: var(--hdr-ink-3);
  cursor: pointer;
  transition: color var(--hdr-dur) var(--hdr-ease),
              background-color var(--hdr-dur) var(--hdr-ease),
              border-color var(--hdr-dur) var(--hdr-ease);
  padding: 0;
}

.nw-header__search-toggle svg {
  width: 18px;
  height: 18px;
}

.nw-header__search-toggle:hover {
  color: var(--hdr-brand);
  background: var(--hdr-brand-ghost);
  border-color: rgba(11, 87, 208, 0.2);
}

/* CTA button in header */
.nw-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--hdr-ink);
  color: #fff;
  font-family: var(--hdr-font);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: normal;
  max-width: 130px;
  text-align: left;
  line-height: 1.2;
  transition: background-color var(--hdr-dur) var(--hdr-ease),
              transform var(--hdr-dur) var(--hdr-ease),
              box-shadow var(--hdr-dur) var(--hdr-ease);
}

.nw-cta-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide CTA text completely on cramped desktop screens (1081px - 1240px)
   to ensure long translated languages never break the layout */
@media (min-width: 1081px) and (max-width: 1240px) {
  .nw-header__cta {
    padding: 10px;
    border-radius: 50%;
    max-width: 40px;
  }
  .nw-cta-text {
    display: none;
  }
}

.nw-header__cta:hover {
  background: var(--hdr-brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(11, 87, 208, 0.45);
  color: #fff;
}

.nw-header__cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.3s var(--hdr-ease);
}

.nw-header__cta:hover svg {
  transform: translateX(2px);
}

/* ---------------------------------------------------------------
   7. SEARCH OVERLAY (Fullscreen)
   --------------------------------------------------------------- */
.nw-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--hdr-ease),
              visibility 0.35s;
}

.nw-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.nw-search-overlay__inner {
  width: min(640px, calc(100% - 48px));
  transform: translateY(16px);
  transition: transform 0.4s var(--hdr-ease);
}

.nw-search-overlay.is-open .nw-search-overlay__inner {
  transform: none;
}

.nw-search-overlay__field {
  position: relative;
}

.nw-search-overlay__field input {
  width: 100%;
  height: 64px;
  padding: 0 60px 0 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  color: #fff;
  font-family: var(--hdr-font-display);
  font-size: 1.3rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.3s var(--hdr-ease),
              background-color 0.3s var(--hdr-ease);
}

.nw-search-overlay__field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.nw-search-overlay__field input:focus {
  border-color: var(--hdr-cyan);
  background: rgba(255, 255, 255, 0.14);
}

.nw-search-overlay__close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s, color 0.2s;
  padding: 0;
}

.nw-search-overlay__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nw-search-overlay__close svg {
  width: 18px;
  height: 18px;
}

.nw-search-overlay__hint {
  margin-top: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  font-weight: 500;
}

.nw-search-overlay__hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 0.72rem;
  margin: 0 2px;
}

/* ---------------------------------------------------------------
   8. MOBILE NAV TOGGLE (≤ 1080px)
   --------------------------------------------------------------- */
#masthead .nw-header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--hdr-ink);
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color var(--hdr-dur) var(--hdr-ease),
              border-color var(--hdr-dur) var(--hdr-ease);
}

#masthead .nw-header__toggle:hover {
  background: var(--hdr-ink);
}

#masthead .nw-header__toggle:hover span[aria-hidden="true"] {
  background: #fff;
}

/* Hamburger lines — clear and visible */
#masthead .nw-header__toggle span[aria-hidden="true"] {
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--hdr-ink);
  border-radius: 2px;
  transition: transform 0.3s var(--hdr-ease),
              opacity 0.3s var(--hdr-ease),
              background-color 0.2s;
}

/* Animate to X when open */
#masthead .nw-header__toggle.is-active {
  background: var(--hdr-ink);
}
#masthead .nw-header__toggle.is-active span[aria-hidden="true"] {
  background: #fff;
}
#masthead .nw-header__toggle.is-active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
#masthead .nw-header__toggle.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#masthead .nw-header__toggle.is-active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------------------------------------------------------------
   9. MOBILE NAV DRAWER (≤ 1080px)
   --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nw-topbar { height: auto; min-height: 32px; }
  .nw-topbar__inner { flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 12px; }
  .nw-topbar__left { display: none; }
  .nw-topbar__right { justify-content: center; }

  #masthead .nw-header__inner {
    min-height: 60px;
    gap: 10px;
  }

  #masthead .nw-header__toggle {
    display: flex;
    order: 99;
  }

  .nw-header__cta { display: none; }

  .nw-header__search-toggle {
    width: 38px;
    height: 38px;
  }

  #masthead .nw-header__nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: var(--hdr-bg);
    border-left: 1px solid var(--hdr-border);
    box-shadow: -16px 0 48px rgba(12, 26, 46, 0.12);
    padding: 20px;
    padding-top: 80px;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s var(--hdr-ease);
  }

  #masthead .nw-header__nav.is-open {
    display: block;
    transform: translateX(0);
  }

  /* Backdrop */
  .nw-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
  }

  .nw-mobile-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  #masthead .nw-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  #masthead .nw-menu > li > a {
    padding: 14px 12px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  #masthead .nw-menu > li > a::after {
    display: none;
  }

  #masthead .nw-menu > li > a::before {
    display: none;
  }

  /* Mobile sub-menus */
  #masthead .nw-menu .sub-menu {
    margin-top: 4px;
    margin-left: 8px;
    padding-left: 14px;
    border-left: 2px solid var(--hdr-border);
  }

  #masthead .nw-menu .sub-menu li a {
    display: block;
    padding: 11px 10px;
    color: var(--hdr-ink-3);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color var(--hdr-dur) var(--hdr-ease),
                color var(--hdr-dur) var(--hdr-ease),
                padding-left var(--hdr-dur) var(--hdr-ease);
  }

  #masthead .nw-menu .sub-menu li a:hover {
    background: var(--hdr-brand-ghost);
    color: var(--hdr-brand);
    padding-left: 16px;
  }

  /* Mobile CTA at bottom of drawer */
  .nw-mobile-cta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--hdr-border);
  }

  .nw-mobile-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--hdr-ink);
    color: #fff;
    font-family: var(--hdr-font);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: background-color 0.3s var(--hdr-ease);
  }

  .nw-mobile-cta a:hover {
    background: var(--hdr-brand);
  }
}

/* ---------------------------------------------------------------
   10. PARENT THEME OVERRIDES
   --------------------------------------------------------------- */
#masthead .container,
#masthead .navbar,
#masthead .header-inner,
#masthead .site-header-inner,
#masthead .header-content,
#masthead .site-branding {
  all: unset !important;
  display: contents !important;
}

#masthead .navbar-toggle,
#masthead .menu-toggle,
#masthead .hamburger,
#masthead #primary-menu-toggle {
  display: none !important;
}

/* Kill all Superfish arrows globally */
#masthead .sf-arrows .sf-with-ul::after,
#masthead .sf-arrows ul .sf-with-ul::after,
#masthead .nw-menu a.sf-with-ul::after {
  display: none !important;
  content: none !important;
}

/* Ensure our nav takes over */
#masthead .nw-header__nav .nw-menu {
  display: flex !important;
}

@media (max-width: 1080px) {
  #masthead .nw-header__nav .nw-menu {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* ---------------------------------------------------------------
   11. GTRANSLATE — hide from main nav, style in topbar
   --------------------------------------------------------------- */
/* Hide GTranslate from main menu */
#masthead .nw-menu .gt_switcher,
#masthead .nw-menu .gt_switcher-popup,
#masthead .nw-menu .gtranslate_wrapper,
#masthead .nw-menu [class*="gt_"],
#masthead .nw-menu li:has(.gt_switcher),
#masthead .nw-menu li:has(.gtranslate_wrapper),
#masthead .nw-menu li:has(.gt_switcher-popup) {
  display: none !important;
}

/* Also hide floating/widget GTranslate */
body > .gt_switcher_wrapper,
body > .gtranslate_wrapper:not(.nw-topbar__gt),
#gt-nvframe {
  display: none !important;
}

/* GTranslate in topbar — flag-only compact style */
.nw-topbar__gt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nw-topbar__gt .gt_switcher {
  position: relative;
}

.nw-topbar__gt a.gt_switcher-popup,
.nw-topbar__gt .glink {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  font-size: 0.74rem !important;
  font-weight: 500 !important;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.nw-topbar__gt a.gt_switcher-popup:hover,
.nw-topbar__gt .glink:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff !important;
}

.nw-topbar__gt img {
  width: 18px !important;
  height: 14px !important;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
}

/* GTranslate popup dropdown styling */
.nw-topbar__gt .gt_switcher .gt_option {
  background: var(--hdr-ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important;
  padding: 6px !important;
  min-width: 140px;
}

.nw-topbar__gt .gt_switcher .gt_option a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 10px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.78rem !important;
  border-radius: 6px;
  transition: background-color 0.15s;
}

.nw-topbar__gt .gt_switcher .gt_option a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.nw-topbar__gt .gt_switcher .gt_option a img {
  width: 20px !important;
  height: 15px !important;
  border-radius: 2px;
}

/* ---------------------------------------------------------------
   12. TRANSLATION OVERFLOW PROTECTION
   GTranslate can produce long text — prevent layout breakage
   --------------------------------------------------------------- */
/* Nav items: truncate if translated text is too long */
#masthead .nw-menu > li {
  flex-shrink: 1;
  min-width: 0; /* Required for text-overflow to work in flex children */
}
#masthead .nw-menu > li > a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* CTA button: handled above with @media and .nw-cta-text */

/* Topbar items */
.nw-topbar__item {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mega menu headings — allow wrapping but cap width */
@media (min-width: 1081px) {
  #masthead .nw-menu > li > .sub-menu > li > a {
    word-break: break-word;
    hyphens: auto;
  }
  #masthead .nw-menu > li > .sub-menu > li > .sub-menu > li > a {
    word-break: break-word;
    hyphens: auto;
  }
}

/* Prevent header from growing too tall */
#masthead .nw-header__inner {
  flex-wrap: nowrap;
  overflow: visible;
}

/* ---------------------------------------------------------------
   13. PRINT
   --------------------------------------------------------------- */
@media print {
  .nw-topbar,
  #masthead.site-header { display: none !important; }
}

