/* Scope every rule to the WooCommerce login/register block only. */
#customer_login {
	display: grid !important;
	grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
	column-gap: clamp(24px, 4vw, 56px);
	row-gap: 0;
	align-items: start;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

#customer_login > .u-column1,
#customer_login > .u-column2 {
	float: none !important;
	clear: none !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	box-sizing: border-box;
}

/* Pin WooCommerce's login and registration panels to the approved tracks. */
#customer_login > .u-column1 {
	grid-column: 1;
	grid-row: 1;
}

#customer_login > .u-column2 {
	grid-column: 2;
	grid-row: 1;
}

#customer_login > .u-column1 > h2,
#customer_login > .u-column2 > h2 {
	margin-top: 0;
}

/* Registration uses explicit grid placement so WooCommerce's floated form rows
 * cannot move fields beside the address or privacy notice. */
#customer_login .u-column2 .woocommerce-form-register {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
	row-gap: 0;
	align-items: start;
	width: 100%;
	min-width: 0;
}

#customer_login .u-column2 .woocommerce-form-register > * {
	box-sizing: border-box;
	min-width: 0;
}

#customer_login .u-column2 .woocommerce-form-register > .form-row {
	float: none !important;
	clear: none !important;
	width: 100% !important;
	max-width: 100%;
	margin: 0 0 14px !important;
}

#customer_login .u-column2 #first_name_field {
	grid-column: 1;
	grid-row: 1;
}

#customer_login .u-column2 #last_name_field {
	grid-column: 2;
	grid-row: 1;
}

#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_email) {
	grid-column: 1 / -1;
	grid-row: 2;
}

#customer_login .u-column2 #billing_phone_field {
	grid-column: 1 / -1;
	grid-row: 3;
}

#customer_login .u-column2 .maglux-shipping-fields {
	grid-column: 1 / -1;
	grid-row: 4;
	width: 100%;
	margin: 0 0 14px;
	padding: 14px 16px;
	border: 1px solid rgba(0, 0, 0, .16);
	border-radius: 4px;
}

#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_password) {
	grid-column: 1 / -1;
	grid-row: 5;
}

#customer_login .u-column2 #maglux_password_confirm_field {
	grid-column: 1 / -1;
	grid-row: 6;
}

#customer_login .u-column2 .woocommerce-privacy-policy-text {
	grid-column: 1 / -1;
	grid-row: 7;
	width: 100%;
	margin: 0 0 14px;
}

#customer_login .u-column2 .woocommerce-form-register > p:has(.woocommerce-form-register__submit) {
	grid-column: 1 / -1;
	grid-row: 8;
}

#customer_login .u-column2 .maglux-shipping-fields > summary {
	cursor: pointer;
	font-weight: 600;
}

#customer_login .u-column2 .maglux-shipping-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
	row-gap: 0;
	padding-top: 16px;
}

#customer_login .u-column2 .maglux-shipping-grid .form-row {
	float: none !important;
	clear: none !important;
	width: 100% !important;
	margin: 0 0 14px !important;
}

#customer_login .woocommerce-form input.input-text,
#customer_login .woocommerce-form select,
#customer_login .woocommerce-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

#customer_login .u-column2 .woocommerce-form-register wc-order-attribution-inputs {
	display: none;
}

@media (max-width: 767px) {
	#primary:has(#customer_login) {
		margin-top: 16px !important;
		margin-bottom: 24px !important;
	}

	.entry-content:has(#customer_login) {
		box-sizing: border-box;
		padding-inline: 16px !important;
	}

	#customer_login {
		grid-template-columns: minmax(0, 1fr);
		column-gap: 0;
		row-gap: 16px;
	}

	#customer_login > .u-column1 > h2,
	#customer_login > .u-column2 > h2 {
		margin: 0 0 12px !important;
		line-height: 1.25;
	}

	#customer_login > .u-column1 { grid-column: 1; grid-row: 1; }
	#customer_login > .u-column2 { grid-column: 1; grid-row: 2; }

	#customer_login .u-column2 .woocommerce-form-register {
		grid-template-columns: minmax(0, 1fr);
		column-gap: 0;
	}

	#customer_login .u-column2 .woocommerce-form-register > .form-row {
		margin-bottom: 16px !important;
	}

	#customer_login .u-column2 #first_name_field,
	#customer_login .u-column2 #last_name_field,
	#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_email),
	#customer_login .u-column2 #billing_phone_field,
	#customer_login .u-column2 .maglux-shipping-fields,
	#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_password),
	#customer_login .u-column2 #maglux_password_confirm_field,
	#customer_login .u-column2 .woocommerce-privacy-policy-text,
	#customer_login .u-column2 .woocommerce-form-register > p:has(.woocommerce-form-register__submit) {
		grid-column: 1;
	}

	#customer_login .u-column2 #first_name_field { grid-row: 1; }
	#customer_login .u-column2 #last_name_field { grid-row: 2; }
	#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_email) { grid-row: 3; }
	#customer_login .u-column2 #billing_phone_field { grid-row: 4; }
	#customer_login .u-column2 .maglux-shipping-fields { grid-row: 5; }
	#customer_login .u-column2 .woocommerce-form-register > p:has(#reg_password) { grid-row: 6; }
	#customer_login .u-column2 #maglux_password_confirm_field { grid-row: 7; }
	#customer_login .u-column2 .woocommerce-privacy-policy-text { grid-row: 8; }
	#customer_login .u-column2 .woocommerce-form-register > p:has(.woocommerce-form-register__submit) { grid-row: 9; }

	#customer_login .u-column2 .maglux-shipping-grid {
		grid-template-columns: minmax(0, 1fr);
		column-gap: 0;
	}

	#customer_login .woocommerce-privacy-policy-text {
		overflow-wrap: anywhere;
	}

	#customer_login .woocommerce-form button[type="submit"],
	#customer_login .woocommerce-form input[type="submit"] {
		min-height: 48px;
		padding-inline: 20px;
	}
}
