/*
 * Mini cart lines.
 *
 * One list item per basket line inside WooCommerce's scrolling items block
 * (which pads 16px itself): image left, the body in the middle (name; one
 * row of unit price with quantity and remove; the line's offer or its
 * saving), the totals right. The offer's bar is the Progress bar block's track and fill in its
 * Discreet style (its stylesheet is shared); the strokes and the image
 * width are the literal sizes here.
 */
.wage-mini-cart-lines {
	list-style: none;
	margin: 0 0 auto;
	padding: 0;
}

.wage-mini-cart-lines__line {
	display: grid;
	grid-template-columns: 5rem minmax(0, 1fr) auto;
	gap: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--s);
	align-items: start;
	padding: var(--wp--preset--spacing--s) 0;
}

.wage-mini-cart-lines__line + .wage-mini-cart-lines__line {
	border-top: var(--wp--custom--border--width) solid var(--wp--custom--border--color);
}

.wage-mini-cart-lines__media[hidden],
.wage-mini-cart-lines__was[hidden],
.wage-mini-cart-lines__saving[hidden],
.wage-mini-cart-lines__rule[hidden],
.wage-mini-cart-lines__unit[hidden],
.wage-mini-cart-lines__controls[hidden],
.wage-mini-cart-lines__quantity[hidden],
.wage-mini-cart-lines__step[hidden] {
	display: none;
}

.wage-mini-cart-lines__media {
	display: block;
	line-height: 0;
}

/* The product image at the store's own ratio and fit (theme.json custom.product.image), as every product image is. */
.wage-mini-cart-lines__image {
	aspect-ratio: var(--wp--custom--product--image--aspect-ratio);
	border-radius: var(--wp--preset--border-radius--s);
	display: block;
	object-fit: var(--wp--custom--product--image--fit);
	width: 100%;
}

.wage-mini-cart-lines__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
	min-width: 0;
}

.wage-mini-cart-lines__name {
	font-weight: var(--wp--custom--font-weight--bold);
	overflow-wrap: anywhere;
}

.wage-mini-cart-lines__unit,
.wage-mini-cart-lines__saving,
.wage-mini-cart-lines__totals {
	margin: 0;
}

.wage-mini-cart-lines__unit,
.wage-mini-cart-lines__saving,
.wage-mini-cart-lines__offer {
	font-size: var(--wp--preset--font-size--x-small);
	line-height: var(--wp--custom--line-height--snug);
}

/* What it was: before a sale or a discount, struck and muted. */
.wage-mini-cart-lines__was {
	color: var(--wp--custom--contrast--muted);
	margin-right: var(--wp--preset--spacing--xxs);
}

/* One row: the unit price left, the controls right. */
.wage-mini-cart-lines__meta {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--s);
	justify-content: space-between;
}

/* The line's offer: a bar across, the ask under it. Nothing to ask: no room taken. */
.wage-mini-cart-lines__offer {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xxs);
}

.wage-mini-cart-lines__offer:not(.is-asking) {
	display: none;
}

.wage-mini-cart-lines__ask {
	min-width: 0;
}

/* The quantity steps and remove: small controls in the text colour. */
.wage-mini-cart-lines__step,
.wage-mini-cart-lines__remove {
	background: transparent;
	border: var(--wp--custom--border--width) solid currentColor;
	border-radius: var(--wp--preset--border-radius--s);
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: var(--wp--custom--line-height--snug);
}

/* The saving: the rule's name, then the figure in bold. */
.wage-mini-cart-lines__saved {
	font-weight: var(--wp--custom--font-weight--bold);
}

.wage-mini-cart-lines__rule::after {
	content: " · ";
}

.wage-mini-cart-lines__controls {
	align-items: center;
	display: flex;
	gap: var(--wp--preset--spacing--s);
}

/* The quantity selector: one bordered box, the steps and the figure inside it. */
.wage-mini-cart-lines__quantity {
	align-items: center;
	border: var(--wp--custom--border--width) solid var(--wp--custom--border--color);
	border-radius: var(--wp--preset--border-radius--s);
	display: inline-flex;
}

.wage-mini-cart-lines__step {
	border: 0;
	padding: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--xs);
}

.wage-mini-cart-lines__step:disabled {
	cursor: default;
	opacity: 0.4;
}

.wage-mini-cart-lines__input {
	appearance: textfield;
	-moz-appearance: textfield;
	background: transparent;
	border: 0;
	color: inherit;
	font: inherit;
	font-weight: var(--wp--custom--font-weight--bold);
	padding: var(--wp--preset--spacing--xxs) 0;
	text-align: center;
	width: 2.5rem;
}

.wage-mini-cart-lines__input::-webkit-inner-spin-button,
.wage-mini-cart-lines__input::-webkit-outer-spin-button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
}

.wage-mini-cart-lines__remove {
	border: 0;
	display: inline-flex;
	padding: var(--wp--preset--spacing--xxs);
}

.wage-mini-cart-lines__remove svg {
	fill: currentColor;
}

/* The totals: what the line costs, what it was above it. */
.wage-mini-cart-lines__totals {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: var(--wp--custom--line-height--snug);
	white-space: nowrap;
}

.wage-mini-cart-lines__totals .wage-mini-cart-lines__was {
	font-size: var(--wp--preset--font-size--x-small);
	margin: 0;
	order: -1;
}

.wage-mini-cart-lines__total {
	font-weight: var(--wp--custom--font-weight--bold);
}
