/* 基本スタイル */
body {
  margin: 0;
  font-family: 'Noto Sans JP',sans-serif,system-ui;
	font-weight:600;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  position: fixed;
  opacity: 1;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 101;
  padding-top: 0px;
  background: linear-gradient(to bottom, 
  rgba(0, 0, 0, 0.5),  
  rgba(0, 0, 0, 0.2),  
  rgba(0, 0, 0, 0.1), 
  transparent);
  visibility: visible;
  transition: opacity 0.3s ease;
}

/* ロゴ */
.logo {
  position: absolute;
  top: 30%;
  left: 10px;
}

.logo img {
  height: 25px;
}

.logo .default-logo {
  display: block;
  /* 初期状態では .default-logo を表示 */
}

.logo .scrolled-logo {
  display: none;
  /* 初期状態では .scrolled-logo を非表示 */
}

.scrolled .logo .default-logo {
  display: none;
  /* scrolled 状態では .default-logo を非表示 */
}

.scrolled .logo .scrolled-logo {
  display: block;
  /* scrolled 状態では .scrolled-logo を表示 */
}

/* メニュー */
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu li {
  position: relative;
}

.menu a {
  display: block;
  padding: 18px 30px;
  text-decoration: none;
  color: #fff;
  transition: color 0.3s ease;
  font-weight: bold;
  pointer-events: auto;
  position: relative;
  /* position: relative を追加 */
  z-index: 100;
  /* メニューバー本体のz-index */
  font-size: 1rem;
}

.menu a .line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #333;
  transition: width 0.3s ease;
}

.submenu-category a .line {
  /* ラインのスタイル */
  height: 0px;
}

.menu a.hover .line {
  /* マウスオーバー時のスタイル */
  width: 100%;
}

/* スクロール時・ホバー時 */
header.scrolled {
  background: none; /* グラデーションを追加 */
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


.scrolled .menu a {
  color: #333;
}

/* サブメニュー */
.submenu-wrap {
  display: none;
  position: fixed;
  top: 54px;
  left: 0;
  width: 100%;
  height: calc(100% - 100px);
  z-index: 99;
  overflow-y: auto;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
}

.submenu-category {
  width: calc(100% / 3);
  box-sizing: border-box;
}

.submenu-category a {
  color: #333;
  padding: 15px;
  display: block;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 5px;
  margin: 0px 10px;
  font-weight: bold;
}

.submenu .second-level {
  position: static;
  display: block;
  /* PCでは常に表示 */
  width: 100%;
}

.submenu .second-level li {
  margin-bottom: 5px;
}

.submenu .second-level a {
  display: flex;
  align-items: center;
  color: #333;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 5px;
  text-decoration: none;
  pointer-events: auto;
  /* クリックイベントを有効にする */
}

.submenu .second-level img {
  width: 80px;
  height: auto;
  margin-right: 10px;
  border-radius: 5px;
}

/* スクロール位置によるサブメニューの非表示 */
.hide-submenu .submenu-wrap {
  display: none !important;
  transition: display 0.3s ease;
}

/*ドロップダウン展開時のぼかし効果

.submenu-wrap.show>.submenu {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
 }

 */
 
 .submenu-wrap.show {
  display: block;
}

/* メニュー非表示 */
.hide-menu,
.hide-menu .menu,
.hide-menu .submenu-wrap,
.hide-menu .hamburger {
  visibility: hidden;
  opacity: 0;
  transition: 
  opacity 0.3s ease,
  visibility 0.3s ease 0.3s; /* visibilityのトランジションを3秒遅らせる */
}



#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100%);
  background-color: rgba(0, 0, 0, 0.500);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 98;
}

.submenu-wrap.show~#overlay {
  /* サブメニューが表示されている場合にオーバーレイを表示 */
  display: block;
}


/* スマホサイズ */
@media screen and (max-width: 960px) {
  .menu a:hover .line {
    /* マウスオーバー時のスタイル */
    width: 0;
    /* スマホ表示ではアンダーラインを表示しない */
  }

  .menu {
    display: none;
  }

  .logo {
    position: absolute;
    top: 10px;
    left: 40px;
  }

  .logo img {
    margin-left: 0px;
    height: 17px;
  }

  /* ハンバーガーメニュー */
  .hamburger {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列のグリッド */
    grid-template-rows: repeat(3, 1fr); /* 3行のグリッド */
    gap: 3.5px; /* グリッドアイテム間の隙間 */
    width: 20px; /* アイコン全体の幅 */
    height: 20px; /* アイコン全体の高さ */
    margin: 8px 0;
    transition: all 0.3s ease;
  }
  
  .grid-item {
    background-color: rgb(255, 255, 255); /* 正方形の色 */
    width: 100%; /* 親要素の幅いっぱいに広げる */
    height: 100%; /* 親要素の高さいっぱいに広げる */
    transition: all 0.3s ease;
  }
  
  .grid-item:nth-child(3) { 
    background-color: transparent !important; 
    transition: all 0.3s ease;
  }


 
/* ハンバーガーメニュー active 時 */
.hamburger.active {
  transform: rotate(135deg); /* グリッド全体を45度回転 */
  transition: all 0.3s ease;
}

.hamburger.active .grid-item:nth-child(1) {
  background-color: transparent; 
  transition: all 0.3s ease;
}

.hamburger.active .grid-item:nth-child(7) {
  background-color: transparent; 
  transition: all 0.3s ease;
}

.hamburger.active .grid-item:nth-child(9) {
  background-color: transparent; 
  transition: all 0.3s ease;
}

  header.scrolled .grid-item {
    background-color: #333;
    transition: all 0.3s ease;
    /* または任意の色 */
  }

  

    .menu.active {
    display: block;
    position: fixed;
    top: 36px;
    left: 0;
    width: 100%;
    height: calc(100% - 40px);
    background-color: #fff;
    z-index: 99;
    overflow-y: auto;
    
  }

  .menu.active li {
    width: 100%;
  }

  .menu.active a {
    color: #333;
    padding:8px 20px;
    border-bottom: 1px solid #eee;
  }

  .menu.active .submenu-wrap {
    position: static;
    display: none;
    height: auto;
    background-color: transparent;
    backdrop-filter: none;
  }

  .menu.active .submenu {
    display: block;
    flex-direction: column;
    backdrop-filter: none;
  }

  .menu.active .submenu-category {
    width: 100%;
  }

  .menu.active .second-level {
    padding-left: 20px;
    display: none;
    /* スマホでは初期状態では非表示 */
  }

  .menu.active .second-level a {
    background-color: transparent;
  }

  .menu{
    background-color: rgba(255, 255, 255, 1);
    /* メニューを不透明にする */
  }

  .menu.active a:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background-color: #333;
    /* または任意の色 */
  }


  .menu a .line,
  .submenu-category a .line {
    /* ラインのスタイル */
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translateX(0);
    width: 0;
    height: 2px;
    background-color: #333;
    transition: width 0.3s ease;
  }


  .menu.active a.active .line {
    /* 親ボタンがアクティブ時のスタイル */
    width: 100%;
    /* アンダーラインを表示 */
  }

  .submenu-category a.active .line {
    /* 親ボタンがアクティブ時のスタイル */
    width: 100%;
    /* アンダーラインを表示 */
  }

}