#g-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
}

#g-nav ul ul {
  display: block;
}

#g-nav ul li {
  position: relative;
}

#g-nav ul li a {
  display: block;
  text-decoration: none;
  color: #666;
  padding: 10px 26px;
  transition: all 0.3s;
}

#g-nav ul li li a {
  padding: 10px 20px;
}

#g-nav ul li.current a,
#g-nav ul li a:hover {
  color: #333;
}

/*==矢印の設定*/
@media screen and (min-width: 768px) {
.bl-gnav::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 1px;
    height: 14px;
    margin-top: -7px;
    background: rgba(0,0,0,.15);
    -webkit-transform: rotate(20deg);
    transform: rotate(20deg);
    pointer-events: none;
  }
}

/*2階層目を持つliの矢印の設定*/
#g-nav ul li.has-child::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-top: 2px solid #999;
  border-right: 2px solid #999;
  transform: rotate(135deg);
}

/*== 2・3階層目の共通設定 */

/*下の階層を持っているulの指定*/
#g-nav li.has-child ul {
  position: absolute;
  left: 0;
  top: 53px;
  z-index: 4;
  background: #333;
  width: 100%;
  min-width: 180px;
  visibility: hidden;
  opacity: 0;
  transition: all .3s;
}

/*hoverしたら表示*/
#g-nav li.has-child:hover>ul,
#g-nav li.has-child ul li:hover>ul,
#g-nav li.has-child:active>ul,
#g-nav li.has-child ul li:active>ul {
  visibility: visible;
  opacity: 1;
}

/*ナビゲーションaタグの形状*/
#g-nav li.has-child ul li a {
  color: #fff !important;
  border-bottom: solid 1px rgba(255, 255, 255, 0.6);
}

#g-nav li.has-child ul li:last-child a {
  border-bottom: none;
}

#g-nav li.has-child ul li a:hover,
#g-nav li.has-child ul li a:active {
  background: #444;
}

/*==1023px以下の形状*/

@media screen and (max-width:1023px) {

  /*========= ナビゲーションのためのCSS ===============*/
  #header {
    height: 60px;
  }

  #g-nav {
    position: fixed;
    z-index: 999;
    top: -120%;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ddd;
    transition: all 0.6s;
    padding: 0;
  }

  /*アクティブクラスがついたら位置を0に*/
  #g-nav.panelactive {
    top: 0;
  }

  /*ナビゲーションの縦スクロール*/
  #g-nav.panelactive #g-nav-list {
    /*ナビの数が増えた場合縦スクロール*/
    position: fixed;
    z-index: 999;
    width: 100%;
    height: 100vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /*ナビゲーション*/
  #g-nav ul {
    width: 90%;
    margin: 100px auto 0 auto;
    display: block;
  }

  #g-nav ul ul {
    width: 100%;
    margin: 0;
  }

  /*プルダウンナビのCSS*/
  #g-nav ul li.has-child ul {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    visibility: visible;
    opacity: 1;
    display: none;
    transition: none;
    transform: none;
  }

  #g-nav li.has-child ul {
    background: none;
  }

  #g-nav ul li a {
    border-bottom: 1px solid #ccc;
  }

  #g-nav li.has-child ul li a {
    color: #666 !important;
    border-bottom: solid 1px #ccc;
  }

  #g-nav li.has-child ul li a:hover,
  #g-nav li.has-child ul li a:active {
    background: #c6c6c6;
  }

  /*矢印の位置と向き*/
  #g-nav ul li.has-child::before {
    left: 20px;
  }

  #g-nav ul ul li.has-child::before {
    /*  transform: rotate(135deg);*/
    left: 20px;
  }

  #g-nav ul li.has-child.active::before {
    transform: rotate(-45deg);
  }



  /*リストのレイアウト設定*/
  #g-nav li {
    list-style: none;
    text-align: center;
  }

  #g-nav li a {
    color: #aaa;
    text-decoration: none;
    padding: 10px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: bold;
  }


  @keyframes gnaviAnime {
    0% {
      opacity: 0;
    }

    100% {
      opacity: 1;
    }
  }

  /*========= ボタンのためのCSS ===============*/
  .openbtn {
    position: fixed;
    z-index: 9999;
    /*ボタンを最前面に*/
    top: 0;
    right: 0;
    cursor: pointer;
    width: 50px;
    height: 50px;
    background: #fff;
    padding: 13px;
  }

  /*×に変化*/
  .openbtn span {
    display: inline-block;
    transition: all .4s;
    position: absolute;
    left: 14px;
    height: 2px;
    /*border-radius: 2px;*/
    background-color: #333;
    width: 48%;
  }

  .openbtn span:nth-of-type(1) {
    top: 16px;
  }

  .openbtn span:nth-of-type(2) {
    top: 24px;
  }

  .openbtn span:nth-of-type(3) {
    top: 32px;
  }

  .openbtn.active span:nth-of-type(1) {
    top: 19px;
    left: 15px;
    transform: translateY(6px) rotate(-45deg);
    width: 48%;
  }

  .openbtn.active span:nth-of-type(2) {
    opacity: 0;
  }

  .openbtn.active span:nth-of-type(3) {
    top: 31px;
    left: 15px;
    transform: translateY(-6px) rotate(45deg);
    width: 48%;
  }

}