/* 1. Setup the relative container boundary for the full width */
.navbar {
  /* position: relative; */
  /* background: #333; */
}


.nav {
  text-align: center;
  font-size: 0;
  background: var(--header-bg);
  padding: 12px 0px;
  padding-top: 45px;
  position: relative;
}

#mobileNav {
  text-transform: capitalize;
  cursor: pointer;
  font-size: initial;
  padding: 15px;
  text-align: left;
  display: flex;
  color: var(--light-text);
  font-size:20px;
}
#mobileNav i {
  float: right;
}
.nav ul {
  justify-content: center;
  font-size: initial;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  text-align: left;
  -webkit-transition: 0.3s max-height ease-in-out, 0.3s border-color ease-in-out;
  transition: 0.3s max-height ease-in-out, 0.3s border-color ease-in-out;
}
.nav.open ul {
  max-height: 270px;
  flex-direction: column;
  background: var(--text-white);
}
.nav li {
  display: block;
  -webkit-transition-property: color;
  transition-property: color;
  cursor: pointer;
  padding: 1px 10px;
}

.nav li .fa-chevron-down {
  float:right;
}

.fa-arrow-icon {
  float:right
}
.fa-arrow-icon .fa{    
  background: var(--text-white);
  border: 1.5px solid var(--light-text);
  border-radius: 50%;
  padding: 0px 4px;
  font-weight: 500;
}
.nav li:hover {
  color: var(--grey-bg);
}
.nav li a {
  padding: 10px 10px;
  text-transform: capitalize;
  font-size: 15px;
  font-weight: 600;
  color: var(--light-text);
}

span.listTitle{
  font-family: var(--chevysans-demi);
}

.burger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 17px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.burger-menu .line {
  width: 100%;
  height: 2px;
  background-color: var(--grey-bg);
  transition: all 0.3s ease;
  margin-top: 3px;
}

/* Burger X Animation States */
.burger-menu.active .line:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger-menu.active .line:nth-child(2) { opacity: 0; }
.burger-menu.active .line:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }



/* Mobile Drawer Overlay */
.nav-links {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 60px; /* Navbar height */
  right: -100%;
  width: 100%;
  height: calc(100vh - 60px);
  background-color: #1a1a1a;
  list-style: none;
  padding: 20px;
  transition: right 0.3s ease;
  overflow-y: auto; /* Allows scrolling inside mobile menu */
}

.nav-links.active {
  right: 0;
}

.nav-links > li {
  width: 100%;
  border-bottom: 1px solid var(--dark-text);
}

.nav-links > li > a {
  display: block;
  padding: 15px 0;
  color: var(--text-white);
  text-decoration: none;
  font-size: 1.2rem;
}

/* Mobile Dropdown Interaction */
.mega-menu {
  display: none; /* Controlled via JS toggle class on mobile */
  background-color: var(--dark-bg);
  padding-bottom:0px;
}

.mega-menu.mobile-open {
  display: block;
}

.mega-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mega-col {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mega-col img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.mega-col h4 {
  color: var(--text-white);
  font-size: 1rem;
  margin-bottom: 5px;
}

.mega-col a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.85rem;
}
.menu-item .model-title{
  font-family: var(--chevysans-bold);
  font-size: 15px;
  font-weight: 600;
}

/* ==========================================
   3. DESKTOP STYLES (768px and up)
   ========================================== */
@media screen and (min-width: 768px) {
  .burger-menu {
    display: none;
  }

  .fa-arrow-icon{
    display: none;
  }

  .nav-links {
    position: static;
    flex-direction: row;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
  }
.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav.open ul{
  background: transparent;
}


.nav li .fa-chevron-down {
  display: none;
}

/* 2. Hide mega menu and make it span 100% width of the .navbar */
.mega-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  max-width: 1100px !important;
  margin: 3px auto;
  background-color: var(--menu-bg);
  z-index: 100;
}

/* 3. Show menu on hover */
.dropdown:hover .mega-menu {
  display: block;
}

/* 4. Create the 4-column layout */
.mega-menu  .grid-4-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0px;
  max-width: 1200px; /* Optional: keeps content centered if screen is huge */
  margin: 0 auto;
  align-items: center;
}

.mega-menu  .grid-4-columns > a:not(:nth-child(4n + 1):nth-last-child(-n + 4), 
                      :nth-child(4n + 1):nth-last-child(-n + 4) ~ *){
  border-bottom: 2px solid var(--light-text);
  margin-bottom: 0px;
}

.mega-menu  .grid-4-columns > a:nth-child(4n) {
    margin-right: 20px;
    padding-right: 0px !important;
}

.mega-menu  .grid-4-columns > a:nth-child(4n+1) {
    margin-left: 20px;
    padding-left: 0px !important;
}

.mega-menu  .grid-4-columns > a {
  padding: 15px 20px !important;
  margin-bottom: 50px;
}

.menu-item .model-title {
    padding-top: 10px;
    font-size: 15px;
}


  #mobileNav {
    display: none;
  }
  .nav ul {
    font-size: inherit;
    max-height: none;
    overflow: visible;
    text-align: center;
    gap:20px;
  }
  .nav li {
    display: inline-block;
    padding: 0px 10px;
    border-bottom: 3px solid transparent;
  }
  .nav li a {
    padding: 14px 0;
    font-size: 20px; 
    line-height: normal;
  }

  .dealer-header .nav li:hover, .nav .selected {
    font-weight: bold;
    color: var(--primary-color);
    /* position: relative; */
    border-bottom-color: var(--primary-color);
  }

  .dealer-header .nav li:hover > a, .nav .selected > a:first-child {
    color: var(--primary-color);
  }

  .mega-menu .bg-img-ratio .bg-img{
    background-size: contain;
  }
}

@media screen and (min-width: 1024px) {
 .mega-menu .bg-img-ratio .bg-img{
    background-size: 200px auto;
  }
}

@media screen and (max-width: 768px) {
  .burger-menu {    
    margin-right: 12px;
    height: 17px;
    margin-left: 10px;
  }
  .nav{
    padding: 20px 0px 0px 0px;
  }
  .nav.open ul {
    max-height: 270px;
    flex-direction: column;
    padding: 15px 0px;
  }
  .nav li{
    padding:0px;
  }
  .nav li a {
    padding: 8px 15px;
    text-transform: capitalize;
    font-size: 15px;
    font-weight: 600;
    color: var(--light-text);
}
.fa-arrow-icon .fa {
    background: var(--text-white);
    border: 2px solid var(--light-text);
    border-radius: 50%;
    padding: 2px 5px;
    font-weight: 500;
    margin-right: 11px;
}
.fa-angle-right:before {
    content: ">";
    font-family: var(--chevysans-bold);
}

span.listTitle {
    font-family: var(--chevysans-bold);
    font-size: 16px;
    color: #666;
    padding: 0px;
    line-height: 30px;
}
.nav.navbar.open {
    position: absolute;
    width: 100%;
}
.nav.navbar.open ul#navLinks {
    position: relative;
    z-index: 999;
}
.nav ul{
  background: var(--text-white);
}
}