/*! Catalog Photo Preview 1.0 | Kotelnikov LAB */
.cpp-wrap {
	--cpp-color: #222;
	--cpp-duration: 280ms;
	position: relative;
	display: block;
	touch-action: pan-y;
}

.cpp-wrap.cpp-active > .cpp-base {
	visibility: hidden !important;
}

/* Рамка точно по размеру картинки товара */
.cpp-frame {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	visibility: hidden;
	pointer-events: none;
	z-index: 2;
}

.cpp-wrap.cpp-active .cpp-frame {
	visibility: visible;
}

.cpp-stage {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	overflow: hidden;
}

.cpp-stage > .cpp-layer {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: contain;
	opacity: 0 !important;
	z-index: 0;
}

.cpp-stage > .cpp-layer.is-prev {
	opacity: 1 !important;
	z-index: 1;
}

.cpp-stage > .cpp-layer.is-active {
	opacity: 1 !important;
	z-index: 2;
}

/* Эффекты */
.cpp-effect-fade .cpp-stage > .cpp-layer {
	transition: opacity var(--cpp-duration) ease;
}

.cpp-effect-slide .cpp-stage > .cpp-layer {
	opacity: 1 !important;
	transition: transform var(--cpp-duration) cubic-bezier(.4, 0, .2, 1);
}

/* «+N фото» на последнем кадре */
.cpp-more {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	opacity: 0;
	transition: opacity var(--cpp-duration) ease;
	z-index: 3;
}

.cpp-last .cpp-more {
	opacity: 1;
}

/* Индикатор */
.cpp-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	gap: 4px;
	padding: 0 10px 8px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity .2s ease;
	z-index: 4;
}

.cpp-wrap.cpp-active .cpp-bar {
	opacity: 1;
}

.cpp-dot {
	flex: 1 1 0;
	padding-top: 6px;
}

.cpp-dot-line {
	display: block;
	height: 2px;
	border-radius: 1px;
	background: rgba(0, 0, 0, .15);
	transition: background-color .15s ease;
}

.cpp-mode-dots .cpp-bar {
	padding-bottom: 0;
	pointer-events: auto;
}

.cpp-mode-dots .cpp-dot {
	padding: 14px 0 8px;
	cursor: pointer;
}

.cpp-mode-dots .cpp-dot:hover .cpp-dot-line {
	background: rgba(0, 0, 0, .35);
}

.cpp-wrap .cpp-bar .cpp-dot.is-active .cpp-dot-line {
	background: var(--cpp-color);
}

.cpp-wrap.cpp-last .cpp-bar .cpp-dot-line {
	background: rgba(255, 255, 255, .45);
}

.cpp-wrap.cpp-last .cpp-bar .cpp-dot.is-active .cpp-dot-line {
	background: #fff;
}

/* Стрелки */
.cpp-arrow {
	position: absolute;
	top: 50%;
	width: 32px;
	height: 32px;
	margin-top: -16px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	cursor: pointer;
	pointer-events: auto;
	opacity: 0;
	transition: opacity .2s ease, transform .15s ease;
	z-index: 5;
}

.cpp-wrap.cpp-active .cpp-arrow {
	opacity: 1;
}

.cpp-arrow:hover {
	transform: scale(1.08);
}

.cpp-prev {
	left: 8px;
}

.cpp-next {
	right: 8px;
}

.cpp-arrow::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-top: 2px solid var(--cpp-color);
	border-right: 2px solid var(--cpp-color);
}

.cpp-prev::before {
	transform: translate(-30%, -50%) rotate(-135deg);
}

.cpp-next::before {
	transform: translate(-70%, -50%) rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
	.cpp-stage > .cpp-layer,
	.cpp-more {
		transition: none !important;
	}
}
