/* Product page fields. Deliberately minimal so themes stay in charge. */

.obra-ef-fields {
	margin: 0 0 1.5em;
}

/*
 * Block themes.
 *
 * WooCommerce's Add to Cart Form block lays form.cart out as a column grid:
 *
 *   .wp-block-woocommerce-add-to-cart-form form.cart {
 *       display: grid;
 *       grid-auto-flow: column;
 *       grid-template-columns: min-content auto auto;
 *   }
 *
 * Our fields are a direct child of that form, so without this they land in the
 * first (min-content) column and get squashed to almost nothing. Spanning every
 * column gives them a full-width row, which is the same trick the block's own
 * ::before pseudo-element uses to force a row break.
 *
 * This site runs a block theme (Twenty Twenty-Five child), so this rule is
 * load-bearing, not defensive. Check it still holds after a major WooCommerce
 * upgrade.
 */
.wp-block-woocommerce-add-to-cart-form form.cart .obra-ef-fields {
	grid-column: 1 / -1;
}

.obra-ef-field {
	display: flex;
	flex-direction: column;
	gap: .25em;
	margin: 0 0 1em;
}

.obra-ef-field > label {
	font-weight: 600;
}

.obra-ef-field input[type="text"],
.obra-ef-field input[type="email"],
.obra-ef-field input[type="date"],
.obra-ef-field input[type="number"],
.obra-ef-field input[type="file"],
.obra-ef-field select,
.obra-ef-field textarea {
	max-width: 26em;
	width: 100%;
	padding: .5em;
	box-sizing: border-box;
}

.obra-ef-field textarea {
	max-width: 100%;
}

.obra-ef-checkbox {
	display: flex;
	align-items: center;
	gap: .5em;
}

.obra-ef-checkbox input[type="checkbox"] {
	width: auto;
}

.obra-ef-rate,
.obra-ef-upload-limit,
.obra-ef-description {
	font-size: .9em;
	opacity: .8;
}

/*
 * Shown only while the Add to cart button is disabled, so the greying out has
 * a visible reason. Rendered hidden by PHP and revealed by JavaScript, so with
 * scripting off it never appears and the button is never disabled.
 *
 * The [hidden] rule is explicit because flex and grid layouts override the
 * browser's default display:none for hidden elements.
 */
.obra-ef-hint {
	margin: 0 0 1em;
	font-size: .9em;
	opacity: .8;
}

.obra-ef-hint[hidden] {
	display: none;
}

.single_add_to_cart_button.obra-ef-disabled,
.obra-ef-disabled[disabled] {
	cursor: not-allowed;
	opacity: .5;
}
