nav {
    position: absolute;
    width: -moz-available;
    width: -webkit-fill-available;
    width: fill-available;
    z-index: 30;
    height: 70px;
    /*height: -webkit-fill-available;*/
}

nav ul:first-of-type {
    padding: 0 var(--margin-x-mobile) 0 var(--margin-x-mobile);
}

nav ul {
  list-style-type: none;
  margin: 0;
}

nav > ul {
  display: flex;
  align-items: center;
  flex-direction: row;
  padding: 0;
  height: 70px;
}

nav > ul > li {
    max-height: 70px;
}

nav a {
    display: block;
}

nav .subpage-item {
    display: none;
}

nav > ul > li.language-switch {
    margin-left: auto;
    padding: 21px 24px;
    position: relative;
}

nav > ul > li.menu {
    padding: 21px 0 21px 24px;
    position: relative;
}

nav > ul > li.menu > button > .line {
    border-left: 1px solid rgba(162, 169, 177, 1);
    position: absolute;
    height: 20px;
    left: 0;
}

nav > .language-list, nav > .menu-list {
    display: none;
    padding: 80px var(--margin-x-mobile);
    justify-content: center;
    gap: 40px;
    flex-direction: column;
    border-top: 1px solid rgba(255 255 255 / 50%);
    padding-top: 60px;
    border-opacity: 0.3;
    background-color: rgba(31, 49, 68, 50%) /*added by MTOTA*/
}

nav > .language-list > p, nav > .menu-list > p {
    margin: 0;
}

nav > .language-list > ul, nav > .menu-list > ul {
    padding: 0;
    margin: 0;
    display: flex;
    gap: 40px;
}

nav > .menu-list > ul {
    flex-direction: column;
    font-family: VestasSansMedium;
}

nav > .language-list object {
    width: 28px;
}

nav > .language-list > ul > li > a {
    color: black;
    text-transform: capitalize;
}

nav > .language-list > ul > li.current > a, nav > .language-list > ul > li:hover > a {
    border-bottom: 2px solid white;
}

nav > ul > li.menu {
    margin-left: auto;
}

nav > ul > li > a {
    color: white;
    text-decoration: none;
    padding: 24px 24px;
}

nav > ul > li > button {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
}

nav > ul > li > button > object {
    width: 28px;
    filter: invert(99%) sepia(0%) saturate(1%) hue-rotate(334deg) brightness(106%) contrast(100%);
}

nav > ul > li:first-of-type > a > img:last-of-type, .nav-subpage:not(.with-modal) > ul > li:first-of-type > a > img:first-of-type {
    display: block;
    height: 55px;
}

nav > ul > li:first-of-type > a > img:first-of-type, .nav-subpage:not(.with-modal) > ul > li:first-of-type > a > img:last-of-type {
    display: none;
}

.nav-subpage > ul > li.current {
    border-bottom: 2px solid rgba(0, 90, 255, 1);
}

.nav-subpage > ul > li.current > a {
    text-decoration: none;
    font-family: VestasSansBold;
}

.nav-subpage {
    background: white;
}

.nav-subpage:not(.with-modal) > ul > li > a {
    color: black;
}

.nav-subpage:not(.with-modal) > ul > li > button > object {
    filter: none;
}

nav.with-modal {
    background: rgba(31, 49, 68, 0.5);
    color: white;
}

nav.with-modal > .language-list > ul > li > a {
    color: white;
}

nav.with-modal .language-list.visible {
    background: rgba(31, 49, 68, 0.5);
    display: flex;
}

nav.with-modal .menu-list.visible {
    display: block;
}

body:has(> nav.with-modal) {
    overflow: hidden;
}

@media screen and (min-width: 700px) {
    nav ul:first-of-type {
        padding: 0 var(--margin-x-desktop) 0 var(--margin-x-desktop);
    }
    
    nav .subpage-item {
        display: list-item;
    }
    
    nav > ul > li.menu {
        display: none;
    }
    
    nav > ul > li:nth-child(2) {
        margin-left: auto;
    }
    
    nav > ul > li.language-switch {
        margin-left: unset;
    }
    
    nav > ul > li > button > .line {
        border-left: 1px solid rgba(162, 169, 177, 1);
        position: absolute;
        height: 20px;
        left: 0;
    }
    
    .nav-subpage > ul > li:not(:first-of-type) {
        border-bottom: 2px solid transparent;
    }
    
    .nav-subpage > ul > li:not(:first-of-type):hover {
        border-bottom: 2px solid rgba(0, 90, 255, 1);
    }
    
    nav:not(.nav-subpage) > ul > li:not(:first-of-type), 
    nav.with-modal > ul > li.current, 
    nav.with-modal > ul > li:not(:first-of-type) {
        border-bottom: 2px solid transparent;
    }
    
    nav:not(.nav-subpage) > ul > li:not(:first-of-type):hover, 
    nav.with-modal > ul > li.current, 
    nav.with-modal > ul > li:not(:first-of-type):hover {
        border-bottom: 2px solid white;
    }
    
    nav > .language-list {
        gap: 70px;
        align-items: center;
        flex-direction: row;
    }
    
    nav > ul > li:first-of-type > a {
        padding: 0;
        display: flex;
        align-items: center;
    }
    
    /* Give each top-level <li> a positioning context */
nav > ul > li {
  position: relative;
  overflow: visible; /* ensure dropdown can overflow the 70px nav height */
}

/* Dropdown base (hidden by default) */
nav ul li ul.dropdown {
  display: none;
  position: absolute;
  top: 100%;   /* sit directly below the parent li */
  left: 0;
  background: white;
  padding: 0;
  margin: 0;
  list-style: none;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 9999; /* above other nav content */
}

/* Show on hover */
nav > ul > li:hover > ul.dropdown {
  display: block;
}

/* Dropdown item styling */
nav ul li ul.dropdown > li > a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
}

nav ul li ul.dropdown > li > a:hover {
  background: #f0f0f0;
}

/* Optional: don't draw the bottom border when the parent is hovered */
.nav-subpage > ul > li:hover {
  border-bottom-color: transparent;
}
}