/* Alegro Caffè — independent WooCommerce gallery carousel */
.alegro-product-gallery,
.alegro-product-gallery * { box-sizing: border-box; }

.alegro-product-gallery {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	isolation: isolate;
}

.alegro-product-gallery__viewport {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
	cursor: grab;
}
.alegro-product-gallery__viewport:active { cursor: grabbing; }

.alegro-product-gallery__track {
	display: flex;
	flex-flow: row nowrap;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	transform: translate3d(0, 0, 0);
	transition: transform 280ms ease;
	will-change: transform;
}

.alegro-product-gallery__slide {
	position: relative;
	display: flex;
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.alegro-product-gallery__image {
	display: block !important;
	flex: 0 0 auto;
	width: 100% !important;
	max-width: 100% !important;
	height: auto;
	max-height: var(--alegro-image-max-h, 520px);
	object-fit: contain;
	object-position: center;
	margin: 0 auto !important;
	padding: 0 !important;
	border: 0;
	box-shadow: none;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.alegro-product-gallery__arrow {
	position: absolute;
	z-index: 3;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--alegro-arrow-size, 34px);
	height: var(--alegro-arrow-size, 34px);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--alegro-arrow-bg, rgba(255,255,255,.92));
	color: var(--alegro-arrow-color, #292929);
	box-shadow: 0 1px 6px rgba(0,0,0,.16);
	font-size: calc(var(--alegro-arrow-size, 34px) * .78);
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	appearance: none;
	-webkit-appearance: none;
}
.alegro-product-gallery__arrow:hover,
.alegro-product-gallery__arrow:focus { filter: brightness(.96); }
.alegro-product-gallery__arrow:disabled { opacity: .45; cursor: default; }
.alegro-product-gallery__arrow--prev { left: 8px; }
.alegro-product-gallery__arrow--next { right: 8px; }

.alegro-product-gallery__dots {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	max-width: 100%;
	margin: 9px 0 0;
	padding: 0 4px;
}
.alegro-product-gallery__dot {
	display: block;
	flex: 0 0 var(--alegro-dot-size, 7px);
	width: var(--alegro-dot-size, 7px);
	height: var(--alegro-dot-size, 7px);
	min-width: var(--alegro-dot-size, 7px);
	min-height: var(--alegro-dot-size, 7px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--alegro-dot-color, #c9c9c9);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
.alegro-product-gallery__dot.is-active { background: var(--alegro-dot-active, #555); }
.alegro-product-gallery button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@media (max-width: 767px) {
	.alegro-product-gallery,
	.alegro-product-gallery__viewport,
	.alegro-product-gallery__track,
	.alegro-product-gallery__slide { max-width: 100%; min-width: 0; }
	.alegro-product-gallery__image { max-height: var(--alegro-mobile-max-h, 360px); }
	.alegro-product-gallery__arrow--prev { left: 5px; }
	.alegro-product-gallery__arrow--next { right: 5px; }
}
@media (prefers-reduced-motion: reduce) {
	.alegro-product-gallery__track { transition: none; }
}
