.bes-pef-modal[hidden],
[data-bes-pef-sku-row][hidden],
[data-bes-pef-options-row][hidden],
[data-bes-pef-form-result][hidden],
[data-bes-pef-direct-form][hidden] {
	display: none !important;
}

body.bes-pef-modal-open {
	overflow: hidden;
}

.bes-pef-modal {
	--bes-pef-text: #212529;
	--bes-pef-muted: #59636d;
	--bes-pef-border: #d5dee6;
	--bes-pef-surface: #f6fafb;
	--bes-pef-danger: #b00020;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(2, 6, 9, 0.74);
}

.bes-pef-dialog {
	position: relative;
	width: min(100%, var(--bes-pef-dialog-max));
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow: auto;
	padding: clamp(1.35rem, 3vw, 2.25rem);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 0.75rem;
	background: #fff;
	box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.34);
	color: var(--bes-pef-text);
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.bes-pef-dialog-small {
	max-width: 560px;
}

.bes-pef-dialog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.bes-pef-dialog-header h2 {
	margin: 0;
	font-size: clamp(1.65rem, 4vw, 2.1rem);
	line-height: 1.15;
}

.bes-pef-close {
	position: static;
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 1px solid var(--bes-pef-border);
	border-radius: 50%;
	background: var(--bes-pef-surface);
	color: var(--bes-pef-text);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.bes-pef-close:hover,
.bes-pef-close:focus {
	border-color: var(--bes-pef-accent);
	background: var(--bes-pef-accent);
	color: #fff;
}

.bes-pef-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.bes-pef-actions .button,
.bes-pef-actions .btn {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Pi's generated colours use !important; keep Bootstrap's outline states authoritative. */
body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry.btn-outline-primary {
	background-color: transparent !important;
	color: var(--bes-pef-accent) !important;
}

body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry.btn-outline-primary:hover,
body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry.btn-outline-primary:focus {
	background-color: var(--bes-pef-accent) !important;
	color: #fff !important;
}

body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry::after {
	filter: none !important;
}

body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry:hover::after,
body.single-product #woocommerce-wrapper .summary .bes-pef-add-to-enquiry:focus::after {
	filter: brightness(0) invert(1) !important;
}

.bes-pef-primary {
	border-color: var(--bes-pef-accent) !important;
	background: var(--bes-pef-accent) !important;
	color: #fff !important;
}

.bes-pef-secondary {
	border-color: var(--bes-pef-accent) !important;
	background: transparent !important;
	color: var(--bes-pef-accent) !important;
}

.bes-pef-secondary:hover,
.bes-pef-secondary:focus {
	background: var(--bes-pef-accent) !important;
	color: #fff !important;
}

.bes-pef-product-summary {
	margin: 0 0 1.5rem;
	padding: 1rem 1.125rem;
	border: 1px solid #dce7ee;
	border-radius: 0.5rem;
	background: var(--bes-pef-surface);
}

.bes-pef-product-summary h3 {
	margin: 0 0 0.5rem;
	font-size: 1.2rem;
	line-height: 1.25;
}

.bes-pef-product-summary dl,
.bes-pef-product-summary dd,
.bes-pef-product-summary ul {
	margin: 0;
}

.bes-pef-product-summary dl > div {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.2rem;
}

.bes-pef-product-summary dt {
	font-weight: 700;
	color: var(--bes-pef-muted);
}

.bes-pef-product-summary ul {
	padding-left: 1.1rem;
}

.bes-pef-product-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-top: 0.35rem;
	font-weight: 700;
	text-decoration: none;
}

.bes-pef-product-link::after {
	content: "\2192";
	margin-left: 0.45rem;
	transition: transform 0.18s ease;
}

.bes-pef-product-link:hover::after,
.bes-pef-product-link:focus::after {
	transform: translateX(0.2rem);
}

.bes-pef-form-intro {
	margin-bottom: 1.25rem;
}

.bes-pef-form-intro .icon.triangle {
	display: none !important;
}

.bes-pef-form-intro h2,
.bes-pef-form-intro h3,
.bes-pef-form-intro h4,
.bes-pef-form-intro .pt-5,
.bes-pef-form-intro .pb-3 {
	margin: 0 0 0.35rem !important;
	padding: 0 !important;
}

.bes-pef-form-intro h3 {
	font-size: 1.2rem;
	line-height: 1.3;
}

.bes-pef-required-note {
	margin: 0;
	color: var(--bes-pef-muted);
	font-size: 0.875rem;
}

.bes-pef-required-note > span,
.bes-pef-field-label > span[aria-hidden="true"] {
	color: var(--bes-pef-danger);
}

.bes-pef-direct-content form[data-bes-pef-direct-form] {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem 1.25rem;
}

.bes-pef-direct-content .pi-row {
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}

.bes-pef-direct-content .pi-row > .pi-col-12 {
	min-width: 0;
	padding: 0 !important;
}

.bes-pef-field-label {
	display: block;
	margin-bottom: 0.4rem;
	color: var(--bes-pef-text);
	font-size: 0.925rem;
	font-weight: 700;
	line-height: 1.3;
}

.bes-pef-direct-content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
.bes-pef-direct-content select,
.bes-pef-direct-content textarea {
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 0.85rem !important;
	border: 1px solid var(--bes-pef-border) !important;
	border-radius: 0.375rem !important;
	background-color: #fff !important;
	box-shadow: none !important;
	color: var(--bes-pef-text) !important;
	font-size: 1rem !important;
	line-height: 1.45 !important;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bes-pef-direct-content select {
	padding-right: 2.75rem !important;
}

.bes-pef-direct-content textarea {
	min-height: 6.5rem;
	resize: vertical;
}

.bes-pef-direct-content #field-container-pi_company_address textarea {
	min-height: 5.25rem;
}

.bes-pef-direct-content input::placeholder,
.bes-pef-direct-content textarea::placeholder {
	color: #737c84;
	opacity: 1;
}

.bes-pef-direct-content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
.bes-pef-direct-content select:focus,
.bes-pef-direct-content textarea:focus {
	border-color: var(--bes-pef-accent) !important;
	box-shadow: 0 0 0 0.2rem rgba(18, 117, 187, 0.14) !important;
	box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bes-pef-accent) 16%, transparent) !important;
	outline: 0;
}

.bes-pef-direct-content .pi-form-control.error,
.bes-pef-direct-content .pi-form-control.bes-pef-field-error,
.bes-pef-direct-content [aria-invalid="true"],
#bes-pef-direct-enquiry-form .pi-form-control.bes-pef-field-error {
	border-color: var(--bes-pef-danger) !important;
}

.bes-pef-direct-content label.error {
	display: block;
	margin-top: 0.35rem;
	color: var(--bes-pef-danger);
	font-size: 0.85rem;
	font-weight: 700;
}

.bes-pef-direct-content .type-textarea,
.bes-pef-direct-content #field-container-pi_company_name,
.bes-pef-direct-content .type-dropdown,
.bes-pef-direct-content .type-submit {
	grid-column: 1 / -1;
}

.bes-pef-direct-content .type-submit .pi-col-12 {
	display: flex;
	justify-content: flex-end;
}

.bes-pef-direct-content .pi-submit-enq-button.btn {
	min-width: 11rem;
	padding: 0.5rem 1rem !important;
	border: 1px solid var(--bes-pef-accent) !important;
	border-radius: 0.3rem !important;
	line-height: 1.5 !important;
}

.bes-pef-direct-content span.bes-pef-field-error {
	display: block;
	margin-top: 0.3rem;
	color: var(--bes-pef-danger);
	font-weight: 700;
}

.bes-pef-form-notice:empty {
	display: none;
}

.bes-pef-form-notice:not(:empty),
.bes-pef-form-result:not([hidden]) {
	margin-bottom: 1rem;
	padding: 0.8rem 1rem;
	border: 1px solid #f0b8c2;
	border-left: 4px solid var(--bes-pef-danger);
	border-radius: 0.375rem;
	background: #fff3f4;
}

.bes-pef-form-result:not([hidden]) {
	border-left-color: #1b7f3a;
	border-color: #b9dfc5;
	border-left-color: #1b7f3a;
	background: #f1fbf4;
}

@media (min-width: 768px) {
	.bes-pef-product-summary {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"title link"
			"meta link";
		align-items: center;
		gap: 0.2rem 1.5rem;
	}

	.bes-pef-product-summary h3 {
		grid-area: title;
		margin-bottom: 0.2rem;
	}

	.bes-pef-product-summary dl {
		grid-area: meta;
	}

	.bes-pef-product-link {
		grid-area: link;
		margin-top: 0;
		white-space: nowrap;
	}

	.bes-pef-direct-content form[data-bes-pef-direct-form] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.bes-pef-direct-content[aria-busy="true"],
.bes-pef-direct-content form[aria-busy="true"] {
	cursor: progress;
}

.bes-pef-modal :focus-visible,
.bes-pef-enquire-now:focus-visible {
	outline: 3px solid #020609;
	outline-offset: 3px;
}

@media (max-width: 575.98px) {
	.bes-pef-modal {
		align-items: flex-end;
		padding: 0;
	}

	.bes-pef-dialog {
		width: 100%;
		max-height: 94vh;
		max-height: 94dvh;
		padding: 1.25rem;
		border-radius: 0.75rem 0.75rem 0 0;
	}

	.bes-pef-actions,
	.bes-pef-actions .button,
	.bes-pef-actions .btn,
	.bes-pef-direct-content .pi-submit-enq-button.btn {
		width: 100%;
	}

	.bes-pef-product-summary dl > div {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bes-pef-modal *,
	.bes-pef-enquire-now {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

@media (forced-colors: active) {
	.bes-pef-dialog,
	.bes-pef-product-summary,
	.bes-pef-form-notice,
	.bes-pef-form-result {
		border: 2px solid CanvasText;
	}
}
