/*
 * Modulo Home: ogni regola e' protetta dalla classe di contesto aggiunta dal plugin.
 * Nessun selettore di questo file deve essere usato senza .ivision-responsive-home.
 */

.ivision-responsive-home,
.ivision-responsive-home * {
	box-sizing: border-box;
}

/* Target tattili: l'icona non cresce, cresce soltanto l'area interattiva. */
.ivision-responsive-home #menu-m,
.ivision-responsive-home #menu-d,
.ivision-responsive-home .elementor-menu-cart__toggle_button,
.ivision-responsive-home .ekit_navsearch-button,
.ivision-responsive-home .elementor-social-icon,
.ivision-responsive-home .elementor-swiper-button {
	align-items: center;
	display: inline-flex;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
}

@media (max-width: 767px) {
	/* Ripristina il punto focale mobile originale per mantenere leggibile il testo. */
	.ivision-responsive-home .elementor-element-f20c566 .swiper-slide-bg {
		background-position: calc(50% + 135px) calc(50% - 30px) !important;
		background-repeat: no-repeat !important;
	}
}

@media (orientation: landscape) and (max-width: 767px) {
	/* La tipografia verticale resta originale; conserva solo il trattamento orizzontale. */
	.ivision-responsive-home .elementor-element-f20c566 .elementor-slide-description h2,
	.ivision-responsive-home .elementor-element-f20c566 .elementor-slide-heading {
		line-height: .92 !important;
		max-width: 100%;
		text-wrap: balance;
	}
}

@media (max-width: 1279px) {
	/* Scala progressivamente i titoli editoriali anche nell'intervallo tablet. */
	.ivision-responsive-home :is(.elementor-element-efe8435, .elementor-element-0543c87, .elementor-element-0dbe58b) .elementor-heading-title,
	.ivision-responsive-home :is(.elementor-element-75ac0af, .elementor-element-be264e6) .elementor-heading-title,
	.ivision-responsive-home .elementor-element-3b7aab9 .elementor-heading-title,
	.ivision-responsive-home .elementor-element-a670b38 .elementor-heading-title {
		line-height: .96 !important;
		max-width: 100%;
		overflow-wrap: break-word;
		text-wrap: balance;
	}

	/* Evita la collisione tra il nome collezione e il link "mostra tutto". */
	.ivision-responsive-home .elementor-element-6f95399 .elementor-hidden-mobile.elementor-widget-heading .elementor-heading-title,
	.ivision-responsive-home .elementor-element-6f95399 .elementor-hidden-desktop.elementor-hidden-tablet.elementor-widget-heading .elementor-heading-title {
		line-height: 1.05 !important;
	}

	.ivision-responsive-home .elementor-element-6f95399 .elementor-widget-button .elementor-button,
	.ivision-responsive-home .elementor-element-6f95399 .elementor-widget-button .elementor-button-text {
		line-height: 1.1 !important;
		white-space: nowrap;
	}
}

@media (min-width: 1025px) and (max-width: 1279px) {
	/* Il menu compatto evita overflow sui viewport iPad Pro senza ridurre il target tattile. */
	.ivision-responsive-home #menu-d {
		padding-left: 0 !important;
		padding-right: 0 !important;
		width: 44px;
	}

	.ivision-responsive-home #menu-d .elementor-button-content-wrapper {
		justify-content: center;
	}

	.ivision-responsive-home #menu-d .elementor-button-text {
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}
}

@media (max-width: 1024px) {
	/* Le frecce seguono il centro delle foto, non l'altezza complessiva delle schede. */
	.ivision-responsive-home .elementor-element-6f95399 .elementor-main-swiper .elementor-swiper-button {
		top: var(--ivision-product-image-center-y, 50%) !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	/* Compatta il carosello attorno alla copertina senza ridimensionarla o tagliarla. */
	.ivision-responsive-home .elementor-element-cc3315a .elementor-main-swiper {
		height: 650px !important;
	}

	.ivision-responsive-home .elementor-element-cc3315a .swiper-slide {
		height: 600px !important;
	}

	.ivision-responsive-home .elementor-element-cc3315a .swiper-slide-bg {
		background-position: center top !important;
	}
}

@media (orientation: landscape) and (min-width: 1000px) and (max-width: 1024px) {
	/* Pareggia il respiro sopra e sotto le schede nel layout tablet largo. */
	.ivision-responsive-home .elementor-element-6f95399 :is(.elementor-main-swiper, .swiper-slide) {
		height: 390px !important;
	}

	.ivision-responsive-home .elementor-element-6f95399 .swiper-slide {
		padding-bottom: 0 !important;
	}
}

/* Margine di sicurezza nel punto di passaggio fra layout mobile e tablet. */
@media (min-width: 750px) and (max-width: 767px) {
	.ivision-responsive-home .elementor-element-6f95399 :is(.elementor-main-swiper, .swiper-wrapper, .swiper-slide) {
		min-height: 580px;
	}
}

@media (max-width: 349px) {
	/* Rimuove la griglia fissa 150px + 150px che generava overflow a 320px. */
	.ivision-responsive-home :is(.elementor-element-16e19e4, .elementor-element-8f94eff, .elementor-element-9b1ce4e) {
		--e-con-grid-template-columns: repeat(2, minmax(0, 1fr));
		--e-con-grid-template-rows: auto auto;
		max-width: 100%;
		padding-left: max(10px, env(safe-area-inset-left));
		padding-right: max(10px, env(safe-area-inset-right));
		width: 100%;
	}

	.ivision-responsive-home :is(.elementor-element-16e19e4, .elementor-element-8f94eff, .elementor-element-9b1ce4e) > .e-con-inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-width: 100%;
		min-width: 0;
		width: 100%;
	}

	.ivision-responsive-home :is(.elementor-element-16e19e4, .elementor-element-8f94eff, .elementor-element-9b1ce4e) .elementor-element,
	.ivision-responsive-home :is(.elementor-element-16e19e4, .elementor-element-8f94eff, .elementor-element-9b1ce4e) .elementor-widget-container {
		max-width: 100%;
		min-width: 0;
	}

	.ivision-responsive-home :is(.elementor-element-16e19e4, .elementor-element-8f94eff, .elementor-element-9b1ce4e) img {
		height: auto;
		max-width: 140px;
		width: 100%;
	}
}

/*
 * Telefoni in orizzontale: limita le due immagini verticali senza influire
 * sulla resa portrait. Il punto focale degli occhiali resta intenzionale,
 * mentre il lingotto viene mostrato per intero.
 */
@media (orientation: landscape) and (max-width: 899px) and (max-height: 500px) {
	/* Quando testo e foto si impilano, mantiene coerente il CTA nelle tre lingue. */
	.ivision-responsive-home .e-con-inner:has(> .elementor-widget-image img.wp-image-970) .elementor-mobile-align-center.elementor-widget-button,
	.ivision-responsive-home .e-con-inner:has(> .elementor-widget-image img.wp-image-970) .elementor-button-wrapper {
		text-align: center !important;
	}

	.ivision-responsive-home img.wp-image-970 {
		display: block;
		height: min(55vh, 230px) !important;
		height: min(55svh, 230px) !important;
		object-fit: cover;
		object-position: center 42%;
		width: 100% !important;
	}

	.ivision-responsive-home img.wp-image-1068 {
		background: #fff;
		display: block;
		height: min(82vh, 360px) !important;
		height: min(82svh, 360px) !important;
		object-fit: contain;
		object-position: center;
		width: 100% !important;
	}
}

/* Tablet in verticale: immagini complete, centrate e senza scroll eccessivo. */
@media (orientation: portrait) and (min-width: 768px) and (max-width: 899px) {
	.ivision-responsive-home img.wp-image-970,
	.ivision-responsive-home img.wp-image-1068 {
		display: block;
		height: auto !important;
		margin-left: auto;
		margin-right: auto;
		max-height: min(70vh, 720px);
		max-height: min(70svh, 720px);
		max-width: 100%;
		object-fit: contain;
		object-position: center;
		width: auto !important;
	}
}

@media (orientation: portrait) and (max-width: 767px) {
	/* Riduce solo l'ingombro della foto verticale, mantenendola completa. */
	.ivision-responsive-home img.wp-image-1068 {
		display: block;
		height: auto !important;
		margin-left: auto;
		margin-right: auto;
		max-height: min(55vh, 320px);
		max-height: min(55svh, 320px);
		max-width: 100%;
		object-fit: contain;
		object-position: center;
		width: auto !important;
	}

	/* Elimina il solo vuoto macroscopico prima del footer. */
	.ivision-responsive-home .elementor-element-b5fe466 {
		margin-top: 48px !important;
	}
}

/* Ammorbidisce il salto strutturale fra tablet Elementor e desktop. */
@media (min-width: 900px) and (max-width: 1024px) {
	.ivision-responsive-home :is(.elementor-element-2d35a5f, .elementor-element-587362b, .elementor-element-d95b0da) > .e-con-inner {
		align-items: stretch;
		display: grid;
		gap: clamp(24px, 4vw, 48px);
		grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
	}

	.ivision-responsive-home :is(.elementor-element-2d35a5f, .elementor-element-587362b, .elementor-element-d95b0da) > .e-con-inner > .elementor-element {
		min-width: 0;
		width: 100%;
	}

	/* Allinea la foto all'inizio visivo del titolo della colonna testuale. */
	.ivision-responsive-home :is(.elementor-element-2d35a5f, .elementor-element-587362b, .elementor-element-d95b0da) > .e-con-inner > .elementor-widget-image {
		align-self: start;
		margin-top: 30px;
	}
}
