/**
 * Scoped Single Product template layout and shared dynamic widget primitives.
 */
body.bizopt-single-product-template-active .bizopt-single-product-template,
body.bizopt-single-product-template-active .bizopt-single-product-template-host,
body.bizopt-single-product-template-active :where(
	.site-content,
	#content,
	.ast-container,
	#primary,
	.content-area,
	#main,
	.site-main,
	.ast-woocommerce-container
):has(.bizopt-single-product-template) {
	box-sizing: border-box;
	float: none !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	margin-top: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	margin-left: 0 !important;
	padding-top: 0 !important;
	padding-right: 0 !important;
	padding-bottom: 0 !important;
	padding-left: 0 !important;
}

.bizopt-single-product-template,
.bizopt-single-product-template *,
.bizopt-single-product-widget {
	box-sizing: border-box;
}

.bizopt-single-product-template :is(img, video, iframe, svg) {
	max-width: 100%;
}

.bizopt-single-product-template,
.bizopt-single-product-widget,
.bizopt-product-meta,
.bizopt-product-rating,
.bizopt-product-stock {
	min-width: 0;
	max-width: 100%;
}

.bizopt-product-title,
.bizopt-product-short-description,
.bizopt-product-meta,
.bizopt-product-stock {
	overflow-wrap: anywhere;
}

.bizopt-product-title.bizopt-product-title__text {
	display: block;
	visibility: visible;
	opacity: 1;
}

.bizopt-product-title,
.bizopt-product-price .price,
.bizopt-product-stock .stock,
.bizopt-product-notices__output > :first-child,
.bizopt-product-short-description > :first-child {
	margin-top: 0;
}

.bizopt-product-title,
.bizopt-product-price .price,
.bizopt-product-stock .stock,
.bizopt-product-notices__output > :last-child,
.bizopt-product-short-description > :last-child {
	margin-bottom: 0;
}

.bizopt-product-rating {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.bizopt-product-rating .star-rating {
	float: none;
	margin: 0;
}

.bizopt-product-meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bizopt-product-meta__row {
	--bizopt-product-meta-content-gap: 0.35em;
	--bizopt-product-meta-inline-gap: var(--bizopt-product-meta-content-gap);
	display: block;
	align-items: baseline;
	column-gap: 0.35em;
	row-gap: 0.15em;
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.bizopt-product-meta__label,
.bizopt-product-meta__value {
	display: inline !important;
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.bizopt-product-meta__row > .bizopt-product-meta__label {
	flex: 0 0 auto;
	margin-inline-end: var(--bizopt-product-meta-inline-gap);
	width: auto !important;
}

.bizopt-product-meta__row > .bizopt-product-meta__value {
	flex: 0 1 auto;
	width: auto !important;
}

.bizopt-product-meta__row--hook-meta > .bizopt-product-meta__value {
	display: block !important;
	flex: 1 1 100%;
	width: 100% !important;
}

/* Defensive fallback for themes that print their Woo breadcrumb outside the
 * standard callback. Only the deliberately placed BizOpt widget is restored. */
body.bizopt-single-product-template-active .woocommerce-breadcrumb {
	display: none !important;
}

body.bizopt-single-product-template-active .bizopt-product-breadcrumbs .woocommerce-breadcrumb {
	display: block !important;
}

.bizopt-product-notices,
.bizopt-product-notices__output,
.bizopt-product-notices :is(.woocommerce-error, .woocommerce-message, .woocommerce-info) {
	min-width: 0;
	max-width: 100%;
}

.bizopt-product-notices__output {
	display: grid;
	gap: 12px;
}

.bizopt-product-notices :is(.woocommerce-error, .woocommerce-message, .woocommerce-info) {
	width: 100%;
	margin: 0;
	padding: 1em 1.5em;
	overflow-wrap: anywhere;
	outline: 0 !important;
}

.bizopt-product-notices :is(.woocommerce-message, .woocommerce-info) {
	display: grid !important;
	grid-template-columns: max-content minmax(0, auto) max-content;
	grid-template-areas: "icon content action";
	align-items: center;
	justify-content: var(--bizopt-notice-align, left);
	column-gap: var(--bizopt-notice-content-gap, 12px);
	row-gap: var(--bizopt-notice-content-gap, 12px);
}

.bizopt-product-notices .woocommerce-error {
	display: grid !important;
	grid-template-columns: max-content minmax(0, auto);
	align-items: start;
	justify-content: var(--bizopt-notice-align, left);
	column-gap: var(--bizopt-notice-content-gap, 12px);
	row-gap: var(--bizopt-notice-content-gap, 12px);
}

.bizopt-product-notices :is(.woocommerce-error, .woocommerce-message, .woocommerce-info)::before {
	position: static !important;
	inset: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	align-self: center;
	justify-self: center;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	transform: none !important;
	line-height: 1;
}

.bizopt-product-notices :is(.woocommerce-message, .woocommerce-info)::before {
	grid-area: icon;
}

.bizopt-product-notices .woocommerce-error::before {
	grid-column: 1;
	grid-row: 1;
}

.bizopt-product-notices .bizopt-product-notice__content {
	grid-area: content;
	min-width: 0;
	max-width: 100%;
	text-align: inherit;
}

.bizopt-product-notices .woocommerce-error > li {
	grid-column: 2;
	min-width: 0;
	margin: 0;
	text-align: inherit;
}

.bizopt-product-notices :is(.button, .wc-forward) {
	grid-area: action;
	justify-self: var(--bizopt-notice-align, left);
	float: none;
	max-width: 100%;
	margin: 0;
	white-space: normal;
}

.bizopt-product-notices--button-start :is(.woocommerce-message, .woocommerce-info) {
	grid-template-areas: "icon action content";
}

.bizopt-product-notices--button-end :is(.woocommerce-message, .woocommerce-info) {
	grid-template-areas: "icon content action";
}

.bizopt-product-notices--hide-action :is(.button, .wc-forward) {
	display: none !important;
}

.bizopt-product-add-to-cart,
.bizopt-product-add-to-cart form.cart,
.bizopt-product-add-to-cart table,
.bizopt-product-add-to-cart tbody,
.bizopt-product-add-to-cart tr,
.bizopt-product-add-to-cart td,
.bizopt-product-add-to-cart .single_variation_wrap,
.bizopt-product-add-to-cart .woocommerce-variation-add-to-cart {
	min-width: 0;
	max-width: 100%;
}

.bizopt-product-add-to-cart form.cart {
	margin: 0;
}

.bizopt-product-add-to-cart form.cart:not(.variations_form):not(.grouped_form),
.bizopt-product-add-to-cart .woocommerce-variation-add-to-cart {
	display: flex;
	align-items: stretch;
	justify-content: var(--bizopt-add-to-cart-align, flex-start);
	flex-wrap: wrap;
	gap: var(--bizopt-add-to-cart-gap, 10px);
}

.bizopt-product-add-to-cart .quantity {
	display: inline-flex;
	align-items: stretch;
	float: none;
	margin: 0;
	max-width: 100%;
}

.bizopt-product-add-to-cart .quantity .qty,
.bizopt-product-add-to-cart .quantity :is(.plus, .minus, button) {
	box-sizing: border-box;
	margin: 0;
}

.bizopt-product-add-to-cart .quantity .qty {
	flex: 0 1 64px;
	width: 64px;
	height: 48px;
	min-height: 48px;
	padding: 0 8px;
	text-align: center;
	line-height: normal;
	appearance: textfield;
	-moz-appearance: textfield;
}

.bizopt-product-add-to-cart .quantity .qty::-webkit-outer-spin-button,
.bizopt-product-add-to-cart .quantity .qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.bizopt-product-add-to-cart .quantity [data-bizopt-quantity-step] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 46px;
	width: 46px;
	height: 48px;
	min-height: 48px;
	min-width: 0;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-size: 20px;
	line-height: 1;
}

.bizopt-product-add-to-cart .quantity [data-bizopt-quantity-step]:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.bizopt-product-add-to-cart :is(.single_add_to_cart_button, .single_add_to_cart_button.button, a.single_add_to_cart_button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	margin: 0;
	max-width: 100%;
	white-space: normal;
	text-align: center;
}

.bizopt-product-add-to-cart__button-text,
.bizopt-product-add-to-cart__button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bizopt-product-add-to-cart__button-icon {
	flex: 0 0 auto;
	line-height: 0;
}

.bizopt-product-add-to-cart__button-icon--left {
	margin-inline-end: var(--bizopt-single-cart-icon-gap, 8px);
}

.bizopt-product-add-to-cart__button-icon--right,
.bizopt-product-add-to-cart .bizopt-cart-button__status-icon {
	margin-inline-start: var(--bizopt-single-cart-icon-gap, 8px);
}

.bizopt-product-add-to-cart__button-icon svg,
.bizopt-product-add-to-cart__button-icon img {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.bizopt-product-add-to-cart__button-icon i {
	display: block;
	font-size: 1em;
	line-height: 1;
}

.bizopt-product-add-to-cart :is(.single_add_to_cart_button, .single_add_to_cart_button.button):disabled,
.bizopt-product-add-to-cart :is(.single_add_to_cart_button, .single_add_to_cart_button.button).disabled,
.bizopt-product-add-to-cart :is(.single_add_to_cart_button, .single_add_to_cart_button.button).wc-variation-selection-needed {
	cursor: not-allowed;
	opacity: 0.55;
}

.bizopt-product-add-to-cart table.variations {
	width: 100%;
	margin: 0 0 var(--bizopt-add-to-cart-gap, 10px);
	table-layout: fixed;
	border-collapse: separate;
}

.bizopt-product-add-to-cart table.variations :is(th, td) {
	vertical-align: middle;
	border: 0;
}

.bizopt-product-add-to-cart table.variations th.label {
	width: 28%;
	padding-left: 0;
}

.bizopt-product-add-to-cart table.variations td.value {
	width: 72%;
	padding-right: 0;
}

.bizopt-product-add-to-cart table.variations select {
	width: 100%;
	max-width: 100%;
}

.bizopt-product-add-to-cart .reset_variations {
	display: inline-block;
	margin-top: 6px;
}

.bizopt-product-add-to-cart .single_variation_wrap,
.bizopt-product-add-to-cart .single_variation,
.bizopt-product-add-to-cart .woocommerce-variation-description,
.bizopt-product-add-to-cart .woocommerce-variation-price,
.bizopt-product-add-to-cart .woocommerce-variation-availability {
	width: 100%;
}

.bizopt-product-add-to-cart .single_variation > :last-child,
.bizopt-product-add-to-cart .woocommerce-variation-description > :last-child,
.bizopt-product-add-to-cart .woocommerce-variation-availability > :last-child {
	margin-bottom: var(--bizopt-add-to-cart-gap, 10px);
}

.bizopt-product-add-to-cart form.grouped_form {
	display: flex;
	align-items: var(--bizopt-add-to-cart-align, flex-start);
	flex-direction: column;
	gap: var(--bizopt-add-to-cart-gap, 10px);
}

.bizopt-product-add-to-cart .woocommerce-grouped-product-list {
	align-self: stretch;
	width: 100%;
	margin: 0;
	table-layout: auto;
	border-collapse: collapse;
}

.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item > td {
	vertical-align: middle;
	border-width: 0 0 1px;
	border-style: solid;
	border-color: #e4e7e6;
}

.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item__quantity {
	width: 1%;
	white-space: nowrap;
}

.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item__price {
	text-align: right;
}

.bizopt-product-add-to-cart--hide-price-for-guests .woocommerce-variation-price,
.bizopt-product-add-to-cart--hide-price-for-guests .woocommerce-grouped-product-list-item__price {
	display: none !important;
}

.bizopt-product-add-to-cart .stock {
	margin-top: 0;
}

@media (max-width: 767px) {
	.bizopt-product-notices :is(.woocommerce-message, .woocommerce-info) {
		grid-template-columns: max-content minmax(0, 1fr);
		grid-template-areas:
			"icon content"
			"action action";
		align-items: start;
		justify-content: stretch;
	}

	.bizopt-product-notices--button-start :is(.woocommerce-message, .woocommerce-info) {
		grid-template-areas:
			"action action"
			"icon content";
	}

	.bizopt-product-notices--button-end :is(.woocommerce-message, .woocommerce-info) {
		grid-template-areas:
			"icon content"
			"action action";
	}

	.bizopt-product-notices :is(.woocommerce-message, .woocommerce-info)::before {
		align-self: start;
		margin-top: 0.15em !important;
	}

	.bizopt-product-add-to-cart table.variations,
	.bizopt-product-add-to-cart table.variations tbody,
	.bizopt-product-add-to-cart table.variations tr,
	.bizopt-product-add-to-cart table.variations :is(th, td) {
		display: block;
		width: 100%;
	}

	.bizopt-product-add-to-cart table.variations th.label {
		padding-right: 0;
		padding-bottom: 4px;
	}

	.bizopt-product-add-to-cart table.variations td.value {
		padding-left: 0;
	}

	.bizopt-product-add-to-cart .woocommerce-grouped-product-list,
	.bizopt-product-add-to-cart .woocommerce-grouped-product-list tbody {
		display: block;
		width: 100%;
	}

	.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item {
		display: grid;
		grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
		width: 100%;
	}

	.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item > td {
		display: block;
		width: auto;
		white-space: normal;
	}

	.bizopt-product-add-to-cart .woocommerce-grouped-product-list-item__price {
		grid-column: 2;
		text-align: left;
	}
}

.bizopt-single-product-editor-notice {
	padding: 12px 16px;
	color: #5f6b66;
	background: #f5f7f6;
	border: 1px dashed #aab4b0;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
}
