nav {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  align-items: center;
  background-color: transparent;
  position: fixed;
  width: 100vw;
  height: 60px;
  z-index: 99999;
  transition: background-color 0.4s ease-in-out, transform 0.4s ease-in-out;
}

/* Hide navbar on scroll down with smooth transition */
nav.hidden {
  transform: translateY(-100%);
  transition: transform 0.4s ease-in-out;
}

/* Show navbar when scrolling up */
nav.nav-visible {
  transform: translateY(0);
  background-color: white;
  transition: transform 0.4s ease-in-out, background-color 0.4s ease-in-out;
}

/* Show links and background when hovering or when nav is visible */
nav:hover,
nav.nav-visible {
  background-color: white;
}

.progress-bar-images {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  width: auto;
  /* flex: 0 0 40px; */
  position: relative;
  z-index: 20;
}

.progress-bar-img {
  height: 60px;
  width: 60px;
  object-fit: contain;
  /* background: #fff; */
  /* box-shadow: 0 2px 8px #d4c2a655; */
  display: block;
}

.scent-left-img {
  margin-right: -15px;
}

.bottle-right-img {
  margin-left: -15px;
}

/* Left container styles */
nav .left-container-nav {
  display: flex;
  align-items: center;
  gap: 11.75vw;
  order: 1;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 100%;
  /* Make the container stretch to the actions */
  right: 220px; /* Reserve space for actions on the right */
  width: calc(100vw - 260px); /* 20px left + 220px right + some buffer */
}

/* Quiz Progress Bar Styles */
.quiz-navbar-progress-bar-outer {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 24px;
  min-width: 300px;
  margin-left: 18px;
  margin-right: 0;
  position: relative;
  z-index: 100;
  pointer-events: none;
  transition: all 0.3s ease-in-out;
}

.quiz-navbar-progress-bar-track {
  width: 88%;
  height: 3.5px;
  background: #d4c2a6;
  border-radius: 0px;
  position: relative;
}

.circle-number {
  color: white;
  font-family: "Jost", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  user-select: none;
  letter-spacing: 0.5px;
  z-index: 11;
}

.circle-label {
  display: block;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 2px;
  color: black;
  font-family: "Jost", sans-serif;
  font-size: 12px;
  font-weight: 400;
  /* letter-spacing: 0.2px; */
  white-space: nowrap;
  text-align: center;
  user-select: none;
  pointer-events: none;
  z-index: 12;
}

.quiz-navbar-progress-bar-circle {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: #d4c2a6;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 2px 8px #d4c2a655;
  pointer-events: none;
  /* Center the circle on the bar */
  transform: translate(-50%, -50%);
}
.quiz-navbar-progress-bar-circle.circle-1 {
  left: 25%;
  top: 50%;
}
.quiz-navbar-progress-bar-circle.circle-2 {
  left: 50%;
  top: 50%;
}
.quiz-navbar-progress-bar-circle.circle-3 {
  left: 75%;
  top: 50%;
}

.quiz-navbar-progress-bar-circle.passed {
  background: #111;
  color: #fff;
  box-shadow: 0 2px 8px #1112;
}
.quiz-navbar-progress-bar-circle.passed .circle-number {
  color: #fff;
}

.quiz-navbar-progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: black;
  border-radius: 0px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
  box-shadow: 0 2px 12px 0 #d4c2a655;
}

nav:hover .quiz-navbar-progress-bar-outer,
nav:focus-within .quiz-navbar-progress-bar-outer {
  opacity: 0;
  pointer-events: none;
}

/* Logo styles */
nav .logo {
  width: 40px;
  margin-right: 0;
}

nav .logo img {
  width: 100%;
  height: auto;
}

nav .logo a {
  display: block;
}

nav .logo a:hover::after {
  display: none;
}

/* Translate button styles */
nav .gtranslate_wrapper {
  position: static;
  transform: none;
  max-width: 5rem;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

/* Show translate button on hover for desktop through min-width */
@media screen and (min-width: 769px) {
  nav:hover .gtranslate_wrapper {
    opacity: 1;
    visibility: visible;
  }
}

nav .gtranslate_wrapper select,
nav .gtranslate_wrapper .gt_selector {
  font-family: inherit;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: normal;
  color: #000;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 5ch;
  text-overflow: clip;
  letter-spacing: 1px;
}

nav .gtranslate_wrapper select option {
  font-family: inherit;
  font-size: 14px;
  text-transform: none;
  font-weight: normal;
  color: #000;
}

/* Links container */
nav .links {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  margin-left: 120px;
}

/* Hide translate in mobile links by default */
nav .links .gtranslate_wrapper {
  display: none;
}

/* Navigation links */
nav .links ul {
  display: flex;
  justify-content: center;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  gap: 40px;
  text-transform: uppercase;
  font-weight: normal;
  font-size: 16px;
  transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  margin: 0;
  padding: 0;
}

/* Show links on hover or when navbar is visible */
nav:hover .links ul,
nav.nav-visible .links ul {
  opacity: 1;
  visibility: visible;
}

/* Actions (icons) */
nav .actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  order: 3;
  padding-right: 20px;
}

nav .actions ul {
  display: flex;
  gap: 15px;
  font-size: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Link styles */
nav .links li a {
  text-decoration: none;
  text-wrap: nowrap;
  color: #000;
  position: relative;
}

nav .links li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: rgb(0, 0, 0);
  margin: 0 auto;
  transition: 0.5s;
  bottom: -5px;
  right: 50%;
}

nav .links li a:hover::after {
  width: 100%;
  right: 0;
}

nav .actions ul li:nth-child(2) {
  border-left: 2px solid #000;
  padding-left: 15px;
}

/* Class to show the navbar */
nav.visible {
  opacity: 1;
  transform: translateY(0);
}

ul .mobile-logo {
  width: 40px;
  display: none;
}
nav .mobile-logo img {
  width: 100%;
  height: auto;
}

/* Navbar Progress Bar Styles */
.navbar-progress-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 100;
}

.navbar-progress-bar {
  height: 100%;
  width: 0%;
  background: #d4c2a6;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
  nav .links ul {
    gap: 20px;
    font-size: 20px;
  }
}

@media screen and (max-width: 768px) {
  .mobile-menu-btn {
    display: block !important;
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
  }

  /* Hide the left container in mobile view */
  nav > .left-container-nav {
    display: none;
  }

  nav .links .gtranslate_wrapper {
    display: block; /* Show translate in mobile links */
    opacity: 1;
    visibility: visible;
  }

  ul > .mobile-logo {
    display: block;
  }

  nav .links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: white;
    margin: 0;
    padding: 0;
    padding-top: 60px;
    transition: left 0.3s ease-in-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  }

  nav .links.active {
    left: 0;
  }

  /* Logo in mobile menu */
  nav .links .logo {
    display: block;
    width: 60px;
    margin: 0;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
    color: #000;
  }

  nav .links ul {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    opacity: 1;
    visibility: visible;
    gap: 20px;
    margin: 0;
    padding: 20px;
    padding-top: 80px;
    position: absolute;
    top: 1%;
    gap: 25px;
  }

  /* Adjust actions position in mobile */
  nav .actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Overlay when menu is open */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }

  .menu-overlay.active {
    display: block;
  }

  .logo-item {
    width: 60px;
    margin-bottom: 30px;
    padding: 10px 0;
  }
}

@media screen and (max-width: 480px) {
  nav {
    padding: 10px 15px;
  }

  nav .actions {
    padding-right: 15px;
  }

  nav .actions ul {
    font-size: 16px;
    gap: 8px;
    margin-right: -25px;
  }

  nav .actions ul li:nth-child(2) {
    padding-right: 8px;
    padding-left: 8px;
  }

  .mobile-menu-btn {
    font-size: 20px;
    padding: 8px;
  }
}

/* Logo styles */
.logo-item {
  width: 40px;
  margin-bottom: 20px;
  padding: 10px 0;
}

.logo-item img {
  width: 100%;
  height: auto;
}

.logo-item a {
  display: block;
}

.logo-item a:hover::after {
  display: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  z-index: 100000;
  order: 2;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #000;
}

.mobile-menu-btn:visited {
  color: #000;
}

/* Actions (icons) */
nav .actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  order: 3;
  padding-right: 20px;
  color: #000;
}

nav .actions ul li a {
  color: #000;
}

nav .actions ul li a:visited {
  color: #000;
}

.fa-magnifying-glass {
  /* Hide it since search isn't used in navbar */
  display: none;
}

nav .actions ul li:nth-child(2) {
  /* Remove padding from the bar beside translate */
  padding-right: 0px;
}

nav .profile {
  width: 30px;
  margin-right: 0;
}

nav .profile img {
  width: 100%;
  height: auto;
}

nav .profile a:hover::after {
  display: none;
}

nav .profile img,
.profile-img {
  width: 40px;
  height: 40px;
  object-fit: cover; /* Makes the picture stay centered and not stretched */
  border-radius: 50%; /* Makes it perfectly circular */
  border: 2px solid #000; /* Optional: adds a nice black border */
}

nav.user-logged-in .actions ul {
  display: flex;
  align-items: center;
}
nav.user-logged-in .actions ul li {
  display: flex;
  align-items: center;
  height: 40px;
}
nav.user-logged-in .actions ul li .gtranslate_wrapper,
nav.user-logged-in .actions ul li .fa-cart-shopping,
nav.user-logged-in .actions ul li .fa-right-from-bracket,
nav.user-logged-in .actions ul li .profile {
  display: flex;
  align-items: center;
  height: 40px;
}

nav .actions ul li a#logoutLink {
  text-decoration: none !important;
}

/* Ensure all navbar icons are black, regardless of parent */
nav .actions ul li i {
  color: #000 !important;
}

/* Also, make sure buttons don't override the color */
nav .actions ul li button,
nav .actions ul li button:active,
nav .actions ul li button:focus {
  color: #000 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
