/**
 * Roark – Favorites / Wishlist
 *
 * Structural styles for the heart toggle, the favorites counter and the
 * favorites page grid. Colours are intentionally minimal so the buttons inherit
 * the surrounding theme where possible.
 */

/* ── Heart toggle (on cards) ────────────────────────────────────────────── */
.roark-fav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.9 );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 );
	color: #6b7280;
	cursor: pointer;
	line-height: 1;
	transition: transform 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.roark-fav-toggle:hover {
	transform: scale( 1.08 );
	color: #ef4444;
}

.roark-fav-toggle__icon {
	font-size: 1.25rem;
	line-height: 1;
	pointer-events: none;
}

/* Outline heart by default, filled red when active. */
.roark-fav-toggle .roark-fav-toggle__icon::before {
	content: '\2661'; /* ♡ */
}

.roark-fav-toggle.is-active {
	color: #ef4444;
}

.roark-fav-toggle.is-active .roark-fav-toggle__icon::before {
	content: '\2665'; /* ♥ */
}

/* When placed over a card image, pin it to the top-right corner. */
.roark-fav-toggle--overlay {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 3;
}

/* ── Favorites counter (nav / header) ───────────────────────────────────── */
.roark-fav-count {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	text-decoration: none;
}

.roark-fav-count__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4em;
	height: 1.4em;
	padding: 0 0.35em;
	border-radius: var(--roark-radius-pill, 999px);
	background: #ef4444;
	color: #fff;
	font-size: 0.8em;
	line-height: 1;
}

.roark-fav-count__badge.roark-fav-count--empty {
	background: #9ca3af;
}

/* ── Favorites page ─────────────────────────────────────────────────────── */
.roark-favorites {
	width: 100%;
}

.roark-favorites__grid {
	display: grid;
	grid-template-columns: repeat( var( --roark-fav-columns, 3 ), minmax( 0, 1fr ) );
	gap: 1.5rem;
}

.roark-favorites__item {
	position: relative;
	min-width: 0;
}

.roark-favorites__empty {
	text-align: center;
	padding: 2rem 1rem;
	color: #6b7280;
}

.roark-favorites.is-loading {
	opacity: 0.6;
}

@media (max-width: 1024px) {
	.roark-favorites__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media (max-width: 600px) {
	.roark-favorites__grid {
		grid-template-columns: 1fr;
	}
}

/* Touch target ≥ 44px on mobile (docs/plans/audit-2026-09/design.md §4/§8). */
@media (max-width: 767px) {
	.roark-fav-toggle {
		width: 44px;
		height: 44px;
	}
}
