/* WooGallery Personal — frontend styles */

.wgp-gallery-wrap {
	position: relative;
	--wgp-thumb-size: 90px;
	--wgp-thumb-gap: 8px;
	--wgp-icon-color: #fff;
	--wgp-zoom-cursor: crosshair;
}

.wgp-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
}
.wgp-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid rgba(0, 0, 0, .12);
	border-top-color: rgba(0, 0, 0, .55);
	border-radius: 50%;
	animation: wgp-spin .7s linear infinite;
}
@keyframes wgp-spin { to { transform: rotate(360deg); } }

/* ---------- Main slider ---------- */
.wgp-main {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
}
.wgp-main .swiper-slide {
	position: relative;
	background: #f6f6f6;
}
.wgp-media {
	position: relative;
	overflow: hidden;
	width: 100%;
}
.wgp-media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .12s ease-out;
	will-change: transform;
}
.wgp-media-image.wgp-zoomable { cursor: var(--wgp-zoom-cursor); }

/* Navigation arrows */
.wgp-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .92);
	color: #222;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s ease, transform .15s ease;
}
.wgp-prev { left: 14px; }
.wgp-next { right: 14px; }
.wgp-main:hover .wgp-nav,
.wgp-nav:focus-visible { opacity: 1; }
.wgp-nav:hover { transform: translateY(-50%) scale(1.06); }
.wgp-nav.swiper-button-disabled { opacity: 0 !important; pointer-events: none; }

/* ---------- Thumbnails ---------- */
.wgp-thumbs {
	margin-top: var(--wgp-thumb-gap);
	overflow: hidden;
}
.wgp-layout-thumbs_top .wgp-thumbs { margin-top: 0; margin-bottom: var(--wgp-thumb-gap); }

.wgp-thumbs .swiper-slide { width: var(--wgp-thumb-size); cursor: pointer; }
.wgp-thumb {
	position: relative;
	width: var(--wgp-thumb-size);
	height: var(--wgp-thumb-size);
	overflow: hidden;
	border-radius: 4px;
	border: 2px solid transparent;
	box-sizing: border-box;
	transition: border-color .15s, opacity .15s, filter .15s, transform .15s;
}
.wgp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wgp-thumb-blank { width: 100%; height: 100%; background: #2b2b2b; }
.wgp-thumb-play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 22px;
	height: 22px;
	background: rgba(0, 0, 0, .55);
	border-radius: 50%;
}
.wgp-thumb-play::after {
	content: "";
	position: absolute;
	left: 8px;
	top: 6px;
	border-left: 8px solid #fff;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
}

/* Active thumb styles */
.wgp-active-border .wgp-thumbs .swiper-slide-thumb-active .wgp-thumb { border-color: #111; }
.wgp-active-line .wgp-thumbs .swiper-slide-thumb-active .wgp-thumb { border-bottom: 3px solid #111; border-radius: 4px 4px 0 0; }
.wgp-active-opacity .wgp-thumbs .swiper-slide .wgp-thumb { opacity: .45; }
.wgp-active-opacity .wgp-thumbs .swiper-slide-thumb-active .wgp-thumb { opacity: 1; }
.wgp-active-zoomout .wgp-thumbs .swiper-slide-thumb-active .wgp-thumb { transform: scale(.88); }

/* Inactive effects */
.wgp-inactive-grayscale .wgp-thumbs .swiper-slide:not(.swiper-slide-thumb-active) .wgp-thumb img { filter: grayscale(1); }
.wgp-inactive-opacity .wgp-thumbs .swiper-slide:not(.swiper-slide-thumb-active) .wgp-thumb { opacity: .5; }

/* Vertical thumbs (left/right) */
.wgp-h-flex { display: flex; gap: var(--wgp-thumb-gap); align-items: flex-start; }
.wgp-h-flex .wgp-main { flex: 1 1 auto; min-width: 0; }
.wgp-h-flex .wgp-thumbs {
	flex: 0 0 var(--wgp-thumb-size);
	width: var(--wgp-thumb-size);
	margin-top: 0;
	max-height: calc((var(--wgp-thumb-size) + var(--wgp-thumb-gap)) * 5);
	align-self: stretch;
}
.wgp-h-flex .wgp-thumbs .swiper-slide { height: var(--wgp-thumb-size) !important; }

/* ---------- Grid / tiles layout (uniform 2-column) ---------- */
.wgp-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.wgp-grid-item { position: relative; border-radius: 6px; overflow: hidden; background: #f6f6f6; }
.wgp-grid .wgp-media-image { aspect-ratio: 1 / 1; }
.wgp-grid .wgp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Vertical scroll layout ---------- */
.wgp-vscroll { display: flex; flex-direction: column; gap: 10px; }
.wgp-vscroll-item { position: relative; border-radius: 6px; overflow: hidden; background: #f6f6f6; }

/* ---------- Video ---------- */
.wgp-media-video,
.wgp-video-poster { position: relative; aspect-ratio: var(--wgp-video-ratio, 1 / 1); background: #111; }
.wgp-video-poster img {
	width: 100%; height: 100%;
	object-fit: cover;
	opacity: .9;
}
.wgp-video-poster-blank { width: 100%; height: 100%; background: linear-gradient(135deg, #1d1d1f, #3a3a3e); }

.wgp-play-icon {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 64px;
	height: 64px;
	border: 0;
	padding: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	cursor: pointer;
	transition: transform .15s ease, background .15s ease;
	z-index: 3;
}
.wgp-play-icon::after {
	content: "";
	position: absolute;
	left: 26px;
	top: 19px;
	border-left: 20px solid var(--wgp-icon-color, #fff);
	border-top: 13px solid transparent;
	border-bottom: 13px solid transparent;
}
.wgp-play-icon:hover { transform: scale(1.08); background: rgba(0, 0, 0, .7); }

/* While playing, the container keeps the SAME aspect ratio — no size jump. */
.wgp-video-playing { aspect-ratio: var(--wgp-video-ratio, 1 / 1); }
.wgp-video-el {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	object-fit: contain;
	background: #000;
}
/* Self-hosted video matching the container ratio (e.g. 1:1 in 1:1) fills it edge to edge. */
video.wgp-video-el { object-fit: contain; }

/* Auto ratio: container follows the media's own natural size. */
.wgp-ratio-auto .wgp-media-video,
.wgp-ratio-auto .wgp-video-poster,
.wgp-ratio-auto .wgp-video-playing { aspect-ratio: auto; }
.wgp-ratio-auto .wgp-video-poster img { height: auto; object-fit: unset; }
.wgp-ratio-auto video.wgp-video-el { position: static; height: auto; }
.wgp-ratio-auto iframe.wgp-video-el { position: static; height: auto; aspect-ratio: 16 / 9; }

/* ---------- Lightbox trigger icon ---------- */
.wgp-lb-trigger {
	position: absolute;
	z-index: 6;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #222;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	opacity: 0;
	transition: opacity .18s ease, transform .15s ease;
}
.swiper-slide:hover .wgp-lb-trigger,
.wgp-grid-item:hover .wgp-lb-trigger,
.wgp-vscroll-item:hover .wgp-lb-trigger,
.wgp-lb-trigger:focus-visible { opacity: 1; }
.wgp-lb-trigger:hover { transform: scale(1.08); }

.wgp-lb-pos-top-right .wgp-lb-trigger { top: 12px; right: 12px; }
.wgp-lb-pos-top-left .wgp-lb-trigger { top: 12px; left: 12px; }
.wgp-lb-pos-bottom-right .wgp-lb-trigger { bottom: 12px; right: 12px; }
.wgp-lb-pos-bottom-left .wgp-lb-trigger { bottom: 12px; left: 12px; }
.wgp-lb-pos-center .wgp-lb-trigger { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.wgp-lb-pos-center .wgp-lb-trigger:hover { transform: translate(-50%, -50%) scale(1.08); }

.wgp-no-counter ~ .glightbox-container .gcounter,
.wgp-no-counter ~ .glightbox-container .gslide-counter { display: none !important; }

/* ---------- Shop page featured video ---------- */
.wgp-shop-video {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	background: #111;
	cursor: pointer;
	margin-bottom: .8em;
}
.wgp-shop-video img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
}
.wgp-shop-video .wgp-play-icon { width: 48px; height: 48px; pointer-events: none; }
.wgp-shop-video .wgp-play-icon::after { left: 19px; top: 14px; border-left-width: 15px; border-top-width: 10px; border-bottom-width: 10px; }
.wgp-shop-video.wgp-video-playing { cursor: default; }
.wgp-shop-video.wgp-video-playing .wgp-play-icon { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	.wgp-h-flex { flex-direction: column; }
	.wgp-h-flex .wgp-thumbs {
		flex-basis: auto;
		width: 100%;
		max-height: none;
		order: 2;
	}
	.wgp-h-flex .wgp-thumbs .swiper-wrapper { flex-direction: row !important; }
	.wgp-h-flex .wgp-thumbs .swiper-slide { width: var(--wgp-thumb-size) !important; }
	.wgp-grid { grid-template-columns: 1fr; }
	.wgp-nav { opacity: 1; width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
	.wgp-media img, .wgp-nav, .wgp-lb-trigger, .wgp-play-icon, .wgp-thumb { transition: none; }
}
