/**
 * Catalogo Comics: card compatta tipo app (due colonne mobile), foto dominante,
 * cuore in basso a destra sulla foto, sotto solo titolo + spedizione + prezzo.
 */

/* Fallback sold-by / stelle (archivi Woo) */
body.woocommerce.post-type-archive-product ul.products li.product .wcfmmp_sold_by_container:not(.woocommerce-error),
body.woocommerce.tax-product_cat ul.products li.product .wcfmmp_sold_by_container:not(.woocommerce-error),
body.woocommerce.tax-product_tag ul.products li.product .wcfmmp_sold_by_container:not(.woocommerce-error),
body.woocommerce[class*="tax-pa_"] ul.products li.product .wcfmmp_sold_by_container:not(.woocommerce-error) {
	display: none !important;
}

body.woocommerce.post-type-archive-product ul.products li.product .star-rating,
body.woocommerce.tax-product_cat ul.products li.product .star-rating,
body.woocommerce.tax-product_tag ul.products li.product .star-rating,
body.woocommerce[class*="tax-pa_"] ul.products li.product .star-rating {
	display: none !important;
}

/* Card principale catalogo Comics */
body.woocommerce ul.products li.product.vc-comics-catalog-card {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	min-height: 0 !important;
	padding: 0 0 8px !important;
	margin: 0 !important;
	background: #fff !important;
	border-radius: 14px !important;
	box-shadow: 0 4px 20px rgba(255, 29, 206, 0.1);
	border: 1px solid rgba(0, 0, 0, 0.06) !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
}

/* WCFM modifica/cancella in archivio: non occupare più un’intera fascia sopra alla foto */
body.woocommerce ul.products li.product.vc-comics-catalog-card > .wcfm_buttons {
	position: absolute;
	left: 6px;
	top: 6px;
	z-index: 6;
	margin: 0 !important;
	padding: 2px 4px !important;
	background: rgba(255, 255, 255, 0.94);
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	line-height: 1 !important;
}

/* Kadence “action on hover”: disattiva translateY sulla scheda prodotti Comics */
body.woocommerce ul.products li.product.vc-comics-catalog-card:hover .product-details.entry-content-wrap,
body.woocommerce ul.products li.product.vc-comics-catalog-card:focus-within .product-details.entry-content-wrap,
body.woocommerce ul.products.woo-archive-action-on-hover li.product.vc-comics-catalog-card:hover .entry-content-wrap,
body.woocommerce ul.products.woo-archive-action-on-hover li.product.vc-comics-catalog-card:focus-within .entry-content-wrap {
	transform: none !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	margin: 0 !important;
	border-radius: 0 !important;
	overflow: hidden;
	background: #f2f2f2;
	line-height: 0;
	flex: 0 0 auto;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a[class*="woocommerce-LoopProduct-link"],
body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a.woocommerce-loop-product__link {
	display: block;
	line-height: 0;
	position: relative !important;
	aspect-ratio: 1 / 1 !important;
	overflow: hidden !important;
	width: 100% !important;
	margin: 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap a img {
	width: auto !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	aspect-ratio: unset !important;
	object-fit: cover !important;
	border-radius: 0 !important;
	margin: 0 !important;
	display: block !important;
}

/* Thumb: contenitore fisso — neutralizza slide/flip Kadence (translate) che sposta il clipping del testo sotto */
body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a img.attachment-woocommerce_thumbnail {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	transform: none !important;
	backface-visibility: visible !important;
	transform-style: flat !important;
	transition: opacity 0.35s ease !important;
	opacity: 1 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a img.secondary-product-image {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	object-fit: cover !important;
	transform: none !important;
	transition: opacity 0.35s ease !important;
	opacity: 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a:has(img.secondary-product-image):hover img.attachment-woocommerce_thumbnail:not(.secondary-product-image) {
	opacity: 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-thumb-wrap > a:has(img.secondary-product-image):hover img.secondary-product-image {
	opacity: 1 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card span.onsale,
body.woocommerce ul.products li.product.vc-comics-catalog-card .sale-product-label {
	top: 8px !important;
	left: 8px !important;
	right: auto !important;
	z-index: 3;
	margin: 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0 4px 4px;
	flex: 0 0 auto;
	width: 100%;
	box-sizing: border-box;
	position: relative;
	z-index: 2;
	min-height: 0;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .woocommerce-loop-product__title {
	order: unset;
	display: block;
	font-weight: 800 !important;
	font-size: 13px !important;
	line-height: 1.2 !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	color: #1e2a39;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-title-link {
	text-decoration: none;
	color: inherit;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-shipping {
	font-size: 11px !important;
	line-height: 1.3;
	color: #555;
	font-weight: 600;
	margin: 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-shipping__label {
	font-weight: 700;
	color: #444;
	margin-right: 4px;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .price {
	order: unset;
	font-size: 15px !important;
	font-weight: 800 !important;
	color: #111 !important;
	margin: 0 !important;
	padding: 2px 0 0 !important;
}

body.woocommerce ul.products li.product.vc-comics-catalog-card .price del {
	font-size: 12px;
	opacity: 0.85;
}

/* Carrello / scambio eventualmente agganciati da altri livelli */
body.woocommerce ul.products li.product.vc-comics-catalog-card > a:not(.woocommerce-loop-product__link),
body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-meta ~ a.button,
body.woocommerce ul.products li.product.vc-comics-catalog-card .added_to_cart,
body.woocommerce ul.products li.product.vc-comics-catalog-card .product-action-wrap,
body.woocommerce ul.products li.product.vc-comics-catalog-card a.add_to_cart_button,
body.woocommerce ul.products li.product.vc-comics-catalog-card a.button:not(.woocommerce-loop-product__link),
body.woocommerce ul.products li.product.vc-comics-catalog-card .vc-loop-swap,
body.woocommerce ul.products li.product.vc-comics-catalog-card .woocommerce-loop-product__link + .added_to_cart {
	display: none !important;
}

/* Cuore: angolo inferiore destro sulla foto */
body.woocommerce ul.products li.product.vc-comics-catalog-card button.vc-vendor-fav-btn {
	position: absolute;
	right: 8px;
	bottom: 8px;
	top: auto;
	left: auto;
	z-index: 5;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94) !important;
}

button.vc-vendor-fav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	cursor: pointer;
	line-height: 0;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	border: none;
	position: relative;
	z-index: 0;
}

button.vc-vendor-fav-btn:focus-visible {
	outline: 2px solid #fff;
	box-shadow: 0 0 0 4px rgba(255, 0, 60, 0.45);
	outline-offset: 2px;
}

button.vc-vendor-fav-btn .vc-vendor-fav-heart {
	display: grid;
	place-items: center;
	filter: drop-shadow(0 0 3px rgba(255, 0, 71, 0.45));
	pointer-events: none;
	position: relative;
	z-index: 1;
}

button.vc-vendor-fav-btn:not(.is-active) .vc-heart-svg path {
	fill: #ffffff !important;
	stroke: #ff0047 !important;
	stroke-width: 1.4px !important;
	paint-order: stroke fill;
}

button.vc-vendor-fav-btn:not(.is-active):hover .vc-heart-svg path {
	fill: rgba(255, 255, 255, 0.96) !important;
}

button.vc-vendor-fav-btn.is-active .vc-heart-svg path {
	fill: #e6002d !important;
	stroke: #c40026 !important;
	stroke-width: 0 !important;
}

button.vc-vendor-fav-btn.is-active {
	box-shadow: 0 0 12px rgba(230, 0, 46, 0.45);
}

/* --- Preferiti: animazione “celebrazione” vuoto → pieno --- */
@keyframes vcHeartFillPop {
	0% {
		transform: scale(1) rotate(0deg);
	}
	11% {
		transform: scale(1.62) rotate(-18deg);
	}
	26% {
		transform: scale(0.88) rotate(14deg);
	}
	44% {
		transform: scale(1.35) rotate(-8deg);
	}
	62% {
		transform: scale(0.93) rotate(4deg);
	}
	80% {
		transform: scale(1.09) rotate(-2deg);
	}
	100% {
		transform: scale(1) rotate(0deg);
	}
}

@keyframes vcHeartFillNeonBurst {
	0% {
		filter: brightness(1) saturate(1) hue-rotate(0deg)
			drop-shadow(0 0 0 rgba(255, 29, 206, 0));
	}
	25% {
		filter: brightness(1.55) saturate(2.15) hue-rotate(-18deg)
			drop-shadow(0 0 2px rgba(255, 255, 255, 0.95))
			drop-shadow(0 0 14px rgba(255, 29, 206, 1))
			drop-shadow(0 0 28px rgba(0, 229, 255, 0.55));
	}
	50% {
		filter: brightness(1.35) saturate(1.85) hue-rotate(10deg)
			drop-shadow(0 0 8px rgba(255, 29, 206, 0.85))
			drop-shadow(0 0 22px rgba(255, 0, 150, 0.45));
	}
	100% {
		filter: brightness(1) saturate(1) hue-rotate(0deg)
			drop-shadow(0 0 6px rgba(255, 29, 206, 0));
	}
}

@keyframes vcHeartFillRingScale {
	0% {
		opacity: 0.85;
		transform: translate(-50%, -50%) scale(0.35);
		border-color: rgba(255, 29, 206, 0.75);
	}
	55% {
		opacity: 0.32;
		transform: translate(-50%, -50%) scale(2.05);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(2.85);
		border-color: rgba(0, 229, 255, 0);
	}
}

@keyframes vcHeartFillSparkBurst {
	0% {
		box-shadow:
			0 0 0 0 rgba(255, 29, 206, 0.55),
			0 0 0 0 rgba(0, 229, 255, 0.35),
			inset 0 0 0 0 rgba(255, 255, 255, 0);
	}
	38% {
		box-shadow:
			0 0 0 6px rgba(255, 29, 206, 0.25),
			0 0 22px rgba(255, 29, 206, 0.55),
			0 0 36px rgba(0, 229, 255, 0.25),
			inset 0 0 14px rgba(255, 255, 255, 0.5);
	}
	100% {
		box-shadow:
			0 0 0 0 rgba(255, 29, 206, 0),
			0 0 12px rgba(230, 0, 46, 0.45),
			inset 0 0 0 transparent;
	}
}

/* Pieno → vuoto */
@keyframes vcHeartEmptyPop {
	0% {
		transform: scale(1);
		opacity: 1;
	}
	40% {
		transform: scale(0.76);
		opacity: 0.7;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes vcHeartEmptyNeonFlicker {
	0%,
	100% {
		filter: brightness(1) saturate(1) drop-shadow(0 0 3px rgba(255, 0, 71, 0.25));
	}
	45% {
		filter: brightness(1.35) saturate(1.35) drop-shadow(0 0 8px rgba(255, 29, 206, 0.35));
	}
}

button.vc-vendor-fav-btn.vc-heart-anim-fill::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-width: 48px;
	max-height: 48px;
	transform: translate(-50%, -50%) scale(0.35);
	border-radius: 50%;
	border: 2px solid rgba(255, 29, 206, 0.55);
	box-sizing: border-box;
	pointer-events: none;
	z-index: 0;
	animation: vcHeartFillRingScale 820ms cubic-bezier(0.2, 0.82, 0.32, 1) forwards;
}

body.single-product div.product button.vc-vendor-fav-btn.vc-heart-anim-fill::before {
	max-width: 88px;
	max-height: 88px;
	animation-duration: 900ms;
}

button.vc-vendor-fav-btn.vc-heart-anim-fill .vc-heart-svg {
	transform-origin: 50% 58%;
	animation:
		vcHeartFillPop 840ms cubic-bezier(0.32, 1.55, 0.52, 1) both,
		vcHeartFillNeonBurst 840ms cubic-bezier(0.25, 0.82, 0.35, 1) both;
}

button.vc-vendor-fav-btn.vc-heart-anim-empty .vc-heart-svg {
	transform-origin: 50% 58%;
	animation:
		vcHeartEmptyPop 560ms cubic-bezier(0.45, 0, 0.15, 1.45) both,
		vcHeartEmptyNeonFlicker 560ms ease both;
}

button.vc-vendor-fav-btn.vc-heart-anim-fill.is-active:not(.vc-vendor-fav-btn--single-summary) {
	animation: vcHeartFillSparkBurst 760ms cubic-bezier(0.3, 0.92, 0.35, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
	button.vc-vendor-fav-btn.vc-heart-anim-fill .vc-heart-svg,
	button.vc-vendor-fav-btn.vc-heart-anim-empty .vc-heart-svg,
	button.vc-vendor-fav-btn.vc-heart-anim-fill.is-active:not(.vc-vendor-fav-btn--single-summary),
	button.vc-vendor-fav-btn.vc-heart-anim-fill::before {
		animation: none !important;
	}
}

@media (max-width: 768px) {
	body.woocommerce ul.products li.product.vc-comics-catalog-card button.vc-vendor-fav-btn {
		width: 36px;
		height: 36px;
		right: 7px;
		bottom: 7px;
	}
}

/* ----- Scheda prodotto: cuore sopra il titolo, senza riquadro ----- */
body.single-product .vc-single-product-gallery-wrap {
	position: relative;
	display: block;
	width: 100%;
	z-index: 1;
	overflow: hidden;
}

body.single-product .vc-single-product-gallery-wrap .woocommerce-product-gallery {
	position: relative;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	min-width: 72px;
	min-height: 72px;
	padding: 6px 2px 4px 0;
	margin: 0 0 6px;
	box-sizing: border-box;
	background: transparent !important;
	border: none !important;
	border-radius: 0;
	box-shadow: none !important;
	line-height: 0;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary .vc-heart-svg,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary .vc-heart-svg {
	width: 66px;
	height: 66px;
	display: block;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary:hover,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary:hover {
	box-shadow: none !important;
	filter: saturate(1.12);
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary:focus-visible,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary:focus-visible {
	outline: 2px solid rgba(255, 29, 206, 0.55);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px rgba(255, 29, 206, 0.18) !important;
	transform: none;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary.is-active,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary.is-active {
	box-shadow: none !important;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary .vc-vendor-fav-heart,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary .vc-vendor-fav-heart {
	filter: none;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary:not(.is-active) .vc-heart-svg path,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary:not(.is-active) .vc-heart-svg path {
	fill: #ffffff !important;
	stroke: #ff1dce !important;
	stroke-width: 1px !important;
	vector-effect: non-scaling-stroke;
	paint-order: stroke fill;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary:not(.is-active):hover .vc-heart-svg path,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary:not(.is-active):hover .vc-heart-svg path {
	fill: #ffffff !important;
}

body.single-product div.product .entry-summary .vc-vendor-fav-btn--single-summary.is-active .vc-heart-svg path,
body.single-product div.product .summary .vc-vendor-fav-btn--single-summary.is-active .vc-heart-svg path {
	fill: #ff1dce !important;
	stroke: #c4009e !important;
	stroke-width: 0 !important;
}
