/* リセットは別途 */

/* ヘッダー全体 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #ccc;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ロゴ */
.headerLogo {
  display: flex;
  align-items: center;
  position: relative;
}

.logoImg {
  height: 80px;
  cursor: pointer;
}

/* ハンバーガーメニュー */
.hamMenu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 15px;
}

.hamMenu .bar {
  height: 3px;
  width: 100%;
  background-color: #00A99D;
  border-radius: 2px;
}

/* ナビゲーション */
nav {
  display: flex;
  padding-right: 120px; /* 右端に余裕を持たせる */
}

.dropDownMenu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

/* メニュー項目 */
.menu {
  position: relative;
}

.primaryItem {
  color: #00A99D;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  display: inline-block;
  padding: 10px 5px;
}

/* サブメニュー初期非表示 */
.subMenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px 0;
  min-width: 150px;
  display: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 100;
}

.subMenu li {
  padding: 5px 20px;
}

.subMenu li a {
  color: #00A99D;
  text-decoration: none;
  font-weight: normal;
}

.subMenu li a:hover {
  color: #008078;
}

/* PC：ホバーでサブメニュー表示 */
@media (hover: hover) and (min-width: 929px) {
  .menu.hasChild:hover > .subMenu {
    display: block;
  }
}

/* スマホ用 */
@media (max-width: 928px) {
  .hamMenu {
    display: flex;
  }

  nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 250px;
    height: calc(100% - 70px);
    background: #f2fdfd;
    flex-direction: column;
    padding-top: 20px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    z-index: 9999;
  }

  nav.active {
    right: 0;
  }

  .dropDownMenu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .menu {
    width: 100%;
  }

  .primaryItem {
    display: block;
    padding: 15px 20px;
    font-size: 16px;
    width: 100%;
  }

  /* サブメニューは相対配置で縦並び、非表示 */
  .subMenu {
    position: relative;
    top: auto;
    left: auto;
    border: none;
    box-shadow: none;
    padding: 0;
    display: none;
  }

  .subMenu li {
    padding: 10px 40px;
  }

  .subMenu li a {
    font-size: 15px;
  }

  /* サブメニューの開閉はJSでvisibleクラスを付け外し */
  .subMenu.visible {
    display: block;
  }
}
