/* Native product cards and account favorites share one compact, accessible control. */
.mrwax-favorite-form {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
}

.woocommerce ul.products > li.product > .mrwax-favorite--card {
	position: absolute;
	inset-block-start: 0.75rem;
	inset-inline-end: 0.75rem;
	z-index: 4;
}

/* Keep the native sale badge readable rather than placing a heart over it. */
.woocommerce ul.products > li.product:has(.onsale) > .mrwax-favorite--card {
	inset-block-start: 3.5rem;
}

.mrwax-favorite-toggle,
.mrwax-favorite-login {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	min-inline-size: 44px;
	min-block-size: 44px;
	margin: 0;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--wp--preset--color--mrwax-bronze);
	border-radius: 6px;
	background: var(--wp--preset--color--mrwax-canvas);
	color: var(--wp--preset--color--mrwax-muted);
	font-family: var(--wp--preset--font-family--mrwax-body);
	font-size: 0.8125rem;
	font-weight: var(--wp--custom--mrwax--font-weight--medium);
	line-height: 1.35;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease;
}

.mrwax-favorite--card .mrwax-favorite-toggle,
.mrwax-favorite-login.mrwax-favorite--card {
	inline-size: 44px;
	block-size: 44px;
	padding: 0;
	border-radius: 50%;
	box-shadow: 0 0.125rem 0.5rem color-mix(in srgb, var(--wp--preset--color--mrwax-ink) 12%, transparent);
}

.mrwax-favorite-icon {
	display: inline-flex;
	flex: 0 0 auto;
	inline-size: 20px;
	block-size: 20px;
	color: var(--wp--preset--color--mrwax-danger);
	fill: none;
	stroke: currentColor;
	stroke-width: 1.65;
	pointer-events: none;
}

.mrwax-favorite-icon > svg {
	inline-size: 100%;
	block-size: 100%;
}

.mrwax-favorite-toggle[aria-pressed="true"] .mrwax-favorite-icon {
	fill: currentColor;
}

.mrwax-favorite-toggle:is(:hover, :active),
.mrwax-favorite-login:is(:hover, :active) {
	background: var(--wp--preset--color--mrwax-bronze-light);
	color: var(--wp--preset--color--mrwax-muted);
	text-decoration: none;
}

.mrwax-favorite-toggle:focus-visible,
.mrwax-favorite-login:focus-visible {
	outline: var(--wp--custom--mrwax--focus--width) solid var(--wp--preset--color--mrwax-ink);
	outline-offset: var(--wp--custom--mrwax--focus--width);
	box-shadow: 0 0 0 var(--wp--custom--mrwax--focus--width) var(--wp--preset--color--mrwax-surface);
}

.mrwax-favorite-toggle[aria-disabled="true"] {
	cursor: progress;
	opacity: 0.7;
}

.mrwax-favorite--card .mrwax-favorite-label {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

.mrwax-favorite--single {
	margin-block: 0.9rem;
}

.mrwax-favorites-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-block-end: 1.5rem;
}

.mrwax-favorites-header > :is(h2, p) {
	margin: 0;
}

.mrwax-favorites-count {
	color: var(--wp--preset--color--mrwax-muted);
	font-size: 0.8125rem;
}

/* Reserve consistent columns even when the saved selection has one product. */
body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites ul.products {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

/* Account copy/link rules do not turn native product links into text links. */
body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites .woocommerce-LoopProduct-link {
	color: var(--wp--preset--color--mrwax-ink);
	text-decoration: none;
}

body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites .woocommerce-loop-product__title {
	font-size: 1.08rem;
	line-height: 1.22;
}

body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites .mrwax-favorite-login {
	text-decoration: none;
}

.mrwax-favorites-empty {
	padding: 1.75rem;
	border: 1px solid var(--wp--preset--color--mrwax-border);
	border-radius: 6px;
	background: var(--wp--preset--color--mrwax-canvas);
}

.mrwax-favorites-empty > :first-child {
	margin-block-start: 0;
}

.mrwax-favorites-empty > :last-child {
	margin-block-end: 0;
}

.mrwax-favorites-pagination {
	margin-block-start: 1.5rem;
}

@media (width <= 1100px) {
	body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (width <= 640px) {
	body.mrwax-account-member-route .woocommerce-MyAccount-content .mrwax-favorites ul.products {
		grid-template-columns: minmax(0, 1fr);
	}

	.mrwax-favorites-empty {
		padding: 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mrwax-favorite-toggle,
	.mrwax-favorite-login {
		transition: none;
	}
}

@media (forced-colors: active) {
	.mrwax-favorite-icon {
		color: ButtonText;
	}

	.mrwax-favorite-toggle,
	.mrwax-favorite-login,
	.mrwax-favorite-toggle:is(:hover, :active),
	.mrwax-favorite-login:is(:hover, :active) {
		border-color: ButtonText;
		background: ButtonFace;
		color: ButtonText;
		box-shadow: none;
	}

	.mrwax-favorite-toggle:focus-visible,
	.mrwax-favorite-login:focus-visible {
		outline-color: Highlight;
		box-shadow: none;
	}

	.mrwax-favorites-empty {
		border-color: CanvasText;
		background: Canvas;
		color: CanvasText;
		box-shadow: none;
	}
}
