/*
 * BCS Offcanvas Menu
 *
 * Colors, width and the breakpoint are set per site as custom properties by the plugin (see inline CSS).
 * The values below are only fallbacks.
 */

.bcs-ocm {
	--bcs-ocm-width: 380px;
	--bcs-ocm-bg: #fff;
	--bcs-ocm-text: #333;
	--bcs-ocm-accent: #f39200;
	--bcs-ocm-line: rgba(51, 51, 51, .14);
	--bcs-ocm-tint: rgba(51, 51, 51, .06);
	--bcs-ocm-shade: rgba(0, 0, 0, .55);
	--bcs-ocm-speed: .3s;
	--bcs-ocm-ease: cubic-bezier(.22, .61, .36, 1);

	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999; /* above Divi's header (99999/100000) and the admin bar (99999) */
	visibility: hidden;
	pointer-events: none;
	/* hidden only after the closing animation has finished */
	transition: visibility 0s linear var(--bcs-ocm-speed);
	font-size: 16px;
	line-height: 1.4;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

.bcs-ocm.is-open {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

/* ---- Reset: keep Divi's/WooCommerce's global element styles out of the panel ---------------------------------- */

.bcs-ocm *,
.bcs-ocm *::before,
.bcs-ocm *::after {
	box-sizing: border-box;
}

.bcs-ocm ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bcs-ocm li {
	margin: 0;
	padding: 0;
	list-style: none;
	float: none;
	width: auto;
}

.bcs-ocm a {
	background: none;
	border: 0;
	box-shadow: none;
}

/*
 * Link color/underline: themes colour links per state and per color scheme (Divi: ".et_color_scheme_orange a"),
 * with the same specificity as a plain ".bcs-ocm a" – so these use the class and cover every state.
 */
.bcs-ocm .bcs-ocm__link,
.bcs-ocm .bcs-ocm__link:hover,
.bcs-ocm .bcs-ocm__link:focus,
.bcs-ocm .bcs-ocm__link:active,
.bcs-ocm .bcs-ocm__link:visited {
	color: inherit;
	text-decoration: none;
}

.bcs-ocm button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
}

.bcs-ocm svg {
	display: block;
}

/* ---- Overlay + panel ------------------------------------------------------------------------------------------- */

.bcs-ocm__overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: var(--bcs-ocm-shade);
	opacity: 0;
	transition: opacity var(--bcs-ocm-speed) var(--bcs-ocm-ease);
	-webkit-tap-highlight-color: transparent;
	touch-action: none;
}

.bcs-ocm.is-open .bcs-ocm__overlay {
	opacity: 1;
}

.bcs-ocm__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(var(--bcs-ocm-width), 88vw);
	max-width: 100%;
	background: var(--bcs-ocm-bg);
	color: var(--bcs-ocm-text);
	box-shadow: 0 0 32px rgba(0, 0, 0, .28);
	transition: transform var(--bcs-ocm-speed) var(--bcs-ocm-ease);
	outline: 0;
}

.bcs-ocm--left .bcs-ocm__panel {
	left: 0;
	transform: translateX(-102%);
}

.bcs-ocm--right .bcs-ocm__panel {
	right: 0;
	transform: translateX(102%);
}

.bcs-ocm.is-open .bcs-ocm__panel {
	transform: none;
}

/* ---- Header (title + close) ------------------------------------------------------------------------------------ */

.bcs-ocm__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 60px;
	padding: 0 8px 0 20px;
	padding-top: env(safe-area-inset-top, 0);
	border-bottom: 1px solid var(--bcs-ocm-line);
}

.bcs-ocm__title {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .65;
}

.bcs-ocm .bcs-ocm__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
}

/* ---- Navigation ------------------------------------------------------------------------------------------------ */

/* the scrolling area: main menu + additional links */
.bcs-ocm__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.bcs-ocm .bcs-ocm__item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
}

.bcs-ocm .bcs-ocm__list--root > .bcs-ocm__item {
	border-bottom: 1px solid var(--bcs-ocm-line);
}

/* link */
.bcs-ocm .bcs-ocm__link {
	grid-column: 1;
	grid-row: 1;
	display: block;
	min-width: 0;
	padding: 16px 20px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	-webkit-hyphens: auto;
	hyphens: auto;
	-webkit-tap-highlight-color: transparent;
}

.bcs-ocm .bcs-ocm__list--depth-1 > .bcs-ocm__item > .bcs-ocm__link {
	padding: 12px 20px 12px 34px;
	font-size: 15px;
	font-weight: 400;
}

.bcs-ocm .bcs-ocm__list--depth-2 > .bcs-ocm__item > .bcs-ocm__link,
.bcs-ocm .bcs-ocm__list--depth-3 > .bcs-ocm__item > .bcs-ocm__link {
	padding: 11px 20px 11px 48px;
	font-size: 14px;
	font-weight: 400;
}

.bcs-ocm .bcs-ocm__list--depth-3 > .bcs-ocm__item > .bcs-ocm__link {
	padding-left: 62px;
}

/* parents inside a sub-list stay a little stronger so the tree reads well */
.bcs-ocm .bcs-ocm__list--sub > .bcs-ocm__item--has-children > .bcs-ocm__link {
	font-weight: 600;
}

/* current page: accent marker + weight (not color alone) */
.bcs-ocm .bcs-ocm__item--current > .bcs-ocm__link,
.bcs-ocm .bcs-ocm__item--ancestor > .bcs-ocm__link {
	box-shadow: inset 4px 0 0 var(--bcs-ocm-accent);
}

.bcs-ocm .bcs-ocm__item--current > .bcs-ocm__link {
	font-weight: 700;
}

.bcs-ocm .bcs-ocm__item--overview > .bcs-ocm__link {
	font-style: italic;
	opacity: .85;
}

/* menu-item icons (Menu Icons plugin) – and show the label even where the site hides it next to an icon on desktop */
.bcs-ocm .bcs-ocm__link img {
	display: inline-block;
	width: auto;
	max-width: none;
	height: 20px;
	margin: -2px 12px 0 0;
	vertical-align: middle;
}

.bcs-ocm .bcs-ocm__link span {
	display: inline;
}

/* additional links (e.g. account, wishlist): a quiet single-level list below the main menu */
.bcs-ocm .bcs-ocm__nav--secondary {
	padding: 10px 0 14px;
}

.bcs-ocm .bcs-ocm__list--secondary > .bcs-ocm__item > .bcs-ocm__link {
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 400;
}

/* arrow button */
.bcs-ocm .bcs-ocm__toggle {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	border-left: 1px solid var(--bcs-ocm-line);
	-webkit-tap-highlight-color: transparent;
}

.bcs-ocm__chevron {
	transition: transform var(--bcs-ocm-speed) var(--bcs-ocm-ease);
}

.bcs-ocm .bcs-ocm__item.is-open > .bcs-ocm__toggle .bcs-ocm__chevron {
	transform: rotate(180deg);
}

.bcs-ocm .bcs-ocm__item.is-open > .bcs-ocm__link,
.bcs-ocm .bcs-ocm__item.is-open > .bcs-ocm__toggle {
	background: var(--bcs-ocm-tint);
}

/* ---- Sub-lists: animate height without measuring it (grid 0fr -> 1fr) ------------------------------------------ */

.bcs-ocm .bcs-ocm__sub {
	grid-column: 1 / -1;
	grid-row: 2;
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden; /* keeps collapsed links out of the tab order and away from screen readers */
	transition: grid-template-rows var(--bcs-ocm-speed) var(--bcs-ocm-ease), visibility 0s linear var(--bcs-ocm-speed);
}

.bcs-ocm .bcs-ocm__item.is-open > .bcs-ocm__sub {
	grid-template-rows: 1fr;
	visibility: visible;
	transition-delay: 0s, 0s;
}

.bcs-ocm .bcs-ocm__sub-inner {
	min-height: 0;
	overflow: hidden;
	background: var(--bcs-ocm-tint);
}

.bcs-ocm .bcs-ocm__list--sub {
	padding: 4px 0 8px;
}

/* ---- States ---------------------------------------------------------------------------------------------------- */

@media (hover: hover) {
	.bcs-ocm .bcs-ocm__link:hover,
	.bcs-ocm .bcs-ocm__toggle:hover,
	.bcs-ocm .bcs-ocm__close:hover {
		background: var(--bcs-ocm-tint);
	}
}

/* touch screens have no hover: show the press */
.bcs-ocm .bcs-ocm__link:active,
.bcs-ocm .bcs-ocm__toggle:active,
.bcs-ocm .bcs-ocm__close:active {
	background: var(--bcs-ocm-line);
}

.bcs-ocm .bcs-ocm__link:focus-visible,
.bcs-ocm .bcs-ocm__toggle:focus-visible,
.bcs-ocm .bcs-ocm__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -3px;
}

/* ---- Page behind the panel ------------------------------------------------------------------------------------- */

/* (The rule that locks page scrolling while the panel is open lives in the plugin's inline CSS, inside the
   breakpoint media query – so it can never lock scrolling on desktop.) */

/* The script resets the open/closed state without animating it while the panel is not visible. */
.bcs-ocm.bcs-ocm--instant *,
.bcs-ocm.bcs-ocm--instant *::before,
.bcs-ocm.bcs-ocm--instant *::after {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.bcs-ocm,
	.bcs-ocm *,
	.bcs-ocm *::before,
	.bcs-ocm *::after {
		transition-duration: 0s !important;
		transition-delay: 0s !important;
	}
}

@media print {
	.bcs-ocm {
		display: none !important;
	}
}
