.hamburger {
  position: fixed;
  top: 20px;
  right: 20px;
  flex-direction: column;
  justify-content: space-around;
  background-color: transparent;
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
  z-index: 999;
  transition: opacity 0.5s ease;
  display: flex;
  opacity: 0;
  pointer-events: none;
}

.hamburger span {
  display: block;
  height: 3px;
  background: #e6b422;
  border-radius: 2px;
  transition: 0.3s;
  z-index: 9999;
  width: 100%;
}

.nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  height: 100vh;
  background: white;
  transition: right 0.3s ease;
  z-index: 600;
}

.nav-menu ul {
  list-style: none;
  padding: 60px 20px;
}

.nav-menu li {
  margin-bottom: 20px;
  margin-left: 20px;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-size: 1.2rem;
}

.nav-menu.active {
  right: 0;
}

@media screen and (min-width: 899px) {
  .hamburger {
    display: none;
}
}

/* オーバーレイのスタイルを追加 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒色 */
    z-index: 500; /* メニューより下、元のページより上になるように設定 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

/* メニューが開いたときにオーバーレイを表示するスタイル */
.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* nav-menu の z-index をオーバーレイより高く設定 */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: white;
    transition: right 0.3s ease;
    z-index: 600; /* ← z-index を変更 */
}