/**
 * Right of withdrawal: the customer-facing form.
 *
 * Deliberately quiet. This is a legal declaration, not a marketing surface —
 * the job is to make the prefilled facts easy to check and the confirm button
 * unmistakable. Palette variables with fallbacks keep it inside the theme.
 */

.mg-withdrawal {
	max-width: 40rem;
}

.mg-withdrawal > p:first-child {
	margin-bottom: 1.5rem;
	color: var( --global-palette4, #4b5563 );
}

.mg-withdrawal-form {
	padding: 1.75rem;
	border: 1px solid var( --global-palette6, #e5e7eb );
	border-radius: 0.75rem;
	background: var( --global-palette9, #fff );
}

/* The order we recognised from the emailed link. */
.mg-withdrawal-form .mg-withdrawal-order {
	margin: 0 0 0.5rem;
	padding: 0.875rem 1rem;
	border-radius: 0.5rem;
	background: var( --global-palette8, #f9fafb );
	font-size: 0.95rem;
}

.mg-withdrawal-form .mg-withdrawal-order.description {
	margin-bottom: 1.5rem;
	padding: 0;
	background: none;
	font-size: 0.85rem;
	color: var( --global-palette5, #6b7280 );
}

.mg-withdrawal-form .form-row {
	display: flex;
	flex-direction: column;
	margin: 0 0 1.25rem;
}

.mg-withdrawal-form label {
	margin-bottom: 0.35rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var( --global-palette3, #1f2937 );
}

.mg-withdrawal-form .required {
	border: 0;
	color: var( --global-palette1, #c62828 );
	text-decoration: none;
}

.mg-withdrawal-form .input-text {
	width: 100%;
	padding: 0.65rem 0.85rem;
	font-size: 1rem;
	line-height: 1.4;
	border: 1px solid var( --global-palette6, #d1d5db );
	border-radius: 0.5rem;
	background: var( --global-palette9, #fff );
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mg-withdrawal-form .input-text:focus {
	outline: none;
	border-color: var( --global-palette1, #c62828 );
	box-shadow: 0 0 0 3px rgba( 198, 40, 40, 0.15 );
}

.mg-withdrawal-form .description {
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	color: var( --global-palette5, #6b7280 );
}

.mg-withdrawal-form textarea.input-text {
	min-height: 6rem;
	resize: vertical;
}

.mg-withdrawal-form .form-row:last-child {
	margin-bottom: 0;
	padding-top: 0.5rem;
	border-top: 1px solid var( --global-palette6, #e5e7eb );
}

.mg-withdrawal-form button[type="submit"] {
	align-self: flex-start;
	margin-top: 1rem;
	padding: 0.75em 1.75em;
	font-size: 1rem;
	font-weight: 600;
	border-radius: 0.5rem;
}

/* The honeypot must stay invisible even if the theme resets positioning. */
.mg-withdrawal-form .mg-wd-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mg-withdrawal .woocommerce-error,
.mg-withdrawal .woocommerce-message {
	margin-bottom: 1.5rem;
}

@media ( max-width: 600px ) {

	.mg-withdrawal-form {
		padding: 1.25rem;
	}

	.mg-withdrawal-form button[type="submit"] {
		align-self: stretch;
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Partial withdrawal: choosing the whole order or picking items off it.
 *
 * The picker is visible by default and hidden by the script, so the form is
 * still complete when JavaScript never arrives.
 * ------------------------------------------------------------------------ */

.mg-withdrawal-form .mg-wd-scope {
	margin: 0 0 1.25rem;
	padding: 1rem 1.125rem;
	border: 1px solid var( --global-palette6, #e5e7eb );
	border-radius: 0.5rem;
	background: var( --global-palette8, #f9fafb );
}

.mg-withdrawal-form .mg-wd-scope legend {
	padding: 0 0.35rem;
	margin-left: -0.35rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var( --global-palette3, #1f2937 );
}

.mg-withdrawal-form .mg-wd-choice {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	margin: 0 0 0.4rem;
	font-weight: 400;
}

.mg-withdrawal-form .mg-wd-choice input {
	flex: 0 0 auto;
	margin: 0;
}

.mg-withdrawal-form .mg-wd-items[hidden] {
	display: none;
}

.mg-withdrawal-form .mg-wd-items {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var( --global-palette6, #e5e7eb );
}

.mg-withdrawal-form .mg-wd-item-list {
	margin: 0.5rem 0 1rem;
	padding: 0;
	list-style: none;
}

.mg-withdrawal-form .mg-wd-item {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0;
	border-bottom: 1px solid var( --global-palette7, #eef0f2 );
}

.mg-withdrawal-form .mg-wd-item:last-child {
	border-bottom: 0;
}

.mg-withdrawal-form .mg-wd-item__name {
	flex: 1 1 14rem;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.mg-withdrawal-form .mg-wd-item__qty {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex: 0 0 auto;
}

.mg-withdrawal-form .mg-wd-item__qty label {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 400;
	color: var( --global-palette5, #6b7280 );
}

.mg-withdrawal-form .mg-wd-item__qty input {
	width: 4.5rem;
	padding: 0.4rem 0.5rem;
	font-size: 0.9375rem;
	text-align: center;
	border: 1px solid var( --global-palette6, #d1d5db );
	border-radius: 0.375rem;
	background: var( --global-palette9, #fff );
}

.mg-withdrawal-form .mg-wd-item__max {
	font-size: 0.8125rem;
	color: var( --global-palette5, #6b7280 );
}

.mg-withdrawal-form .mg-wd-items-text {
	margin-bottom: 0;
}
