/**
 * Header offcanvas styles.
 *
 * Location: /assets/css/frontend/header/parts/offcanvas.css
 *
 * @package SunTechPortal
 */

.stp-header-offcanvas-toggle {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--stp-header-text, #050711);
	background: #ffffff;
	border: 1px solid var(--stp-header-border, #e5e7eb);
	border-radius: 9px;
	box-shadow: none;
	cursor: pointer;
}

.stp-header-offcanvas-toggle span {
	display: block;
	width: 16px;
	height: 2px;
	background: currentColor;
	border-radius: 999px;
}

.stp-header-offcanvas-toggle:hover,
.stp-header-offcanvas-toggle:focus {
	color: #050711;
	background: #ffffff;
	border-color: var(--stp-header-orange, #ff7900);
	outline: none;
}

body.stp-header-offcanvas-open {
	overflow: hidden;
}

.stp-header-offcanvas {
	--stp-header-orange: #ff7900;
	--stp-header-text: #050711;
	--stp-header-muted: #4b5563;
	--stp-header-border: #e5e7eb;

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	width: 100vw;
	height: 100vh;
	margin: 0;
	padding: 0;
	background: rgba(17, 24, 39, 0.50);
}

.stp-header-offcanvas[hidden] {
	display: none;
}

.stp-header-offcanvas,
.stp-header-offcanvas *,
.stp-header-offcanvas *::before,
.stp-header-offcanvas *::after {
	box-sizing: border-box;
}

.stp-header-offcanvas__panel {
	position: relative;
	z-index: 2147483001;
	display: flex;
	flex-direction: column;
	width: min(368px, 92vw);
	height: 100vh;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	overflow: hidden;
	color: var(--stp-header-text);
	background: #ffffff;
	border-right: 1px solid var(--stp-header-border);
	box-shadow: 22px 0 56px rgba(17, 24, 39, 0.25);
}

.stp-header-offcanvas__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
	width: 100%;
	min-height: 50px;
	padding: 8px 12px;
	background: #ffffff;
	border-bottom: 1px solid var(--stp-header-border);
}

.stp-header-offcanvas__title {
	display: block;
	min-width: 0;
	margin: 0;
	padding: 0;
	color: #050711;
	font-size: 13px;
	font-weight: 900;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	white-space: nowrap;
}

.stp-header-offcanvas__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	min-width: 32px;
	margin: 0;
	padding: 0;
	color: #050711;
	background: #ffffff;
	border: 1px solid var(--stp-header-border);
	border-radius: 8px;
	box-shadow: none;
	font-size: 21px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	appearance: none;
}

.stp-header-offcanvas__close:hover,
.stp-header-offcanvas__close:focus {
	color: #ffffff;
	background: var(--stp-header-orange);
	border-color: var(--stp-header-orange);
	outline: none;
}

.stp-header-offcanvas__close span {
	display: block;
	line-height: 1;
	transform: translateY(-1px);
}

.stp-header-offcanvas__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 8px 8px 16px;
	background: #ffffff;
	-webkit-overflow-scrolling: touch;
}

.stp-header-offcanvas__empty {
	margin: 0;
	padding: 12px;
	color: var(--stp-header-muted);
	background: #f8fafc;
	border: 1px solid var(--stp-header-border);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
}

.stp-header-offcanvas__menu,
.stp-header-offcanvas__menu ul,
.stp-header-offcanvas__menu .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.stp-header-offcanvas__menu {
	display: block;
	width: 100%;
}

.stp-header-offcanvas__menu li {
	position: relative;
	margin: 0;
	padding: 0;
}

.stp-header-offcanvas__menu > li {
	border-bottom: 1px solid #eef0f3;
}

.stp-header-offcanvas__menu > li:first-child {
	border-top: 1px solid #eef0f3;
}

.stp-header-offcanvas__menu a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 38px;
	margin: 0;
	padding: 10px 34px 10px 12px;
	color: #050711;
	background: #ffffff;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-size: 12px;
	font-weight: 850;
	line-height: 1.25;
	text-align: left;
	text-transform: uppercase;
	text-decoration: none;
	white-space: normal;
	cursor: pointer;
	transition:
		background-color 150ms ease,
		color 150ms ease;
}

.stp-header-offcanvas__menu a:hover,
.stp-header-offcanvas__menu a:focus,
.stp-header-offcanvas__menu .is-open > a {
	color: #ffffff;
	background: var(--stp-header-orange);
	text-decoration: none;
	outline: none;
}

.stp-header-offcanvas__menu .menu-item-has-children > a::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 13px;
	width: 8px;
	height: 8px;
	border-right: 1.8px solid currentColor;
	border-bottom: 1.8px solid currentColor;
	transform: translateY(-50%) rotate(-45deg);
	transition: transform 150ms ease;
}

.stp-header-offcanvas__menu .menu-item-has-children.is-open > a::after {
	transform: translateY(-60%) rotate(45deg);
}

.stp-header-offcanvas__menu .sub-menu {
	display: none;
	margin: 0;
	padding: 4px 0 7px;
	background: #ffffff;
	border-left: 1px solid var(--stp-header-border);
}

.stp-header-offcanvas__menu .is-open > .sub-menu {
	display: block;
}

.stp-header-offcanvas__menu .sub-menu li {
	border-bottom: 0;
}

.stp-header-offcanvas__menu .sub-menu a {
	min-height: 34px;
	padding: 8px 30px 8px 24px;
	color: #050711;
	background: #ffffff;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-size: 11px;
	font-weight: 760;
	line-height: 1.25;
	text-transform: uppercase;
}

.stp-header-offcanvas__menu .sub-menu a:hover,
.stp-header-offcanvas__menu .sub-menu a:focus,
.stp-header-offcanvas__menu .sub-menu .is-open > a {
	color: #ffffff;
	background: var(--stp-header-orange);
	text-decoration: none;
	outline: none;
}

.stp-header-offcanvas__menu .sub-menu .sub-menu {
	padding-left: 10px;
}

@media (max-width: 640px) {
	.stp-header-offcanvas-toggle {
		flex-basis: 28px;
		width: 28px;
		height: 28px;
		border: 0;
		border-radius: 0;
	}

	.stp-header-offcanvas__panel {
		width: min(288px, 88vw);
	}

	.stp-header-offcanvas__head {
		min-height: 48px;
		padding: 8px 10px 8px 12px;
	}

	.stp-header-offcanvas__title {
		font-size: 12px;
	}

	.stp-header-offcanvas__close {
		flex-basis: 30px;
		width: 30px;
		height: 30px;
		min-width: 30px;
		font-size: 20px;
	}

	.stp-header-offcanvas__body {
		padding: 7px 7px 14px;
	}

	.stp-header-offcanvas__menu a {
		min-height: 36px;
		padding: 9px 32px 9px 10px;
		font-size: 11px;
	}

	.stp-header-offcanvas__menu .sub-menu a {
		min-height: 32px;
		padding: 7px 28px 7px 22px;
		font-size: 10px;
	}
}