/* Shared modal/drawer system: enquiry popup + mobile nav drawer. */

.bwf-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 30, 24, 0.6);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
}
.bwf-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* Centered dialog (brochure/enquiry modal) */
.bwf-dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.95);
	z-index: 9999;
	width: 100%;
	max-width: 32rem;
	max-height: 90vh;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.bwf-dialog.is-open {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
}
.bwf-dialog__panel {
	position: relative;
	border-radius: 1.5rem;
	background: var(--color-background, #fdfcf9);
	color: var(--color-foreground, #22291f);
	padding: 1.5rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
@media (min-width: 768px) {
	.bwf-dialog__panel { padding: 2rem; }
}
.bwf-dialog__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	cursor: pointer;
	opacity: 0.7;
	color: inherit;
	font-size: 1.1rem;
	line-height: 1;
}
.bwf-dialog__close:hover { opacity: 1; }

/* Slide-in mobile nav drawer (targets the Elementor container's own
 * rendered CSS ID directly — the Advanced > CSS Classes control doesn't
 * reach the DOM for `container` elements on this Elementor version, only
 * `widget` elements, so ID is the reliable hook here). */
#bwf-mobile-panel {
	position: fixed !important;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	width: min(85vw, 360px) !important;
	max-width: none !important;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	box-shadow: -12px 0 30px rgba(0, 0, 0, 0.2);
}
#bwf-mobile-panel.is-open {
	transform: translateX(0);
}

body.bwf-modal-open {
	overflow: hidden;
}

/* Header: transparent over the hero, solid once the page scrolls. */
#bwf-site-header {
	background-color: transparent !important;
	transition: background-color 0.3s ease;
}
#bwf-site-header.is-scrolled {
	background-color: rgba(24, 41, 33, 0.92) !important;
}

/* Header nests the mobile drawer, so its own stacking context must
 * outrank the shared overlay, or the overlay traps clicks even though
 * the drawer's own z-index is higher (classic nested-stacking-context
 * gotcha: a descendant's z-index only wins within its ancestor's local
 * context, not the root one). */
#bwf-site-header {
	z-index: 10000 !important;
}
/* The actual bottleneck: Xpro Theme Builder wraps the whole header in its
 * own <nav class="xpro-theme-builder-header-nav" style="position:relative;
 * z-index:99"> — that low z-index caps this entire subtree below the
 * shared overlay (9998) no matter what z-index is set inside it. */
.xpro-theme-builder-header-nav {
	z-index: 10000 !important;
}
