/**
 * Eletricx — página da lista de favoritos.
 *
 * Depende de catalog.css (tokens e o card do produto). Aqui só entra o que é
 * da página: cabeçalho com contagem, grade, selo de estoque, botão de remover,
 * estado vazio e o esqueleto de carregamento do visitante.
 *
 * Escopado por body.elx-wishlist-page.
 */

.elx-wishlist-page .elx-wishlist {
	--elx-wish-cols: 4;
	--elx-wish-gap: 33px;
	max-width: var(--content-width, 1213px);
	margin: 0 auto;
	font-family: var(--elx-sans);
	color: var(--elx-text);
}

/* ------------------------------------------------------------ cabeçalho -- */

.elx-wishlist-page .elx-wishlist__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 32px;
	flex-wrap: wrap;
	margin: 0 0 32px;
}

.elx-wishlist-page .elx-wishlist__heading {
	min-width: 0;
	flex: 1 1 420px;
}

.elx-wishlist-page .elx-wishlist__title {
	margin: 0;
	font-family: var(--elx-display);
	font-size: 42px;
	font-weight: 700;
	line-height: 1.15;
	color: var(--elx-green);
}

.elx-wishlist-page .elx-wishlist__sub {
	margin: 10px 0 0;
	max-width: 640px;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--elx-text);
}

.elx-wishlist-page .elx-wishlist__tools {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.elx-wishlist-page .elx-wishlist__count {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--elx-tint);
	color: var(--elx-green-dark);
	font-family: var(--elx-display);
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}

.elx-wishlist-page .elx-wishlist__clear {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--elx-line);
	border-radius: var(--elx-radius-field);
	background: #fff;
	color: var(--elx-text);
	font-family: var(--elx-sans);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.elx-wishlist-page .elx-wishlist__clear:hover,
.elx-wishlist-page .elx-wishlist__clear:focus-visible {
	border-color: var(--elx-green);
	color: var(--elx-green);
	outline: none;
}

.elx-wishlist-page .elx-wishlist__clear.is-confirming {
	border-color: #c0392b;
	background: rgba(192, 57, 43, 0.08);
	color: #c0392b;
}

.elx-wishlist-page .elx-wishlist__clear[disabled] {
	opacity: 0.6;
	cursor: wait;
}

/* Sem produtos não há o que contar nem limpar. */
.elx-wishlist-page .elx-wishlist--empty .elx-wishlist__clear,
.elx-wishlist-page .elx-wishlist--loading .elx-wishlist__clear {
	display: none;
}

/* ---------------------------------------------------------------- grade -- */

.elx-wishlist-page .elx-wishlist__grid {
	display: grid;
	grid-template-columns: repeat(var(--elx-wish-cols), minmax(0, 1fr));
	gap: var(--elx-wish-gap);
	align-items: stretch;
}

.elx-wishlist-page .elx-wishlist--empty .elx-wishlist__grid,
.elx-wishlist-page .elx-wishlist--loading .elx-wishlist__grid {
	display: none;
}

.elx-wishlist-page .elx-wishlist__item {
	position: relative;
	min-width: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.elx-wishlist-page .elx-wishlist__item.is-leaving {
	opacity: 0;
	transform: scale(0.96);
}

/* O item de loop dentro do envelope: mesmo card da listagem, altura cheia. */
.elx-wishlist-page .elx-wishlist__item > .e-loop-item,
.elx-wishlist-page .elx-wishlist__item > .e-loop-item > .elx-card-product {
	height: 100%;
}

/* O card sobe 4px ao passar o mouse (catalog.css); selo e "remover" vão junto. */
@media (hover: hover) and (pointer: fine) {
	.elx-wishlist-page .elx-wishlist__item:hover .elx-wishlist__stock,
	.elx-wishlist-page .elx-wishlist__item:hover .elx-wishlist__remove {
		transform: translateY(-4px);
	}
	.elx-wishlist-page .elx-wishlist__stock,
	.elx-wishlist-page .elx-wishlist__remove {
		transition: transform 0.2s ease, color 0.16s ease, background-color 0.16s ease;
	}
}

/* Selo de estoque, sobre a foto. */
.elx-wishlist-page .elx-wishlist__stock {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--elx-tint);
	color: var(--elx-green-dark);
	font-family: var(--elx-sans);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	pointer-events: none;
}

.elx-wishlist-page .elx-wishlist__stock::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.elx-wishlist-page .elx-wishlist__stock--out-of-stock {
	background: rgba(192, 57, 43, 0.1);
	color: #c0392b;
}

.elx-wishlist-page .elx-wishlist__stock--available-on-backorder {
	background: rgba(230, 162, 60, 0.16);
	color: #8a5a12;
}

/* Remover: um pequeno "×" com texto, no canto superior direito do card. */
.elx-wishlist-page .elx-wishlist__remove {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px 0 8px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--elx-muted);
	font-family: var(--elx-sans);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: color 0.16s ease, background-color 0.16s ease;
}

.elx-wishlist-page .elx-wishlist__remove span {
	position: relative;
	width: 14px;
	height: 14px;
}

.elx-wishlist-page .elx-wishlist__remove span::before,
.elx-wishlist-page .elx-wishlist__remove span::after {
	content: "";
	position: absolute;
	left: 1px;
	top: 6px;
	width: 12px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transform: rotate(45deg);
}

.elx-wishlist-page .elx-wishlist__remove span::after {
	transform: rotate(-45deg);
}

.elx-wishlist-page .elx-wishlist__remove:hover,
.elx-wishlist-page .elx-wishlist__remove:focus-visible {
	background: rgba(192, 57, 43, 0.08);
	color: #c0392b;
	outline: none;
}

.elx-wishlist-page .elx-wishlist__remove:focus-visible {
	box-shadow: 0 0 0 2px var(--elx-green);
}

/* ----------------------------------------------------------- vazio -- */

.elx-wishlist-page .elx-wishlist__empty {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 56px 24px 60px;
	background: #fff;
	border: 1px solid var(--elx-card-line);
	border-radius: var(--elx-radius-card);
	box-shadow: 0 0 50px rgba(226, 226, 226, 0.5);
	text-align: center;
}

.elx-wishlist-page .elx-wishlist--empty .elx-wishlist__empty {
	display: flex;
}

.elx-wishlist-page .elx-wishlist__emptyicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 92px;
	height: 92px;
	border-radius: 50%;
	background: var(--elx-tint);
	color: var(--elx-green);
	font-size: 38px;
}

.elx-wishlist-page .elx-wishlist__emptyicon svg {
	width: 40px;
	height: 40px;
	fill: currentColor;
}

.elx-wishlist-page .elx-wishlist__emptytitle {
	margin: 6px 0 0;
	font-family: var(--elx-display);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--elx-ink);
}

.elx-wishlist-page .elx-wishlist__emptytext {
	margin: 0;
	max-width: 460px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--elx-text);
}

.elx-wishlist-page .elx-wishlist__emptybtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 260px;
	height: 50px;
	margin-top: 8px;
	padding: 0 24px;
	border-radius: var(--elx-radius-field);
	background: var(--elx-green);
	color: #fff;
	font-family: var(--elx-sans);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.16s ease;
}

.elx-wishlist-page .elx-wishlist__emptybtn:hover,
.elx-wishlist-page .elx-wishlist__emptybtn:focus-visible {
	background: var(--elx-green-hover);
	color: #fff;
}

/* ------------------------------------------------------ carregando -- */
/* Visitante: enquanto a lista do navegador vira cards, quatro blocos cinza. */

.elx-wishlist-page .elx-wishlist__loading {
	display: none;
	grid-template-columns: repeat(var(--elx-wish-cols, 4), minmax(0, 1fr));
	gap: var(--elx-wish-gap, 33px);
}

.elx-wishlist-page .elx-wishlist--loading .elx-wishlist__loading {
	display: grid;
}

.elx-wishlist-page .elx-wishlist__loading span {
	display: block;
	height: 420px;
	border-radius: var(--elx-radius-card);
	background: linear-gradient(90deg, #f3f3f3 25%, #e9e9e9 37%, #f3f3f3 63%);
	background-size: 400% 100%;
	animation: elx-wish-shimmer 1.4s ease infinite;
}

@keyframes elx-wish-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.elx-wishlist-page .elx-wishlist__loading span {
		animation: none;
	}
	.elx-wishlist-page .elx-wishlist__item {
		transition: none;
	}
}

/* ------------------------------------------------------- responsivo -- */

@media (max-width: 1024px) {
	.elx-wishlist-page .elx-wishlist {
		--elx-wish-gap: 20px;
	}
	.elx-wishlist-page .elx-wishlist__title {
		font-size: 34px;
	}
	.elx-wishlist-page .elx-wishlist__loading span {
		height: 380px;
	}
}

@media (max-width: 767px) {
	.elx-wishlist-page .elx-wishlist__head {
		align-items: flex-start;
		flex-direction: column;
		gap: 14px;
		margin-bottom: 22px;
	}
	/* Em coluna, o `flex-basis` de 420px viraria altura. */
	.elx-wishlist-page .elx-wishlist__heading {
		flex: 0 0 auto;
		width: 100%;
	}
	.elx-wishlist-page .elx-wishlist__title {
		font-size: 28px;
	}
	.elx-wishlist-page .elx-wishlist__sub {
		font-size: 15px;
	}
	.elx-wishlist-page .elx-wishlist__tools {
		width: 100%;
		justify-content: space-between;
	}
	.elx-wishlist-page .elx-wishlist {
		--elx-wish-gap: 16px;
	}
	.elx-wishlist-page .elx-wishlist__remove {
		height: 34px;
		padding: 0 14px 0 10px;
		font-size: 13px;
	}
	.elx-wishlist-page .elx-wishlist__empty {
		padding: 40px 18px 44px;
	}
	.elx-wishlist-page .elx-wishlist__emptybtn {
		width: 100%;
		min-width: 0;
	}
	.elx-wishlist-page .elx-wishlist__loading span {
		height: 360px;
	}
	.elx-wishlist-page .elx-wishlist__loading span:nth-child(n+3) {
		display: none;
	}
}
