@media print,
screen and (min-width: 768px) {
  #menu {
    background-color: #bbe7f5;
  }


  nav {
    background-color: #bbe7f5;
    height: 50px;
  }
}



#menu-btn {
  display: none;
}

#menu-content {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

#menu-content>li {
  position: relative;
  float: left;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}

#menu-content>li>a {
  /* 高さ指定とFlexboxを追加 */
  height: 50px;
  /* navの高さに合わせる */
  display: flex;
  /* Flexboxを使用 */
  align-items: center;
  /* 上下中央揃え */
  justify-content: center;
  /* 左右中央揃え */
  text-align: center;
  /* 2行になった時のテキスト中央揃え */

    padding: 0 14px;
    line-height: 1.3;
    font-size: 13px;
  /* 必要に応じて調整 */
  color: #000;
  text-decoration: none;
  box-sizing: border-box;
  /* paddingを含めたサイズ計算にする */
}

#menu-content>li>a i {
  padding-left: 5px;
}



@media print,
screen and (max-width: 1000px) {
  #menu-content>li>a {
    font-size: 10px;
    padding: 6px;
    line-height: 2;
  }
}

@media print,
screen and (min-width: 1040px) {
  #menu-content>li>a {
    font-size: 12px;
  }
}





@media print,
screen and (min-width: 768px) {

  #menu-content>li:hover>a {
    background: #38a0c9;
    color: #fff;
  }


  #menu-content>li.active {
    background: #38a0c9;
    color: #fff;
  }

  #menu-content>li.active a {
    color: #fff;
  }

  #menu-content>li>a {
    min-width: 105px;
  }


}

@media print,
screen and (min-width: 1400px) {
  #menu-content>li>a {
    font-size: 15px;
  }
      #menu-content>li>a {
        min-width: 135px;
    }
}


#menu-content>li>ul.second-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  padding-left: 0;
  list-style-type: none;
}

#menu-content>li:hover>ul.second-content {
  visibility: visible;
  opacity: 1;
  -webkit-transition: opacity 0.5s, visibility 0.5s;
  transition: opacity 0.5s, visibility 0.5s;

}

#menu-content>li>ul.second-content>li {
  text-align: left;
  width: 275px;
  background: #bbe7f5;
}

#menu-content>li>ul.second-content>li>a {
  display: block;
  line-height: 50px;
  color: #000;
  font-size: 14px;
  text-decoration: none;
  padding-left: 10px;
}

#menu-content>li>ul.second-content>li>a:hover {
  background: #38a0c9;
  color: #fff;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}

@media screen and (max-width: 767px) {
  .toggle_btn span:nth-of-type(4)::after {
    content: "Menu";
    /*3つ目の要素のafterにMenu表示を指定*/
    position: absolute;
    top: 35px;
    left: 5px;
    color: #333;
    font-size: 0.6rem;
    text-transform: uppercase;

  }

  .toggle_btn.active span:nth-of-type(4)::after {
    content: "Close";
    /*3つ目の要素のafterにClose表示を指定*/
  }

  nav {
    position: fixed;
    top: 0;
    right: -300px;
    bottom: 0;
    width: 300px;
    padding: 50px 0 20px 0;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    z-index: 3;
    opacity: 0;
  }

  .open nav {
    right: 0;
    opacity: 1;
  }

  nav .inner {
    padding: 25px;
  }

  nav .inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  nav .inner ul li {
    position: relative;
    margin: 0;
  }

  nav .inner ul li a {
    display: block;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    -webkit-transition-duration: 0.2s;
    transition-duration: 0.2s;
  }

  .toggle_btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    cursor: pointer;
    z-index: 3;
  }

  .toggle_btn span {
    position: absolute;
    left: 0;
    width: 40px;
    height: 1px;
    background-color: #333;
    border-radius: 4px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
  }

  .toggle_btn span:nth-child(1) {
    top: 0px;
  }

  .toggle_btn span:nth-child(2) {
    top: 12px;
  }

  .toggle_btn span:nth-child(3) {
    bottom: 15px;
  }

  .open .toggle_btn span {
    background-color: #333;
  }

  .open .toggle_btn span:nth-child(1) {
    -webkit-transform: translateY(0px) rotate(-315deg);
    transform: translateY(10px) rotate(-45deg);
  }

  .open .toggle_btn span:nth-child(2) {
    opacity: 0;
  }

  .open .toggle_btn span:nth-child(3) {
    -webkit-transform: translateY(-13px) rotate(315deg);
    transform: translateY(-13px) rotate(45deg);
  }

  .open .toggle_btn span:nth-child(4) {
    background-color: #fff;
    z-index: -1;
  }

  #mask {
    display: none;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
  }

  .open #mask {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0.5;
    z-index: 2;
    cursor: pointer;
  }

  #menu-content>li {
    width: 100%;
    margin-bottom: 5px;
  }

  #menu-content>li:hover {
    background: none;
  }

  #menu-content>li>a {
    height: 100%;
    padding: 0px;
    font-size: 100%;
    line-height: 30px;
  }

  #menu-content>li>a:hover {
    color: #38a0c9;
  }

  #menu-content>li>ul.second-content {
    visibility: visible;
    opacity: 1;
    width: 100%;
    position: relative;
    -webkit-box-shadow: none;
    box-shadow: none;
  }

  #menu-content>li>ul.second-content>li {
    width: 100%;
    text-align: left;
    background-color: #fff;
  }

  #menu-content>li>ul.second-content>li>a {
    padding-left: 15px;
    line-height: 40px;
    border-top: 1px solid #ccc;

  }

  #menu-content>li>ul.second-content>li>a:hover {
    background: none;
    color: #38a0c9;
  }
}

@media screen and (max-width: 767px) {
  .toggle_btn span:nth-of-type(4)::after {
    content: "Menu";
    /*3つ目の要素のafterにMenu表示を指定*/
    position: absolute;
    top: 35px;
    left: 5px;
    color: #333;
    font-size: 0.6rem;
    text-transform: uppercase;

  }

  .toggle_btn.active span:nth-of-type(4)::after {
    content: "Close";
    /*3つ目の要素のafterにClose表示を指定*/
  }

  nav {
    position: fixed;
    top: 0;
    right: -300px;
    bottom: 0;
    width: 300px;
    padding: 50px 0 20px 0;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    z-index: 3;
    opacity: 0;
  }

  .open nav {
    right: 0;
    opacity: 1;
  }

  nav .inner {
    padding: 25px;
  }

  nav .inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  nav .inner ul li {
    position: relative;
    margin: 0;
  }

  nav .inner ul li a {
    display: block;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    -webkit-transition-duration: 0.2s;
    transition-duration: 0.2s;
  }

  .toggle_btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    cursor: pointer;
    z-index: 3;
  }

  .toggle_btn span {
    position: absolute;
    left: 0;
    width: 40px;
    height: 1px;
    background-color: #333;
    border-radius: 4px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
  }

  .toggle_btn span:nth-child(1) {
    top: 0px;
  }

  .toggle_btn span:nth-child(2) {
    top: 12px;
  }

  .toggle_btn span:nth-child(3) {
    bottom: 15px;
  }

  .open .toggle_btn span {
    background-color: #333;
  }

  .open .toggle_btn span:nth-child(1) {
    -webkit-transform: translateY(0px) rotate(-315deg);
    transform: translateY(10px) rotate(-45deg);
  }

  .open .toggle_btn span:nth-child(2) {
    opacity: 0;
  }

  .open .toggle_btn span:nth-child(3) {
    -webkit-transform: translateY(-13px) rotate(315deg);
    transform: translateY(-13px) rotate(45deg);
  }

  .open .toggle_btn span:nth-child(4) {
    background-color: #fff;
    z-index: -1;
  }

  #mask {
    display: none;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
  }

  .open #mask {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0.5;
    z-index: 2;
    cursor: pointer;
  }

  #menu-content>li {
    width: 100%;
    margin-bottom: 5px;
  }

  #menu-content>li:hover {
    background: none;
  }

  #menu-content>li>a {
    height: 100%;
    padding: 0px;
    font-size: 11px;
    line-height: 30px;
  }

  #menu-content>li>a:hover {
    color: #66cc99;
  }

  #menu-content>li>ul.second-content {
    visibility: visible;
    opacity: 1;
    width: 100%;
    position: relative;
    -webkit-box-shadow: none;
    box-shadow: none;
  }

  #menu-content>li>ul.second-content>li {
    width: 100%;
    text-align: left;
    background-color: #fff;
  }

  #menu-content>li>ul.second-content>li>a {
    padding-left: 15px;
    line-height: 40px;
    border-top: 1px solid #ccc;

  }

  #menu-content>li>ul.second-content>li>a:hover {
    background: none;
    color: #66cc99;
  }
}


/* スマホ表示用：メニューを左揃えに戻す記述 */
@media screen and (max-width: 767px) {

  #menu-content>li>a {
    display: block;
    /* Flexboxを解除してブロック表示に戻す */
    text-align: left;
    /* テキストを左揃え */
    justify-content: flex-start;
    /* 念のためFlexの左寄せも指定 */
    padding-left: 10px;
    /* 左側に少し余白を追加して見やすくする */
    padding-right: 10px;
  }

  /* ドロップダウン内のリンクも左揃えを徹底 */
  #menu-content>li>ul.second-content>li>a {
    display: block;
    text-align: left;
    padding-left: 30px;
    /* 子メニューは少し右にインデント */
  }
}