/**
 * Storefront styles of the custom request fields and the line extras,
 * scoped to the add-on's own wpdevart-raqp-* classes (theme and WooCommerce
 * elements are never restyled). The fields use the free form's classes for
 * their labels, inputs and errors, so they look like the free fields in
 * every theme; these rules only add what the free form has no rule for.
 *
 * @package WPDEVART_RAQP
 */

/* Request form: help text, option groups. */

.wpdevart-raqp-field__help {
	display: block;
	margin: 0.3em 0 0;
	font-size: 0.9em;
	opacity: 0.8;
}

fieldset.wpdevart-raqp-field {
	min-width: 0;
	margin-right: 0;
	margin-left: 0;
	padding: 0;
	border: 0;
}

.wpdevart-raqp-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em 1.25em;
}

.wpdevart-raqp-choice {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
}

.wpdevart-raqp-choice__input {
	margin: 0;
}

/* Long answers and option groups take the whole form width. */
.wpdevart-raqp-field--checkboxes,
.wpdevart-raqp-field--radio {
	grid-column: 1 / -1;
}

.wpdevart-raq-form__fields > .wpdevart-raq-form__field:has(> textarea[data-wpdevart-raq-field^="raqp_"]) {
	grid-column: 1 / -1;
}

/* Quote list: per-product inputs. */

.wpdevart-raqp-x__head {
	white-space: nowrap;
}

.wpdevart-raqp-x__cell {
	min-width: 8em;
}

.wpdevart-raqp-x__input {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	font: inherit;
}

textarea.wpdevart-raqp-x__input {
	min-height: 2.6em;
	resize: vertical;
}

.wpdevart-raqp-x__group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.wpdevart-raqp-x__choice {
	display: flex;
	align-items: center;
	gap: 0.45em;
	margin: 0 0 0.25em;
	font-weight: 400;
	cursor: pointer;
}

.wpdevart-raqp-x__check {
	margin: 0;
}

.wpdevart-raqp-x__text {
	font-size: 0.95em;
	white-space: pre-line;
}

/*
 * Narrow quote list (the free list's stacked rows, measured on the list's
 * own box): a per-product cell sits in the content column with its label,
 * like the free Price / Quantity / Note cells, never in the thumbnail column.
 */
@container wpdevart-raq-list (max-width: 48em) {
	.wpdevart-raq-list__table td.wpdevart-raqp-x__cell {
		grid-column: 2;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5em;
		width: auto;
		min-width: 0;
	}

	.wpdevart-raq-list__table td.wpdevart-raqp-x__cell > .wpdevart-raqp-x__input,
	.wpdevart-raq-list__table td.wpdevart-raqp-x__cell > .wpdevart-raqp-x__group,
	.wpdevart-raq-list__table td.wpdevart-raqp-x__cell > .wpdevart-raqp-x__text {
		flex: 1 1 10em;
		width: auto;
		min-width: 0;
	}
}

/* Quote view: "Your request details". */

.wpdevart-raqp-request-details {
	margin: 1.5em 0;
}

.wpdevart-raqp-request-details__list {
	display: grid;
	grid-template-columns: minmax(8em, max-content) minmax(0, 1fr);
	gap: 0.4em 1.25em;
	margin: 0;
	padding: 0;
}

.wpdevart-raqp-request-details__list dt {
	margin: 0;
	font-weight: 600;
}

.wpdevart-raqp-request-details__list dd {
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

@media (max-width: 600px) {
	.wpdevart-raqp-request-details__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.15em 0;
	}

	.wpdevart-raqp-request-details__list dd {
		margin-bottom: 0.6em;
	}

	.wpdevart-raqp-x__cell {
		min-width: 0;
	}
}
