.header {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease; /* トランジションの追加 */
  opacity: 1; /* 初期状態の透明度 */
  visibility: visible; /* 初期状態の可視性 */
}

.header-hidden {
  opacity: 0;
  visibility: hidden; /* 非表示時の可視性 */
}

#header__sp {
  display: none;
}

.header__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
}

.header__logo {
  flex: 1;
}

.header__logo img {
  width: 250px;
}

.header__menu {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 6;
  gap: 16px;

  padding: 8px 24px;

  background-color: #fff;

  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.16);
  border-radius: 40px;
}

.header__menuInner {
  display: flex;
  gap: 16px;
}

.header__menuItem a {
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
}

.rotate {
  /* 3D変形させた際の、奥行きを指定 */
  perspective: 300px;
  text-decoration: none;
  display: inline-block;
}

.rotate > span {
  /* 背面の要素（2個目のspanタグ）を非表示にする */
  backface-visibility: hidden;
  /* アニメーション効果を0.5秒間で適用 */
  transition: transform 0.3s;
  display: block;
  height: 20px;
}

/* ホバー前 */
.rotate > span:first-child {
  /* 10px下に移動し縦中央に表示する */
  transform: translateY(10px) rotateX(0deg);
}

.rotate > span:last-child {
  /* 90度回転させ非表示にする */
  transform: rotateX(-90deg);
}

/* ホバー時 */
.rotate:hover > span:first-child {
  /* X軸周りに90度回転して非表示にする */
  transform: rotateX(90deg);
}

.rotate:hover > span:last-child {
  /* 10px上に移動し表示する */
  transform: translateY(-10px) rotateX(0deg);
}

.header__btn {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  background-color: var(--blue);
  color: #fff;

  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.16);
  border-radius: 40px;
}

.header__btn a {
  flex: 1;

  color: var(--white);

  text-decoration: none;
}

.header__btn i {
  margin-left: 8px;
}

/* header__sp */

.header__spDrawer {
  position: relative; /*ボタン内側の基点となるためrelativeを指定*/
  background: var(--white);
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 100vh;
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.16);
}

/*ボタン内側*/
.header__spDrawer span {
  display: inline-block;
  transition: all 0.4s; /*アニメーションの設定*/
  position: absolute;
  left: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  width: 45%;
}

.header__spDrawer span:nth-of-type(1) {
  top: 15px;
}

.header__spDrawer span:nth-of-type(2) {
  top: 23px;
}

.header__spDrawer span:nth-of-type(3) {
  top: 31px;
}

/*activeクラスが付与されると線が回転して×に*/

.header__spDrawer.active span:nth-of-type(1) {
  top: 18px;
  left: 18px;
  transform: translateY(6px) rotate(-45deg);
  width: 30%;
}

.header__spDrawer.active span:nth-of-type(2) {
  opacity: 0; /*真ん中の線は透過*/
}

.header__spDrawer.active span:nth-of-type(3) {
  top: 30px;
  left: 18px;
  transform: translateY(-6px) rotate(45deg);
  width: 30%;
}

#header__innerNav {
  position: fixed;
  z-index: -1;
  top: 0;
  right: -100%;
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: var(--btn);
  transition: right 0.3s;
}

#header__innerNav.active {
  right: 0;
}

.header__navSp {
  position: absolute;
  top: 18%;
  left: 10%;
  width: 80%;
}

.header__navItemSp a {
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  display: block;
  margin: 10px 0;
  position: relative;
}

.header__navItemSp a::after {
  content: "\f105";
  position: absolute;
  font-family: "Font Awesome 6 Pro";
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
}

.header__navItemSp {
  border-bottom: 2px dashed #fff;
}

.header__navItemSp.header__navItemSpContact {
  margin-top: 40px;
  border: 2px solid #fff;
  border-radius: 5px;
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.16);
}

.header__navItemSp.header__navItemSpContact a {
  color: var(--blue);
  background-color: #fff;
  margin: 0;
  padding: 10px 0;
  text-align: center;
}

.header__navItemSp.header__navItemSpContact a::after {
  display: none;
}

@media screen and (max-width: 980px) {
  #header__pc {
    display: none;
  }

  #header__sp {
    display: flex;
    position: fixed;
    top: 0;
    width: 100%;
  }

  .header__inner {
    padding: 16px 12px;
  }

  .header__logo img {
    width: 200px;
  }
}
