/**
 * Homepage composition.
 *
 * Magic Banner owns the hero/slider component. These rules only define the
 * homepage shell and never override the plugin's controls or slide logic.
 */

body.magic-fse-home .magic-site-main {
	min-height: 55vh;
}

.magic-home-main,
.magic-home-main > * {
	margin-block-start: 0;
}

.magic-home-hero {
	width: 100%;
	margin: 0;
	padding: 0;
}

.magic-home-hero__inner {
	width: 100%;
	max-width: none !important;
	margin: 0 !important;
}

.magic-home-hero__inner > .magic-fse-slot {
	width: 100%;
	margin: 0;
}

.magic-home-hero__inner > .magic-fse-slot:empty,
.magic-home-hero:not(:has(.magic-fse-slot)) {
	display: none;
}

.magic-home-hero img,
.magic-home-hero video,
.magic-home-hero iframe {
	max-width: 100%;
}

/* Hero: il tema forza la Home senza radius; Magic Banner conserva slider e media responsive. */
.magic-home-hero .mbr-slot {
	--mbr-banner-radius: 0px;
	--mbr-slider-radius: 0px;
	margin: 0;
}

.magic-home-hero .mbr-slider,
.magic-home-hero .mbr-item,
.magic-home-hero .mbr-img,
.magic-home-hero .mbr-video {
	border-radius: 0;
}

@media (max-width: 767px) {
	.magic-home-hero .mbr-slider .mbr-item,
	.magic-home-hero .mbr-slider picture {
		display: block;
		width: 100%;
	}

	.magic-home-hero .mbr-slider .mbr-img,
	.magic-home-hero .mbr-slider .mbr-video {
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 5;
		object-fit: cover;
	}
}

/**
 * Home categories — visual cards inspired by the approved reference.
 *
 * Product category names, links, images and counts remain WooCommerce data.
 */
.magic-home-section {
	width: 100%;
	margin: 0;
	padding: clamp(32px, 4.2vw, 56px) 20px 0;
}

.magic-home-section__inner {
	width: 100%;
	max-width: 1240px !important;
	margin-inline: auto !important;
}

.magic-home-section__title {
	margin: 0;
	font-size: clamp(1.65rem, 2.6vw, 2.2rem);
	line-height: 1.12;
}

.magic-home-categories__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(14px, 1.5vw, 20px);
}

.magic-home-category-card {
	min-width: 0;
}

.magic-home-category-card__link {
	position: relative;
	display: block;
	min-height: clamp(320px, 31vw, 430px);
	overflow: hidden;
	border-radius: 12px;
	background: #24262b;
	color: #fff;
	text-decoration: none;
	isolation: isolate;
}

.magic-home-category-card__media,
.magic-home-category-card__overlay,
.magic-home-category-card__placeholder {
	position: absolute;
	inset: 0;
	display: block;
}

.magic-home-category-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform 240ms ease;
}

.magic-home-category-card__placeholder {
	background:
		radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 32%),
		linear-gradient(145deg, #313640, #15171c);
}

.magic-home-category-card__overlay {
	z-index: 1;
	background: linear-gradient(to top, rgba(6, 7, 10, 0.88) 0%, rgba(6, 7, 10, 0.48) 32%, rgba(6, 7, 10, 0.05) 68%, rgba(6, 7, 10, 0.04) 100%);
}

.magic-home-category-card__content {
	position: absolute;
	z-index: 2;
	inset-inline: clamp(20px, 2vw, 28px);
	bottom: clamp(22px, 2.2vw, 30px);
	display: grid;
	gap: 6px;
}

.magic-home-category-card__title-row {
	display: flex;
	align-items: flex-start;
	gap: 5px;
}

.magic-home-category-card__title {
	font-size: clamp(1.32rem, 1.8vw, 1.72rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.025em;
}

.magic-home-category-card__count {
	position: relative;
	top: -0.18em;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
}

.magic-home-category-card__kicker {
	display: -webkit-box;
	overflow: hidden;
	font-size: clamp(0.86rem, 1vw, 0.98rem);
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.94);
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.magic-home-category-card__link:hover .magic-home-category-card__media img {
	transform: scale(1.035);
}

.magic-home-category-card__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}

@media (max-width: 899px) {
	.magic-home-categories__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.magic-home-category-card__link {
		min-height: 360px;
	}
}

@media (max-width: 639px) {
	.magic-home-section {
		padding-inline: 12px;
	}

	.magic-home-categories__grid {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 12px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.magic-home-categories__grid::-webkit-scrollbar {
		display: none;
	}

	.magic-home-category-card {
		flex: 0 0 min(78vw, 310px);
		scroll-snap-align: start;
	}

	.magic-home-category-card__link {
		min-height: 390px;
		border-radius: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.magic-home-category-card__media img {
		transition: none;
	}
}

/**
 * Progressive Home carousels — products, categories, blog and reviews.
 *
 * The first page is fetched only near the viewport. Subsequent pages are
 * requested only when the visitor uses the arrow controls; no autoplay.
 */
.magic-home-async-slider {
	padding-top: clamp(38px, 4.8vw, 64px);
}

.magic-home-async-slider__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.magic-home-async-slider__controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.magic-home-slider-button {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(23, 24, 28, 0.18);
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--foreground, #17181c);
	font: inherit;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.magic-home-slider-button:hover:not(:disabled) {
	border-color: rgba(23, 24, 28, 0.42);
	background: #f6f6f4;
	transform: translateY(-1px);
}

.magic-home-slider-button:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.magic-home-slider-button:disabled {
	opacity: 0.32;
	cursor: default;
}

.magic-home-async-slider__viewport {
	margin-block-start: 24px;
	overflow: hidden;
	touch-action: pan-y;
	overscroll-behavior-x: contain;
}

.magic-home-async-slider__track {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(14px, 1.5vw, 21px);
	min-height: 220px;
	animation: magic-home-slider-in 180ms ease both;
}

.magic-home-async-slider--posts .magic-home-async-slider__track {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(18px, 2vw, 28px);
}

.magic-home-async-slider--categories .magic-home-async-slider__track {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(14px, 1.5vw, 20px);
}

.magic-home-async-slider--reviews .magic-home-async-slider__track {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	min-height: 220px;
}

.magic-home-async-slider--reviews .mgr-card,
.magic-home-async-slider--reviews .mgr-card * {
	box-sizing: border-box;
}

.magic-home-async-slider--reviews .mgr-card {
	min-width: 0;
	width: 100%;
}

.magic-home-reviews-slider__body {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 18px;
	align-items: stretch;
	margin-block-start: 24px;
}

.magic-home-reviews-slider__body .magic-home-async-slider__viewport {
	margin-block-start: 0;
}

.magic-home-review-summary .mgr-wrap {
	display: block;
	width: 100%;
}

.magic-home-review-summary .mgr-summary {
	min-height: 220px;
}

.magic-home-async-slider__track.is-changing {
	opacity: 0.58;
}

.magic-home-async-slider__status {
	min-height: 1.3em;
	margin: 10px 0 0;
	color: var(--wp--preset--color--muted, #62646b);
	font-size: 0.82rem;
	text-align: right;
}

.magic-home-slider-card {
	min-width: 0;
}

.magic-home-product-card {
	display: flex;
	min-width: 0;
	height: 100%;
	margin: 0;
	flex-direction: column;
	text-align: left;
}

/* Home product cards deliberately reuse the exact catalog card DOM contract.
 * Keep this block synchronized with the catalog Studio/Air component without
 * loading the much larger archive stylesheet on the front page. */
.magic-home-product-card .magic-catalog-card-content {
	display: flex;
	min-width: 0;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.26rem;
}

.magic-home-product-card .magic-catalog-card-footer {
	display: none;
}

/* Studio: same validated visual contract as product archives. */
.magic-home-product-card--studio {
	overflow: hidden;
	padding: 0 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.045);
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
	.magic-home-product-card--studio:hover {
		border-color: #cbd5e1;
		box-shadow: 0 9px 22px rgba(15, 23, 42, 0.08);
		transform: translateY(-2px);
	}
}

.magic-home-product-card--studio .magic-catalog-card-media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: auto;
	margin: 0 0 0.4rem;
	overflow: visible;
	border-radius: 0;
	background: transparent;
}

.magic-home-product-card--studio .magic-catalog-card-media > .wc-block-product-image {
	position: relative;
	display: flex;
	width: 100%;
	height: auto;
	min-height: 0;
	aspect-ratio: 1 / 1;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin: 0;
	border: 0;
	border-radius: 16px 16px 0 0;
	background: #fff;
}

.magic-home-product-card--studio .magic-catalog-card-media > .wc-block-product-image > a {
	display: block;
	width: 100%;
	height: 100%;
}

.magic-home-product-card--studio .magic-catalog-card-media > .wc-block-product-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	object-fit: contain;
}

.magic-home-product-card--studio .magic-catalog-card-media > .magic-catalog-card-rating--overlay {
	position: absolute;
	left: 50%;
	bottom: 0.58rem;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 20px;
	margin: 0;
	padding: 0.22rem 0.5rem;
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
	transform: translateX(-50%);
}

.magic-home-product-card--studio .magic-catalog-card-media > .magic-catalog-card-rating--overlay.is-empty {
	display: none;
}

.magic-home-product-card--studio .magic-catalog-card-media > .magic-catalog-card-rating--overlay > * {
	margin: 0 !important;
}

/* 0.9.117 — Ensure WooCommerce classic star markup renders correctly inside
 * Home product cards without loading the heavier archive catalog stylesheet. */
.magic-home-product-card--studio .magic-catalog-card-rating .star-rating,
.magic-home-product-card--air .magic-catalog-card-rating .star-rating {
	overflow: hidden;
	position: relative;
	display: inline-block;
	width: 5.4em;
	height: 1em;
	margin: 0 !important;
	font-family: star;
	font-size: 13px;
	line-height: 1;
	color: #f59e0b;
}

.magic-home-product-card--studio .magic-catalog-card-rating .star-rating::before,
.magic-home-product-card--air .magic-catalog-card-rating .star-rating::before {
	content: "sssss";
	position: absolute;
	top: 0;
	left: 0;
	color: #d7d9dd;
}

.magic-home-product-card--studio .magic-catalog-card-rating .star-rating span,
.magic-home-product-card--air .magic-catalog-card-rating .star-rating span {
	overflow: hidden;
	position: absolute;
	top: 0;
	left: 0;
	float: left;
	height: 1em;
	padding-top: 1.5em;
}

.magic-home-product-card--studio .magic-catalog-card-rating .star-rating span::before,
.magic-home-product-card--air .magic-catalog-card-rating .star-rating span::before {
	content: "SSSSS";
	position: absolute;
	top: 0;
	left: 0;
	color: #f59e0b;
}

.magic-home-product-card--studio .magic-catalog-card-content {
	gap: 0.14rem;
	padding: 0 12px;
}

.magic-home-product-card--studio .wc-block-components-product-title {
	min-height: 2.55em;
	margin: 0;
	text-align: left !important;
	font-size: clamp(0.95rem, 0.98vw, 1.03rem);
	font-weight: 700;
	line-height: 1.3;
}

.magic-home-product-card--studio .wc-block-components-product-title a {
	display: -webkit-box;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.magic-home-product-card--studio .wc-block-components-product-title a:hover,
.magic-home-product-card--studio .wc-block-components-product-title a:focus-visible {
	text-decoration: none;
}

.magic-home-product-card--studio .wc-block-product-price {
	min-height: 1.55em;
	margin-top: 0;
	padding-top: 0;
	text-align: left !important;
	font-size: clamp(0.98rem, 0.96vw, 1.1rem);
	font-weight: 700;
	line-height: 1.25;
}

.magic-home-product-card--studio .wc-block-product-price del {
	margin-right: 0.32rem;
	color: #98a2b3;
	font-weight: 500;
	opacity: 1;
}

.magic-home-product-card--studio .wc-block-product-price ins {
	background: none;
	text-decoration: none;
}

.magic-home-product-card--studio .magic-catalog-card-footer {
	display: flex;
	gap: 0.28rem;
	align-items: center;
	justify-content: flex-start;
	margin-top: auto;
	padding: 0.62rem 0 0;
}

.magic-home-product-card--studio .magic-catalog-card-link {
	display: inline-flex;
	height: 40px;
	min-height: 40px;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.magic-home-product-card--studio .magic-catalog-card-link--primary {
	min-width: 0;
	flex: 1 1 auto;
	padding: 0.58rem 0.5rem;
	border: 1px solid #d8dee7;
	background: #f8fafc;
	color: #0f172a;
	font-size: 0.78rem;
	font-weight: 650;
	line-height: 1;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.magic-home-product-card--studio .magic-catalog-card-link--primary:hover,
	.magic-home-product-card--studio .magic-catalog-card-link--primary:focus-visible {
		border-color: #c7d0db;
		background: #f1f5f9;
		color: #0f172a;
	}
}

.magic-home-product-card--studio .magic-catalog-card-actions--footer {
	position: static !important;
	display: block;
	width: auto;
	margin: 0 0 0 auto !important;
	padding: 0;
}

.magic-home-product-card--studio .magic-catalog-card-actions--footer > .magic-fse-slot,
.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-product-actions {
	margin: 0 !important;
}

.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-product-actions--category,
.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-product-actions {
	display: flex !important;
	flex-direction: row !important;
	gap: 0.28rem !important;
	align-items: center;
	justify-content: flex-end;
}

.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-compare-button,
.magic-home-product-card--studio .magic-catalog-card-actions--footer .magic-wishlist-button {
	position: relative !important;
	inset: auto !important;
	display: inline-flex !important;
	flex: 0 0 40px !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
	min-height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 !important;
	border: 1px solid #d8dee7 !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: #0f172a !important;
	box-shadow: none !important;
	transform: none !important;
}

.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-label,
.magic-home-product-card--studio .magic-catalog-card-actions--footer .magic-wishlist-button__label {
	display: none !important;
}

.magic-home-product-card--studio .magic-catalog-card-trend,
.magic-home-product-card--studio .magic-catalog-card-actions {
	position: absolute;
	z-index: 6;
	margin: 0;
}

.magic-home-product-card--studio .magic-catalog-card-trend {
	top: 0.72rem;
	left: 0.72rem;
}

.magic-home-product-card--studio .magic-catalog-card-media:has(.wc-block-components-product-sale-badge) > .magic-catalog-card-trend {
	top: 2.95rem;
}

.magic-home-product-card .magic-fse-sale-percentage,
.magic-home-product-card .wc-block-components-product-sale-badge {
	position: absolute;
	top: 0.72rem;
	left: 0.72rem;
	z-index: 7;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0.32rem 0.62rem;
	border: 0;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 750;
	line-height: 1;
}

/* Air: same lightweight catalog alternative. */
.magic-home-product-card--air {
	overflow: hidden;
	padding: 10px 10px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.magic-home-product-card--air .magic-catalog-card-media {
	position: relative;
	margin-bottom: 0.78rem;
	border-radius: 11px;
	background: #f7f7f7;
}

.magic-home-product-card--air .wc-block-product-image {
	display: flex;
	width: 100%;
	aspect-ratio: 1 / 1;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 11px;
}

.magic-home-product-card--air .wc-block-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.magic-home-product-card--air .magic-catalog-card-content {
	padding: 0;
	text-align: center;
}

.magic-home-product-card--air .wc-block-components-product-title {
	min-height: 2.5em;
	margin: 0 0 0.22rem;
	text-align: center !important;
	font-size: clamp(0.82rem, 0.9vw, 0.9rem);
	font-weight: 650;
	line-height: 1.32;
}

.magic-home-product-card--air .wc-block-product-price {
	margin: 0;
	text-align: center !important;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.25;
}

.magic-home-product-card--air .wc-block-components-product-title a {
	color: inherit;
	text-decoration: none;
}

.magic-home-product-card--air .magic-catalog-card-rating {
	display: flex;
	min-height: 1.35rem;
	align-items: center;
	justify-content: center;
	margin: 0 0 0.45rem;
}

.magic-home-product-card--air .magic-catalog-card-actions,
.magic-home-product-card--air .magic-catalog-card-trend {
	position: absolute;
	z-index: 6;
}

.magic-home-product-card--air .magic-catalog-card-trend {
	top: 0.62rem;
	left: 0.62rem;
}

.magic-home-product-card--air .magic-catalog-card-media:has(.wc-block-components-product-sale-badge) > .magic-catalog-card-trend {
	top: 2.85rem;
}

.magic-home-product-card--air .magic-catalog-card-actions {
	top: 0.52rem;
	right: 0.52rem;
}

.magic-home-post-card__image {
	display: block;
	margin: 0 0 18px;
	overflow: hidden;
	border-radius: 14px;
	background: var(--wp--preset--color--surface, #f6f6f4);
}

.magic-home-post-card__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transition: transform 180ms ease;
}

.magic-home-post-card__image:hover img {
	transform: scale(1.025);
}

.magic-home-post-card__categories {
	margin: 0 0 9px;
	font-size: 0.74rem;
	font-weight: 650;
	line-height: 1.35;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.magic-home-post-card__categories a {
	color: var(--wp--preset--color--accent, #1f5fae);
	text-decoration: none;
}

.magic-home-post-card__title {
	display: -webkit-box;
	min-height: 2.7em;
	margin: 0 0 10px;
	overflow: hidden;
	font-size: clamp(1rem, 1.25vw, 1.18rem);
	font-weight: 600;
	line-height: 1.35;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.magic-home-post-card__excerpt {
	margin: 0;
	color: var(--wp--preset--color--muted, #62646b);
	font-size: 0.9rem;
	line-height: 1.55;
}

.magic-home-slider-skeleton {
	display: grid;
	gap: 10px;
	min-width: 0;
}

.magic-home-slider-skeleton::before,
.magic-home-slider-skeleton span {
	content: "";
	display: block;
	border-radius: 8px;
	background: linear-gradient(90deg, #f1f1ef 25%, #fafaf9 50%, #f1f1ef 75%);
	background-size: 200% 100%;
	animation: magic-home-skeleton 1.2s linear infinite;
}

.magic-home-slider-skeleton::before {
	aspect-ratio: 1;
}

.magic-home-slider-skeleton--posts::before {
	aspect-ratio: 16 / 10;
}

.magic-home-slider-skeleton--categories::before {
	aspect-ratio: 3 / 4;
}

.magic-home-slider-skeleton--reviews::before {
	height: 42px;
	aspect-ratio: auto;
}

.magic-home-slider-skeleton span:nth-child(1) { height: 14px; }
.magic-home-slider-skeleton span:nth-child(2) { height: 12px; width: 82%; }
.magic-home-slider-skeleton span:nth-child(3) { height: 12px; width: 62%; }

@keyframes magic-home-slider-in {
	from { opacity: 0.55; transform: translateX(8px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes magic-home-skeleton {
	to { background-position: -200% 0; }
}

@media (max-width: 899px) {
	.magic-home-async-slider__track {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.magic-home-async-slider--posts .magic-home-async-slider__track,
	.magic-home-async-slider--categories .magic-home-async-slider__track,
	.magic-home-async-slider--reviews .magic-home-async-slider__track {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.magic-home-reviews-slider__body {
		grid-template-columns: 1fr;
	}

	.magic-home-review-summary .mgr-summary {
		min-height: auto;
	}
}

@media (max-width: 639px) {
	.magic-home-async-slider {
		padding-top: 34px;
	}

	.magic-home-async-slider__heading {
		align-items: flex-end;
	}

	.magic-home-slider-button {
		width: 38px;
		height: 38px;
	}

	.magic-home-async-slider__viewport {
		margin-block-start: 20px;
	}

	.magic-home-async-slider__track,
	.magic-home-async-slider--posts .magic-home-async-slider__track,
	.magic-home-async-slider--categories .magic-home-async-slider__track,
	.magic-home-async-slider--reviews .magic-home-async-slider__track {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
		min-height: 180px;
	}

	.magic-home-product-card--studio,
	.magic-home-product-card--air {
		border-radius: 11px;
	}

	.magic-home-product-card--studio {
		padding-bottom: 9px;
	}

	.magic-home-product-card--studio .magic-catalog-card-media > .wc-block-product-image {
		border-radius: 11px 11px 0 0;
	}

	.magic-home-product-card--studio .magic-catalog-card-media > .magic-catalog-card-rating--overlay {
		bottom: 0.5rem;
		padding: 0.18rem 0.42rem;
	}

	.magic-home-product-card--studio .magic-catalog-card-content {
		gap: 0.12rem;
		padding-inline: 9px;
	}

	.magic-home-product-card--studio .magic-catalog-card-footer {
		gap: 0.24rem;
		padding-top: 0.58rem;
	}

	.magic-home-product-card--studio .magic-catalog-card-link {
		height: 38px;
		min-height: 38px;
	}

	.magic-home-product-card--studio .magic-catalog-card-link--primary {
		padding-inline: 0.62rem;
		font-size: 0.77rem;
	}

	.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-product-actions--category,
	.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-product-actions {
		gap: 0.24rem !important;
	}

	.magic-home-product-card--studio .magic-catalog-card-actions--footer .mpc-compare-button,
	.magic-home-product-card--studio .magic-catalog-card-actions--footer .magic-wishlist-button {
		flex-basis: 38px !important;
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		min-height: 38px !important;
		max-width: 38px !important;
		max-height: 38px !important;
		border-radius: 10px !important;
	}

	.magic-home-product-card--air {
		padding: 7px 7px 9px;
	}

	.magic-home-product-card--air .magic-catalog-card-content {
		padding: 0;
	}

	.magic-home-category-card__link {
		min-height: 300px;
	}

	.magic-home-post-card__image {
		margin-bottom: 13px;
		border-radius: 12px;
	}

	.magic-home-post-card__excerpt {
		display: none;
	}

	.magic-home-async-slider__status {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.magic-home-slider-button,
	.magic-home-post-card__image img,
	.magic-home-async-slider__track,
	.magic-home-slider-skeleton::before,
	.magic-home-slider-skeleton span {
		transition: none;
		animation: none;
	}
}

/**
 * Home Google reviews — v0.9.5.
 *
 * Magic Google Reviews owns review data, summary, cards, layout mode, carousel
 * behaviour and frontend assets. The theme only provides the Home section shell.
 */
.magic-home-google-reviews {
	padding-top: clamp(38px, 4.8vw, 64px);
}

.magic-home-google-reviews:not(:has(.magic-fse-slot--magic_google_reviews)) {
	display: none;
}

.magic-home-google-reviews__content {
	width: 100%;
	margin-block-start: 24px;
}

.magic-home-google-reviews__content > .magic-fse-slot {
	width: 100%;
	min-width: 0;
	margin: 0;
}

.magic-home-google-reviews__content img,
.magic-home-google-reviews__content svg,
.magic-home-google-reviews__content iframe {
	max-width: 100%;
}

@media (max-width: 639px) {
	.magic-home-google-reviews {
		padding-top: 34px;
	}

	.magic-home-google-reviews__content {
		margin-block-start: 20px;
	}
}

/* Chiusura Home: l'ultima sezione mantiene respiro prima del footer. */
.magic-home-main > .magic-home-section:last-child {
	padding-bottom: clamp(42px, 5vw, 64px);
}

/* Servizi e rassicurazioni: contenuti e card restano nel plugin Magic Woo Enhancer. */
.magic-home-services-assurances:not(:has(.magic-fse-slot--magic_servizi_rassicurazioni)) {
	display: none;
}

.magic-home-services-assurances__inner {
	width: 100%;
}

/* Prodotti in tendenza: query e card sono fornite da Magic In tendenza. */
.magic-home-trending-products:not(:has(.magic-fse-slot--prodotti_in_tendenza)) {
	display: none;
}

.magic-home-trending-products .magic-fse-slot--prodotti_in_tendenza {
	width: 100%;
	margin-block-start: 24px;
}

@media (max-width: 639px) {
	.magic-home-main > .magic-home-section:last-child {
		padding-bottom: 42px;
	}

	.magic-home-trending-products .magic-fse-slot--prodotti_in_tendenza {
		margin-block-start: 20px;
	}
}


/**
 * Home Ads — placement manuali Magic Banner Rotator 1.0.51+.
 */
.magic-home-ad {
	padding-top: clamp(24px, 3vw, 40px);
}

.magic-home-ad:not(:has(.magic-fse-slot--magic_banner)) {
	display: none;
}

.magic-home-ad__inner > .magic-fse-slot {
	width: 100%;
	margin: 0;
}

.magic-home-ad .mbr-slot {
	margin: 0;
}

/**
 * Informational pre-footer — visual treatment inspired by the approved reference.
 */
.magic-home-prefooter-cards {
	padding-top: clamp(56px, 6vw, 86px);
	padding-bottom: clamp(46px, 5.4vw, 76px);
}

.magic-home-prefooter-cards__intro {
	max-width: 760px;
	margin: 0 auto clamp(34px, 4vw, 52px);
	text-align: center;
}

.magic-home-prefooter-cards__eyebrow {
	margin: 0 0 12px;
	font-size: 0.76rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.magic-home-prefooter-cards__title {
	margin: 0;
	font-size: clamp(1.85rem, 3vw, 2.55rem);
	font-weight: 650;
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.magic-home-prefooter-cards__subtitle {
	max-width: 680px;
	margin: 14px auto 0;
	color: var(--wp--preset--color--muted, #62646b);
	font-size: clamp(0.95rem, 1.15vw, 1.04rem);
	line-height: 1.55;
}

.magic-home-prefooter-cards__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(28px, 4vw, 54px);
}

.magic-home-info-card {
	display: block;
	min-width: 0;
	padding: 0;
	background: transparent;
}

.magic-home-info-card__icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0 0 26px;
	color: var(--wp--preset--color--foreground, #17181c);
}

.magic-home-info-card__icon svg {
	display: block;
	width: 38px;
	height: 38px;
}

.magic-home-info-card__content {
	display: block;
}

.magic-home-info-card h3 {
	margin: 0 0 10px;
	font-size: clamp(1rem, 1.25vw, 1.14rem);
	font-weight: 650;
	line-height: 1.25;
}

.magic-home-info-card p {
	margin: 0;
	color: var(--wp--preset--color--muted, #62646b);
	font-size: 0.93rem;
	line-height: 1.62;
}

.magic-home-info-card a {
	display: inline-flex;
	align-items: center;
	margin-top: 16px;
	color: inherit;
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

.magic-home-info-card a:hover {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

@media (max-width: 999px) {
	.magic-home-prefooter-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 34px 40px;
	}
}

@media (max-width: 599px) {
	.magic-home-ad {
		padding-top: 24px;
	}

	.magic-home-prefooter-cards {
		padding-top: 48px;
		padding-bottom: 46px;
	}

	.magic-home-prefooter-cards__intro {
		margin-bottom: 30px;
		text-align: left;
	}

	.magic-home-prefooter-cards__subtitle {
		margin-inline: 0;
	}

	.magic-home-prefooter-cards__grid {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.magic-home-info-card__icon {
		margin-bottom: 18px;
	}
}
