* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

ul {
  list-style: none;
}

.menu {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #590094;
  display: flex;
  justify-content: center;
}
.menu ul {
  display: flex;
  position: relative;
}
.menu ul li {
  flex: 1;
}
.menu a {
  padding: 15px;
  display: block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: all .2s ease-in;
  position: relative;
  white-space: nowrap;
}
.menu a:hover {
  background-color: #9115e4;
  color: #fff;
}
.menu a::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #b863f0;
  transition: all .3s ease-in;
}
.menu a:hover::after {
  width: 100%;
}

.menu ul ul {
  visibility: hidden;
  display: flex;
  flex-direction: column;
  position: absolute;
}
.menu ul li:hover ul {
  visibility: visible;
}
.menu ul ul li a {
  background-color: #2c2c2c;
  color: #fff;
}
.menu ul ul li a:hover {
  background-color: #9115e4;
}

label[for="bt_menu"] {
  padding: 5px;
  background-color: #590094;
  cursor: pointer;
  width: 100%;
  height: 46px;
  z-index: 1;
}
label[for="bt_menu"] img {
  width: 40px;
  height: 40px;
}

label[for="bt_menu"], #bt_menu {
  display: none;
}

@media (max-width: 1024px) {
  label[for="bt_menu"] {
    display: block;
    position: absolute;
    top: 0;
  }

  #bt_menu:checked ~ .menu {
    margin-top: 0;
  }

  .menu {
    padding-top: 50px;
    margin-top: -100%;
    transition: all .4s ease-in;
  }
  .menu a {
    background-color: #242424;
  }
  .menu ul {
    flex-direction: column;
    width: 100%;
  }

  .menu ul li {
    width: 100%;
  }
  .menu ul li:hover ul {
    max-height: 200px;
  }
  .menu ul ul {
    position: static;
    width: 100%;
    overflow: hidden;
    max-height: 0;
    transition: all .4s ease-in-out;
  }
}