/**
 * WooCommerce presentation overrides.
 *
 * Static, unbuilt CSS loaded after dist/styles/main.css. The shipped build
 * of main.css does not match the Sass source (production carries
 * accessibility rules and Tailwind output that a rebuild would lose), so
 * targeted fixes live here until the source is reconciled with the build.
 */

/* Cart and checkout: cap the page content like every other template. */
.woocommerce-cart .content-loop > *,
.woocommerce-checkout .content-loop > * {
	max-width: 1240px;
	margin-left: auto;
	margin-right: auto;
}

/* Radios and checkboxes: 44px squares read as buttons. Draw them at a
   control size; the label stays the click target. */
.woocommerce-page [type="checkbox"],
.woocommerce-page [type="radio"],
.woocommerce [type="checkbox"],
.woocommerce [type="radio"] {
	width: 20px;
	height: 20px;
	min-width: 20px;
	min-height: 20px;
	vertical-align: middle;
	margin: 0 0.5em 0 0;
	flex: none;
}

.woocommerce-page [type="radio"],
.woocommerce [type="radio"] {
	background-size: 60% 60%;
}

/* Shipping method list at checkout and in the cart totals. */
.woocommerce ul#shipping_method li,
.woocommerce-page ul#shipping_method li {
	display: flex;
	align-items: flex-start;
	gap: 0;
	padding: 0 0 0.75em;
	margin: 0;
}

.woocommerce ul#shipping_method li input,
.woocommerce-page ul#shipping_method li input {
	margin-top: 2px;
}

.woocommerce ul#shipping_method li label,
.woocommerce-page ul#shipping_method li label {
	display: inline;
	margin: 0;
	line-height: 1.5;
}

/* "Ship to a different address?" and similar checkbox labels. */
.woocommerce form .woocommerce-form__label-for-checkbox,
.woocommerce-page form .woocommerce-form__label-for-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-size: 1em;
}

.woocommerce form .woocommerce-form__label-for-checkbox input,
.woocommerce-page form .woocommerce-form__label-for-checkbox input {
	margin: 0;
}

/* Payment method list at checkout. */
.woocommerce-checkout #payment ul.payment_methods li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.5em;
}

.woocommerce-checkout #payment ul.payment_methods li > label {
	display: inline;
	margin: 0;
}

.woocommerce-checkout #payment ul.payment_methods li .payment_box {
	flex-basis: 100%;
}

/* Order review table: give the value column the room, not the labels. */
.woocommerce-checkout .woocommerce-checkout-review-order-table th:first-child,
.woocommerce-checkout .woocommerce-checkout-review-order-table td:first-child {
	width: 34%;
}

/* Checkout validation notices. The theme lays the checkout form out as a
   flex row; WooCommerce injects the notice group as a third child, which
   squeezed it into a narrow column beside the billing fields, and the
   error list itself was a row so each message became a column. */
form.woocommerce-checkout {
	flex-wrap: wrap;
}

/* With wrapping on, the two columns need a shared basis or the review
   column (content-sized) drops below the billing fields. The theme only
   lays the form out as a row from 768px. */
@media (min-width: 768px) {
	form.woocommerce-checkout #customer_details.col2-set,
	form.woocommerce-checkout .woocommerce-review-order {
		flex: 1 1 0;
		min-width: 0;
	}
}

form.woocommerce-checkout .woocommerce-NoticeGroup-checkout {
	flex: 0 0 100%;
	width: 100%;
	margin-bottom: 1.5rem;
}

form.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5em;
}

/* Checkbox fields rendered by woocommerce_form_field() (restocking-fee
   acknowledgment, Klaviyo newsletter opt-in). The theme's form label style
   (uppercase, bold, 12px) and an inline-display checkbox made these read as
   a heading with a 2px-wide box. */
#restocking-fee-checkbox p.form-row {
	margin: 0;
	padding: 0;
}

/* The Mailchimp opt-in prints its own markup (label.inline with the
   woocommerce-form__label-for-checkbox class) inside the checkout form, so
   it needs the same treatment under a selector that outranks WooCommerce's
   label.inline rule. */
.woocommerce-checkout .form-row label.checkbox,
.woocommerce-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.5em;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.5;
	text-transform: none;
}

.woocommerce-checkout .form-row label.checkbox input[type="checkbox"],
.woocommerce-checkout form.checkout .form-row label.woocommerce-form__label-for-checkbox input[type="checkbox"] {
	display: inline-block;
	margin: 3px 0 0;
}

/* AvaTax "Validate Address" button. The plugin ships it as a grey default
   button with no spacing, so it hides between the ZIP field and the order
   notes even though checkout cannot proceed without it. Match the Place
   Order button. */
.woocommerce-checkout .wc_avatax_validate_address.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0.25rem 0 1.5rem;
	padding: 1rem 1.75rem;
	border: 0;
	border-radius: 0.25rem;
	background-color: #f57e25;
	color: #242429;
	font-family: "Readex Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 15px;
	text-transform: uppercase;
	cursor: pointer;
}

.woocommerce-checkout .wc_avatax_validate_address.button:hover,
.woocommerce-checkout .wc_avatax_validate_address.button:focus {
	background-color: #fda100;
	color: #242429;
}

/* The plugin injects the "Address validated" result right after the button
   and inlines margin-bottom on the button, so give the result its own gap. */
.woocommerce-checkout .wc-avatax-address-validation-result {
	margin: 0 0 1.5rem;
}
