/**
 * Checkout checkbox alignment fixes.
 *
 * Several stylesheets (woocommerce.css, themify.framework.css, ptb-public.css)
 * load after this file, so the layout-critical declarations use !important to
 * win regardless of source order. Scope is limited to the checkout form.
 *
 * Targets the three checkout consent / option checkboxes:
 *   - #ship-to-different-address  ("Odoslať na inú adresu?")
 *   - p.form-row.terms            ("Súhlasím s obchodnými podmienkami")
 *   - p.mailchimp-newsletter      ("Súhlasím so spracovaním osobných údajov…")
 */

/* One consistent layout for all three: checkbox on the left, text beside it,
   top-aligned. Flex takes the checkbox out of the text flow, which also kills
   the inflated line-box / huge inter-line gap on the wrapping newsletter row. */
body.woocommerce-checkout #ship-to-different-address > label,
body.woocommerce-checkout p.form-row.terms > label.checkbox,
body.woocommerce-checkout p.mailchimp-newsletter > label {
	display: flex !important;
	align-items: flex-start;
	gap: 0.5em;
	margin: 0 !important;
	padding: 0 !important;        /* removes Storefront's 22px left gutter on terms */
	text-indent: 0 !important;
	/* ship-to-different sits in an <h3>, which forces the Greta display font at
	   a small size — pull it back to the regular form font. */
	font-family: "Inter UI", sans-serif !important;
	font-size: 14px !important;
	font-weight: 300;
	line-height: 1.4 !important;
	cursor: pointer;
}

/* The text itself wraps as a normal block-level flex item. */
body.woocommerce-checkout #ship-to-different-address > label > span,
body.woocommerce-checkout p.form-row.terms > label.checkbox > span,
body.woocommerce-checkout p.mailchimp-newsletter > label > span {
	line-height: 1.4 !important;
	flex: 0 1 auto;
	min-width: 0;       /* allow the text to wrap instead of pushing siblings */
}

/* Native checkbox: real size, on the left, no absolute/stretch positioning. */
body.woocommerce-checkout #ship-to-different-address .woocommerce-form__input-checkbox,
body.woocommerce-checkout p.form-row.terms .woocommerce-form__input-checkbox,
body.woocommerce-checkout p.mailchimp-newsletter .woocommerce-form__input-checkbox {
	position: static !important;
	transform: none !important;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px;
	margin: 0 !important;
	flex: 0 0 auto;
	-webkit-appearance: checkbox;
	appearance: checkbox;
}

/* Drop the relative wrapper that anchored the absolute ship-to checkbox,
   and give the order-notes field below it some breathing room. */
body.woocommerce-checkout #ship-to-different-address {
	position: static !important;
	margin-bottom: 1.5em !important;
}

/* Space the submit button away from the newsletter consent row above it. */
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout #place_order {
	margin-top: 1.5em !important;
}

/* Remove stray row indentation. */
body.woocommerce-checkout p.form-row.terms,
body.woocommerce-checkout p.mailchimp-newsletter {
	margin-left: 0 !important;
	padding-left: 0 !important;
}

/* Keep the required asterisk tight to the terms text. */
body.woocommerce-checkout p.form-row.terms .required {
	margin-left: 0.15em;
	border: 0;
}
