/* Bony Packaging – Enquiry modal (Enquiry Mode) */

html.bony-modal-open,
html.bony-modal-open body {
	overflow: hidden;
}

.bony-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.bony-modal[hidden] {
	display: none;
}

.bony-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	animation: bony-fade 0.2s ease;
}

@keyframes bony-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.bony-modal__dialog {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 660px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 30px 30px 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	font-family: inherit;
	animation: bony-pop 0.2s ease;
}

@keyframes bony-pop {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Scoped to the dialog on purpose: the Woodmart theme ships
   :is(.btn, .button, button, [type="submit"]) { ... }
   which resolves to the same 0-1-0 specificity as a bare class and therefore
   wins on source order (the theme stylesheet loads after this one). Every
   modal button is therefore written as .bony-modal__dialog .x to reach 0-2-0.
   The theme rule keeps styling the product "Enquire Now" buttons and the
   card hover buttons, exactly as intended. */
.bony-modal__dialog .bony-modal__close {
	position: absolute;
	top: 8px;
	left: 12px;
	border: 0;
	background: transparent;
	box-shadow: none;
	display: block;
	font-family: inherit;
	font-size: 30px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	text-decoration: none;
	cursor: pointer;
	color: #333;
	padding: 4px 8px;
	margin: 0;
	min-width: 0;
	/* The theme sets min-height on every button; undo it so the bare "x"
	   does not carry an invisible 42px box. */
	min-height: 0 !important;
	max-width: none;
}

.bony-modal__dialog .bony-modal__close:hover {
	color: #000;
	background: transparent;
}

.bony-modal__title {
	margin: 0 0 4px;
	/* Keeps the heading clear of the close button in the top-left corner. */
	padding-left: 30px;
	font-size: 24px;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.bony-modal__subtitle {
	margin: 0 0 16px;
	color: #666;
	font-size: 14px;
}

.bony-modal__product {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	align-items: baseline;
	background: #f6f7f7;
	border-left: 3px solid #00833c;
	padding: 10px 14px;
	margin-bottom: 18px;
}

.bony-modal__product-name {
	font-weight: 700;
	font-size: 15px;
}

.bony-modal__product-sku {
	font-size: 13px;
	color: #666;
}

.bony-modal__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
}

/* Spans the full 12 columns of the row (grid-column 1 / -1). */
.bony-field--full {
	grid-column: 1 / -1;
}

.bony-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.bony-field label {
	font-size: 13px;
	font-weight: 600;
	color: #222;
}

.bony-field label span {
	color: #d63638;
}

.bony-field input,
.bony-field select,
.bony-field textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #d6d6d6;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	border-radius: 0;
}

.bony-field input:focus,
.bony-field select:focus,
.bony-field textarea:focus {
	outline: none;
	border-color: #00833c;
	box-shadow: 0 0 0 2px rgba(0, 131, 60, 0.12);
}

.bony-field textarea {
	resize: vertical;
}

.bony-field.is-error input,
.bony-field.is-error select,
.bony-field.is-error textarea {
	border-color: #d63638;
	background: #fdf1f1;
}

.bony-field__error {
	color: #d63638;
	font-size: 12px;
}

/* Quantity + product attributes (e.g. "Count *") share one 6 / 6 row. */
.bony-modal__options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
	align-items: start;
	margin-top: 12px;
}

/* The attributes block no longer sits on its own line, so drop the divider. */
.bony-modal__options .bony-modal__attributes {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* No attributes for this product: let Quantity Required use the full width. */
.bony-modal__options.is-single {
	grid-template-columns: 1fr;
}

.bony-modal__attr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px 16px;
}

.bony-variation-label {
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #00833c;
}

.bony-modal__grid + .bony-field,
.bony-modal__options + .bony-field,
.bony-modal__attributes + .bony-field {
	margin-top: 14px;
}

.bony-modal__note {
	font-size: 12px;
	color: #777;
	margin: 14px 0 0;
}

.bony-modal__actions {
	margin: 16px 0 0;
}

/* Painted with the very same Woodmart accent variables the "Enquire Now"
   buttons use (.single_add_to_cart_button, .wd-add-btn > a both resolve to
   var(--btn-accented-bgcolor)). enquiry.js additionally copies the computed
   colours of the button that was actually clicked onto --bony-btn-* so the
   submit button can never drift from it, even where the theme styles the grid
   and the single product page differently. */
.bony-modal__dialog .bony-modal__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--bony-btn-bg, var(--btn-accented-bgcolor, #b58352));
	color: var(--bony-btn-color, var(--btn-accented-color, #fff));
	border: 0;
	border-radius: var(--bony-btn-radius, var(--btn-brd-radius, 0));
	box-shadow: none;
	padding: var(--btn-padding, 5px 20px);
	min-height: var(--btn-height, 42px);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.2;
	text-transform: var(--btn-transform, uppercase);
	text-shadow: none;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.25s ease;
	width: 100%;
}

/* Darkened from whatever colour the theme uses, instead of a hard-coded
   second colour that would stop matching after a theme colour change. */
.bony-modal__dialog .bony-modal__submit:hover {
	background-color: var(--bony-btn-bg, var(--btn-accented-bgcolor, #b58352));
	color: var(--bony-btn-color, var(--btn-accented-color, #fff));
	filter: brightness(0.9);
}

.bony-modal__dialog .bony-modal__submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.bony-modal__message {
	min-height: 20px;
	margin: 12px 0 0;
	font-size: 14px;
}

.bony-modal__message.is-success {
	color: #00833c;
	font-weight: 600;
}

.bony-modal__message.is-error {
	color: #d63638;
}

.bony-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	opacity: 0;
	height: 0;
	width: 0;
}

/* Loop / single product "Enquire Now" buttons keep the theme button look */
a.bony-enquire-btn,
.bony-enquire-btn {
	cursor: pointer;
}

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

	.bony-modal__dialog {
		max-width: 100%;
		max-height: 94vh;
		padding: 26px 18px 20px;
	}

	.bony-modal__grid {
		grid-template-columns: 1fr;
	}

	.bony-modal__options {
		grid-template-columns: 1fr;
	}
}
