/**
 * File Name:     wgs-product.css
 * Version:       2.33.1
 * Last Modified: 2026-11-20
 * Package:       Wagners_Site_Extensions
 * Description:   Single-product add-to-cart row repairs, enqueued on product pages only.
 *
 *                ona-pro makes every non-variable, non-grouped `form.cart` a flex row
 *                (`.woocommerce div.product form.cart:not(.variations_form):not(.grouped_form)`),
 *                with no wrapping. That is fine for a bare qty + button, but breaks the Gift Card
 *                (confirmed on local 2026-11-20): the Product Open Pricing plugin injects a
 *                "Enter Gift Card Amount" <p> as a loose child of the form, so the price field,
 *                a quantity stepper with no visible number (qty input is type=hidden because
 *                max=1), a squashed one-word-per-line button and YITH's in-form wishlist link all
 *                sit on one row.
 *
 *                Also hides YITH's in-form wishlist block: the product column already prints the
 *                icon version below the form, so the in-form text link is a duplicate on every
 *                single product (seen on the Gift Card and Blue Tees Captain Pro pages).
 *
 *                Selectors are prefixed with `body.single-product div.product` so they outrank the
 *                theme's `.woocommerce div.product form.cart ...` rules without !important.
 */

/* Price field + qty + button: let the row wrap, price field gets its own line. */
body.single-product div.product form.cart:not(.variations_form):not(.grouped_form):has(.alg_open_price) {
	flex-wrap: wrap;
	align-items: center;
	column-gap: 1rem;

	& > p {
		flex: 1 1 100%;
		margin-block: 0 1rem;
	}

	/* YITH Add-Ons container: own row so an empty one adds no gap. */
	& > .yith-wapo-container {
		flex: 1 1 100%;
	}
}

/* Sold-individually products render the qty input as type=hidden; a stepper
   with no number is just two orphaned buttons, so drop the wrapper. The hidden
   input still submits quantity=1. */
body.single-product div.product form.cart .quantity:has(> input[type="hidden"]) {
	display: none;
}

/* Keep the add-to-cart label on one line at a usable width. */
body.single-product div.product form.cart:not(.variations_form):not(.grouped_form):has(.alg_open_price) .single_add_to_cart_button {
	flex: 0 0 auto;
	min-inline-size: 12rem;
	white-space: nowrap;
}

/* Duplicate of the wishlist block the product column prints below the form. */
body.single-product div.product form.cart .yith-add-to-wishlist-button-block--single {
	display: none;
}
