.mob-nav ,.mob-nav h2 {
position: relative;
margin: 0;
width: 100%;
font-size: 14px;
font-weight: 400;
font-family: 'IBM Plex Sans', sans-serif;
line-height: 1.05;
letter-spacing: 0.085em;
background: transparent;
text-transform: uppercase;
overflow-y: scroll;
}
.mob-nav ul {
list-style: none;
margin: 0;
padding: 0;
}
.mob-nav ul li {
list-style: none !important;
}
.mob-nav ul li a {
display: block;
background: transparent;
padding: 10px 10px 15px 0;
color: white;
text-decoration: none;
border-bottom: 1px solid #7A7A7A66;
}
.mob-nav ul li a:hover {
background: transparent;
color: #5A9102;
}
.mob-nav ul li a .fa {
width: 16px;
text-align: center;
margin-right: 5px;
float: right;
}
.mob-nav ul ul {
background-color: transparent;
display: none; /* Hide all submenus by default */
}
.mob-nav ul ul.show {
display: block; /* Show submenus with the 'show' class */
}
.mob-nav ul li ul li a {
background: transparent;
padding: 10px 20px;
color: white;
}
.mob-nav ul li ul li a:hover {
background: transparent;
color: #5A9102;
}
.mob-nav ul li a.active {
border-bottom: none !important;
}
document.addEventListener('DOMContentLoaded', function() {
var submenuLinks = document.querySelectorAll('.sub-menu > h2 > a');
submenuLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
// Get the submenu for the clicked link
var submenu = this.parentElement.nextElementSibling;
// Check if the clicked submenu is already visible
var isVisible = submenu.classList.contains('show');
// Hide all submenus
document.querySelectorAll('.mob-nav ul ul').forEach(function(otherSubmenu) {
otherSubmenu.classList.remove('show');
});
// Remove active class from all submenu links
submenuLinks.forEach(function(otherLink) {
otherLink.classList.remove('active');
// Reset caret icons to default state
var caret = otherLink.querySelector('.fa');
if (caret) {
caret.classList.remove('fa-caret-up');
caret.classList.add('fa-caret-down');
}
});
// If the clicked submenu was not visible, show it
if (!isVisible) {
submenu.classList.add('show');
this.classList.add('active');
// Toggle the caret icon
var caret = this.querySelector('.fa');
if (caret) {
caret.classList.remove('fa-caret-down');
caret.classList.add('fa-caret-up');
}
}
});
});
});
.mob-nav ,.mob-nav h2 {
position: relative;
margin: 0;
width: 100%;
font-size: 14px;
font-weight: 400;
font-family: 'IBM Plex Sans', sans-serif;
line-height: 1.05;
letter-spacing: 0.085em;
background: transparent;
text-transform: uppercase;
overflow-y: scroll;
}
.mob-nav ul {
list-style: none;
margin: 0;
padding: 0;
}
.mob-nav ul li {
list-style: none !important;
}
.mob-nav ul li a {
display: block;
background: transparent;
padding: 10px 10px 15px 0;
color: white;
text-decoration: none;
border-bottom: 1px solid #7A7A7A66;
}
.mob-nav ul li a:hover {
background: transparent;
color: #5A9102;
}
.mob-nav ul li a .fa {
width: 16px;
text-align: center;
margin-right: 5px;
float: right;
}
.mob-nav ul ul {
background-color: transparent;
display: none; /* Hide all submenus by default */
}
.mob-nav ul ul.show {
display: block; /* Show submenus with the 'show' class */
}
.mob-nav ul li ul li a {
background: transparent;
padding: 10px 20px;
color: white;
}
.mob-nav ul li ul li a:hover {
background: transparent;
color: #5A9102;
}
.mob-nav ul li a.active {
border-bottom: none !important;
}
document.addEventListener('DOMContentLoaded', function() {
var submenuLinks = document.querySelectorAll('.sub-menu > h2 > a');
submenuLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
// Get the submenu for the clicked link
var submenu = this.parentElement.nextElementSibling;
// Check if the clicked submenu is already visible
var isVisible = submenu.classList.contains('show');
// Hide all submenus
document.querySelectorAll('.mob-nav ul ul').forEach(function(otherSubmenu) {
otherSubmenu.classList.remove('show');
});
// Remove active class from all submenu links
submenuLinks.forEach(function(otherLink) {
otherLink.classList.remove('active');
// Reset caret icons to default state
var caret = otherLink.querySelector('.fa');
if (caret) {
caret.classList.remove('fa-caret-up');
caret.classList.add('fa-caret-down');
}
});
// If the clicked submenu was not visible, show it
if (!isVisible) {
submenu.classList.add('show');
this.classList.add('active');
// Toggle the caret icon
var caret = this.querySelector('.fa');
if (caret) {
caret.classList.remove('fa-caret-down');
caret.classList.add('fa-caret-up');
}
}
});
});
});
/* Font and general styles */
.custom-nav-menu {
font-family: 'IBM Plex Sans', sans-serif;
background-color: white;
color: black;
}
.main-menu {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}
.menu-item {
position: relative;
}
.menu-link {
display: block;
padding: 10px 20px;
color: black;
text-decoration: none;
font-size: 16px;
font-weight: 300;
line-height: 16.88px;
letter-spacing: -0.48px;
}
.menu-link:hover {
color: #5A9102;
}
.arrow {
display: inline-block;
margin-left: 5px;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid black; /* Arrow color */
transition: transform 0.3s ease;
}
.arrow.active {
transform: rotate(180deg);
}
.submenu,
.subsubmenu {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: white;
border: none;
list-style: none;
padding: 0;
margin: 0;
z-index: 1000; /* Ensures submenu is on top */
min-width: 300px;
}
.submenu-item a,
.subsubmenu-item a {
display: block;
padding: 13px 20px;
color: black;
text-decoration: none;
font-size: 16px;
font-weight: 300;
line-height: 16.88px;
letter-spacing: -0.48px;
}
ul .subsubmenu{
background: white !important;
}
.submenu .submenu-item :hover{
background: #EEF3FF;
color : black;
}
.subsubmenu .subsubmenu-item :hover{
background: #EEF3FF;
color : black;
}
/* Ensure submenu remains visible when hovering */
.menu-item:hover .submenu,
.submenu:hover {
display: block;
}
.submenu-item:hover .subsubmenu,
.subsubmenu:hover {
display: block;
}
/* Ensuring submenus stay visible while hovering */
.submenu {
left: 0; /* Positioned directly below the menu item */
}
.submenu .submenu-item {
position: relative;
}
.submenu-item:hover > .subsubmenu {
display: block;
left: 100%; /* Positioned directly to the right of the parent submenu */
top: 0;
}
.subsubmenu {
top: 0;
left: 100%; /* Positioned directly to the right of the parent submenu */
}
/* Ensure submenu and subsubmenu are initially hidden */
.submenu,
.subsubmenu {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: white;
border: none;
list-style: none;
padding: 0;
margin: 0;
z-index: 1000; /* Ensures submenu is on top */
min-width: 300px;
}
/* Display submenu on hover */
.menu-item:hover .submenu,
.submenu.show {
display: block;
}
/* Display subsubmenu on hover */
.submenu-item:hover .subsubmenu,
.subsubmenu.show {
display: block;
}
/* Arrow styles */
.arrow {
display: inline-block;
margin-left: 5px;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid black; /* Arrow color */
transition: transform 0.3s ease;
}
.arrow.active {
transform: rotate(180deg);
}
ul li{
list-style: none !important;
}
.has-subsubmenu .arrow{
transform: rotate(270deg);
}
// Handle main menu toggling
document.querySelectorAll('.submenu-toggle').forEach(item => {
item.addEventListener('click', function(event) {
const submenu = this.nextElementSibling;
// Toggle the submenu
if (submenu) {
const isVisible = submenu.classList.contains('show');
document.querySelectorAll('.submenu').forEach(sub => {
sub.classList.remove('show');
});
submenu.classList.toggle('show', !isVisible);
}
// Toggle the arrow
this.querySelector('.arrow').classList.toggle('active');
// Close other submenus
document.querySelectorAll('.submenu-toggle').forEach(toggle => {
if (toggle !== this) {
toggle.querySelector('.arrow').classList.remove('active');
toggle.nextElementSibling.classList.remove('show');
}
});
});
});
// Handle subsubmenu toggling
document.querySelectorAll('.submenu-item .submenu-toggle').forEach(item => {
item.addEventListener('click', function(event) {
// event.preventDefault();
const subsubmenu = this.nextElementSibling;
// Toggle the subsubmenu
if (subsubmenu) {
const isVisible = subsubmenu.classList.contains('show');
document.querySelectorAll('.subsubmenu').forEach(sub => {
sub.classList.remove('show');
});
subsubmenu.classList.toggle('show', !isVisible);
}
// Toggle the arrow
this.querySelector('.arrow').classList.toggle('active');
// Close other subsubmenus
document.querySelectorAll('.submenu-item .submenu-toggle').forEach(toggle => {
if (toggle !== this) {
toggle.querySelector('.arrow').classList.remove('active');
toggle.nextElementSibling.classList.remove('show');
}
});
});
});
// Handle cursor out of submenu
document.querySelectorAll('.submenu, .subsubmenu').forEach(submenu => {
submenu.addEventListener('mouseleave', function() {
// Hide submenu when cursor leaves
submenu.classList.remove('show');
const submenuToggle = submenu.previousElementSibling;
if (submenuToggle) {
submenuToggle.querySelector('.arrow').classList.remove('active');
}
});
});