/*
 * Yuen Zeon Core: base styles for the quote list, spec table, size picker and form.
 * Low specificity (:where) so Bricks classes and global styles override without !important.
 * Colours follow the Yuen Zeon design system; map them to Bricks variables if you prefer.
 */
:root {
	--yz-surface: #f3f4ef;
	--yz-raised: #ffffff;
	--yz-line: #d9ddd4;
	--yz-ink: #16201b;
	--yz-muted: #56625b;
	--yz-evergreen: #1f3a2e;
	--yz-on-evergreen: #f3f4ef;
	--yz-brass: #b08d57;
	--yz-brass-ink: #7f622e;
	--yz-berry: #7a1f2b;
	--yz-focus: #2f6b4f;
	--yz-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
	--yz-radius: 2px;
}

/* ft / cm: show one unit at a time. */
:where(html[data-yz-units="imperial"]) [data-yz-unit="metric"],
:where(html[data-yz-units="metric"]) [data-yz-unit="imperial"],
:where(html:not([data-yz-units])) [data-yz-unit="metric"] {
	display: none;
}

:where(.yz-sr) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Buttons */
:where(.yz-quote-add, .yz-form__submit, .yz-quote-list__browse) {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid var(--yz-evergreen);
	border-radius: var(--yz-radius);
	background: var(--yz-evergreen);
	color: var(--yz-on-evergreen);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
a.yz-quote-list__browse,
a.yz-quote-list__browse:hover {
	color: var(--yz-on-evergreen, #f3f2ec);
}
:where(.yz-quote-add.is-added) {
	background: transparent;
	color: var(--yz-evergreen);
}
:where(.yz-quote-add.is-added) .yz-quote-add__label::before {
	content: "✓ ";
}
:where(.yz-quote-add, .yz-form__submit, .yz-units__btn, .yz-size input, .yz-quote-item__remove, .yz-quote-list__clear):focus-visible {
	outline: 2px solid var(--yz-focus);
	outline-offset: 2px;
}
:where(.yz-form__submit:disabled) {
	opacity: 0.6;
	cursor: progress;
}

/* ft / cm toggle */
:where(.yz-units) {
	display: inline-flex;
	border: 1px solid var(--yz-line);
	border-radius: var(--yz-radius);
}
:where(.yz-units__btn) {
	min-width: 44px;
	min-height: 36px;
	border: 0;
	background: transparent;
	color: var(--yz-muted);
	font: 500 13px/1 var(--yz-mono);
	cursor: pointer;
}
:where(.yz-units__btn[aria-pressed="true"]) {
	background: var(--yz-ink);
	color: var(--yz-surface);
}

/* Size picker */
:where(.yz-sizes) {
	margin: 0;
	padding: 0;
	border: 0;
}
:where(.yz-sizes__legend) {
	margin-bottom: 8px;
	color: var(--yz-muted);
	font: 500 12px/1.4 var(--yz-mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
:where(.yz-sizes__options) {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	border: 1px solid var(--yz-line);
	border-radius: var(--yz-radius);
	width: fit-content;
}
:where(.yz-size) {
	position: relative;
}
:where(.yz-size + .yz-size) {
	border-left: 1px solid var(--yz-line);
}
:where(.yz-size input) {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}
:where(.yz-size__label) {
	display: block;
	min-width: 72px;
	padding: 12px 16px;
	font: 500 14px/20px var(--yz-mono);
	text-align: center;
}
:where(.yz-size input:checked + .yz-size__label) {
	background: var(--yz-ink);
	color: var(--yz-surface);
}
:where(.yz-size input:focus-visible + .yz-size__label) {
	outline: 2px solid var(--yz-focus);
	outline-offset: -2px;
}

/* Spec sheet with dotted leaders */
:where(.yz-spec) {
	margin: 0;
	font: 400 14px/20px var(--yz-mono);
}
:where(.yz-spec__row) {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--yz-line);
}
:where(.yz-spec__row[hidden]) {
	display: none;
}
:where(.yz-spec__label) {
	flex: none;
	color: var(--yz-muted);
}
:where(.yz-spec__row)::before {
	content: "";
	flex: 1 1 24px;
	order: 1;
	min-width: 24px;
	border-bottom: 1px dotted var(--yz-muted);
	transform: translateY(-5px);
	opacity: 0.6;
}
:where(.yz-spec__value) {
	order: 2;
	margin: 0;
	color: var(--yz-ink);
	text-align: right;
}

/* Quote list */
:where(.yz-quote-list__items) {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--yz-line);
}
:where(.yz-quote-item) {
	display: grid;
	grid-template-columns: 72px 1fr auto auto;
	gap: 16px;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px solid var(--yz-line);
}
:where(.yz-quote-item:not(:has(img))) {
	grid-template-columns: 1fr auto auto;
}
:where(.yz-quote-item__img) {
	width: 72px;
	height: 72px;
	object-fit: cover;
	background: var(--yz-raised);
}
:where(.yz-quote-item__title) {
	color: var(--yz-ink);
	font-weight: 600;
	text-decoration: none;
}
:where(.yz-quote-item__meta) {
	margin: 4px 0 0;
	color: var(--yz-muted);
	font: 400 13px/18px var(--yz-mono);
}
:where(.yz-quote-item__qty) {
	display: grid;
	gap: 4px;
	font-size: 12px;
	color: var(--yz-muted);
}
:where(.yz-quote-item__qty-input) {
	width: 110px;
	min-height: 40px;
	padding: 0 10px;
	border: 1px solid var(--yz-line);
	border-radius: var(--yz-radius);
	background: var(--yz-raised);
	font: 500 14px/1 var(--yz-mono);
	color: var(--yz-ink);
}
:where(.yz-quote-item__remove, .yz-quote-list__clear) {
	border: 0;
	background: none;
	color: var(--yz-muted);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	min-height: 40px;
}
:where(.yz-quote-list__clear) {
	margin-top: 12px;
}
:where(.yz-quote-list__empty) {
	color: var(--yz-muted);
}
@media (max-width: 600px) {
	:where(.yz-quote-item) {
		grid-template-columns: 56px 1fr;
	}
	:where(.yz-quote-item__img) {
		width: 56px;
		height: 56px;
	}
	:where(.yz-quote-item__qty, .yz-quote-item__remove) {
		grid-column: 2;
		justify-self: start;
	}
}

/* Form */
:where(.yz-form) {
	display: grid;
	gap: 24px;
}
:where(.yz-form__grid) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px 24px;
}
:where(.yz-form__field) {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}
:where(.yz-form__label) {
	color: var(--yz-ink);
	font-size: 14px;
	font-weight: 600;
}
:where(.yz-form__opt) {
	color: var(--yz-muted);
	font-weight: 400;
}
:where(.yz-form__req) {
	color: var(--yz-berry);
}
:where(.yz-form__input) {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--yz-line);
	border-radius: var(--yz-radius);
	background: var(--yz-raised);
	color: var(--yz-ink);
	font: inherit;
	box-sizing: border-box;
}
:where(textarea.yz-form__input) {
	min-height: 140px;
	resize: vertical;
}
:where(.yz-form__input):focus-visible {
	outline: 2px solid var(--yz-focus);
	outline-offset: 0;
	border-color: transparent;
}
:where(.yz-form__input[aria-invalid="true"]) {
	border-color: var(--yz-berry);
}
:where(.yz-form__error) {
	color: var(--yz-berry);
	font-size: 13px;
}
:where(.yz-form__choices) {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	padding-top: 4px;
}
:where(.yz-form__choice) {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
}
:where(.yz-form__trap) {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
:where(.yz-form__privacy) {
	margin: 0;
	color: var(--yz-muted);
	font-size: 13px;
}
:where(.yz-form__status, .yz-form__notice--error) {
	margin: 0;
	padding: 12px 16px;
	border-left: 3px solid var(--yz-berry);
	background: var(--yz-raised);
}
:where(.yz-form__notice--ok) {
	padding: 12px 16px;
	border-left: 3px solid var(--yz-evergreen);
	background: var(--yz-raised);
}
:where(.yz-form__status[hidden]) {
	display: none;
}
