@use "global/common" as global;

/* ------------------------------
 オフキャンバス
------------------------------- */
.js-acms-offcanvas-active {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: global.zIndex(js-acms-offcanvas-active);
	display: none;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
}

.js-acms-offcanvas-open {
	display: block;
}

.js-acms-offcanvas-body {
	left: 0;
	width: 100%;
	transition: left 0.3s ease-in-out;
}

.js-acms-offcanvas-body-moving {
	position: fixed;
}

.js-acms-offcanvas-body-right {
	position: fixed;
	left: -70%;
	overflow-y: hidden;
}

.js-acms-offcanvas-body-left {
	position: fixed;
	left: 70%;
	overflow-y: hidden;
}

.js-acms-offcanvas-body-moving {
	position: fixed;
	left: 0;
}

.js-acms-offcanvas-active {
	& .js-acms-offcanvas-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		z-index: global.zIndex(js-acms-offcanvas-sidebar);
		display: block;
		box-sizing: border-box;
		width: 70%;
		max-width: 100%;
		overflow-y: scroll;
		background-color: #fff;
		-webkit-overflow-scrolling: touch;
	}

	& .js-acms-offcanvas-sidebar-right {
		right: 0;
		left: auto;
		margin-right: -70%;
		transition: margin-right 0.3s ease-in-out;
	}

	& .js-acms-offcanvas-sidebar-left {
		right: auto;
		left: 0;
		margin-left: -70%;
		transition: margin-left 0.3s ease-in-out;
	}

	& .js-acms-offcanvas-sidebar-right.active {
		margin-right: 0;
		transition: margin-right 0.3s ease-in-out;
	}

	& .js-acms-offcanvas-sidebar-left.active {
		margin-left: 0px;
		transition: margin-left 0.3s ease-in-out;
	}
}

.js-acms-header-fixed {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	transition: margin-left 0.3s ease-in-out;
}

.js-acms-offcanvas-body-right,
.js-acms-offcanvas-body-left {
	overflow: hidden;
}

.js-acms-offcanvas-body-right .js-acms-header-fixed {
	margin-left: -70%;
}

.js-acms-offcanvas-body-left .js-acms-header-fixed {
	margin-left: 70%;
}
