/* ShelleyWeb Store Helpers - product gallery thumbnail slider. */

/* ===========================================================================
 * Full-takeover mode: native gallery slider absent or broken, so we own the
 * main image. Pin flexslider's pan, show one "stage" slide, hide the rest.
 * =========================================================================== */
.woocommerce-product-gallery.swsh-gts-takeover .woocommerce-product-gallery__wrapper {
	transform: none !important;
	height: auto !important;
}

.woocommerce-product-gallery.swsh-gts-takeover .flex-viewport {
	height: auto !important;
	overflow: visible !important;
}

.woocommerce-product-gallery.swsh-gts-takeover .woocommerce-product-gallery__image {
	display: none !important;
	float: none !important;
	position: relative !important;
	left: auto !important;
	top: auto !important;
	width: 100% !important;
}

.woocommerce-product-gallery.swsh-gts-takeover .woocommerce-product-gallery__image.swsh-gts-stage {
	display: block !important;
}

.woocommerce-product-gallery.swsh-gts-takeover .woocommerce-product-gallery__image.swsh-gts-stage img {
	width: 100% !important;
	height: auto !important;
}

/* ===========================================================================
 * HORIZONTAL strip (landscape / square main image): stack the gallery and put
 * a full-width horizontal thumbnail strip BELOW the main image.
 * =========================================================================== */
.woocommerce-product-gallery.swsh-gts-strip.swsh-gts-horizontal {
	display: block !important;
}

.woocommerce-product-gallery.swsh-gts-horizontal .woocommerce-product-gallery__wrapper {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

.woocommerce-product-gallery.swsh-gts-horizontal .swsh-gts-wrap {
	clear: both;
	flex-direction: row;
	align-items: center;
	width: 100%;
	margin-top: 10px;
}

.woocommerce-product-gallery.swsh-gts-horizontal .swsh-gts-viewport {
	flex: 1 1 auto;
}

.woocommerce-product-gallery.swsh-gts-horizontal ul.flex-control-thumbs {
	flex-direction: row !important; /* themes default this to column */
}

.woocommerce-product-gallery.swsh-gts-horizontal .swsh-gts-wrap.swsh-gts-scroll .swsh-gts-viewport {
	overflow-x: auto;
}

/* ===========================================================================
 * VERTICAL strip (portrait main image): keep the thumbnails as a column BESIDE
 * the main image, capped to the main image height, with up/down arrows.
 * =========================================================================== */
.woocommerce-product-gallery.swsh-gts-strip.swsh-gts-vertical {
	display: flex !important;
	flex-direction: row-reverse !important; /* main on the right, thumbs on the left */
	align-items: flex-start !important;
	gap: 12px;
}

.woocommerce-product-gallery.swsh-gts-vertical .woocommerce-product-gallery__wrapper {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: auto !important;
	margin: 0 !important;
}

.woocommerce-product-gallery.swsh-gts-vertical .swsh-gts-wrap {
	flex: 0 0 auto;
	flex-direction: column;
	align-items: center;
	width: 84px;
	margin: 0;
}

.woocommerce-product-gallery.swsh-gts-vertical .swsh-gts-viewport {
	width: 100%;
}

.woocommerce-product-gallery.swsh-gts-vertical ul.flex-control-thumbs {
	flex-direction: column !important;
	width: 100% !important;
}

.woocommerce-product-gallery.swsh-gts-vertical ul.flex-control-thumbs li {
	width: 100% !important;
}

.woocommerce-product-gallery.swsh-gts-vertical .swsh-gts-wrap.swsh-gts-scroll .swsh-gts-viewport {
	overflow-y: auto;
}

/* ===========================================================================
 * Shared strip / wrap / viewport
 * =========================================================================== */
.swsh-gts-wrap {
	display: flex;
	gap: 6px;
}

.swsh-gts-viewport {
	overflow: hidden;
	min-width: 0;
}

.swsh-gts .flex-control-thumbs {
	display: flex !important;
	flex-wrap: nowrap !important;
	max-width: none !important;
	float: none !important;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform 0.25s ease;
}

.swsh-gts .flex-control-thumbs li {
	float: none !important;
}

/* ---- Thumbnail images ---- */
.swsh-gts .flex-control-thumbs li img {
	display: block;
	width: 100%;
	height: auto;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 4px;
	opacity: 0.85;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.swsh-gts .flex-control-thumbs li img:hover {
	opacity: 1;
}

.swsh-gts .flex-control-thumbs li.swsh-gts-active img {
	opacity: 1;
	border-color: #333;
}

/* ---- Arrows ---- */
.swsh-gts-arrow {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	line-height: 0;
	color: #333;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.12 );
	cursor: pointer;
}

.swsh-gts-arrow svg {
	display: block;
	width: 18px;
	height: 18px;
}

.swsh-gts-arrow:hover {
	background: #f3f3f3;
}

.swsh-gts-arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.swsh-gts-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
