/* ナビゲーションスタイル */
.nav-container {
  margin: 0 auto;
  background: rgb(255, 255, 255);
  display: flex;
  justify-content: flex-end;
  padding: 10px 10px;
  position: relative;
}

.nav {
  display: flex;
  list-style: none;
}
.nav > li {
  position: relative;
  margin-left: 20px;
}
.nav > li > a {
  font-size: 14px;
  font-weight: bold;
  color: black;
  text-decoration: none;
  padding: 10px 0;
  display: inline-block;
  transition: color 0.3s ease;
}
.nav > li > a:hover {
  color: orange;
}

/* サブメニュー */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  list-style: none;
  width: 150px;
  border-radius: 5px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
}
/* .submenu li { */
/* border-bottom: 1px solid #ddd; */
/* } */
.submenu li a {
  display: block;
  color: black;
  font-weight: bold;
  text-decoration: none;
  padding: 10px;
  transition: color 0.3s ease;
}
.submenu li a:hover {
  color: orange;
}

/* ハンバーガーメニュー */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  position: absolute;
  top: -10px; /*上からの位置*/
  right: 10px; /*右からの位置*/
  z-index: 1001;
}
.menu-toggle div {
  width: 30px;
  height: 3px;
  background: black;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* ハンバーガーメニュー開いた時の×アイコン */
.menu-toggle.active {
  position: absolute; /* ← 位置を制御 */
  top: -10px; /* ← 上からの距離 */
  right: 10px; /* ← 右からの距離 */
}

.menu-toggle.active div:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}
.menu-toggle.active div:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active div:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* レスポンシブ対応 */
@media (min-width: 769px) {
  .nav {
    display: flex !important; /* 769px以上では常に表示 */
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .nav-container {
    width: 100%;
    justify-content: flex-end;
    padding: 10px;
  }
  .menu-toggle {
    display: flex;
  }
  .nav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    z-index: 1000;
  }
  .nav.active {
    display: flex;
  }
  .nav > li {
    margin: 10px 0;
  }
  .nav > li > a {
    font-size: large;
    padding: 10px;
    display: inline-block; /* 文字の範囲のみに */
    border-bottom: 1px solid #ddd;
  }
  .submenu {
    position: static;
    display: none;
    background: white;
    width: auto;
    text-align: center;
  }
  .submenu li {
    display: block;
    margin: 5px 0;
  }
}
