/**
 * Фронтенд-галерея вариаций WooTune.
 * Лёгкая разметка: главное фото + лента миниатюр под ним.
 */

.wtune-gallery {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wtune-gallery__main {
	position: relative;
	overflow: hidden;
}

.wtune-gallery__main-img {
	display: block;
	width: 100%;
	height: auto;
	cursor: zoom-in;
}

.wtune-gallery__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #1e293b;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wtune-gallery__arrow:hover {
	background: #fff;
}

.wtune-gallery__arrow[hidden] {
	display: none;
}

.wtune-gallery__arrow--prev {
	left: 8px;
}

.wtune-gallery__arrow--next {
	right: 8px;
}

.wtune-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wtune-gallery__thumb {
	padding: 0;
	margin: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	line-height: 0;
	overflow: hidden;
	flex: 0 0 auto;
	width: 72px;
}

.wtune-gallery__thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.wtune-gallery__thumb.is-active {
	border-color: currentColor;
}

.wtune-gallery__thumb:hover {
	opacity: 0.85;
}

.wtune-lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.9);
	z-index: 100000;
	padding: 40px;
}

.wtune-lightbox.is-open {
	display: flex;
}

/* Рамка размером точно под фото — крестик сидит в её углу, а не в углу экрана. */
.wtune-lightbox__frame {
	position: relative;
	display: inline-block;
	line-height: 0;
	max-width: 100%;
	max-height: 100%;
}

.wtune-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 80px);
	object-fit: contain;
}

.wtune-lightbox__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.55);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.wtune-lightbox__close:hover {
	background: rgba(15, 23, 42, 0.8);
}

.wtune-lightbox__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.55);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.wtune-lightbox__arrow:hover {
	background: rgba(15, 23, 42, 0.8);
}

.wtune-lightbox__arrow[hidden] {
	display: none;
}

.wtune-lightbox__arrow--prev {
	left: 8px;
}

.wtune-lightbox__arrow--next {
	right: 8px;
}

.wtune-lightbox__counter {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.55);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
}

/* Телефон — меньше отступов вокруг фото, крестику больше нечего задевать. */
@media (max-width: 600px) {
	.wtune-lightbox {
		padding: 16px;
	}

	.wtune-lightbox__img {
		max-height: calc(100vh - 32px);
	}
}
