/* Header Section */
.header-section {
  background-color: transparent;
  width: 100%;
  z-index: 999;
  position: fixed;
  left: 0;
  top: 0;
  transition: all 0.3s ease-in-out;
}

.navbar-fixed-top.header-section {
  background-color: var(--white);
  box-shadow: 0 0.1875rem 0.3125rem 0 rgba(44, 46, 48, 0.1);
  height: 70px;
  border-bottom: 0;
  padding: 0;
}

/* Logo Styles */
.logo-img {
  max-width: 200px;
  height: auto;
  transition: all 0.3s ease;
}

.header-btn-two {
  background: transparent;
  color: var(--white);
  line-height: 45px;
  padding: 0 25px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  border-radius: 30px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.header-btn-two:hover {
  opacity: 1;
  color: var(--white);
  text-decoration: none;
}

/* Navbar Styles */
.navbar {
  border: none;
  margin: 0;
  position: relative;
  padding: 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Desktop Navigation */
.menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mainmenu {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 55px;
  padding: 0 15px;
}

ul.nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

ul.nav > li {
  display: inline-block;
}

ul.nav > li > a {
  color: rgba(255, 255, 255, 0.9);
  display: inline-block;
  vertical-align: middle;
  padding: 0 15px;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 60px;
  z-index: 1;
  text-decoration: none;
  transition: all 0.3s ease;
}

ul.nav > li > a:hover,
ul.nav > li > a:focus,
ul.nav > li > a.active {
  background: none;
  color: var(--white);
  opacity: 1;
  text-decoration: none;
}

/* Fixed navbar styles */
.navbar-fixed-top ul.nav > li > a {
  color: #555;
}

.navbar-fixed-top ul.nav > li > a.active {
  color: #333;
}

.navbar-fixed-top ul.nav > li > a:hover,
.navbar-fixed-top ul.nav > li > a:focus,
.navbar-fixed-top ul.nav > li.active > a {
  color: #777;
}

/* Contact Menu */
.contact-menu {
  display: flex;
  align-items: center;
  min-width: 200px;
  justify-content: end;
}

/* Mobile Menu Styles */
.slicknav_menu {
  background: none;
  padding: 4px 0;
  display: none;
  position: relative;
  z-index: 10;
}

.slicknav_btn {
  background-color: transparent;
  margin: 4px 0 0 0;
  cursor: pointer;
  display: block;
  border: none;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.slicknav_icon-bar {
  background-color: #333;
  height: 3px;
  margin: 4px 0;
  width: 25px;
  display: block;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.navbar-fixed-top .slicknav_icon-bar {
  background-color: #333;
}

/* Hamburger Animation */
.slicknav_open .slicknav_icon-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.slicknav_open .slicknav_icon-bar:nth-child(2) {
  opacity: 0;
}

.slicknav_open .slicknav_icon-bar:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.overlay-visible {
  opacity: 1;
}

/* Mobile Navigation Menu */
.slicknav_nav {
  display: none;
  background-color: #2d374894;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  padding: 10px 0 20px 0;
  z-index: 999;
  list-style: none;
  margin: 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.slicknav_nav.slicknav_visible {
  transform: translateX(0);
}

.slicknav_nav.slicknav_hidden {
  transform: translateX(100%);
}

.slicknav_nav li {
  list-style: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slicknav_nav a {
  padding: 18px 30px;
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.slicknav_nav a:hover:before {
  transform: scaleY(1);
}

/* Mobile Auth Button */
.mobile-auth-btn {
  margin-top: 20px;
  padding: 0 30px;
  border-bottom: none;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .navbar {
    padding: 0 30px;
  }

  .logo-img {
    max-width: 180px;
  }
}

@media (max-width: 992px) {
  .navbar {
    padding: 0 20px;
  }

  .logo-img {
    max-width: 160px;
  }

  ul.nav > li > a {
    padding: 0 12px;
    font-size: 13px;
  }

  .mainmenu {
    padding: 0 10px;
  }
}

@media (max-width: 768px) {
  /* Hide desktop navigation */
  .mainmenu {
    display: none;
  }

  .contact-menu {
    display: none;
  }

  /* Show mobile navigation */
  .slicknav_menu {
    display: block;
  }

  .navbar {
    padding: 0 15px;
    min-height: 60px;
  }

  .logo-img {
    max-width: 140px;
  }

  .slicknav_nav {
    width: 280px;
  }

  .slicknav_nav a {
    font-size: 15px;
    padding: 16px 25px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 10px;
  }

  .logo-img {
    max-width: 120px;
  }

  /* Adjusted mobile menu width for smaller screens */
  .slicknav_nav {
    width: 260px;
  }

  .slicknav_nav a {
    font-size: 15px;
    padding: 16px 25px;
  }
}

@media (max-width: 360px) {
  .logo-img {
    max-width: 100px;
  }

  .slicknav_btn {
    padding: 6px;
  }

  .slicknav_icon-bar {
    width: 20px;
    height: 2px;
  }

  /* Further reduced mobile menu width for very small screens */
  .slicknav_nav {
    width: 260px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .slicknav_nav {
    background-color: #2d374894;
  }

  .slicknav_nav a {
    color: #e2e8f0;
    border-bottom-color: #4a5568;
  }
}

#mobile-menu .mobile-cta{
  display: flex;
  justify-content: center;
  padding: 12px 0;
  border-bottom: none;
}

#mobile-menu .mobile-cta a{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 140px;
  padding: 10px 18px;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
  margin: 0 auto;
}

body.mega-open { 
  overflow: hidden;
  padding-right: var(--sbw, 0px); /* set by JS */
}

/* --- Mega menu --- */
.has-mega{ position:relative; }
.has-mega > .top-link{ position:relative; }

.mega-menu{
  position: fixed;
  left: 50vw;                      /* center to viewport, not the nav */
  transform: translateX(-50%);
  top: var(--mega-top, 78px);      /* JS sets this to header bottom */
  width: min(1180px, calc(100vw - var(--mega-gutter) * 2));
  max-height: calc(100vh - var(--mega-top, 78px) - var(--mega-gutter));
  overflow: auto;                  /* scroll inside if too tall */
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.12);
  padding: 22px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 1000;
}

.has-mega.open .mega-menu,
.has-mega:hover .mega-menu,
.has-mega:focus-within .mega-menu{
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-inner{
  display:grid; gap:28px;
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.mega-group + .mega-group{ margin-top:18px; }

.mega-title{
  margin:0 0 10px; padding:0;
  font-size:13px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase; color:#6b7280;
}

/* Item row with icon + text + badge */
.mega-item{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:10px; text-decoration:none;
  color:#222; transition:background .18s ease, transform .08s ease;
}
.mega-item:hover{ background:rgba(0,0,0,.045); transform:translateX(2px); }

.mi-icon{
  width:28px; height:28px; flex:0 0 28px; display:grid; place-items:center;
  border-radius:6px; background:#f3f4f6;
  overflow:hidden;
}
.mi-icon img{ width:100%; height:100%; object-fit:contain; display:block; }

.mi-text{ font-weight:600; }
.mega-badge{
  margin-left: auto;
  display: inline-block; 
  padding: 3px 8px; 
  line-height: 1;
  font-size: 11px; 
  font-weight: 800; 
  border-radius: 999px;
  background: #CCFBF1; 
  color: #134E4A;
  white-space:nowrap;
}

/* Variants you may reuse (optional) */
.mega-badge.green{ background:rgba(16,185,129,.15); color:#047857; }
.mega-badge.blue{ background:rgba(59,130,246,.15); color:#1d4ed8; }
.mega-badge.purple{ background:rgba(139,92,246,.15); color:#6d28d9; }
.mega-badge.orange{ background:rgba(249,115,22,.14); color:#b45309; }

/* Fixed header variant */
.navbar-fixed-top .mega-item{ color:#222; }

/* Responsive */
@media (max-width: 1200px){ .mega-inner{ gap:22px; } }
@media (max-width: 992px){ .mega-inner{ grid-template-columns:repeat(2,1fr); } }
@media (max-width: 768px){ .mega-menu{ display:none !important; } }

/* Mobile collapsible styling already present; add tiny tweaks */
#mobile-menu .mobile-sub-heading{
  opacity:.7; font-size:13px; padding:10px 30px 4px;
  text-transform:uppercase; font-weight:800;
}

/* Keep the panel inside the viewport with safe gutters */
.mega-menu{
  width: min(1180px, calc(100vw - 32px));   /* 16px gutter on both sides */
  max-height: calc(100vh - 140px);          /* never taller than the screen */
  overflow-y: auto;                          /* scroll if needed */
  overscroll-behavior: contain;
}

/* When we detect an edge, anchor to that edge instead of centering */
.has-mega.edge-left .mega-menu{
  left: 16px; right: auto; transform: translate(0, 6px);
  width: calc(100vw - 32px);
}
.has-mega.edge-right .mega-menu{
  right: 16px; left: auto; transform: translate(0, 6px);
  width: calc(100vw - 32px);
}
/* If both would overflow (very narrow viewports), stretch between gutters */
.has-mega.edge-left.edge-right .mega-menu{
  left: 16px; right: 16px; transform: translate(0, 6px); width: auto;
}

/* More responsive columns so it packs down smoothly */
@media (max-width: 1280px){ .mega-inner{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 992px){  .mega-inner{ grid-template-columns: repeat(2, 1fr); } }
/* Already hidden at <= 768px by your rules */