/**
 * monoWishlist - the toggle and the My Account list. Hand-written, no build step (decision 10).
 * Every colour comes from the theme where it can: the button inherits the text colour and only the heart is filled
 * when saved, so a dark theme and a light theme both work without a setting.
 *
 * The one exception is the accent (`accent` in 0.6.0): one custom property, `--mw-accent`, defaults to `currentColor` -
 * which is exactly the 0.5.0 rendering - and is overridden by a one-line <style> block when the shop sets a colour
 * (src/Frontend/Styles.php). The icon stroke and the saved-state fill read it; nothing else does.
 */

.mw-toggle {
	--mw-accent: currentColor;
	align-items: center;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.875em;
	gap: 0.4em;
	line-height: 1.2;
	margin: 0.5em 0;
	min-height: 36px;
	padding: 0.35em 0.85em;
	text-decoration: none;
	transition: background-color 120ms ease, color 120ms ease;
}

.mw-toggle:hover,
.mw-toggle:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
}

.mw-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * The glyph: `stroke` comes from the accent property (default `currentColor`) rather than the SVG's presentation
 * attribute, so a shop colour applies to all four icons without touching the markup. Saved fills the same shape, which
 * works for the heart, the star and the bookmark; a plus has no interior to fill, so with that glyph the saved state is
 * carried by the label and `aria-pressed` alone (noted in CHANGELOG 0.6.0).
 */
.mw-toggle__icon svg {
	stroke: var(--mw-accent);
}

.mw-toggle.is-saved .mw-toggle__icon svg {
	fill: var(--mw-accent);
}

.mw-toggle__icon {
	display: inline-flex;
	line-height: 0;
}

.mw-toggle__count:not(:empty) {
	border-left: 1px solid currentColor;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
	padding-left: 0.45em;
}

.mw-toggle--guest {
	border-style: dashed;
	opacity: 0.9;
}

/*
 * Save for later: a quiet control under the product name on the cart page, in the drawer's action slot next to the
 * heart. It inherits the text colour like the toggle does, so it needs no colour setting.
 */
.mw-save-later {
	align-items: center;
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.8125em;
	gap: 0.3em;
	line-height: 1.2;
	margin: 0.4em 0 0;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mw-save-later:hover,
.mw-save-later:focus-visible {
	color: inherit;
	opacity: 0.75;
}

.mw-save-later:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.mw-save-later[aria-busy="true"] {
	cursor: progress;
	opacity: 0.5;
}

.mw-save-later__label {
	text-decoration: none;
}

.mw-account {
	display: grid;
	gap: 2rem;
}

.mw-status {
	margin: 0 0 1rem;
	min-height: 1.2em;
}

.mw-status.is-error {
	color: #b32d2e;
}

.mw-status.is-success {
	color: #1a7a3c;
}

.mw-list {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	padding: 1rem 1.25rem 1.25rem;
}

.mw-list__head {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-bottom: 1rem;
}

.mw-list__head h2,
.mw-list__title {
	font-size: 1.25rem;
	margin: 0;
}

.mw-list__count {
	color: inherit;
	font-size: 0.9em;
	margin: 0;
	opacity: 0.75;
}

.mw-rename,
.mw-create,
.mw-move,
.mw-move-list {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* 0.6.1: "Move to…" sits next to the action it belongs to, one select and one submit. */
.mw-move select,
.mw-move-list select {
	max-width: 12rem;
}

.mw-create {
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	padding-top: 1rem;
}

.mw-rename .mw-input {
	max-width: 14rem;
}

.mw-delete {
	margin-left: auto;
}

.mw-items {
	display: grid;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mw-item {
	align-items: center;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	display: grid;
	gap: 0.75rem 1rem;
	grid-template-columns: 72px 1fr auto;
	padding-top: 0.75rem;
}

.mw-item__thumb img {
	border-radius: 6px;
	display: block;
	height: auto;
	max-width: 72px;
}

.mw-item__body {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.mw-item__name {
	font-weight: 600;
	text-decoration: none;
}

.mw-item__name:hover,
.mw-item__name:focus-visible {
	text-decoration: underline;
}

.mw-item__price {
	font-variant-numeric: tabular-nums;
}

.mw-item__qty,
.mw-item__unavailable {
	font-size: 0.85em;
	opacity: 0.75;
}

.mw-item__actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-end;
}

.mw-button {
	background: rgba(0, 0, 0, 0.06);
	border: 1px solid currentColor;
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-size: 0.9em;
	line-height: 1.3;
	padding: 0.4em 0.9em;
	text-decoration: none;
}

.mw-button--quiet,
.mw-button.mw-button--quiet {
	background: transparent;
	border-color: rgba(0, 0, 0, 0.25);
}

.mw-button:focus-visible,
.mw-input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.mw-input {
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	font: inherit;
	padding: 0.35em 0.5em;
}

.mw-empty {
	margin: 0;
	opacity: 0.8;
}

@media (max-width: 480px) {
	.mw-item {
		grid-template-columns: 56px 1fr;
	}

	.mw-item__thumb img {
		max-width: 56px;
	}

	.mw-item__actions {
		grid-column: 1 / -1;
		justify-content: flex-start;
	}

	.mw-toggle {
		min-height: 44px;
		padding: 0.5em 1em;
	}
}

/*
 * Icon-only toggle: the monoCheckout drawer's per-item action column is one icon wide, and a "Save / Saved" pill
 * there would stretch the row. Same markup and the same accessible name - only the visible label is dropped.
 */
.mw-toggle--icon {
	justify-content: center;
	margin: 0;
	padding: 0.4em;
	min-width: 2.25em;
	min-height: 2.25em;
}

@media (pointer: coarse) {
	.mw-toggle--icon {
		min-width: 44px;
		min-height: 44px;
	}
}

/*
 * The monoAccount dashboard card ("Saved items"). Same tokens as the account page: no new colours, one thumbnail
 * size, two lines of text at most.
 */
.mw-widget__count {
	margin: 0 0 0.75em;
	font-weight: 600;
}

.mw-widget__list {
	list-style: none;
	margin: 0 0 0.75em;
	padding: 0;
	display: grid;
	gap: 0.5em;
}

.mw-widget__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
}

.mw-widget__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	min-width: 0;
}

.mw-widget__thumb img {
	display: block;
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 6px;
}

.mw-widget__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mw-widget__price {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mw-widget__empty {
	margin: 0;
	opacity: 0.8;
}

.mw-widget__more {
	display: inline-block;
}

/*
 * Text-only variant: the same link without the pill chrome. Used when a theme's product card is already busy and a
 * bordered pill competes with the add-to-cart button.
 */
.mw-toggle--text {
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mw-toggle--text:hover,
.mw-toggle--text:focus-visible {
	background: none;
	text-decoration-thickness: 2px;
}

/*
 * Sharing a list (0.8.0).
 *
 * The account row: the button and the link field sit on one line where there is room, and stack on a narrow screen. The
 * public page reuses .mw-items / .mw-item so it inherits the same product list a theme already styles.
 */
.mw-share-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0.5rem 0;
}

.mw-share-row__form {
	display: contents;
	margin: 0;
}

.mw-share-row__url {
	flex: 1 1 18rem;
	min-width: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.875em;
}

.mw-share-row__hint {
	flex: 1 1 100%;
	margin: 0;
	font-size: 0.8125em;
	opacity: 0.8;
}

.mw-share__main {
	margin: 0 auto;
	padding: 2rem 1rem;
	max-width: 72rem;
}

.mw-share__title {
	margin: 0 0 0.25rem;
}

.mw-share__note {
	margin: 0 0 1.5rem;
	font-size: 0.875em;
	opacity: 0.8;
}
