/* Off-canvas menu toggle: button + slide-in panel. Replaces the Astra Pro
   off-canvas header element. */

/* Astra's global "Buttons" design (Customize > Global > Buttons) targets a
   bare `button` selector, so without a more specific rule here it would win
   and paint this as a solid block. Astra's own header buttons avoid this the
   same way: a selector scoped to their wrapper. `.widget` is the wrapper
   Astra's own header-widget markup already gives us. */
.widget .bi-offcanvas-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 0;
	background-color: transparent;
	color: var(--bi-icon-color, #000000);
	border: none;
	cursor: pointer;
}

.bi-offcanvas-toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	background-color: currentColor;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.bi-offcanvas-toggle[aria-expanded="true"] .bi-offcanvas-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.bi-offcanvas-toggle[aria-expanded="true"] .bi-offcanvas-toggle-bar:nth-child(2) {
	opacity: 0;
}

.bi-offcanvas-toggle[aria-expanded="true"] .bi-offcanvas-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.bi-offcanvas-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
	z-index: 100000;
}

.bi-offcanvas-overlay.is-open {
	opacity: 1;
}

.bi-offcanvas-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(320px, 85vw);
	background: var(--ast-global-color-5, #fff);
	color: var(--ast-global-color-3, #101010);
	box-shadow: -2px 0 16px rgba(0, 0, 0, 0.2);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	z-index: 100001;
	overflow-y: auto;
	padding: 60px 24px 24px;
}

.bi-offcanvas-panel.is-open {
	transform: translateX(0);
}

/* Same Astra global-button collision as the toggle button (see note above):
   this is also a bare <button> outside any `.widget` wrapper, so it needs
   its own scoped selector — `.bi-offcanvas-panel` is a real ancestor here. */
.bi-offcanvas-panel .bi-offcanvas-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	padding: 0;
	background-color: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.bi-offcanvas-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bi-offcanvas-menu li {
	margin: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bi-offcanvas-menu a {
	display: block;
	padding: 14px 4px;
	color: inherit;
	text-decoration: none;
	font-size: 1.05rem;
}

body.bi-offcanvas-open {
	overflow: hidden;
}
