/*
 * Phone and tablet menu (includes/mobile-menu.php): a full-screen green panel.
 * Colours and fonts read Elementor's Global Colors and Global Fonts.
 *
 * Every rule is scoped to #bs-mobile-menu so it outranks the theme's reset and
 * Elementor's site-wide link and button styles, which load after this file.
 */

#bs-mobile-menu {
	--bs-mm-green: var(--e-global-color-primary, #2F4034);
	--bs-mm-amber: var(--e-global-color-accent, #E2A63B);
	--bs-mm-terracotta: var(--e-global-color-secondary, #8A5A3B);
	--bs-mm-ink: var(--e-global-color-bs_ink, #201C17);
	--bs-mm-white: var(--e-global-color-bs_white, #FFFFFF);
	--bs-mm-line: rgba(255, 255, 255, .14);
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: var(--bs-mm-green);
	color: var(--bs-mm-white);
	font-family: var(--e-global-typography-text-font-family, "Open Sans"), sans-serif;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .2s ease, transform .2s ease;
}

#bs-mobile-menu:focus {
	outline: none;
}

#bs-mobile-menu[hidden] {
	display: none;
}

#bs-mobile-menu.is-open {
	opacity: 1;
	transform: none;
}

/* Only below desktop. */
@media (min-width: 1025px) {
	#bs-mobile-menu {
		display: none !important;
	}
}

/* While open, the page behind doesn't scroll. */
html.bs-mm-locked,
html.bs-mm-locked body {
	overflow: hidden;
}

/* JetMenu's own mobile dropdown is replaced by this panel (once the script is running). */
@media (max-width: 1024px) {
	html.bs-mm-ready .bs-main-menu .jet-mega-menu-container {
		display: none !important;
	}
}

#bs-mobile-menu a {
	color: inherit;
	text-decoration: none;
}

/* The theme and Elementor's site-wide button styles don't apply here. */
#bs-mobile-menu button,
#bs-mobile-menu button:hover,
#bs-mobile-menu button:focus {
	margin: 0;
	border: 0 !important;
	box-shadow: none !important;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

#bs-mobile-menu button:focus-visible {
	outline: 2px solid var(--bs-mm-white);
	outline-offset: 2px;
}

#bs-mobile-menu .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Header: wordmark and close button. */
#bs-mobile-menu .bs-mm__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 20px 8px;
}

#bs-mobile-menu .bs-mm__brand {
	font-weight: 800;
	font-size: 18px;
	line-height: 1;
	letter-spacing: .06em;
	text-transform: uppercase;
}

#bs-mobile-menu .bs-mm__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .12) !important;
	color: var(--bs-mm-white) !important;
	font-size: 26px;
	line-height: 1;
}

#bs-mobile-menu .bs-mm__close:hover,
#bs-mobile-menu .bs-mm__close:focus-visible {
	background: rgba(255, 255, 255, .2) !important;
}

/* Rows. */
#bs-mobile-menu .bs-mm__nav {
	flex: 1 0 auto;
	padding: 8px 20px 28px;
}

#bs-mobile-menu .bs-mm__list,
#bs-mobile-menu .bs-mm__tiles {
	margin: 0;
	padding: 0;
	list-style: none;
}

#bs-mobile-menu .bs-mm__item {
	border-bottom: 1px solid var(--bs-mm-line);
}

#bs-mobile-menu .bs-mm__item:last-child {
	border-bottom: 0;
}

#bs-mobile-menu .bs-mm__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#bs-mobile-menu .bs-mm__link {
	flex: 1 1 auto;
	padding: 14px 0;
	font-weight: 800;
	font-size: 19px;
	line-height: 1.25;
}

#bs-mobile-menu .bs-mm__item--has-sub > .bs-mm__row .bs-mm__link {
	padding: 20px 0;
	font-size: 22px;
}

#bs-mobile-menu .bs-mm__link[aria-current="page"] {
	color: var(--e-global-color-bs_label_warm, #F3D9A8);
}

/* Amber +/− button. */
#bs-mobile-menu .bs-mm__toggle {
	position: relative;
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	border-radius: 50% !important;
	background: var(--bs-mm-amber) !important;
	color: var(--bs-mm-ink) !important;
}

#bs-mobile-menu .bs-mm__toggle:hover {
	background: var(--e-global-color-bs_amber_hover, #CF9327) !important;
}

#bs-mobile-menu .bs-mm__toggle::before,
#bs-mobile-menu .bs-mm__toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 2px;
	margin: -1px 0 0 -6px;
	border-radius: 1px;
	background: currentColor;
	transition: transform .2s ease;
}

#bs-mobile-menu .bs-mm__toggle::after {
	transform: rotate(90deg);
}

#bs-mobile-menu .bs-mm__toggle[aria-expanded="true"]::after {
	transform: rotate(0deg);
}

/* Sub-item tiles. */
#bs-mobile-menu .bs-mm__tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding-bottom: 20px;
}

#bs-mobile-menu .bs-mm__tiles[hidden] {
	display: none;
}

#bs-mobile-menu .bs-mm__tile {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	box-sizing: border-box;
	padding: 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .08);
	transition: background-color .15s ease;
}

#bs-mobile-menu .bs-mm__tile:hover,
#bs-mobile-menu .bs-mm__tile:focus-visible {
	background: rgba(255, 255, 255, .14);
}

#bs-mobile-menu .bs-mm__thumb {
	flex: none;
	width: 32px;
	height: 32px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--e-global-color-bs_photo_dark, #3A4C3E);
}

#bs-mobile-menu .bs-mm__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

#bs-mobile-menu .bs-mm__tile-label {
	min-width: 0;
	font-weight: 700;
	font-size: 13.5px;
	line-height: 1.3;
}

/* Footer: terracotta with a wavy top, phone and quote buttons. */
#bs-mobile-menu .bs-mm__foot {
	flex: none;
	margin-top: auto;
}

#bs-mobile-menu .bs-mm__wave {
	display: block;
	width: 100%;
	height: 24px;
	margin-bottom: -1px;
	fill: var(--bs-mm-terracotta);
}

#bs-mobile-menu .bs-mm__foot-inner {
	padding: 10px 20px 24px;
	padding-bottom: max(24px, env(safe-area-inset-bottom));
	background: var(--bs-mm-terracotta);
}

#bs-mobile-menu .bs-mm__note {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(255, 255, 255, .92);
}

#bs-mobile-menu .bs-mm__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

#bs-mobile-menu .bs-mm__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 10px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	text-align: center;
	color: var(--bs-mm-ink) !important;
}

#bs-mobile-menu .bs-mm__btn--white {
	background: var(--bs-mm-white);
}

#bs-mobile-menu .bs-mm__btn--amber {
	background: var(--bs-mm-amber);
}

@media (prefers-reduced-motion: reduce) {
	#bs-mobile-menu,
	#bs-mobile-menu .bs-mm__toggle::after {
		transition: none;
	}
}
