/**
 * علاقه‌مندی‌ها: دکمه‌ی قلب و شبکه‌ی فهرست.
 * پیام شناور در mah24-toast.css است.
 *
 * فاصله‌ها و جهت‌ها منطقی (logical) هستند تا در RTL و LTR یکسان کار کنند.
 */

/* --------------------------------------------------------- دکمه‌ی قلب */

.mah24-wish-wrap {
	display: inline-flex;
	max-width: 100%;
}

.mah24-wish-wrap--right {
	justify-content: flex-start;
	display: flex;
}

.mah24-wish-wrap--center {
	justify-content: center;
	display: flex;
}

.mah24-wish-wrap--left {
	justify-content: flex-end;
	display: flex;
}

.mah24-wish {
	--mah24-wish-size: 30px;
	--mah24-wish-color: #35091c;
	--mah24-wish-on: #c1123f;

	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 4px;
	border: 0;
	border-radius: 12px;
	background: none;
	box-shadow: none;
	color: var(--mah24-wish-color);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: color 0.25s ease, transform 0.2s ease;
}

.mah24-wish:hover {
	color: var(--mah24-wish-on);
	background: none;
}

.mah24-wish:focus-visible {
	outline: 2px solid var(--mah24-wish-on);
	outline-offset: 2px;
}

.mah24-wish__icon {
	display: block;
	width: var(--mah24-wish-size);
	height: var(--mah24-wish-size);
	flex: 0 0 auto;
}

.mah24-wish__icon path {
	fill: none;
	transition: fill 0.25s ease;
}

.mah24-wish.is-on {
	color: var(--mah24-wish-on);
}

/* حالت «در علاقه‌مندی هست»: همان مسیر، فقط پرشده. */
.mah24-wish.is-on .mah24-wish__icon path {
	fill: currentColor;
}

.mah24-wish__text {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

/* حالت دکمه‌ای (وقتی متن دارد) */
.mah24-wish--labeled {
	padding: 8px 14px;
	border: 1px solid #ece3e6;
	border-radius: 999px;
	background: #fff;
}

.mah24-wish--labeled:hover {
	border-color: var(--mah24-wish-on);
	background: #fff;
}

.mah24-wish--labeled.is-on {
	border-color: var(--mah24-wish-on);
	background: #fdf2f5;
}

/* در حال ارسال درخواست */
.mah24-wish[disabled],
.mah24-wish.is-busy {
	opacity: 0.55;
	cursor: progress;
}

.mah24-wish.is-pop .mah24-wish__icon {
	animation: mah24-wish-pop 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes mah24-wish-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.3); }
	70% { transform: scale(0.92); }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.mah24-wish,
	.mah24-wish__icon path {
		transition: none;
	}

	.mah24-wish.is-pop .mah24-wish__icon {
		animation: none;
	}
}

/* -------------------------------------------------- فهرست علاقه‌مندی */

.mah24-wishlist {
	--line: #ece3e6;
	--ink: #2b2330;
	--muted: #a1959b;
	--wine: #4e1229;

	box-sizing: border-box;
	width: 100%;
	margin: 0 0 32px;
	color: var(--ink);
	line-height: 1.9;
}

.mah24-wishlist *,
.mah24-wishlist *::before,
.mah24-wishlist *::after {
	box-sizing: border-box;
}

.mah24-wishlist__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}

.mah24-wishlist__title {
	color: var(--wine);
	font-size: 17px;
	font-weight: 800;
}

.mah24-wishlist__count {
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
}

.mah24-wishlist__note,
.mah24-wishlist__empty {
	margin: 0;
	padding: 22px 20px;
	border: 1px dashed var(--line);
	border-radius: 16px;
	background: #fdfbfc;
	color: var(--muted);
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

.mah24-wishlist__note {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 10px;
}

.mah24-wishlist__login {
	color: var(--wine);
	font-weight: 800;
	text-decoration: underline;
}

.mah24-wishlist__grid {
	display: grid;
	grid-template-columns: repeat(var(--mah24-cols, 3), minmax(0, 1fr));
	gap: 18px;
}

.mah24-wishlist__grid[hidden] {
	display: none;
}

/*
 * کارت فهرست، همان کارت مشترک افزونه است (.mah24-card). اینجا فقط پوسته‌ی
 * سلول استایل می‌گیرد: کشیده‌شدن تا ته سلول گرید و محوشدن هنگام حذف.
 */
.mah24-wishlist__cell {
	display: flex;
	flex-direction: column;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.mah24-wishlist__cell > .mah24-card {
	flex: 1 1 auto;
}

.mah24-wishlist__cell.is-leaving {
	opacity: 0;
	transform: scale(0.96);
}

/* صفحه‌بندی */

.mah24-wpager {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.mah24-wpager__item {
	min-width: 34px;
	padding: 6px 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	color: var(--ink);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.mah24-wpager__item.is-current,
.mah24-wpager__item:hover {
	border-color: var(--wine);
	background: var(--wine);
	color: #fff;
}

/* واکنش‌گرا */

/* در عرض‌های میانی، تعداد ستون از خودِ فضا درمی‌آید نه از پارامتر شورت‌کد. */
@media (max-width: 900px) {
	.mah24-wishlist__grid {
		grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	}
}

@media (max-width: 560px) {
	.mah24-wishlist__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
