/*
 * Metric Horizon Favorites - toggles, counter and the selection page.
 * Uses --mh-* tokens from mh-core.
 */

/* ---------------- heart toggle ---------------- */
.mh-fav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--mh-text-muted, #5a6473);
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.mh-fav-toggle__icon {
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1L12 21l7.7-7.6 1.1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1L12 21l7.7-7.6 1.1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.mh-fav-toggle:hover {
	color: var(--mh-primary, #0a1b4d);
	border-color: var(--mh-primary, #0a1b4d);
	transform: translateY(-1px);
}

.mh-fav-toggle.is-active {
	color: var(--mh-accent, #c9a14a);
	border-color: var(--mh-accent, #c9a14a);
}

/* ---------------- header counter ---------------- */
.mh-fav-count {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	text-decoration: none;
	color: inherit;
	font-family: "Manrope", sans-serif;
	font-weight: 600;
	font-size: 14px;
}

.mh-fav-count__icon {
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1L12 21l7.7-7.6 1.1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1L12 21l7.7-7.6 1.1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.mh-fav-count__badge {
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--mh-primary, #0a1b4d);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---------------- selection page ---------------- */
.mh-favorites__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.mh-fav-card {
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-m, 16px);
	overflow: hidden;
	background: var(--mh-white, #fff);
	display: flex;
	flex-direction: column;
}

.mh-fav-card__media img {
	width: 100%;
	height: 170px;
	object-fit: cover;
	display: block;
}

.mh-fav-card__body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mh-fav-card__title {
	font-family: "Manrope", sans-serif;
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	line-height: 1.25;
}

.mh-fav-card__title a {
	color: var(--mh-primary, #0a1b4d);
	text-decoration: none;
}

.mh-fav-card__loc {
	font-size: 13px;
	color: var(--mh-text-muted, #5a6473);
}

.mh-fav-card__price {
	font-family: "Manrope", sans-serif;
	font-weight: 700;
	font-size: 16px;
	color: var(--mh-text, #1c1f26);
}

.mh-fav-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-top: 6px;
	font-size: 13px;
}

.mh-fav-card__link {
	color: var(--mh-secondary, #1e5ed6);
}

.mh-fav-card__remove {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: var(--mh-text-muted, #5a6473);
	font-size: 13px;
	text-decoration: underline;
	margin-left: auto;
}

.mh-favorites__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 24px 0 8px;
}

.mh-favorites__empty {
	color: var(--mh-text-muted, #5a6473);
}

/* ---------------- manager form ---------------- */
.mh-favorites__form {
	margin-top: 28px;
	max-width: 520px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--mh-surface, #f4f6fa);
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-l, 24px);
	padding: 24px;
}

.mh-favorites__form-title {
	font-family: "Manrope", sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--mh-primary, #0a1b4d);
	margin: 0;
}

.mh-favorites__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mh-favorites__row label {
	font-family: "Manrope", sans-serif;
	font-size: 13px;
	font-weight: 700;
}

.mh-favorites__row input {
	padding: 12px 14px;
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-s, 12px);
	background: #fff;
	font-size: 15px;
	font-family: inherit;
}

.mh-favorites__row input:focus {
	outline: none;
	border-color: var(--mh-primary, #0a1b4d);
	box-shadow: 0 0 0 3px rgba(10, 27, 77, 0.12);
}

.mh-favorites__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	line-height: 1.45;
	color: var(--mh-text-muted, #5a6473);
	cursor: pointer;
}

.mh-favorites__consent input {
	margin-top: 2px;
	width: 17px;
	height: 17px;
	accent-color: var(--mh-primary, #0a1b4d);
}

.mh-favorites__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mh-favorites__note {
	margin: 0;
	font-size: 14px;
	min-height: 1em;
}

.mh-favorites__note.is-success { color: #1a7f4b; }
.mh-favorites__note.is-error { color: #c0392b; }

/* Shared button styles when the theme does not provide them. */
.mh-favorites .mh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 22px;
	border-radius: var(--mh-radius-s, 12px);
	font-family: "Manrope", sans-serif;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	border: 1px solid var(--mh-border, #e1e5ee);
	background: #fff;
	color: var(--mh-primary, #0a1b4d);
	text-decoration: none;
	transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.mh-favorites .mh-btn--primary {
	background: var(--mh-primary, #0a1b4d);
	border-color: var(--mh-primary, #0a1b4d);
	color: #fff;
}

.mh-favorites .mh-btn--primary:hover {
	background: var(--mh-primary-hover, #0d3b8e);
}

.mh-favorites .mh-btn--ghost:hover {
	border-color: var(--mh-primary, #0a1b4d);
}

.mh-favorites .mh-btn:disabled {
	opacity: 0.6;
	cursor: default;
}
