/* Modern mobile product gallery. Desktop lightbox and desktop zoom stay intact. */
@media only screen and (max-width: 767px) {
	/* The obsolete Devicer/YITH viewers must never cover the new gallery. */
	body.single-product > .ilightbox-overlay,
	body.single-product > .ilightbox-loader,
	body.single-product > .ilightbox-holder,
	body.single-product > .pp_overlay,
	body.single-product > .pp_pic_holder,
	body.single-product > .ppt {
		display: none !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}

	html.idanny-mobile-gallery-open,
	body.idanny-mobile-gallery-open {
		overflow: hidden !important;
		overscroll-behavior: none;
	}

	.idanny-mobile-gallery {
		position: fixed;
		inset: 0;
		z-index: 2147483000;
		display: grid;
		grid-template-rows: auto minmax(0, 1fr) auto;
		width: 100%;
		height: 100%;
		height: 100dvh;
		margin: 0;
		padding: 0;
		background: #050506;
		color: #fff;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
		overscroll-behavior: contain;
		touch-action: none;
	}

	.idanny-mobile-gallery[hidden] {
		display: none !important;
	}

	.idanny-mobile-gallery__topbar {
		position: relative;
		z-index: 4;
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 64px;
		padding: max(10px, env(safe-area-inset-top)) 66px 8px;
		background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
	}

	.idanny-mobile-gallery__counter {
		min-width: 62px;
		padding: 6px 13px;
		border: 1px solid rgba(255, 255, 255, .14);
		border-radius: 999px;
		background: rgba(28, 29, 35, .72);
		font-size: 14px;
		font-weight: 600;
		line-height: 1;
		text-align: center;
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
	}

	.idanny-mobile-gallery__close {
		position: absolute;
		top: max(10px, env(safe-area-inset-top));
		right: 14px;
		display: grid;
		width: 42px;
		height: 42px;
		min-width: 42px;
		min-height: 42px;
		margin: 0;
		padding: 0;
		place-items: center;
		border: 1px solid rgba(255, 255, 255, .16);
		border-radius: 50%;
		background: rgba(28, 29, 35, .78);
		box-shadow: none;
		color: #fff;
		-webkit-appearance: none;
		appearance: none;
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
	}

	.idanny-mobile-gallery__close > span {
		position: relative;
		display: block;
		width: 19px;
		height: 19px;
	}

	.idanny-mobile-gallery__close > span::before,
	.idanny-mobile-gallery__close > span::after {
		position: absolute;
		top: 50%;
		left: 50%;
		width: 21px;
		height: 3px;
		border-radius: 999px;
		background: currentColor;
		content: "";
		transform-origin: center;
	}

	.idanny-mobile-gallery__close > span::before {
		transform: translate(-50%, -50%) rotate(45deg);
	}

	.idanny-mobile-gallery__close > span::after {
		transform: translate(-50%, -50%) rotate(-45deg);
	}

	.idanny-mobile-gallery__stage {
		position: relative;
		min-width: 0;
		min-height: 0;
		overflow: hidden;
		outline: 0;
		touch-action: none;
		user-select: none;
		-webkit-user-select: none;
		-webkit-tap-highlight-color: transparent;
	}

	.idanny-mobile-gallery__image-wrap {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		will-change: transform;
		transform: translate3d(0, 0, 0) scale(1);
		transform-origin: center center;
	}

	.idanny-mobile-gallery__image {
		display: block;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 10px 14px;
		object-fit: contain;
		pointer-events: none;
		-webkit-user-drag: none;
	}

	.idanny-mobile-gallery__footer {
		position: relative;
		z-index: 4;
		padding: 8px 14px max(14px, env(safe-area-inset-bottom));
		background: linear-gradient(0deg, rgba(0, 0, 0, .68), rgba(0, 0, 0, 0));
	}

	.idanny-mobile-gallery__thumbs {
		display: flex;
		justify-content: center;
		gap: 8px;
		max-width: 100%;
		margin: 0;
		padding: 0;
		overflow-x: auto;
		scrollbar-width: none;
		list-style: none;
	}

	.idanny-mobile-gallery__thumbs::-webkit-scrollbar {
		display: none;
	}

	.idanny-mobile-gallery__thumb {
		flex: 0 0 54px;
		width: 54px;
		height: 54px;
		margin: 0;
		padding: 3px;
		border: 2px solid transparent;
		border-radius: 11px;
		background: rgba(255, 255, 255, .16);
		box-shadow: none;
		opacity: .68;
		-webkit-appearance: none;
		appearance: none;
	}

	.idanny-mobile-gallery__thumb.is-active {
		border-color: #fff;
		background: #fff;
		opacity: 1;
	}

	.idanny-mobile-gallery__thumb img {
		display: block;
		width: 100%;
		height: 100%;
		margin: 0;
		border-radius: 7px;
		object-fit: contain;
		background: #fff;
		pointer-events: none;
	}
}
