/**
 * Страницы «Сравнение» и «Избранное».
 * Цвета и стили в палитре темы (--mav-*).
 */

.mav-list-page {
	padding: 2rem 0 3rem;
	min-height: 50vh;
}

.mav-list-section {
	position: relative;
}

.mav-list-section__title {
	margin: 0 0 1.5rem;
	color: var(--mav-heading);
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.25;
}

/* ----- Загрузка ----- */
.mav-list-section__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 3rem 1rem;
	text-align: center;
}

.mav-list-section__loading--hidden {
	display: none !important;
}

.mav-list-section__loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--mav-border);
	border-top-color: var(--mav-primary);
	border-radius: 50%;
	animation: mav-list-spin 0.8s linear infinite;
}

.mav-list-section__loading-text {
	color: var(--mav-text);
	font-size: 1rem;
}

@keyframes mav-list-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ----- Пустое состояние ----- */
.mav-list-section__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	padding: 3rem 1rem;
	text-align: center;
	background: #fff;
	border: 1px solid var(--mav-border);
	border-radius: 12px;
	box-shadow: var(--mav-shadow);
}

.mav-list-section__empty--hidden {
	display: none !important;
}

.mav-list-section__empty-text {
	margin: 0;
	color: var(--mav-text);
	font-size: 1.0625rem;
	line-height: 1.5;
	max-width: 28em;
}

.mav-list-section__empty-btn {
	display: inline-block;
	padding: 0.6rem 1.25rem;
	background: var(--mav-btn-primary) !important;
	color: #fff !important;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s, transform 0.15s;
}

.mav-list-section__empty-btn:hover {
	background: var(--mav-btn-primary-hover) !important;
	color: #fff !important;
	transform: translateY(-1px);
}

/* ----- Сетка товаров ----- */
.mav-list-section__grid {
	transition: opacity 0.2s ease;
}

.mav-list-section__grid--hidden {
	display: none !important;
}

/* ----- Таблица сравнения товаров ----- */
.mav-compare-table-wrap {
	overflow-x: auto;
	background: #fff;
	border: 1px solid var(--mav-border);
	border-radius: 12px;
	box-shadow: var(--mav-shadow);
}

.mav-compare-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.mav-compare-table th,
.mav-compare-table td {
	padding: 12px 14px;
	vertical-align: top;
	border-bottom: 1px solid var(--mav-border);
	text-align: left;
}

.mav-compare-table thead th {
	background: rgba(51, 122, 183, 0.06);
	color: var(--mav-heading);
	font-weight: 600;
}

.mav-compare-table__attr-col {
	width: 18%;
	min-width: 140px;
	color: var(--mav-text);
	font-weight: 500;
}

.mav-compare-table__product-col {
	min-width: 160px;
}

.mav-compare-table__product-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.mav-compare-table__img {
	display: block;
	width: 120px;
	height: 120px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--mav-bg);
}

.mav-compare-table__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.mav-compare-table__name {
	font-weight: 600;
	color: var(--mav-link);
	text-decoration: none;
	text-align: center;
	line-height: 1.3;
}

.mav-compare-table__name:hover {
	color: var(--mav-link-hover);
}

.mav-compare-table__remove {
	margin-top: 4px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
}

.mav-compare-table tbody tr:hover .mav-compare-table__attr-col {
	background: rgba(51, 122, 183, 0.04);
}

@media (max-width: 767.98px) {
	.mav-compare-table th,
	.mav-compare-table td {
		padding: 10px 8px;
		font-size: 0.875rem;
	}
	.mav-compare-table__attr-col {
		min-width: 100px;
	}
	.mav-compare-table__product-col {
		min-width: 130px;
	}
	.mav-compare-table__img {
		width: 80px;
		height: 80px;
	}
}

/* Специфика страницы сравнения: можно позже добавить таблицу сравнения */
.mav-compare-page .mav-list-section__title::before {
	content: "";
	display: inline-block;
	width: 0.35em;
	height: 1em;
	margin-right: 0.35em;
	vertical-align: -0.1em;
	background: var(--mav-primary);
	border-radius: 2px;
}

.mav-favorites-page .mav-list-section__title::before {
	content: "";
	display: inline-block;
	width: 0.4em;
	height: 0.4em;
	margin-right: 0.4em;
	vertical-align: 0.15em;
	background: var(--mav-btn-primary);
	border-radius: 50%;
}

.mav-recently-viewed-page .mav-list-section__title::before {
	content: "";
	display: inline-block;
	width: 0.35em;
	height: 0.35em;
	margin-right: 0.4em;
	vertical-align: 0.2em;
	background: var(--mav-accent-orange);
	border-radius: 50%;
}

@media (max-width: 767.98px) {
	.mav-list-page {
		padding: 1.25rem 0 2rem;
	}
	.mav-list-section__title {
		font-size: 1.375rem;
		margin-bottom: 1.25rem;
	}
	.mav-list-section__empty,
	.mav-list-section__loading {
		padding: 2rem 1rem;
	}
}
