.hamburger-menu{
  position: relative;
  right: 1rem;
}


.hamburger-menu input.menu__toggle{
  opacity: 0;
  height: 0px;
  width: 0px;
  z-index: 1;
}

.hamburger-menu input.menu__toggle:checked{
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}


.hamburger-menu:has(input.menu__toggle:checked) .menu__btn  span {
  transform: rotate(45deg);
  z-index: 3;
}
.hamburger-menu:has(input.menu__toggle:checked) .menu__btn  span::before {
  top: 0;
  transform: rotate(0deg);
  background-color: white;
  z-index: 3;
}
.hamburger-menu:has(input.menu__toggle:checked) .menu__btn  span::after {
  top: 0;
  transform: rotate(90deg);
  background-color: white;
  z-index: 3;
}
.hamburger-menu:has(input.menu__toggle:checked) .menu__box{
  right: 0 !important;
}

.hamburger-menu:has(input.menu__toggle:checked) div.black_background{
  visibility: visible;
  opacity: 50%;
}


div.black_background{
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background-color: black;
  opacity: 0;
  transition-duration: .5s;
  z-index: 2;
}

input.menu__toggle:checked + .menu__btn {
  z-index: 5;
  position: fixed;
  top: .5rem;
  right: 1.2rem;
}

.menu__btn {
  position: relative;
  width: 30px;
  height: 50px;
  cursor: pointer;
  z-index: 2;
}
.menu__btn  span,
.menu__btn  span::before,
.menu__btn  span::after {
  display: block;
  position: relative;
  top: 50%;
  width: 100%;
  height: 1px;
  background-color: white;
  transition-duration: .5s;
  z-index: 2;
}
.menu__btn  span::before {
  content: '';
  top: -0.8rem;
  z-index: 2;
}
.menu__btn span::after {
  content: '';
  top: 0.8rem;
  z-index: 2;
}
.menu__box {
  display: flex;
  align-items: center;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: -200%;
  width: calc(100vw + 10px);
  max-width: 768px;
  height: 100%;
  margin: 0;
  padding: 80px 0;
  list-style: none;
  background-color: var(--primary-color);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, .4);
  transition-duration: .5s;
  z-index: 3;
}
li:has(.menu__item) {
  display: block;
  padding: 12px 24px;
  color: var(--text-color);
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  transition-duration: .25s;
}

.menu__item{
  padding: 5px 20px;
}

.menu__item:hover {
  background-color: #CFD8DC;
}

.hamburger-menu{
  margin: 0 10px;
}