/**
 * Conversion-oriented bundle selection layout.
 * Aligns product title, price, and quantity into consistent columns (Standard layout).
 */

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: 0.75rem;
	background: rgba(0, 0, 0, 0.02);
	border-bottom-width: 1px;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary:last-child {
	margin-bottom: 1.25rem;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .details {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 6.5rem 4.75rem;
	column-gap: 1.25rem;
	row-gap: 0.5rem;
	align-items: center;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary h4.bundled_product_title {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
	padding-right: 0.25rem;
	line-height: 1.35;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_product_optional_checkbox {
	grid-column: 1 / -1;
	margin-bottom: 0.25rem;
}

/* Flatten wrappers so price/qty participate in the details grid. */
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .details > .cart,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .details > .cart.bundled_item_cart_content,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_wrap,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_content,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .single_variation_wrap {
	display: contents;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	text-align: right;
	align-self: center;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details > .price,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details > p.price {
	display: block;
	margin: 0;
	white-space: nowrap;
	font-weight: 600;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_after_cart_details,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .woocommerce-variation-add-to-cart.bundled_item_after_cart_details {
	grid-column: 3;
	grid-row: 1;
	justify-self: center;
	align-self: center;
	margin: 0;
	position: static;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_after_cart_details .quantity,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .woocommerce-variation-add-to-cart .quantity {
	float: none;
	margin: 0;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .quantity .qty {
	min-width: 3rem;
	text-align: center;
	padding: 0.45em 0.35em;
	border-radius: 6px;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details > p.stock,
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details > p.bundled_item_unavailable {
	grid-column: 1 / -1;
	grid-row: 2;
	margin: 0.35em 0 0;
	text-align: left;
}

/* Variable bundled products: options full width below the title row. */
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .cart.bundled_item_cart_content > table.variations {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
	margin: 0.35rem 0 0;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .cart.bundled_item_cart_content > table.variations td.label {
	padding-top: 0.5em;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .cart.bundled_item_cart_content > table.variations td.value {
	padding-top: 0.35em;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .cart.bundled_item_cart_content > table.variations select {
	width: 100%;
	max-width: 16rem;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .single_variation.bundled_item_cart_details {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	text-align: right;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .single_variation.bundled_item_cart_details .price {
	margin: 0;
	font-weight: 600;
}

/* Optional items: checkbox + title + price on one row. */
.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary.bundled_item_optional .bundled_product_optional_checkbox {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) 6.5rem 4.75rem;
	column-gap: 1.25rem;
	align-items: center;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary.bundled_item_optional .bundled_product_optional_checkbox input {
	grid-column: 1;
	margin: 0;
}

.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary.bundled_item_optional .bundled_product_optional_checkbox span.price {
	grid-column: 3;
	margin: 0;
	text-align: right;
	white-space: nowrap;
	font-weight: 600;
}

/* Tabular layout: clearer table presentation. */
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products {
	border-collapse: collapse;
	border-spacing: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

/* Remove empty image column. */
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_images_col,
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products th.bundled_item_images_head {
	width: 0 !important;
	min-width: 0 !important;
	max-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden;
	font-size: 0;
	line-height: 0;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_images_col *,
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products th.bundled_item_images_head * {
	display: none !important;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products thead th {
	background: rgba(0, 0, 0, 0.04);
	color: #1a1a1a !important;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 600;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products thead th.bundled_item_details_head,
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products thead th.bundled_item_qty_head {
	color: #1a1a1a !important;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_col {
	vertical-align: middle;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products tbody tr.bundled_product_summary {
	background: #fff;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products tbody tr.bundled_product_summary + tr.bundled_product_summary td {
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products tbody tr.bundled_product_summary:nth-child(even) {
	background: #fff;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_details_col .bundled_item_cart_details span.price,
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_details_col .bundled_item_cart_details p.price {
	display: block;
	margin: 0.35em 0 0;
	font-weight: 600;
	text-align: right;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_qty_col {
	min-width: 5rem;
	vertical-align: middle !important;
	text-align: center;
}

/* Align fixed quantity text with editable quantity inputs. */
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_qty_col .quantity {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	margin: 0 auto;
	min-height: 2.75em;
	min-width: 2.75em;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_qty_col .quantity .qty {
	margin: 0;
}

.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_qty_col .quantity input[type="hidden"] + *,
.bundle_form.layout_tabular.bundle_selection_layout table.bundled_products td.bundled_item_qty_col .quantity:not(:has(input.qty[type="number"])) {
	font-weight: 600;
	line-height: 1;
}

@media (max-width: 600px) {
	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .details {
		grid-template-columns: minmax(0, 1fr) 4.75rem;
	}

	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary h4.bundled_product_title {
		grid-column: 1 / -1;
	}

	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_cart_details,
	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .single_variation.bundled_item_cart_details {
		grid-column: 1;
		grid-row: 2;
		text-align: left;
	}

	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .bundled_item_after_cart_details,
	.bundle_form.layout_default.bundle_selection_layout .bundled_product_summary .woocommerce-variation-add-to-cart.bundled_item_after_cart_details {
		grid-column: 2;
		grid-row: 2;
	}
}
