:root {
	--bmqe-primary: #0b57b0;
	--bmqe-ink: #14233b;
	--bmqe-muted: #5d6b80;
	--bmqe-line: #cfd9e7;
	--bmqe-mist: #f1f5fb;
	--bmqe-err: #c0262d;
	--bmqe-wa: #1aa355;
}

html.bmqe-lock,
html.bmqe-lock body {
	overflow: hidden;
}

.bmqe[hidden] {
	display: none !important;
}

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

.bmqe {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--bmqe-ink);
}

.bmqe__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 24, 46, 0.62);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bmqe.is-open .bmqe__backdrop {
	opacity: 1;
}

/* Dialog: bottom sheet on phones, centred card on larger screens */
.bmqe .bmqe__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 94vh;
	max-height: 94dvh;
	overflow: hidden;
	background: #fff;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -12px 40px rgba(10, 24, 46, 0.28);
	opacity: 0;
	transform: translateY(36px);
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.bmqe.is-open .bmqe__dialog {
	opacity: 1;
	transform: none;
}

@media (min-width: 700px) {
	.bmqe {
		align-items: center;
		padding: 24px;
	}

	.bmqe .bmqe__dialog {
		max-width: 640px;
		max-height: 92vh;
		border-radius: 14px;
		box-shadow: 0 24px 70px rgba(10, 24, 46, 0.35);
		transform: translateY(14px) scale(0.985);
	}
}

/* Header */
.bmqe .bmqe__head {
	flex: 0 0 auto;
	padding: 22px 64px 20px 26px;
	background: var(--bmqe-primary);
	color: #fff;
}

.bmqe h2.bmqe__title {
	margin: 0;
	padding: 0;
	font-size: 23px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
	color: #fff;
}

.bmqe .bmqe__intro {
	margin: 6px 0 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.88);
}

.bmqe .bmqe__x {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bmqe .bmqe__x:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Body */
.bmqe .bmqe__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 20px 26px 26px;
}

.bmqe .bmqe__product {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 18px;
	padding: 12px 14px;
	background: var(--bmqe-mist);
	border-left: 4px solid var(--bmqe-primary);
	border-radius: 8px;
}

.bmqe .bmqe__product[hidden] {
	display: none;
}

.bmqe .bmqe__thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	margin: 0;
	object-fit: cover;
	border-radius: 6px;
	background: #fff;
}

.bmqe .bmqe__thumb[hidden] {
	display: none;
}

.bmqe .bmqe__pinfo {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bmqe .bmqe__pname {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bmqe-ink);
}

.bmqe .bmqe__psku {
	font-size: 13px;
	color: var(--bmqe-muted);
}

.bmqe .bmqe__psku:empty {
	display: none;
}

.bmqe .bmqe__alert {
	margin: 0 0 16px;
	padding: 11px 14px;
	font-size: 14px;
	color: #8d1b20;
	background: #fdeeee;
	border: 1px solid #f2c4c6;
	border-radius: 8px;
}

.bmqe .bmqe__alert[hidden] {
	display: none;
}

/* Form */
.bmqe .bmqe__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

@media (min-width: 560px) {
	.bmqe .bmqe__grid {
		grid-template-columns: 1fr 1fr;
	}

	.bmqe .bmqe__full {
		grid-column: 1 / -1;
	}
}

.bmqe .bmqe__field {
	margin: 0;
	min-width: 0;
}

.bmqe .bmqe__field > label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--bmqe-ink);
}

.bmqe .bmqe__req {
	color: var(--bmqe-err);
}

.bmqe .bmqe__dialog input.bmqe__input,
.bmqe .bmqe__dialog textarea.bmqe__input {
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.3;
	color: var(--bmqe-ink);
	background: #fff;
	border: 1.5px solid var(--bmqe-line);
	border-radius: 8px;
	box-shadow: none;
	transition: border-color 0.15s ease;
}

.bmqe .bmqe__dialog textarea.bmqe__input {
	height: auto;
	min-height: 96px;
	padding: 12px 14px;
	resize: vertical;
}

.bmqe .bmqe__dialog input.bmqe__input::placeholder,
.bmqe .bmqe__dialog textarea.bmqe__input::placeholder {
	color: #8c98aa;
	opacity: 1;
}

.bmqe .bmqe__dialog input.bmqe__input:focus,
.bmqe .bmqe__dialog textarea.bmqe__input:focus {
	border-color: var(--bmqe-primary);
	outline: 2px solid var(--bmqe-primary);
	outline-offset: 1px;
}

.bmqe .bmqe__dialog .is-invalid {
	border-color: var(--bmqe-err);
}

.bmqe .bmqe__err {
	display: block;
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var(--bmqe-err);
}

.bmqe .bmqe__err:empty {
	display: none;
}

/* Quantity stepper */
.bmqe .bmqe__qty {
	display: inline-flex;
	align-items: stretch;
	height: 46px;
	border: 1.5px solid var(--bmqe-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.bmqe .bmqe__qty button {
	width: 44px;
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--bmqe-primary);
	background: var(--bmqe-mist);
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

.bmqe .bmqe__qty button:hover {
	background: #e3ebf7;
}

.bmqe .bmqe__qty input {
	width: 64px;
	height: auto;
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	color: var(--bmqe-ink);
	background: #fff;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.bmqe .bmqe__qty input::-webkit-outer-spin-button,
.bmqe .bmqe__qty input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Honeypot */
.bmqe .bmqe__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons */
.bmqe .bmqe__submit {
	display: block;
	width: 100%;
	height: 50px;
	margin: 20px 0 0;
	padding: 0 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
	background: var(--bmqe-primary);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.bmqe .bmqe__submit:hover {
	filter: brightness(0.92);
}

.bmqe .bmqe__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.bmqe .bmqe__note {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--bmqe-muted);
}

.bmqe .bmqe__x:focus-visible,
.bmqe .bmqe__submit:focus-visible,
.bmqe .bmqe__qty button:focus-visible,
.bmqe .bmqe__wa:focus-visible,
.bmqe .bmqe__ghost:focus-visible {
	outline: 3px solid #f5a300;
	outline-offset: 2px;
}

/* Success view */
.bmqe .bmqe__done {
	padding: 14px 0 4px;
	text-align: center;
}

.bmqe .bmqe__done[hidden] {
	display: none;
}

.bmqe .bmqe__tick {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 66px;
	height: 66px;
	margin: 0 auto 14px;
	color: #178a4a;
	background: #e3f4ea;
	border-radius: 50%;
}

.bmqe h3.bmqe__donetitle {
	margin: 0 0 8px;
	padding: 0;
	font-size: 21px;
	font-weight: 700;
	color: var(--bmqe-ink);
}

.bmqe .bmqe__donemsg {
	max-width: 420px;
	margin: 0 auto 20px;
	color: var(--bmqe-muted);
}

.bmqe a.bmqe__wa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 50px;
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	color: #fff;
	background: var(--bmqe-wa);
	border-radius: 8px;
}

.bmqe a.bmqe__wa[hidden] {
	display: none;
}

.bmqe a.bmqe__wa:hover {
	filter: brightness(0.93);
	color: #fff;
}

.bmqe .bmqe__ghost {
	height: 44px;
	margin: 0;
	padding: 0 18px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--bmqe-primary);
	background: transparent;
	border: 0;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.bmqe .bmqe__dialog,
	.bmqe .bmqe__backdrop {
		transition: none;
	}
}
