
.impmc-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.impmc-viewport {
	width: 100%;
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
}

.impmc-track {
	display: flex;
	align-items: stretch;
	gap: 2px;
	will-change: transform;
	transform: translate3d(0,0,0);
}

.impmc-slide {
	position: relative;
	flex: 0 0 auto;
	height: var(--impmc-height);
	overflow: hidden;
	background: #f2f2f2;
}

.impmc-slide--landscape {
	width: clamp(420px, 41vw, 680px);
}

.impmc-slide--portrait {
	width: auto;
}

.impmc-slide--square {
	width: clamp(330px, 33vw, 520px);
}

.impmc-open {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: zoom-in;
	overflow: hidden;
}

.impmc-image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: var(--impmc-fit);
	object-position: center;
	user-select: none;
	-webkit-user-drag: none;
	transition: transform 550ms cubic-bezier(.16,1,.3,1);
	image-orientation: from-image;
}

.impmc-slide--portrait .impmc-open {
	width: auto;
	height: 100%;
}

.impmc-slide--portrait .impmc-image {
	width: auto;
	height: 100%;
	max-width: none;
	object-fit: contain;
	transform: none;
}

.impmc-open:hover .impmc-image {
	transform: scale(1.02);
}

.impmc-slide--portrait .impmc-open:hover .impmc-image {
	transform: none;
}

.impmc-arrow {
	position: absolute;
	top: 50%;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	padding: 0;
	border: 1px solid rgba(255,255,255,.75);
	border-radius: 50%;
	background: rgba(255,255,255,.92);
	box-shadow: 0 8px 28px rgba(0,0,0,.14);
	color: #111;
	cursor: pointer;
	transform: translateY(-50%);
	transition:
		background-color 220ms ease,
		color 220ms ease,
		transform 220ms ease;
}

.impmc-arrow:hover {
	background: #111;
	color: #fff;
	transform: translateY(-50%) scale(1.04);
}

.impmc-arrow--prev {
	left: 18px;
}

.impmc-arrow--next {
	right: 18px;
}

.impmc-arrow svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* LIGHTBOX */

.impmc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 35px;
	background: rgba(0,0,0,.86);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 250ms ease;
}

.impmc-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.impmc-lightbox__content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: calc(100vw - 90px);
	max-height: calc(100vh - 90px);
}

.impmc-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: calc(100vw - 90px);
	max-height: calc(100vh - 90px);
	object-fit: contain;
	opacity: 1;
	transform: translate3d(0,0,0) scale(1);
	transition:
		opacity 320ms cubic-bezier(.4,0,.2,1),
		transform 420ms cubic-bezier(.16,1,.3,1);
	will-change: opacity, transform;
}

.impmc-lightbox__image.is-changing-out {
	opacity: 0;
	transform: translate3d(var(--impmc-lb-shift, 14px),0,0) scale(.992);
}

.impmc-lightbox__image.is-changing-in {
	opacity: 0;
	transform: translate3d(calc(var(--impmc-lb-shift, 14px) * -1),0,0) scale(.992);
}

.impmc-lightbox__close {
	position: absolute;
	top: -20px;
	right: -20px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	box-shadow: 0 6px 20px rgba(0,0,0,.35);
	font-size: 28px;
	cursor: pointer;
}

.impmc-lightbox__nav {
	position: fixed;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba(255,255,255,.4);
	border-radius: 50%;
	background: rgba(0,0,0,.25);
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
}

.impmc-lightbox__nav--prev {
	left: 22px;
}

.impmc-lightbox__nav--next {
	right: 22px;
}

.impmc-lightbox__nav svg {
	width: 23px;
	height: 23px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body.impmc-lightbox-open {
	overflow: hidden !important;
}

@media (max-width: 767px) {

	.impmc-slide,
	.impmc-slide--landscape,
	.impmc-slide--portrait,
	.impmc-slide--square {
		width: calc(100vw - 44px);
		height: var(--impmc-mobile-height);
	}

	.impmc-slide--landscape,
	.impmc-slide--landscape .impmc-open,
	.impmc-slide--portrait,
	.impmc-slide--portrait .impmc-open {
		background: #eeeeee;
	}

	.impmc-slide--landscape .impmc-image,
	.impmc-slide--portrait .impmc-image {
		width: 100%;
		height: 100%;
		max-width: 100%;
		object-fit: contain;
		object-position: center;
	}

	.impmc-arrow {
		width: 42px;
		height: 42px;
	}

	.impmc-arrow--prev {
		left: 10px;
	}

	.impmc-arrow--next {
		right: 10px;
	}

	.impmc-lightbox {
		padding: 18px;
	}

	.impmc-lightbox__content,
	.impmc-lightbox__image {
		max-width: calc(100vw - 36px);
		max-height: calc(100vh - 90px);
	}

	.impmc-lightbox__close {
		top: -16px;
		right: -8px;
		width: 40px;
		height: 40px;
	}

	.impmc-lightbox__nav {
		top: auto;
		bottom: 18px;
		width: 46px;
		height: 46px;
		transform: none;
	}

	.impmc-lightbox__nav--prev {
		left: calc(50% - 54px);
	}

	.impmc-lightbox__nav--next {
		right: calc(50% - 54px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.impmc-track,
	.impmc-image,
	.impmc-lightbox,
	.impmc-lightbox__image {
		transition: none !important;
	}
}

/* Tablet: due immagini affiancate, stesso plugin/slug */
@media (min-width: 768px) and (max-width: 1366px) {
	.impmc-track { gap: 2px; }
	.impmc-slide,
	.impmc-slide--landscape,
	.impmc-slide--portrait,
	.impmc-slide--square {
		width: calc((100vw - 2px) / 2);
		flex: 0 0 calc((100vw - 2px) / 2);
		background: #fff;
	}
	.impmc-slide .impmc-open,
	.impmc-slide--portrait .impmc-open {
		width: 100%;
		height: 100%;
		background: #fff;
	}
	.impmc-slide .impmc-image,
	.impmc-slide--portrait .impmc-image {
		width: 100%;
		height: 100%;
		max-width: 100%;
		object-fit: cover;
	}
}

/* Tablet verticale: stessa logica del desktop (striscia continua, niente spazi grigi) */
@media (min-width: 600px) and (max-width: 1366px) and (orientation: portrait) {
	.impmc-slide,
	.impmc-slide--landscape,
	.impmc-slide--portrait,
	.impmc-slide--square {
		flex: 0 0 auto;
		height: var(--impmc-height);
		background: #f2f2f2;
	}
	.impmc-slide--landscape { width: clamp(420px, 41vw, 680px); }
	.impmc-slide--square    { width: clamp(330px, 33vw, 520px); }
	.impmc-slide--portrait  { width: auto; }

	.impmc-slide .impmc-open,
	.impmc-slide--landscape .impmc-open {
		width: 100%;
		height: 100%;
		background: transparent;
	}
	.impmc-slide .impmc-image,
	.impmc-slide--landscape .impmc-image {
		width: 100%;
		height: 100%;
		max-width: none;
		object-fit: var(--impmc-fit);
	}

	.impmc-slide--portrait .impmc-open {
		width: auto;
		height: 100%;
	}
	.impmc-slide--portrait .impmc-image {
		width: auto;
		height: 100%;
		max-width: none;
		object-fit: contain;
	}
}
