/**
 * AOP Product Gallery styles.
 * Brand: primary #FF4D00, secondary #00FF94.
 */

.aop-pg {
	--aop-pg-primary: #FF4D00;
	--aop-pg-border: #e0e0e0;
	--aop-pg-radius: 12px;
	--aop-pg-cols: 3;
	width: 100%;
}

/* ---------- Main image ---------- */
.aop-pg__main {
	position: relative;
	overflow: hidden;
	border-radius: var(--aop-pg-radius);
	background: rgba(0, 0, 0, 0.04);
}

.aop-pg__main-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	margin: 0;
	background: none;
	cursor: zoom-in;
	position: relative;
	line-height: 0;
}

.aop-pg__main-img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.4s ease;
}

.aop-pg__main-btn:hover .aop-pg__main-img {
	transform: scale(1.03);
}

.aop-pg__zoom-hint {
	position: absolute;
	bottom: 14px;
	right: 14px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
	transition: background 0.2s ease;
}

.aop-pg__main-btn:hover .aop-pg__zoom-hint {
	background: var(--aop-pg-primary);
}

/* ---------- Thumbnails (bottom) ---------- */
.aop-pg__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

.aop-pg__thumb {
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	padding: 0;
	border: 2px solid var(--aop-pg-border);
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	background: none;
	transition: border-color 0.2s ease, transform 0.2s ease;
	line-height: 0;
}

.aop-pg__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aop-pg__thumb.is-active {
	border-color: var(--aop-pg-primary);
}

.aop-pg__thumb:hover {
	transform: translateY(-2px);
}

/* ---------- Layout: thumbs left ---------- */
.aop-pg--thumbs-left {
	display: flex;
	flex-direction: row-reverse;
	gap: 14px;
	align-items: flex-start;
}

.aop-pg--thumbs-left .aop-pg__main {
	flex: 1;
}

.aop-pg--thumbs-left .aop-pg__thumbs {
	flex-direction: column;
	margin-top: 0;
	flex: 0 0 88px;
}

/* ---------- Layout: grid ---------- */
.aop-pg__grid {
	display: grid;
	grid-template-columns: repeat(var(--aop-pg-cols), 1fr);
	gap: 12px;
}

.aop-pg__grid-item {
	padding: 0;
	border: 1px solid var(--aop-pg-border);
	border-radius: var(--aop-pg-radius);
	overflow: hidden;
	cursor: zoom-in;
	background: none;
	line-height: 0;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.aop-pg__grid-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	aspect-ratio: 1 / 1;
}

.aop-pg__grid-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ---------- Data script never displays ---------- */
.aop-pg__data {
	display: none;
}

/* ---------- Lightbox ---------- */
.aop-pg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(6, 5, 4, 0.94);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aop-pg-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.aop-pg-lightbox__stage {
	position: relative;
	max-width: 90vw;
	max-height: 82vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aop-pg-lightbox__img {
	max-width: 90vw;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 8px;
	user-select: none;
}

.aop-pg-lightbox__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	z-index: 2;
}

.aop-pg-lightbox__btn:hover {
	background: var(--aop-pg-primary, #FF4D00);
}

.aop-pg-lightbox__btn--prev {
	left: 24px;
}

.aop-pg-lightbox__btn--next {
	right: 24px;
}

.aop-pg-lightbox__close {
	position: absolute;
	top: 24px;
	right: 24px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.aop-pg-lightbox__close:hover {
	background: var(--aop-pg-primary, #FF4D00);
}

.aop-pg-lightbox__counter {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	letter-spacing: 0.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.aop-pg--thumbs-left {
		flex-direction: column;
	}

	.aop-pg--thumbs-left .aop-pg__thumbs {
		flex-direction: row;
		flex-wrap: wrap;
		margin-top: 12px;
	}

	.aop-pg__thumb {
		width: 64px;
		height: 64px;
	}

	.aop-pg-lightbox__btn--prev {
		left: 10px;
	}

	.aop-pg-lightbox__btn--next {
		right: 10px;
	}
}
