.nav-header {
  width: 100%;
}
/* ==================== BASE NAVBAR ==================== */
.navbar {
  position: relative;
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, rgb(0, 110, 145), rgb(0, 73, 95) 100%) !important;
  color: #252525;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
  padding: 0;
  margin-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 56px;
}

.navbar.scrolled {
  background: linear-gradient(90deg, rgb(0, 110, 145), rgb(0, 73, 95) 100%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Remove container side padding inside the navbar only */
.navbar .container-fluid {
  padding-right: 0 !important;
  padding-left: 0 !important;
}

/* Optional: tighten nav list alignment */
.navbar-nav {
  margin-right: 1rem !important;
}

/* If you still see a tiny visual gap due to scrollbars or body padding */
.navbar {
  margin-right: 0 !important;
}


.navbar-toggler {
  border: none;
}

.navbar-toggler:focus {
  box-shadow: none !important;
}

.navbar-toggler .bi,
.navbar-toggler-icon .bi {
  color: #ffffff !important;
  font-size: 1.9em;
  line-height: 1;
}

#mainNav {
  margin-right: 0;
  padding-right: 0;
}

.navbar-dark .navbar-toggler-icon {
  background-image: none !important;
}

/* ==================== NAV LINKS ==================== */
.navbar-nav .nav-link {
  color: #ffffff !important;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #00c2ff !important;
}

/* ==================== MEGA MENU ==================== */
.mega-dropdown {
  position: static !important;
}

.mega-menu {
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  margin: 0 !important;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, rgb(0, 110, 145) 0%, rgb(0, 73, 95) 100%) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.dropdown-menu.show,
.mega-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu h6 {
  font-weight: 700;
  font-size: 0.9rem;
  color: #00c2ff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mega-menu .dropdown-item {
  padding: 0.35rem .5rem;
  color: #ffffff !important;
  white-space: normal;
  transition: all 0.2s ease;
}

.mega-menu .dropdown-item:hover {
  background: rgba(0, 194, 255, 0.15);
  color: #ffffff !important;
}

.mega-menu .col-md-3,
.mega-menu .col-md-4 {
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.mega-menu .col-md-3:last-child,
.mega-menu .col-md-4:last-child {
  border-right: none;
}

/* ==================== MOBILE STYLES ==================== */
@media (max-width: 991px) {
  /* Full bleed background and no max width */
  .navbar {
    position: relative;
    width: 100%;
    left: 0;
    right: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    color: #fff !important;
  }

  .navbar .container-fluid {
    max-width: 100%;
    padding: 0; /* eliminate inner padding completely */
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Logo alignment */
  .navbar-brand,
  #nav_header_logo {
    order: 1;
    margin-left: 0.75rem;
  }

  #nav_header_logo img {
    max-height: 40px;
    object-fit: contain;
  }

  .navbar-toggler {
    position: absolute !important; /* relative to navbar */
    top: 0.4rem !important;
    right: 0.75rem !important;
    margin: 0 !important;
    padding: 0.4rem !important;
    background: transparent !important;
    z-index: 1200 !important;
  }

  #nav_header_logo {
    margin-right: 0 !important; /* reset margin */
  }

  .navbar-toggler-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8em;
    height: 1.8em;
    background: none !important;
  }

  .navbar-toggler-icon i {
    font-size: 1.8em;
    color: #fff !important;
    line-height: 1;
  }

  /* Slide-in menu from right */
  .navbar-collapse {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    height: 100vh;
    background: rgba(15, 15, 15, 0.97);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.4);
    padding: 2.25rem 1.25rem 1.5rem;
    overflow-y: auto;
    transition: right 0.35s ease-in-out;
    z-index: 1050;
  }

  .navbar-collapse.show {
    right: 0;
  }

  /* Nav items */
  .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  /* Dropdowns inside drawer */
  .dropdown-menu {
    position: static !important;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    padding-left: 0.5rem;
  }

  .dropdown-item {
    display: block;
    padding: 0.6rem 0 0.6rem 1rem;
    color: #f8f9fa !important;
  }

  /* Mega inside drawer */
  .mega-menu {
    position: static;
    width: 100%;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0;
  }

  .mega-menu .container-fluid {
    padding: 0;
  }

  .mega-menu .row {
    display: flex;
    flex-direction: column;
  }

  .mega-menu .col-md-3,
  .mega-menu .col-md-4 {
    width: 100%;
    border: none;
    margin-bottom: 1rem;
  }

  .mega-menu h6 {
    font-size: 1rem;
    margin-top: 1rem;
    color: #00c2ff;
  }

  .mega-menu .dropdown-item {
    padding-left: 1.1rem;
  }

  /* Overlay */
  body.offcanvas-active::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1040;
  }
}

/* ==================== ACCESSIBILITY ==================== */
.navbar-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background-color: #00c2ff;
  border-radius: 1px;
}

/* --- FINAL HARD FIX FOR MOBILE MENU ICON POSITION --- */
@media (max-width: 991px) {
  .navbar-toggler {
    width: 10%;
    position: fixed !important; /* anchor it to viewport */
    top: 0.6rem !important;     /* adjust vertical position */
    left: 65% !important;   /* flush right edge */
    margin: 0 !important;
    padding: 0.4rem !important;
    background: transparent !important;
    z-index: 2000 !important;   /* ensure it sits above nav blur */
  }

  .navbar-toggler-icon i {
    font-size: 1.9rem !important;
    color: #fff !important;
  }

  /* prevent logo overlap */
  .nav-header {
    margin-right: 0 !important;
    font-size: .5rem;
  }

  .nav-header img {
    width: 15%;
}
}