.affin2header-nav {
  background: rgb(223, 223, 223);
  color: rgb(85, 85, 85);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 5%;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.affin2header-logo {
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.affin2header-logo img {
  height: 50px;
  margin-right: 10px;
}

.affin2header-menu-container {
  display: flex;
  justify-content: center;
  flex: 1;
}

.affin2header-menu {
  display: flex;
  list-style: none;
}

.affin2header-menu li {
  position: relative;
  margin: 0 10px;
}

.affin2header-menu li a {
  color: rgb(0, 0, 0);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.affin2header-menu li a:hover {
  color: rgb(0, 0, 0);
  border-top: 2px solid rgb(255, 0, 0);
  border-radius: 10px;
  padding-top: 2px;
  border-radius: 0;
}

.affin2header-menu li a i {
  margin-left: 5px;
  font-size: 18px;
  transition: transform 0.3s ease;
  color: rgb(0, 0, 0);
}

.affin2header-menu li:hover > a i {
  transform: rotate(180deg);
}

.affin2header-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgb(223, 223, 223);
  min-width: 220px;
  padding: 12px 0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s ease;
  z-index: 100;
}

.affin2header-menu li:hover .affin2header-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.affin2header-submenu li {
  margin: 0;
  padding: 0;
  border: none; /* cleaner look */
}

.affin2header-submenu li a {
  color: #000000;
  padding: 10px 20px;
  display: block;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.25s ease;
  border-radius: 6px;
}

.affin2header-submenu li a:hover {
  color: #ff2222;
  border: none;
}

/* icons section */
.affin2header-icons {
  display: flex;
  align-items: center;
}

.affin2header-icons a {
  color: rgb(0, 0, 0);
  font-size: 18px;
  margin-left: 20px;
  transition: all 0.3s ease;
}

.affin2header-icons a:hover {
  color: #ff0000;
}

.affin2header-menu-btn,
.affin2header-close-btn {
  font-size: 22px;
  cursor: pointer;
  display: none;
}

.affin2header-hamburger {
  display: none;
  color: black;
}

.spaceout {
  margin-bottom: 70px;
}

/* ---------- MOBILE ---------- */
@media (max-width: 992px) {
  .affin2header-hamburger {
    display: block;
    font-size: 30px;
    font-weight: lighter;
    padding-top: 10px;
  }

  .affin2header-hamburger2 {
    padding: unset;
    padding-left: 15px;
  }

  .affin2header-menu-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: rgb(223, 223, 223);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 80px;
    transition: all 0.5s ease;
    z-index: 1000;
    box-shadow: 0 20px 15px rgba(0, 0, 0, 0.753);
    overflow-y: auto; /* This enables vertical scrolling */
  }

  .affin2header-menu-container.affin2header-active {
    right: 0;
    overflow-y: auto; /* Ensures scroll on mobile */
  }

  .affin2header-menu {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
  }

  .affin2header-menu li {
    margin: 5px 0;
    width: 100%;
  }

  .affin2header-menu li a {
    font-size: 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }

  .affin2header-submenu {
    position: static;
    width: 100%;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none; /* initially hidden */
    margin-top: 0;
    margin-left: 15px;
    padding: 0;
  }

  .affin2header-submenu.open {
    display: block;
  }

  .affin2header-submenu li {
    border-bottom: none;
  }

  .affin2header-submenu li a {
    color: rgba(0, 0, 0, 0.8);
    padding: 10px 0;
    font-size: 16px;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
  }

  .affin2header-submenu li a:hover {
    color: #ff0000;
    background: transparent;
    transform: none;
  }

  .affin2header-menu-btn,
  .affin2header-close-btn {
    display: block;
    z-index: 1001;
  }

  .affin2header-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
  }
}
