:host {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  /* Allow host pointer events to pass through transparent areas if needed */
  pointer-events: none; 
}

/* Base Header & Hero State (Offset below topbar) */
header {
  pointer-events: auto;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  box-sizing: border-box;
  background-color: transparent;
  color: #FFFFFF;
  /* Synchronized transition including 'top' for smooth sliding */
  transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Open Sans","Proxima Nova",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  will-change: top, color;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.94) 0%, rgba(8, 8, 8, 0.99) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Not Hero (Scrolled) State - Slides to very top of viewport */
header.not-hero {
  top: 0; /* Snaps to top of browser once topbar scrolls out of view */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

header.not-hero::before {
  opacity: 1;
}

header a {
  color: inherit;
  text-decoration: none;
}

/* Navigation Containers */
.nav-left, 
.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  z-index: 10;
}

/* Links & Hover Underline Animation */
.nav-link {
  color: inherit;
  text-decoration: none;
  font-size: 1em;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: currentColor;
  transition: width 0.3s cubic-bezier(0.65, 0, 0.35, 1), background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
  width: 100%;
}

/* Logo */
.logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  width: 90px;
  height: 90px;
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
              height 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  font-size: 0.9em;
  letter-spacing: 2px;
  will-change: width, height, color, border-color;
}

header.not-hero .logo {
  width: 70px;
  height: 70px;
}

/* Divider */
.divider {
  width: 1px;
  height: 20px;
  background-color: #505050;
  transition: background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

:host(.enquire-header) header.hero .divider {
  background-color: #afafaf;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  margin: -24px -24px;
}

.department-dropdown {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  margin: -24px -24px;
}

.policy-dropdown {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  margin: -24px -24px;
}

.desktop-dropdown > .dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  font-family: inherit;
  transition: color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu {
  position: absolute;
  top: calc(100%);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  background: rgba(8, 8, 8, 0.99);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  list-style: none;
  padding: 6px 0;
  margin-left: 0;
  min-width: 96px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  display: flex;
  visibility: hidden;
  transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
}

.desktop-dropdown:hover .dropdown-menu,
.desktop-dropdown .dropdown-menu.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.department-menu,
.policy-menu {
  min-width: 180px;
}

.dropdown-menu li {
  color: #cccfce;
  padding: 12px 18px;
  font-size: 0.9em;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  transform-origin: center;
  text-align: center;
}

.dropdown-menu li:hover {
  color: #ffffff;
  transform: scale(1.03);
  background-color: rgba(255, 255, 255, 0.15);
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 10;
}

.hamburger .line {
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar {
  display: none;
}

/* Mobile Responsive Rules */
@media (max-width: 768px) {
  header {
    top: 0;
    padding: 0 24px;
    position: fixed;
  }

  .nav-left,
  .nav-right .nav-link,
  .nav-right .divider,
  .nav-right .lang-dropdown {
    display: none;
  }

  .hamburger {
    display: flex;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
  }

  .hamburger .line {
    position: absolute;
    left: 0;
    top: 50%;
  }

  .hamburger .line:nth-child(1) {
    transform: translateY(calc(-50% - 8px));
  }

  .hamburger .line:nth-child(2) {
    transform: translateY(-50%);
  }

  .hamburger .line:nth-child(3) {
    transform: translateY(calc(-50% + 8px));
  }

  .hamburger.is-open .line:nth-child(1) {
    transform: translateY(-50%) rotate(45deg);
  }

  .hamburger.is-open .line:nth-child(2) {
    opacity: 0;
  }

  .hamburger.is-open .line:nth-child(3) {
    transform: translateY(-50%) rotate(-45deg);
  }

  .logo,
  header.not-hero .logo {
    width: 80px;
    height: 80px;
  }

  .mobile-sidebar {
    display: block;
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9998;
    padding: 32px;
    box-sizing: border-box;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(8, 8, 8, 0.89) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    font-family: "Open Sans","Proxima Nova",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

.mobile-sidebar-progressive-blur {
  position: fixed;
  overflow: hidden;
}

.mobile-sidebar-progressive-blur::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  mask-image: linear-gradient(to bottom, #000000 0%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000000 0%, rgba(0, 0, 0, 0) 100%);
}

.mobile-sidebar-progressive-blur > * {
  position: relative;
  z-index: 1;
}


  .mobile-sidebar.show {
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-sidebar-nav {
    display: flex;
    flex-direction: column;
  }

  .mobile-sidebar-nav a {
    display: block;
    padding: 18px 0;
    color: inherit;
    font-size: 1.2rem;
    text-decoration: none;
  }

  .mobile-sidebar-parent {
    display: block;
  }

  .mobile-sidebar-toggle-row {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .mobile-sidebar-toggle-row > a {
    flex: 1;
  }

  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 18px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1.2rem;
    text-align: left;
    cursor: pointer;
  }

  .mobile-sidebar-arrow {
    width: 9px;
    height: 9px;
    margin-right: 18px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.25s ease;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.35s ease;
  }

  .mobile-sidebar-arrow:hover { 
  color: rgba(255, 255, 255, 1.0);
}

  .mobile-sidebar-toggle[aria-expanded="true"] .mobile-sidebar-arrow {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  .mobile-sidebar-children {
    max-height: 0;
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding-left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s;
  }

  .mobile-sidebar-children.show {
    max-height: 180px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }

  .mobile-sidebar-children a {
    display: block;
    padding: 0 0 18px 20px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
  }

  .mobile-sidebar-languages {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
  }

  .mobile-sidebar-languages a {
    display: inline;
    padding: 0;
    font-size: 1rem;
    color: #cccfce;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .mobile-sidebar-languages a:hover {
  color: #ffffff;
  transform: scale(1.02);
}

  .mobile-language-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 16px;
    font-size: 0;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.45);
  }

  .mobile-sidebar-divider {
    display: block;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
  }
}