body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

.menu-container {
  position: relative;
}

.burger-checkbox {
  position: absolute;
  visibility: hidden;
}

.burger {
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 1001;
  width: 30px;
  height: 22px;
  cursor: pointer;
  display: none;
}

.burger span {
  display: block;
  height: 4px;
  width: 100%;
  background: rgb(0, 0, 0);
  border-radius: 2px;
  margin-bottom: 5px;
  transition: all 0.3s;
}

.burger-checkbox:checked + .burger span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 7px);
}
.burger-checkbox:checked + .burger span:nth-child(2) {
  opacity: 0;
}
.burger-checkbox:checked + .burger span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.menu {
  list-style: none;
  display: flex;
  justify-content: center;
  background: #4c4e5a;
  padding: 0;
  margin: 0;
}

.menu li {
  position: relative;
}

.menu > li > a {
  display: block;
  padding: 12px 20px;
  color: #f3f3f3;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}

.menu > li:hover > a {
  background: #3a3c46;
  color: #8fde62;
}

/* Підменю */
.submenu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1f2024;
  border-radius: 0 0 5px 5px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  min-width: 150px;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.menu li:hover > .submenu {
  opacity: 1;
  visibility: visible;
}

.submenu li a {
  display: block;
  padding: 10px 15px;
  color: #f3f3f3;
  text-decoration: none;
  transition: background 0.3s;
}

.submenu li a:hover {
  background: #333;
}

.home-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  background: #4caf50;
  color: white;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background 0.3s, transform 0.3s;
  z-index: 1000;
}

.home-button:hover {
  background: #45a049;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .burger {
    display: block;
    right: 20px;
    left: auto;
  }

  .menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background: #4c4e5a;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding-top: 60px;
    text-align: left;
    overflow-y: auto;
  }

  .burger-checkbox:checked ~ .menu {
    transform: translateX(0);
  }

  .menu li {
    width: 100%;
  }

  .menu > li > a {
    padding: 15px 20px;
    display: block;
    font-size: 20px;
  }

  .submenu {
    position: relative;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
  }

  .menu li:hover > .submenu,
  .menu li:focus-within > .submenu {
    display: block;
  }

  .submenu li a {
    padding: 15px 20px;
    font-size: 18px;
  }
}
