:root {
  --nav-height: 80px;
}

.navbar {
  height: var(--nav-height);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  padding: 0;
}

.navbar-brand {
  width: 114px;
  margin-right: 0;
  padding: 0;
}

.navbar-brand-group {
  gap: 56px;
}

.mega-link {
  color: #0A22AA;
  font-weight: bold;
  display: block;
  margin-bottom: 12px;
}

.nav-link {
  color: #111827 !important;
  font-weight: 600;
  font-size: 14px;
}

.navbar-nav {
  gap: 32px;
}

/* Override Bootstrap's column layout for desktop navigation */
@media (min-width: 911px) {
  .navbar-nav {
    flex-direction: row !important;
  }
}

/* Reduce font size on medium screens for better fit */
@media (min-width: 911px) and (max-width: 1199px) {
  .nav-link {
    font-size: 12px !important;
  }
}


.navbar-expand-lg .navbar-nav .nav-link {
  padding: 0;
  }


.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.nav-item .btn {
  font-weight: 500;
  height: 48px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}

.btn-login {
  transition: color 0.2s ease;
  &:hover {
    color: #1677ff !important;
  }
}

/* --- Megamenu Dropdown --- */

.dropdown-megamenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  display: none;
  z-index: 999;
}

/* .dropdown:hover .dropdown-megamenu {
  display: flex;
} */

.mega-title {
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 600;
}

.megamenu-col {
  flex: 1;
  padding: 0 1rem;
}

.megamenu-col h6 {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.megamenu-col a {
  display: block;
  padding: 4px 0;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
}

.megamenu-col a:hover {
  color: #0056b3;
}

/* Responsive overrides */

@media (max-width: 991.98px) {
  .dropdown-megamenu {
    position: static;
    display: none;
    flex-direction: column;
    box-shadow: none;
    border-radius: 0;
    padding: 1rem 1rem;
  }
}

@media (max-width: 991.98px) {
  .dropdown.show .dropdown-megamenu {
    display: flex;
  }
}

.btn-primary.rounded-pill {
  border-radius: 999px;
}

.navbar .btn-primary,
.mobile-menu-footer .btn-primary {
  background-color: #0A22AA;
  border-color: #0A22AA;
}

.navbar .btn-primary:hover,
.mobile-menu-footer .btn-primary:hover {
  background-color: #111827;
  border-color: #111827;
}

.navbar .btn-primary::after,
.mobile-menu-footer .btn-primary::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 12px;
  margin-left: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='12' viewBox='0 0 14 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_8_5119)'%3E%3Cpath d='M1 6H13' stroke='white' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M8 1L13 6L8 11' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_8_5119'%3E%3Crect width='14' height='12' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0;
  transition: all 0.3s ease;
}

.navbar .btn-primary:hover::after,
.mobile-menu-footer .btn-primary:hover::after {
  width: 20px;
  margin-left: 6px;
  opacity: 1;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  background: #fff;
  display: none;
  padding: 20px;
  z-index: 1000;
}

.mega-menu ul {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  float: left;
  width: 100%;
}

/* .menubar nav ul li:hover .mega-menu {
  display: block;
} */

@media (max-width: 768px) {
  .mega-menu {
    position: static;
    width: 100%;
    display: block !important;
  }
}

@media (max-width: 768px) {
  .mega-menu ul {
    width: 100%;
    float: none;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  .menubar nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
}

.menubar {
  margin: 10px 0;
  float: right;
}

.menubar nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menubar nav ul li {
  display: inline-block;
  margin: 0 20px 0 0;
}

.menubar nav ul li a {
  display: block;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  padding: 25px 0;
  letter-spacing: 0.5px;
  color: #000000;
  text-transform: uppercase;
  text-decoration: none;
  transition: 0.3s;
}

.menubar nav ul li:hover > a {
  text-decoration: none;
  color: #dd7e2e;
}

.menubar nav ul li .mega-menu {
  width: 100%;
  display: block;
  position: absolute;
  top: 100%;
  background: #ffffff;
  left: 0;
  transition: 0.3s;
  border: 1px solid #ebebeb;
  padding: 24px 30px;
  visibility: hidden;
  opacity: 0;
}

/* .menubar nav ul li:hover .mega-menu {
  visibility: visible;
  opacity: 1;
  z-index: 99;
} */

.menubar nav ul li .mega-menu ul {
  width: 25%;
  float: left;
}

.menubar nav ul li .mega-menu ul li {
  display: block;
  margin: 0;
  padding: 6px 0px;
}

.menubar nav ul li .mega-menu ul li a {
  text-transform: none;
  font-size: 13px;
  padding: 0;
}

@media (max-width: 767.98px) {
  .menubar nav ul li .mega-menu ul {
    width: 100%;
    float: left;
    margin: 0 0 22px;
  }
}

@media (min-width: 768px) {
  .menubar nav ul li .mega-menu ul {
    width: 100%;
    float: left;
    margin: 0 0 22px;
  }
}

@media (min-width: 992px) {
  .menubar nav ul li .mega-menu ul {
    width: 25%;
  }
}

footer .container {
  padding-top: 64px;
  padding-bottom: 56px;
}

h6 {
  font-size: 18px;
}

small {
  font-size: 16px !important;
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: #f8f9fa;
  overflow-y: auto;
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: normal;
}

/* When menu is open */
.mobile-menu.open {
  right: 0;
}

.mobile-menu-header img {
  max-height: 32px;
}

.close-btn {
  font-size: 2rem;
  background: none;
  border: none;
  color: #1677ff;
}

.menu-group {
  margin-top: 1rem;
}

.menu-link {
  display: block;
  padding: 8px 0;
  font-weight: 600;
  color: #2a3a52;
  text-decoration: none;
}

.menu-link:hover {
  color: #1677ff;
}

.section-title {
  font-size: 1rem;
  font-weight: bold;
  color: #2a3a52;
  margin-bottom: 0.5rem;
}

.section-title.menu-open-tab, a.menu-open-tab{
  height: 42px;
  width: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  text-decoration: none!important;
}

.section-title.menu-open-tab::after{
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: url("../img/arrow-R.svg");
  background-size: 100% 100%;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.menu-group-container{
  padding: 5.1282051282vw 6.1538461538vw 23.0769230769vw;
  position: absolute;
  top: 62px;
  left: 100%;
  width: 100%;
  height: calc(100% - 62px);
  opacity: 0;
  background: #f5f5f5;
  z-index: 2;
  overflow-y: scroll;
  transition: all 0.3s ease-in-out;
}

.menu-group-container.open{
  left: 0;
  opacity: 1;
}

.menu-back-button{
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding-bottom: 16px;
}

.menu-back-button h6{
  margin-bottom: 0;
}

.menu-back-button::before{
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: url("../img/arrow-L.svg");
  background-size: 100% 100%;
}

.menu-group p{
  display: block;
  font-weight: 600;
  padding-bottom: 12px;
}

.menu-group a{
  display: block;
  font-weight: 600;
  color: #0066ff;
  text-decoration: none;
  padding-bottom: 12px;
}


.mobile-menu-footer {
  background-color: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.mobile-menu-footer a {
  font-weight: bold;
}

.dropdown-menu {
  border: none;
  padding-top: 48px;
  padding-bottom: 48px;
  width: 100%;

  [class*="col-"]{
    padding: 0;
    flex-grow: 0;
    flex-shrink: 0; 
  }
}


.dropdown-menu.show {
  box-shadow: rgba(0, 0, 0, 0.1) 0px 40px 40px 0px !important;
}


.dropdown-arrow {
  position: absolute;
  top: -10px; /* Adjust based on arrow size */
  left: 35%;
  transform: translateX(-35%);
  width: 20px;
  height: 10px;
  background: white;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.dropdown-megamenu-modern {
  border-radius: 16px;
  background: white;
  display: flex;
  z-index: 1000;
}

.dropdown-megamenu-modern .menu-item-link {
  margin-bottom: 8px;
  color: #0A22AA;
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;

}

.dropdown-megamenu-modern .menu-item-link--relaxed:not(:last-child) {
  margin-bottom: 1.5rem;
}

.dropdown-megamenu-modern .menu-item-link strong {
  font-size: 1rem;
  font-weight: 600;
  color: #0A22AA;

}

.dropdown-megamenu-modern .menu-item-desc {
  font-size: 13px;
  color: #6b7280;
  display: block;
  margin-top: 2px;
}

.dropdown-megamenu-modern .menu-item-link:hover strong {
  color: #081b88;
}

.dropdown-megamenu-modern p {
  color: #4B5563;
  font-size: 1rem;
  /* text-transform: uppercase; */
}

.dropdown-megamenu-modern {
  display: none;
  opacity: 0;
}

.dropdown-megamenu-modern.show {
  display: block;
  opacity: 1;      
}

/* Hide Bootstrap's default caret */
.nav-link.dropdown-toggle::after { display: none; }

/* The inline arrow that sits right after the text */
/* The inline arrow that sits right after the text */
.nav-link .arrow {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 8L10 13L5 8' stroke='%23111827' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
}

.nav-link .arrow::before {
  content: none;
}

/* Rotate when the dropdown is open (active state only) */
.nav-item.dropdown.show .arrow {
  transform: rotate(180deg);
}

.nav-link.dropdown-toggle::after {
  /* content: "▾"; */
  margin: 0;
  transition: 0.2s;
  display: none;
}

/* .nav-item.dropdown:hover .dropdown-megamenu-modern {
  display: block;
  opacity: 1;
} */



.nav-item.dropdown .dropdown-megamenu-modern.compact {
  left: 0;
  transform: none;
  /* top: calc(100% + 12px);   */
}

/* 2) Compact menus size to their content like the right screenshot */
.dropdown-megamenu-modern.compact {
  display: block;
  width: max-content;
  min-width: 260px;
}

/* 3) Inside compact menus, prevent Bootstrap rows from forcing full width */
.dropdown-megamenu-modern.compact .row {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  margin: 0;
  width: auto;
}
.dropdown-megamenu-modern.compact .col-md-12,
.dropdown-megamenu-modern.compact .col-12 {
  flex: 0 0 auto;
  width: auto;
}

.dropdown-megamenu-modern .dropdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 0;
}

/* 2-column grid variant for extended dropdowns */
.dropdown-megamenu-modern .dropdown-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

/* 3-column grid variant for extended dropdowns */
.dropdown-megamenu-modern .dropdown-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

/* Inline extended column that spans 2 columns */
.dropdown-extended-column-inline {
  grid-column: span 2;
  background-color: #F0F2FA;
  margin-top:-48px;
  margin-bottom: -48px;
  padding: 48px 32px;
  margin-right: -100vw;
  padding-right: 100vw;
  display: flex;
  flex-direction: column;
}


.dropdown-megamenu-modern .menu-item-link:hover, .mega-link:hover, .mobile-submenu-link:hover, .mobile-submenu-view-all:hover {
  color: #1677ff;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.dropdown-megamenu-modern .menu-item-link:hover::after {
  transform: translateX(4px);
  opacity: 1;
  color: #1677ff;
}

/* Arrow nub: anchor it near the left edge so it points to the trigger */
.nav-item.dropdown .dropdown-arrow {
  left: 28px;
  transform: none;
  top: -10px;
}

/* 6) Mobile keeps your existing full width overlay */
@media (max-width: 991.98px) {
  .dropdown-megamenu-modern.compact {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
  #productsDropdown + .dropdown-megamenu-modern {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
}


.dropdown-megamenu-modern .menu-item-link,
.dropdown-megamenu-modern .menu-item-link strong, .mega-link {
  color: #0A22AA;
  white-space: normal;              
  word-break: break-all;           
  overflow-wrap: anywhere;        


  &:hover {
    color: #1677ff
  }
}

#resourcesDropdown + .dropdown-megamenu-modern.compact {
  max-width: 720px;               
  width: 600px;
}

@media (max-width: 991.98px) {
  #resourcesDropdown + .dropdown-megamenu-modern.compact {
    width: 100%;
    max-width: none;
  }
}

#resourcesDropdown + .dropdown-megamenu-modern.compact .col-md-6 {
  padding-right: 12px;
}



/* Full width desktop megamenu */
@media (min-width: 992px) {

  /* Let dropdown escape the navbar container */
  .navbar {
    overflow: visible;
  }

  /* All big nav dropdowns share the same full width bar */
  .dropdown-menu.dropdown-megamenu-modern {
    position: fixed!important;
    left: 0;
    right: 0;
    top: var(--nav-height, 80px);  /* JS will keep this in sync */
    margin: 0;
    border-radius: 0;
    background: #ffffff;
  }

  /* Little diamond arrow stays centered under the tab */
  .nav-item.dropdown .dropdown-arrow {
    position: absolute;
    top: calc(var(--nav-height, 80px) - 8px);
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translateX(-50%) rotate(45deg);
    background: #ffffff;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    z-index: 1101;
  }

  /* Center the content inside the full width bar */
  .dropdown-menu.dropdown-megamenu-modern > .row {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
  }

  /* Narrower inner content for compact menus */
  .dropdown-menu.dropdown-megamenu-modern.compact > .container {
    width: 100%;
    margin: 0 auto;
    /* Reset padding to match main container behavior if needed, or keep 0 */
    padding-left: 0;
    padding-right: 0;
  }
  
  /* Ensure container max-widths match the main site responsive rules */
  @media (min-width: 1200px) and (max-width: 1440px) {
    .dropdown-menu.dropdown-megamenu-modern.compact > .container {
      max-width: 1312px;
    }
  }
  @media screen and (min-width: 1441px) {
    .dropdown-menu.dropdown-megamenu-modern.compact > .container {
      max-width: 1360px;
    }
  }
}


.dropdown-menu .megamenu-title {
  color: #111827;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.dropdown-menu .sub-text {
  margin-bottom: 1.5rem;
  font-size: 14px;
}

.mega-intro {
  padding: 0;
}

.mega-text {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.mega-link {
  text-decoration: none;
}

/* Base link setup so underline can attach */
.navbar .navbar-nav > .nav-item > .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Reset the default Bootstrap after arrow so we can use ::after */
.navbar .navbar-nav > .nav-item > .nav-link.dropdown-toggle::after {
  content: "";
  display: none; /* override old display:none */
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 0;
  height: 4px;
  background-color: #0A22AA;
  transform: translateX(-50%);
  /* border-radius: 2px; */
  transition: width 0.22s ease;
}

/* Show underline on hover OR when active (open) */
.navbar .navbar-nav > .nav-item.show > .nav-link.dropdown-toggle::after {
  display: block; /* override old display:none */
  color: #081b88;
  width: 100%;
  border: none;
}