@charset "utf-8";
/*==================================================
　5-2-8 3本線が横方向に回転して×に
===================================*/

/*ボタン外側※レイアウトによってpositionや形状は適宜変更してください*/
.openbtn8{
  position: relative;/*ボタン内側の基点となるためrelativeを指定*/
  background: var(--wyhite);
  cursor: pointer;
    width: 50px;
    height:50px;
  border-radius: 5px;
}

/*ボタン内側*/
.openbtn8 .openbtn-area{
    transition: all .6s;/*アニメーションの設定*/
  width:50px;
  height:50px;
}

.openbtn8 span{
	display: inline-block;
	transition: all .4s;
	position: absolute;
	left: 14px;
	height: 3px;
	border-radius: 2px;
	background: var(--maincolor);
	width: 45%;
}

.openbtn8 span:nth-of-type(1) {
  top:15px; 
}

.openbtn8 span:nth-of-type(2) {
  top:23px;
}

.openbtn8 span:nth-of-type(3) {
  top:31px;
}

/*activeクラスが付与されると .openbtn-areaが360度回転し、その中の線が回転して×に*/
.openbtn8.active .openbtn-area{
  transform: rotate(360deg);
}

.openbtn8.active span:nth-of-type(1) {
    top: 18px;
    left: 18px;
    transform: translateY(6px) rotate(-45deg);
    width: 30%;
}

.openbtn8.active span:nth-of-type(2) {
  opacity: 0;
}

.openbtn8.active span:nth-of-type(3){
    top: 30px;
    left: 18px;
    transform: translateY(-6px) rotate(45deg);
    width: 30%;
}
