/* ASS Product Gallery — frontend styles
   Sits inside .portfolio-single__image as rendered by Ernesto theme.
   No fixed pixel widths; uses flex/grid and %. */

/* ── Gallery wrapper ──────────────────────────────────────── */

.assg-gallery {
	/* Custom properties scoped here — not on :root — to avoid global name collisions. */
	--assg-thumb-active-outline: 2px solid currentColor;
	--assg-thumb-gap: 8px;
	--assg-r-badge-bg: #c0392b;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

/* ── Main image ───────────────────────────────────────────── */

.assg-gallery__main {
	width: 100%;
	overflow: hidden;
	cursor: zoom-in;
}

.assg-gallery__main-img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	transition: opacity 0.15s ease;
}

.assg-gallery__main-img.is-loading {
	opacity: 0.6;
}

/* ── Thumbnail strip ──────────────────────────────────────── */

.assg-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--assg-thumb-gap);
}

/* Scroll on very small screens */
@media (max-width: 480px) {
	.assg-gallery__thumbs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.assg-gallery__thumbs::-webkit-scrollbar {
		display: none;
	}
}

/* ── Individual thumbnail ─────────────────────────────────── */

.assg-gallery__thumb {
	position: relative;
	flex: 0 0 auto;
	width: calc(20% - var(--assg-thumb-gap));
	min-width: 60px;
	max-width: 100px;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	cursor: pointer;
	outline: 2px solid transparent;
	outline-offset: 2px;
	transition: outline-color 0.1s ease;
}

.assg-gallery__thumb:hover {
	outline-color: rgba(0,0,0,0.3);
}

.assg-gallery__thumb--active {
	outline: var(--assg-thumb-active-outline);
	outline-offset: 2px;
}

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

/* ── R badge ──────────────────────────────────────────────── */

.assg-gallery__r-badge {
	position: absolute;
	top: 4px;
	right: 4px;
	background: var(--assg-r-badge-bg);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	padding: 2px 5px;
	border-radius: 3px;
	letter-spacing: 0.05em;
	pointer-events: none;
}

/* ── Lightbox ─────────────────────────────────────────────── */

.assg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
}

.assg-lightbox__img-wrap {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	cursor: default;
}

.assg-lightbox__img {
	display: block;
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
}

.assg-lightbox__close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.assg-lightbox__prev,
.assg-lightbox__next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255,255,255,0.1);
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 16px 12px;
	z-index: 100000;
}

.assg-lightbox__prev { left: 0; }
.assg-lightbox__next { right: 0; }

.assg-lightbox__prev:hover,
.assg-lightbox__next:hover {
	background: rgba(255,255,255,0.2);
}
