/* ==========================================================================
   Builders quote template. Scoped to this tool; tokens only.
   Line items are small cards: two columns on a phone, one row of five
   fields once the form column is wide enough (container query).
   ========================================================================== */

/* GeneratePress sets this site-wide; repeated here so 100%-wide fields never spill into the next column */
.wg-tool[data-tool="builders-quote"],
.wg-tool[data-tool="builders-quote"] *,
.wg-tool[data-tool="builders-quote"] *::before,
.wg-tool[data-tool="builders-quote"] *::after {
	box-sizing: border-box;
}

/* Line items */
.wg-tool[data-tool="builders-quote"] .bq-items {
	container-type: inline-size;
	display: grid;
	gap: var(--space-s);
	list-style: none;
	margin: 0;
	padding: 0;
}

.wg-tool[data-tool="builders-quote"] .bq-item {
	background-color: var(--color-bg-alt);
	border: var(--border-w) solid var(--color-border);
	border-radius: var(--radius-m);
	display: grid;
	gap: var(--space-xs);
	margin: 0;
	min-inline-size: 0;
	padding: var(--space-xs) var(--space-s) var(--space-s);
}

.wg-tool[data-tool="builders-quote"] .bq-item__head {
	align-items: center;
	display: flex;
	gap: var(--space-xs);
	justify-content: space-between;
}

.wg-tool[data-tool="builders-quote"] .bq-item__num {
	color: var(--color-text-muted);
	font-size: var(--step--1);
	font-weight: var(--fw-semibold);
}

.wg-tool[data-tool="builders-quote"] .bq-item__remove {
	background: none;
	border: 0;
	border-radius: var(--radius-s);
	color: var(--color-accent);
	cursor: pointer;
	font: inherit;
	font-size: var(--step--1);
	font-weight: var(--fw-semibold);
	min-block-size: var(--tap);
	padding-inline: var(--space-2xs);
	text-decoration: underline;
	text-underline-offset: var(--underline-offset);
}

.wg-tool[data-tool="builders-quote"] .bq-item__remove:hover {
	color: var(--color-accent-hover);
}

.wg-tool[data-tool="builders-quote"] .bq-item__remove:focus-visible {
	outline: var(--focus-w) solid var(--color-focus);
	outline-offset: var(--focus-offset);
}

.wg-tool[data-tool="builders-quote"] .bq-item__grid {
	display: grid;
	gap: var(--space-xs);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wg-tool[data-tool="builders-quote"] .bq-item__type {
	grid-column: 1 / -1;
}

.wg-tool[data-tool="builders-quote"] .bq-item__amount output {
	align-items: center;
	display: flex;
	font-variant-numeric: tabular-nums;
	font-weight: var(--fw-semibold);
	min-block-size: var(--tap);
}

@container (min-width: 30rem) {
	.wg-tool[data-tool="builders-quote"] .bq-item__grid {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
	}

	.wg-tool[data-tool="builders-quote"] .bq-item__type {
		grid-column: auto;
	}

	.wg-tool[data-tool="builders-quote"] .bq-item__amount output {
		justify-content: flex-end;
	}

	.wg-tool[data-tool="builders-quote"] .bq-item__amount .wg-field__label {
		text-align: end;
	}
}

/* Logo */
.wg-tool[data-tool="builders-quote"] .bq-logo input[type="file"] {
	font: inherit;
	font-size: var(--step--1);
	max-inline-size: 100%;
	min-block-size: var(--tap);
}

.wg-tool[data-tool="builders-quote"] .bq-logo__preview {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
}

.wg-tool[data-tool="builders-quote"] .bq-logo__preview img {
	background-color: var(--color-bg);
	border: var(--border-w) solid var(--color-border);
	border-radius: var(--radius-s);
	max-block-size: var(--space-2xl);
	max-inline-size: 12rem;
	object-fit: contain;
	padding: var(--space-3xs);
}

/* Deposit field stays short */
.wg-tool[data-tool="builders-quote"] .bq-deposit .wg-field__control {
	max-inline-size: 10rem;
}

/* VAT number reminder */
.wg-tool[data-tool="builders-quote"] .bq-warn {
	background-color: var(--color-bg-alt);
	border-inline-start: var(--border-w-strong) solid var(--color-accent);
	border-radius: var(--radius-s);
	font-size: var(--step--1);
	margin: 0;
	padding: var(--space-2xs) var(--space-xs);
}

/* Clear and draft note */
.wg-tool[data-tool="builders-quote"] .bq-foot {
	align-items: center;
	border-block-start: var(--border-w) solid var(--color-border);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs) var(--space-s);
	padding-block-start: var(--space-s);
}

.wg-tool[data-tool="builders-quote"] .bq-foot .wg-field__hint {
	flex: 1 1 14rem;
}

/* Result panel: Download PDF is sand on ink (brick fails 3:1 on ink, see DECISIONS.md) */
.wg-tool[data-tool="builders-quote"] .wg-result .wg-tool__btn--primary {
	background-color: var(--color-bg-alt);
	border-color: var(--color-bg-alt);
	color: var(--color-text);
}

.wg-tool[data-tool="builders-quote"] .wg-result .wg-tool__btn--primary:hover {
	background-color: var(--color-bg);
	border-color: var(--color-bg);
}

.wg-tool[data-tool="builders-quote"] .bq-status {
	color: var(--color-text-inverse);
	font-size: var(--step--1);
	margin: 0;
}

.wg-tool[data-tool="builders-quote"] .bq-status:empty {
	display: none;
}
