.apd-product-box {
	margin: 0 0 1em;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75em;
}

/* Own styling: block themes and Bricks don't style WooCommerce's ".button.alt". */
.apd-open-designer {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85em 1.6em;
	border: 0;
	border-radius: 6px;
	background: var(--apd-button-bg, #2f6691);
	color: var(--apd-button-color, #fff);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s;
}

.apd-open-designer:hover,
.apd-open-designer:focus-visible {
	background: var(--apd-button-bg-hover, #24506f);
	color: var(--apd-button-color, #fff);
}

.apd-product-box.is-ready .apd-open-designer {
	background: transparent;
	color: inherit;
	box-shadow: inset 0 0 0 1px currentColor;
}

.apd-product-preview {
	max-width: 260px;
	height: auto;
	border: 1px solid rgba(0, 0, 0, 0.12);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.apd-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
}

.apd-overlay iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

html.apd-locked,
html.apd-locked body {
	overflow: hidden;
}

/* Image choices (back imprints): the theme widens each box to its column, so Acowebs' fixed
   height (e.g. 63px) would crop the picture. Let the box follow the image's own proportions. */
.wcpa_wrap .wcpa_image .wcpa_img_wrap { height: auto !important; }
.wcpa_wrap .wcpa_image .wcpa_img_wrap img { height: auto !important; object-fit: contain; }

/* Order options beside the design preview (product.js enterOptions). */
.apd-options-head { display: none; }
html.apd-options .apd-overlay { right: 420px; }
html.apd-options form.apd-options-form {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1000000;
	display: flex !important;
	flex-direction: column;
	width: 420px;
	margin: 0;
	padding: 24px 22px 40px;
	box-sizing: border-box;
	overflow-y: auto;
	background: #fff;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
}
html.apd-options form.apd-options-form > :not(.wcpa_form_outer):not(.apd-options-head):not(.apd-options-foot) { display: none !important; }
/* Marketing blocks with pictures stay on the product page; the panel keeps the choices. */
html.apd-options .wcpa_type_content:has(img) { display: none !important; }
html.apd-options form.apd-options-form .wcpa_price_summary { display: none !important; }
.apd-options-foot { display: none; }
html.apd-options .apd-options-foot {
	display: block;
	position: sticky;
	bottom: -40px;
	margin: auto -22px -40px;
	padding: 14px 22px 18px;
	background: #fff;
	border-top: 1px solid #e3e5e8;
	box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
}
.apd-options-need { margin: 0 0 10px; padding: 0 0 0 18px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: #c62828; }
.apd-options-need:empty { display: none; }
.apd-options-need li { margin: 0 0 4px; }
.apd-options-photo { display: block; width: 100%; margin: 0 0 12px; padding: 10px 14px; border: 1px solid #c62828; border-radius: 8px; background: #fff; color: #c62828; font-size: 15px; font-weight: 600; cursor: pointer; }
.apd-options-photo[hidden] { display: none; }
.apd-options-photo:hover { background: #fdecea; }
.apd-options-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 15px; }
.apd-options-total strong { font-size: 18px; }
.apd-options-continue { display: block; width: 100%; padding: 13px 16px; border: 0; border-radius: 8px; background: #2f6691; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; opacity: 0.5; cursor: not-allowed; }
.apd-options-foot.is-ready .apd-options-continue { opacity: 1; cursor: pointer; }
.apd-options-foot.is-ready .apd-options-continue:hover { background: #24506f; }
html.apd-options .apd-options-head { display: block; flex: none; margin: 0 0 14px; font-size: 20px; font-weight: 700; line-height: 1.3; }

@media (max-width: 760px) {
	html.apd-options .apd-overlay { right: 0; bottom: 48vh; }
	html.apd-options form.apd-options-form { top: 52vh; width: 100%; padding: 18px 16px 32px; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.16); }
	html.apd-options .apd-options-foot { bottom: -32px; margin: auto -16px -32px; padding: 12px 16px 16px; }
}

/* Choices in the options panel: Acowebs' own button padding, stacked full width like Canva's print options. */
html.apd-options form.apd-options-form .wcpa_field_wrap { margin: 0 0 24px !important; }
html.apd-options form.apd-options-form .wcpa_field_label { margin: 0 0 8px !important; font-size: 13.5px !important; line-height: 1.3 !important; }
html.apd-options form.apd-options-form .wcpa_type_radio-group .wcpa_group_field,
html.apd-options form.apd-options-form .wcpa_type_checkbox-group .wcpa_group_field { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
html.apd-options form.apd-options-form .wcpa_group_field .wcpa_radio,
html.apd-options form.apd-options-form .wcpa_group_field .wcpa_checkbox { width: 100% !important; margin: 0 !important; }
html.apd-options form.apd-options-form .wcpa_group_field .wcpa_radio label,
html.apd-options form.apd-options-form .wcpa_group_field .wcpa_checkbox label { display: flex !important; justify-content: space-between; align-items: center; width: 100% !important; box-sizing: border-box; }
/* Colour swatches stay side by side. */
html.apd-options form.apd-options-form .wcpa_type_color-group .wcpa_group_field { flex-direction: row !important; flex-wrap: wrap !important; gap: 12px 14px !important; }
html.apd-options form.apd-options-form .wcpa_option_price { font-size: 11px !important; }
/* The subtotal at the bottom replaces the per-question prices and "Clear Selection". */
html.apd-options form.apd-options-form .wcpa_clear,
html.apd-options form.apd-options-form .wcpa_field_bottom { display: none !important; }
html.apd-options form.apd-options-form .wcpa_section hr,
html.apd-options form.apd-options-form .wcpa_type_separator { margin: 6px 0 !important; }
