/* Mis Favoritos Woo - estilos del front-end */

:root {
	--mfw-accent: #e0245e;
}

/* ---- Botón corazón en tarjetas de producto ---- */
.mfw-card-btn-wrap {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
}

/* Asegura que la tarjeta sea contenedor de posición */
.woocommerce ul.products li.product,
li.product,
.wc-block-grid__product,
.wc-block-product,
li.wc-block-product,
.wp-block-woocommerce-product-template li {
	position: relative;
}

.mfw-fav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	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.18);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.mfw-fav-btn:hover {
	transform: scale(1.08);
	background: #fff;
}

.mfw-fav-btn:focus-visible {
	outline: 2px solid var(--mfw-accent);
	outline-offset: 2px;
}

.mfw-heart-icon {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: #555;
	stroke-width: 1.6;
	transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

/* Estado activo (producto en favoritos) */
.mfw-fav-btn.is-active .mfw-heart-icon,
.mfw-header-heart.is-active .mfw-heart-icon {
	fill: var(--mfw-accent);
	stroke: var(--mfw-accent);
}

/* Animación de latido al AÑADIR a favoritos */
.mfw-fav-btn.mfw-bump .mfw-heart-icon {
	animation: mfw-beat 0.5s ease;
}

/* Animación al QUITAR de favoritos */
.mfw-fav-btn.mfw-pop .mfw-heart-icon {
	animation: mfw-pop 0.3s ease;
}

@keyframes mfw-beat {
	0%   { transform: scale(1); }
	25%  { transform: scale(1.4); }
	40%  { transform: scale(0.9); }
	60%  { transform: scale(1.25); }
	100% { transform: scale(1); }
}

@keyframes mfw-pop {
	0%   { transform: scale(1); }
	50%  { transform: scale(0.75); }
	100% { transform: scale(1); }
}

/* Onda expansiva al añadir */
.mfw-fav-btn {
	position: relative;
	overflow: visible;
}

.mfw-fav-btn.mfw-bump::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--mfw-accent);
	animation: mfw-ring 0.5s ease-out forwards;
	pointer-events: none;
}

@keyframes mfw-ring {
	0%   { transform: scale(1); opacity: 0.7; }
	100% { transform: scale(1.9); opacity: 0; }
}

/* ---- Corazón de la cabecera ---- */
.mfw-header-heart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	text-decoration: none;
	color: inherit;
}

.mfw-header-heart .mfw-heart-icon {
	width: 26px;
	height: 26px;
	stroke: currentColor;
}

.mfw-header-heart:hover .mfw-heart-icon {
	stroke: var(--mfw-accent);
}

.mfw-count {
	position: absolute;
	top: -8px;
	right: -10px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--mfw-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-sizing: border-box;
	transform: scale(0);
	transition: transform 0.15s ease;
}

.mfw-count.is-visible {
	transform: scale(1);
}

/* ---- Página de favoritos ---- */
.mfw-favorites-list {
	margin: 0;
}

.mfw-empty {
	padding: 40px 20px;
	text-align: center;
	color: #777;
	font-size: 16px;
}

.mfw-loading {
	padding: 20px;
	text-align: center;
	color: #999;
}

/* Grid de tarjetas de favoritos */
.mfw-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

@media (min-width: 600px) {
	.mfw-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
	.mfw-grid { grid-template-columns: repeat(4, 1fr); }
}

.mfw-card {
	position: relative;
	border: 1px solid #ececec;
	border-radius: 10px;
	padding: 12px;
	background: #fff;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.mfw-card.mfw-removing {
	opacity: 0;
	transform: scale(0.9);
}

.mfw-card-link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-decoration: none;
	color: inherit;
}

.mfw-card-img img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	display: block;
}

.mfw-card-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.mfw-card-price {
	font-size: 14px;
	color: var(--mfw-accent);
	font-weight: 700;
}

.mfw-remove {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	line-height: 1;
	font-size: 18px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #333;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.mfw-remove:hover {
	background: var(--mfw-accent);
	color: #fff;
	transform: scale(1.1);
}
