.petag-product-gallery {
	--petag-gallery-blue: var(--petag-color-primary, #00548f);
	--petag-gallery-accent: var(--petag-color-accent, #149bd7);
	--petag-gallery-surface: var(--petag-color-surface-soft, #eaf4ff);
	--petag-gallery-focus: #005fcc;
	width: 100%;
}

.petag-product-gallery__stage {
	position: relative;
	padding: 3.25rem 1.5rem 1.5rem;
	background: var(--petag-gallery-surface);
	border-radius: 1.5rem;
	overflow: hidden;
}

.petag-product-gallery__enlarge {
	position: absolute;
	top: 1rem;
	left: 50%;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--petag-gallery-blue);
	font: inherit;
	cursor: pointer;
	transform: translateX(-50%);
}

.petag-product-gallery__enlarge:hover {
	text-decoration: underline;
}

.petag-product-gallery__enlarge-icon {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
}

.petag-product-gallery__enlarge:focus-visible,
.petag-product-gallery__thumbnail:focus-visible,
.petag-product-gallery .swiper-button-prev:focus-visible,
.petag-product-gallery .swiper-button-next:focus-visible {
	outline: 3px solid var(--petag-gallery-focus);
	outline-offset: 3px;
}

.petag-product-gallery__main {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	overflow: hidden;
}

.petag-product-gallery__main > .swiper-wrapper {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.petag-product-gallery__main .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100% !important;
	overflow: hidden;
}

.petag-product-gallery__main .swiper-slide > img.petag-product-gallery__image {
	display: block;
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	border: 0;
	object-fit: contain !important;
}

.petag-product-gallery__video {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
}

/* Divi/FitVids wraps responsive iframes after render. Keep that wrapper
 * inside this component's fixed 16:9 viewport instead of accepting the
 * generated padding ratio. */
.petag-product-gallery__main .fluid-width-video-wrapper {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

.petag-product-gallery__main .fluid-width-video-wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
}

.petag-product-gallery__video {
	background: #000;
}

.petag-product-gallery .swiper-button-prev,
.petag-product-gallery .swiper-button-next {
	width: 2.75rem;
	height: 2.75rem;
	margin-top: -1.375rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--petag-gallery-blue);
}

.petag-product-gallery .swiper-button-prev svg,
.petag-product-gallery .swiper-button-next svg {
	width: 1.4rem;
	height: 2.5rem;
	color: var(--petag-gallery-blue);
	stroke-width: 1.5;
}

.petag-product-gallery .swiper-button-disabled {
	opacity: 0.35;
}

.petag-product-gallery__thumbs {
	margin-top: 1rem;
}

.petag-product-gallery__thumbs .swiper-wrapper {
	align-items: center;
}

.petag-product-gallery__thumbnail {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 5.75rem;
	height: 4rem;
	padding: 0.2rem;
	border: 1px solid transparent;
	background: #fff;
	opacity: 0.62;
	cursor: pointer;
	transition: border-color 160ms ease, opacity 160ms ease;
}

.petag-product-gallery__thumbnail:hover,
.petag-product-gallery__thumbnail.swiper-slide-thumb-active {
	border-color: var(--petag-gallery-blue);
	opacity: 1;
}

.petag-product-gallery__thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.petag-product-gallery__video-thumb {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	background: var(--petag-gallery-surface);
}

.petag-product-gallery__video-thumb img {
	object-fit: cover;
}

.petag-product-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2rem;
	height: 1.45rem;
	border-radius: 0.35rem;
	background: #e62117;
	transform: translate(-50%, -50%);
}

.petag-product-gallery__play::after {
	position: absolute;
	top: 50%;
	left: 52%;
	width: 0;
	height: 0;
	border-top: 0.35rem solid transparent;
	border-bottom: 0.35rem solid transparent;
	border-left: 0.55rem solid #fff;
	content: "";
	transform: translate(-50%, -50%);
}

@media (max-width: 767px) {
	.petag-product-gallery__stage {
		padding: 3rem 0.75rem 1rem;
		border-radius: 1rem;
	}

	.petag-product-gallery__thumbnail {
		width: 4.75rem;
		height: 3.5rem;
	}

	.petag-product-gallery .swiper-button-prev,
	.petag-product-gallery .swiper-button-next {
		width: 2.25rem;
		height: 2.25rem;
		margin-top: -1.125rem;
	}

	.petag-product-gallery .swiper-button-prev svg,
	.petag-product-gallery .swiper-button-next svg {
		width: 1.1rem;
		height: 2rem;
	}
}

.glightbox-container .gslide-video .gvideo-wrapper {
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 5rem);
}

.glightbox-container .gslide-video iframe,
.glightbox-container .gslide-video video {
	width: 100% !important;
	height: 100% !important;
}

@media (prefers-reduced-motion: reduce) {
	.petag-product-gallery__thumbnail {
		transition: none;
	}
}

/* Captions stay attached to their thumbnail without squeezing the media. */
.petag-product-gallery__thumbs .swiper-wrapper { align-items: stretch; }
.petag-product-gallery__thumbnail {
  flex-direction: column;
  justify-content: flex-start;
  height: auto;
  font: inherit;
}
.petag-product-gallery__thumbnail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 4rem;
  flex: 0 0 4rem;
}
.petag-product-gallery__thumbnail-caption {
  display: block;
  width: 100%;
  padding: 0.25rem 0.1rem;
  color: var(--petag-gallery-blue);
  font-size: 0.875rem;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
body.single-product .glightbox-container .gslide-description { text-align: center; }
body.single-product .glightbox-container .gdesc-inner { padding: 8px 16px; }
body.single-product .glightbox-container .gslide-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}
