/* Vision AG – Image Carousel */

.vag-ic {
	--vag-ic-h: 320px;
	--vag-ic-gap: 20px;
	--vag-ic-cols: 3;
	--vag-ic-fit: cover;
	--vag-ic-pos: center center;
	--vag-ic-valign: flex-end;
	--vag-ic-hover-ms: 500ms;
	--vag-ic-arrow-box: 44px;
	--vag-ic-arrow-icon: 20px;
	--vag-ic-arrow-offset: 12px;
	--vag-ic-dot: 8px;
	--vag-ic-dot-color: rgba(0, 0, 0, .25);
	--vag-ic-dot-active: #111;
	--vag-ic-dots-space: 20px;
	position: relative;
	width: 100%;
}

.vag-ic__viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* ---------- Slide / item ---------- */

.vag-ic .vag-ic__slide {
	position: relative;
	flex-shrink: 0;
	height: auto;
	box-sizing: border-box;
}

.vag-ic .vag-ic__item {
	display: flex;
	flex-direction: column;
	position: relative;
	color: inherit;
	text-decoration: none;
	outline-offset: 3px;
}

.vag-ic .vag-ic__media {
	display: block;
	position: relative;
	overflow: hidden;
	line-height: 0;
}

.vag-ic .vag-ic__img {
	display: block;
	height: var(--vag-ic-h);
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: transform var(--vag-ic-hover-ms) cubic-bezier(.25, 1, .5, 1),
		filter var(--vag-ic-hover-ms) ease,
		opacity var(--vag-ic-hover-ms) ease;
}

/* Larghezza automatica: altezza fissa, larghezza dalle proporzioni native */
.vag-ic--width-auto .vag-ic__slide.vag-ic__slide {
	width: auto;
}

.vag-ic--width-auto .vag-ic__item {
	width: min-content; /* il testo sotto va a capo sulla larghezza dell'immagine */
}

.vag-ic--width-auto .vag-ic__img {
	width: auto;
}

/* Numero fisso: l'immagine riempie la cella */
.vag-ic--width-fixed .vag-ic__item {
	width: 100%;
}

.vag-ic--width-fixed .vag-ic__img {
	width: 100%;
	object-fit: var(--vag-ic-fit);
	object-position: var(--vag-ic-pos);
}

/* Altezza in percentuale: serve una catena di altezze definite fino all'immagine.
   La percentuale si riferisce all'altezza del contenitore Elementor. */
.vag-ic--h-relative,
.vag-ic--h-relative .vag-ic__viewport,
.vag-ic--h-relative .vag-ic__track,
.vag-ic--h-relative .vag-ic__slide,
.vag-ic--h-relative .vag-ic__item {
	height: 100%;
}

.vag-ic--h-relative .vag-ic__media {
	height: var(--vag-ic-h);
}

.vag-ic--h-relative .vag-ic__img {
	height: 100%;
}

/* ---------- Testi ---------- */

.vag-ic .vag-ic__content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	line-height: 1.45;
	box-sizing: border-box;
}

.vag-ic--content-below .vag-ic__content {
	padding-top: 12px;
}

.vag-ic--content-overlay .vag-ic__content,
.vag-ic--content-overlay-hover .vag-ic__content {
	position: absolute;
	inset: 0;
	justify-content: var(--vag-ic-valign);
	padding: 20px;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 70%);
}

.vag-ic--content-overlay-hover .vag-ic__content {
	opacity: 0;
	transition: opacity .35s ease;
}

.vag-ic--content-overlay-hover .vag-ic__item:hover .vag-ic__content,
.vag-ic--content-overlay-hover .vag-ic__item:focus-visible .vag-ic__content {
	opacity: 1;
}

.vag-ic .vag-ic__title,
.vag-ic .vag-ic__desc,
.vag-ic .vag-ic__caption {
	display: block;
	margin: 0;
	padding: 0;
	color: inherit;
}

.vag-ic .vag-ic__title {
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.3;
}

.vag-ic .vag-ic__caption {
	font-size: .85em;
	opacity: .8;
}

/* ---------- Effetti hover ---------- */

.vag-ic--hover-zoom .vag-ic__item:hover .vag-ic__img {
	transform: scale(1.06);
}

.vag-ic--hover-grayscale .vag-ic__img {
	filter: grayscale(1);
}

.vag-ic--hover-grayscale .vag-ic__item:hover .vag-ic__img {
	filter: grayscale(0);
}

.vag-ic--hover-opacity .vag-ic__item:hover .vag-ic__img {
	opacity: .75;
}

/* ---------- Carosello (Swiper) ---------- */

.vag-ic--carousel .swiper-wrapper {
	display: flex;
	position: relative;
	z-index: 1;
	width: 100%;
	box-sizing: content-box;
	transition-property: transform;
}

.vag-ic--carousel .swiper-fade .swiper-slide,
.vag-ic--carousel .swiper-container-fade .swiper-slide {
	pointer-events: none;
	transition-property: opacity;
}

.vag-ic--carousel .swiper-fade .swiper-slide-active,
.vag-ic--carousel .swiper-container-fade .swiper-slide-active {
	pointer-events: auto;
}

/* In dissolvenza con larghezza automatica l'immagine è centrata */
.vag-ic--width-auto .swiper-fade .vag-ic__slide,
.vag-ic--width-auto .swiper-container-fade .vag-ic__slide {
	display: flex;
	justify-content: center;
}

.vag-ic--carousel .swiper-3d,
.vag-ic--carousel .swiper-container-3d {
	perspective: 1200px;
}

.vag-ic--carousel .swiper-3d .swiper-wrapper,
.vag-ic--carousel .swiper-3d .swiper-slide,
.vag-ic--carousel .swiper-container-3d .swiper-wrapper,
.vag-ic--carousel .swiper-container-3d .swiper-slide {
	transform-style: preserve-3d;
}

/* Prima dell'inizializzazione: niente "salto" di layout */
.vag-ic--carousel:not(.vag-ic--ready) .swiper-wrapper {
	gap: var(--vag-ic-gap);
}

.vag-ic--carousel.vag-ic--width-fixed:not(.vag-ic--ready) .vag-ic__slide {
	width: calc((100% - (var(--vag-ic-cols) - 1) * var(--vag-ic-gap)) / var(--vag-ic-cols));
}

/* Frecce */
.vag-ic .vag-ic__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--vag-ic-arrow-box);
	height: var(--vag-ic-arrow-box);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #111;
	font-size: var(--vag-ic-arrow-icon);
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	transition: background-color .2s ease, color .2s ease, opacity .2s ease, transform .2s ease;
}

.vag-ic--content-below .vag-ic__arrow {
	top: calc(var(--vag-ic-h) / 2);
}

.vag-ic .vag-ic__arrow:active {
	transform: translateY(-50%) scale(.94);
}

.vag-ic .vag-ic__arrow svg {
	width: 1em;
	height: 1em;
	display: block;
}

.vag-ic .vag-ic__arrow--prev {
	left: var(--vag-ic-arrow-offset);
}

.vag-ic .vag-ic__arrow--next {
	right: var(--vag-ic-arrow-offset);
}

.vag-ic .vag-ic__arrow.swiper-button-disabled {
	opacity: .35;
	cursor: default;
}

.vag-ic .vag-ic__arrow.swiper-button-lock {
	display: none;
}

/* Paginazione */
.vag-ic .vag-ic__pagination {
	position: relative;
	inset: auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-top: var(--vag-ic-dots-space);
	transform: none;
	text-align: center;
}

.vag-ic .vag-ic__pagination .swiper-pagination-bullet {
	display: inline-block;
	width: var(--vag-ic-dot);
	height: var(--vag-ic-dot);
	margin: 0;
	border-radius: 50%;
	background: var(--vag-ic-dot-color);
	opacity: 1;
	cursor: pointer;
	transition: background-color .25s ease, transform .25s ease;
}

.vag-ic .vag-ic__pagination .swiper-pagination-bullet-active {
	background: var(--vag-ic-dot-active);
	transform: scale(1.25);
}

.vag-ic .vag-ic__pagination.swiper-pagination-progressbar {
	display: block;
	height: max(2px, calc(var(--vag-ic-dot) / 2));
	background: var(--vag-ic-dot-color);
	overflow: hidden;
}

.vag-ic .vag-ic__pagination .swiper-pagination-progressbar-fill {
	position: absolute;
	inset: 0;
	background: var(--vag-ic-dot-active);
	transform: scale(0);
	transform-origin: left top;
}

.vag-ic .vag-ic__pagination.swiper-pagination-lock {
	display: none;
}

/* ---------- Marquee ---------- */

.vag-ic--marquee .vag-ic__viewport {
	container-type: inline-size;
}

.vag-ic--marquee .vag-ic__track {
	display: flex;
	gap: var(--vag-ic-gap);
	width: max-content;
	will-change: transform;
}

.vag-ic--marquee .vag-ic__slide {
	flex: 0 0 auto;
}

.vag-ic--marquee.vag-ic--width-fixed .vag-ic__slide {
	width: calc((100cqw - (var(--vag-ic-cols) - 1) * var(--vag-ic-gap)) / var(--vag-ic-cols));
}

/* Trascinamento */
.vag-ic--marquee.vag-ic--draggable:not(.vag-ic--static) .vag-ic__viewport {
	cursor: grab;
	touch-action: pan-y; /* orizzontale al drag, verticale resta scroll pagina */
	-webkit-user-select: none;
	user-select: none;
}

.vag-ic--marquee.vag-ic--dragging .vag-ic__viewport,
.vag-ic--marquee.vag-ic--dragging .vag-ic__item {
	cursor: grabbing;
}

.vag-ic--draggable .vag-ic__img {
	-webkit-user-drag: none;
}

.vag-ic--dragging .vag-ic__item {
	pointer-events: none; /* niente hover/zoom sulle immagini mentre si trascina */
}

/* Riduzione movimento: fila scorrevole a mano */
.vag-ic--static .vag-ic__viewport {
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.vag-ic--static .vag-ic__slide {
	scroll-snap-align: start;
}

/* ---------- Editor ---------- */

.vag-ic-empty {
	padding: 30px;
	border: 1px dashed #c3c4c7;
	text-align: center;
	font-size: 14px;
	color: #6d7882;
}
