/* ============ NAVIGATION & HEADER ============ */
nav.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

nav.topnav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #0a0a0acc;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: -1;
  pointer-events: none;
}

.nav-inner {
  width: 85%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding 0.3s ease;
}

.logo {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 60; /* Keeps logo visible above the full-screen menu overlay */
}

.logo-img {
  min-width: 184px;
  height: auto;
  max-width: 184px;
  object-fit: cover;
  display: inline-block;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2.25rem;
  margin-right: 2.25rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  display: flex;
  color: var(--fg-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: all 0.25s ease;
  letter-spacing: -0.005em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}

.nav-item-dropdown > a {
  padding: 1.25rem 0 1.25rem 2rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: #ffffff08;
  padding: 3px;
  position: relative;
  z-index: 60; /* Remains accessible on mobile */
}

.lang-switcher a {
  display: inline-block;
  padding: 0.35rem 0.75rem !important;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.72rem !important;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--fg-3) !important;
  transition: all 0.25s ease;
  line-height: 1;
}

.lang-switcher a:hover:not(.active) {
  color: var(--fg) !important;
}

.lang-switcher a.active {
  background: #ffffff14;
  color: var(--accent) !important;
}

.nav-cta {
  padding: 0.5rem 1rem;
  background: var(--fg);
  color: var(--bg) !important;
  border-radius: 6px;
  font-weight: 500 !important;
}

.nav-cta:hover {
  opacity: 0.88;
}

.nav-item-dropdown {
  position: static;
}

.nav-megamenu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  height: auto; /* Locked height constraint */
  max-height: 430px;
  overflow: hidden; /* Strict overflow prevention */
  display: block;
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.nav-megamenu::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #0a0a0af2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.nav-item-dropdown:hover .nav-megamenu {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.nav-megamenu-card {
  position: relative;
  z-index: 2;
  padding: 4rem 0; 
  height: 100%;
  box-sizing: border-box;
}

.megamenu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr; /* 2fr gives the double column balanced proportional space */
  gap: 2.5rem;
  height: 100%;
}

.megamenu-col {
  display: flex;
  flex-direction: column;
  max-height: 364px;
}

.megamenu-cat-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--fg-3) !important;
  text-decoration: none;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
  letter-spacing: 0.05em;
}

/* Two equal columns inside the CMS megamenu column with centered separator */
.megamenu-list-double {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Equally sized columns */
  gap: 1.5rem 2.5rem; /* Balanced horizontal and vertical gaps */
  position: relative;
}
.megamenu-list-double > a span{
  font-weight: 400;
}

.megamenu-list-double::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40%; /* Perfect center positioning */
  transform: translateX(-50%);
  width: 1px; /* Solid, crisp line */
  background-color: rgba(255, 255, 255, 0.08); /* Subtle dark border blending with standard UI */
}

.megamenu-cat-title:hover {
  color: var(--fg) !important;
}

.megamenu-cat-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.megamenu-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.megamenu-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  gap: 0.25rem;
  transition: all 0.25s ease;
}

.megamenu-item:hover {
  transform: translate(3px);
}

.megamenu-item-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--fg) !important;
  transition: all 0.25s ease;
}

.megamenu-item:hover .megamenu-item-title {
  color: var(--accent) !important;
}

.megamenu-item-desc {
  font-size: 0.85rem !important; /* Compact description font size */
  color: var(--fg-3) !important;
  line-height: 1.4;
}

.megamenu-promo-card {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid rgba(165, 243, 161, 0.2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #72cf6d05;
  text-decoration: none;
  transition: all 0.2s ease;
}

.megamenu-promo-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.megamenu-promo-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent) !important;
}

.megamenu-promo-desc {
  font-size: 0.78rem;
  color: var(--accent) !important;
  opacity: 0.9;
}

.megamenu-featured-col {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

.megamenu-featured-card {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.megamenu-featured-badge {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(165, 243, 161, 0.15);
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.megamenu-featured-title {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.megamenu-featured-desc {
  font-size: 1.05rem;
  color: var(--fg-3);
  line-height: 1.5;
  margin-bottom: auto;
  padding-bottom: 2rem;
}

.megamenu-featured-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg) !important;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: auto;
  transition: color 0.15s ease;
}

.megamenu-featured-link:hover {
  color: var(--accent) !important;
}

.megamenu-featured-link .arr {
  transition: transform 0.2s ease;
}

.megamenu-featured-link:hover .arr {
  transform: translate(3px);
}

.chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  margin: auto 0 auto 6px;
  transition: transform 0.2s ease;
}

.nav-item-dropdown:hover .chevron {
  transform: translateY(1px) rotate(225deg);
}

.burger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 5px;
}

.burger-bar {
  width: 22px;
  height: 1.5px;
  background: var(--fg);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}


/* Ensure responsiveness resets to single column on mobile */
@media (max-width: 1080px) {
  .nav-megamenu {
    height: auto;
    max-height: none;
    overflow-y: auto;
  }
  .nav-megamenu-card {
    padding: 0.25rem 0 1.25rem 1.25rem;
    height: auto;
  }
  .megamenu-grid {
    grid-template-columns: 1fr;
    height: auto;
    gap: 1.5rem;
  }
  .megamenu-list-double {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .megamenu-list-double::before {
    display: none; /* Hide vertical center separator on responsive stacked layouts */
  }
}
/* ============ RESPONSIVE HEADER OVERRIDES ============ */
@media (max-width: 1080px) {
  /* 1. Topnav bar spacing */
  nav.topnav {
    padding: 0.65rem 0;
  }

  .burger-menu {
    display: flex;
    z-index: 60;
    cursor: pointer;
    padding: 6px;
    gap: 5px;
  }

  .burger-bar {
    width: 22px;
    height: 1.5px;
    background: var(--fg-2);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
  }

  .nav-right {
    gap: 1rem;
  }

  /* 2. Full-screen slide-in drawer */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh; /* dvh handles mobile browser chrome correctly */
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5.5rem 1.75rem 2.5rem;
    gap: 0;
    list-style: none;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 55;
    overflow-y: auto;
  }

  .nav-links.nav-open {
    transform: translateX(0);
  }

  /* Thin rule between every nav item - anchors the list visually */
  .nav-links > li {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav-links > li:first-child {
    border-top: 1px solid var(--line);
  }

  /* Top-level link row */
  .nav-links li > a {
    font-size: clamp(1.25rem, 4.5vw, 1.65rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--fg-2);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: color 0.2s ease;
    text-decoration: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--fg);
  }

  /* Accent pulse on active page link */
  .nav-links a.active {
    color: var(--accent);
  }

  /* Hide desktop CTA - a full-width version lives at the bottom of the drawer */
  .nav-links .nav-cta {
    display: none !important;
  }

  /* Append a full-width CTA at the bottom of the drawer using padding + a pseudo rule */
  .nav-links::after {
    content: '';
    display: block;
    margin-top: auto;
    padding-top: 1.5rem;
  }

  .nav-item-dropdown {
    width: 100%;
    position: static;
  }

  /* Disable hover/focus rotation on mobile and only rotate if open */
  .nav-item-dropdown:hover .chevron {
    transform: translateY(-2px) rotate(45deg);
  }

  .nav-megamenu.megamenu-open ~ a .chevron,
  .nav-item-dropdown:has(.megamenu-open) > a .chevron,
  .nav-item-dropdown > a.expanded .chevron {
    transform: translateY(1px) rotate(225deg) !important;
  }

  /* 3. Mobile megamenu - indented, left-bordered, compact */
  .nav-megamenu {
    position: static;
    width: 100%;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transform: none;
    transition:
      max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.25s ease,
      visibility 0.25s ease;
    pointer-events: none;
  }

  .nav-megamenu::before {
    display: none;
  }

  .nav-megamenu-card {
    padding: 0.25rem 0 1.25rem 1.25rem;
    border-left: 1px solid var(--line-2);
    margin-bottom: 0.5rem;
  }

  .megamenu-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Category label */
  .megamenu-cat-title {
    font-size: 0.68rem;
    font-family: var(--mono);
    color: var(--fg-3) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    padding-bottom: 0;
    border-bottom: none;
  }

  .megamenu-list {
    gap: 0;
    padding-left: 0;
  }

  /* Sub-link rows use the same thin-rule rhythm as top-level links */
  .megamenu-item {
    border-bottom: 1px solid var(--line);
    padding: 0.65rem 0;
    gap: 0;
    transform: none !important; /* Disable horizontal nudge on mobile */
  }

  .megamenu-item:last-child {
    border-bottom: none;
  }

  .megamenu-item-title {
    font-size: 1.05rem;
    color: var(--fg-2) !important;
    transition: color 0.15s ease;
  }

  .megamenu-item:hover .megamenu-item-title {
    color: var(--accent) !important;
  }

  .megamenu-item-desc {
    display: none; /* Stay compact on mobile */
  }

  /* Hide decorative promo/feature panels */
  .megamenu-promo-card,
  .megamenu-featured-col {
    display: none;
  }

  /* Open state */
  .nav-megamenu.megamenu-open {
    max-height: 60vh;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    pointer-events: auto;
  }

  /* 4. Burger → X - exact math for gap: 5px, height: 1.5px bars */
  /* Distance from bar 1 centre to bar 2 centre = 1.5/2 + 5 + 1.5/2 = 6.5px */
  .burger-menu.open .burger-bar {
    background: var(--fg);
  }

  .burger-menu.open .burger-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .burger-menu.open .burger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.4);
  }

  .burger-menu.open .burger-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

@media (max-width: 1080px) {
  .logo-img{
    min-width: 120px;
    max-width: 120px;
  }
}

/* Home Button Style */
.nav-home-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin-left: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--accent) !important;
  transition: all 0.25s ease;
  text-decoration: none;
  z-index: 60;
}

.nav-home-btn:hover {
  background: var(--accent-soft);
  color: var(--fg) !important;
  border-color: var(--accent);
  transform: translateY(-1.5px);
}

.nav-home-btn .home-icon {
  width: 16px;
  height: 16px;
  display: block;
}

@media (max-width: 376px) {
  .nav-inner {
    width: 92%;
  }
  .logo-img {
    min-width: 100px;
    max-width: 100px;
  }
  .nav-right {
    gap: 0.5rem;
  }
  .nav-home-btn {
    margin-left: 5px;
  }
  .lang-switcher a {
    padding: 0.35rem 0.5rem !important;
  }
}