/* ── Product Gallery ─────────────────────────────────────────────── */

.pg-gallery {
	display: flex;
	flex-direction: column;
	gap: 10px;
	user-select: none;
	width: 100%;
	min-width: 0;
	overflow: hidden;
}

/* ── Main slide wrapper ───────────────────────────────────────────── */

.pg-main-wrap {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: var(--wp--preset--color--surface-alt);
}

.pg-main {
	width: 100%;
}

.pg-main .swiper-slide {
	background: var(--wp--preset--color--surface-alt);
	cursor: pointer;
}

/* aspect-ratio on the img itself — Swiper measures real content, no tricks needed */
.pg-main .swiper-slide img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

/* ── Navigation buttons ──────────────────────────────────────────── */

.pg-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	border: 1px solid var(--wp--preset--color--border);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--wp--preset--color--text);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
	transition: background .15s, opacity .15s;
	padding: 0;
}

.pg-nav:hover { background: var(--wp--preset--color--surface); }
.pg-nav.swiper-button-disabled { opacity: .35; pointer-events: none; }

.pg-prev { left: 10px; }
.pg-next { right: 10px; }

/* ── Expand (lightbox) button ────────────────────────────────────── */

.pg-expand {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: rgba(255, 255, 255, .85);
	border: 1px solid var(--wp--preset--color--border);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--wp--preset--color--text);
	padding: 0;
	transition: background .15s;
}

.pg-expand:hover { background: var(--wp--preset--color--surface); }

/* ── Slide counter ───────────────────────────────────────────────── */

.pg-counter {
	position: absolute;
	bottom: 10px;
	right: 12px;
	z-index: 10;
	font-size: 12px;
	font-weight: 600;
	color: var(--wp--preset--color--surface);
	background: rgba(0, 0, 0, .45);
	padding: 3px 8px;
	border-radius: 20px;
	pointer-events: none;
}

/* ── Thumbnails strip ────────────────────────────────────────────── */

.pg-thumbs {
	width: 100%;
	visibility: hidden; /* hide until Swiper sets slide widths */
}

.pg-thumbs.swiper-initialized {
	visibility: visible;
}

.pg-thumb-slide {
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	opacity: .55;
	border: 2px solid transparent;
	transition: opacity .15s, border-color .15s;
	aspect-ratio: 1;
}

.pg-thumb-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pg-thumb-slide.swiper-slide-thumb-active {
	opacity: 1;
	border-color: var(--wp--preset--color--primary);
}

.pg-thumb-slide:hover { opacity: .85; }

/* ── PhotoSwipe v4 overrides ─────────────────────────────────────── */

.pswp__bg { background: rgba(0, 0, 0, 0.95); }
.pswp { z-index: 9999; }
.pswp__top-bar { background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent); }
