/* Product page layout and the payment logos row. Enqueued by custom-functions/pdp-blocks.php. */

/* Payment logos: under "Benefits of Buying Now" and in the footer. Below 1025px the row keeps the
   footprint of the old payments image (1029x104), so phones and tablets are laid out as before. */
.bala-pay {
	display: flex;
	justify-content: space-between;
	align-items: center;
	aspect-ratio: 1029 / 104;
	margin: 10px 0;
}

.bala-pay img {
	display: block;
	height: 100%;
	width: auto;
}

.bala-pay--footer {
	display: inline-flex;
	gap: 0.4em;
	height: 1.5em;
	aspect-ratio: auto;
	margin: 0;
	vertical-align: middle;
}

@media (min-width: 1025px) {
	.bala-pay:not(.bala-pay--footer) {
		justify-content: center;
		gap: 18px;
		height: 38px;
		aspect-ratio: auto;
		margin: 12px 0;
	}

	/* Variant cards: two per row reaching both edges, 10px apart both ways. */
	.variations_form .card-option-wrapper {
		flex: 0 1 calc(50% - 5px);
		margin-bottom: 0;
	}

	div#gift-label {
		margin-top: -10px !important;
	}

	/* The gallery column ends level with the add-to-cart column: the image takes the height left
	   over, never more than its natural square size (100cqi) and never less than 420px. */
	.vc_row-o-equal-height > .wpb_column:has(.wd-single-gallery) > .vc_column-inner {
		display: flex;
		flex-direction: column;
		height: 100%;
	}

	.vc_row-o-equal-height > .wpb_column:has(.wd-single-gallery) > .vc_column-inner > .wpb_wrapper {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.vc_row-o-equal-height .wd-single-gallery {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		min-height: 0;
		container-type: inline-size;
	}

	.vc_row-o-equal-height .wd-single-gallery > .woocommerce-product-gallery {
		flex: 1 1 0;
		min-height: 420px;
		max-height: 100cqi;
	}

	.vc_row-o-equal-height .wd-single-gallery .wd-gallery-images,
	.vc_row-o-equal-height .wd-single-gallery .wd-gallery-images > .wd-carousel-inner,
	.vc_row-o-equal-height .wd-single-gallery .woocommerce-product-gallery__wrapper,
	.vc_row-o-equal-height .wd-single-gallery .wd-carousel-wrap,
	.vc_row-o-equal-height .wd-single-gallery .wd-carousel-item,
	.vc_row-o-equal-height .wd-single-gallery .woocommerce-product-gallery__image,
	.vc_row-o-equal-height .wd-single-gallery .woocommerce-product-gallery__image > a {
		height: 100%;
	}

	.vc_row-o-equal-height .wd-single-gallery .woocommerce-product-gallery__image > a {
		display: block;
	}

	.vc_row-o-equal-height .wd-single-gallery .woocommerce-product-gallery__image img {
		height: 100% !important;
		width: 100%;
		object-fit: contain;
	}

	.bala-offer-title {
		margin-bottom: 12px;
	}
}

/* The 1024-1439px title sizes on wide screens too, so the title fits on two lines. */
@media (min-width: 1440px) {
	.wd-single-gallery #product-offer-header {
		font-size: 2rem;
	}

	.wd-single-gallery #product-offer-description {
		font-size: 1.2rem;
	}
}
