/* Favoritos Carousel para WooCommerce
   Diseño tipo "Compra nuestros favoritos" (estilo Flying Tiger) */

.favcar {
	--favcar-bg-card: #f2f2f2;
	--favcar-fg: #111111;
	--favcar-btn-bg: #000000;
	--favcar-btn-fg: #ffffff;
	--favcar-badge-bg: #ffffff;
	--favcar-badge-fg: #111111;
	--favcar-radius: 4px;
	--favcar-gap: 24px;
	--favcar-card-min: 260px;

	box-sizing: border-box;
	width: 100%;
	margin: 0 0 2.5rem;
	font-family: inherit;
	color: var(--favcar-fg);
}

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

.favcar__title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.6rem, 3vw, 2.25rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--favcar-fg);
}

/* ---------- Viewport + navegación ---------- */
.favcar__viewport {
	position: relative;
}

.favcar__track {
	display: flex;
	gap: var(--favcar-gap);
	margin: 0;
	padding: 4px 0 8px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.favcar__track::-webkit-scrollbar {
	display: none;
}

.favcar__item {
	flex: 0 0 auto;
	width: calc((100% - var(--favcar-gap) * 3) / 4);
	min-width: var(--favcar-card-min);
	scroll-snap-align: start;
}

/* ---------- Botones de navegación ---------- */
.favcar__nav {
	position: absolute;
	top: 38%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	background: #ffffff;
	color: #111111;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	transition: transform 0.15s ease, background 0.15s ease;
}

.favcar__nav:hover {
	background: #f5f5f5;
	transform: scale(1.05);
}

.favcar__nav--prev {
	left: -12px;
}

.favcar__nav--next {
	right: -12px;
}

.favcar__nav[hidden] {
	display: none;
}

/* ---------- Tarjeta de producto ---------- */
.favcar-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.favcar-card__media {
	position: relative;
	background: var(--favcar-bg-card);
	border-radius: var(--favcar-radius);
	/* Proporción vertical tipo A4 (210 x 297) */
	aspect-ratio: 210 / 297;
	overflow: hidden;
}

.favcar-card__image-link {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 12%;
}

.favcar-card__image,
.favcar-card__media img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: auto;
	mix-blend-mode: multiply;
	transition: transform 0.35s ease;
}

.favcar-card__media:hover .favcar-card__image {
	transform: scale(1.04);
}

/* Etiqueta "Nuevo" */
.favcar-card__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	padding: 6px 14px;
	background: var(--favcar-badge-bg);
	color: var(--favcar-badge-fg);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	border-radius: 3px;
}

/* Corazón / favorito */
.favcar-card__wishlist {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #444444;
	cursor: pointer;
	transition: transform 0.15s ease, color 0.15s ease;
}

.favcar-card__wishlist:hover {
	transform: scale(1.08);
}

.favcar-card__wishlist[aria-pressed="true"] {
	color: #e2483d;
}

.favcar-card__wishlist[aria-pressed="true"] svg path {
	fill: currentColor;
	stroke: currentColor;
}

/* Cuerpo */
.favcar-card__body {
	display: flex;
	flex-direction: column;
	padding-top: 14px;
}

.favcar-card__title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: -0.01em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.favcar-card__title a {
	color: var(--favcar-fg);
	text-decoration: none;
}

.favcar-card__title a:hover {
	text-decoration: underline;
}

.favcar-card__price {
	margin: 0 0 14px;
	font-size: 1.4rem;
	font-weight: 800;
	line-height: 1;
	color: var(--favcar-fg);
}

.favcar-card__price del {
	margin-right: 8px;
	font-weight: 400;
	opacity: 0.5;
}

.favcar-card__price ins {
	text-decoration: none;
}

/* Botón añadir a la cesta */
.favcar-card__cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: auto;
	padding: 16px 20px;
	border: 0;
	border-radius: var(--favcar-radius);
	background: var(--favcar-btn-bg);
	color: var(--favcar-btn-fg);
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.favcar-card__cart:hover {
	background: #2a2a2a;
	color: var(--favcar-btn-fg);
}

.favcar-card__cart:focus-visible,
.favcar__nav:focus-visible,
.favcar-card__wishlist:focus-visible {
	outline: 2px solid #0071e3;
	outline-offset: 2px;
}

.favcar-card__cart.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.favcar-card__cart.is-added {
	background: #1a7f37;
}

.favcar-empty {
	padding: 2rem;
	text-align: center;
	color: #666666;
}

/* ---------- Colecciones (círculos) ---------- */
.favcar--collections {
	/* Menos espacio vacío arriba y abajo del carrusel de colecciones */
	margin-bottom: 1rem;
}

/* Sin título, elimina el hueco superior que dejaba el <h2> */
.favcar--collections .favcar__title:empty {
	display: none;
	margin: 0;
}

/* Quita el relleno vertical extra del carril de scroll */
.favcar--collections .favcar__track {
	padding-top: 0;
	padding-bottom: 0;
}

.favcar--collections .favcar__item {
	width: calc((100% - var(--favcar-gap) * 3) / 4);
	min-width: 0;
}

.favcar-collection {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: var(--favcar-fg);
}

.favcar-collection__circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	background: var(--favcar-bg-card);
}

.favcar-collection__circle img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.35s ease;
}

.favcar-collection:hover .favcar-collection__circle img {
	transform: scale(1.05);
}

.favcar-collection__name {
	font-size: 1.2rem;
	font-weight: 700;
	text-align: center;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.favcar__item,
	.favcar--collections .favcar__item {
		width: calc((100% - var(--favcar-gap) * 2) / 3);
	}
}

@media (max-width: 768px) {
	.favcar {
		--favcar-gap: 12px;
		/* Separación del borde izquierdo de la pantalla */
		padding-left: 16px;
	}
	.favcar__nav {
		display: none;
	}
	.favcar__track {
		/* deja aire al final para que se vea el "medio" producto */
		padding-right: 16px;
	}
	/* 2 productos y medio visibles: cada tarjeta ocupa ~38vw
	   (2 completas + media + gaps + separación izquierda) */
	.favcar__item {
		width: 38vw;
		min-width: 0;
		max-width: none;
	}
	/* 2 colecciones y media visibles */
	.favcar--collections .favcar__item {
		width: 36vw;
		min-width: 0;
	}
}

@media (max-width: 480px) {
	.favcar-card__title {
		font-size: 1rem;
	}
	.favcar-card__price {
		font-size: 1.2rem;
	}
	.favcar-card__cart {
		padding: 13px 12px;
		font-size: 0.95rem;
	}
	.favcar-collection__name {
		font-size: 1.05rem;
	}
}
