/**
 * Storefront polish: single product gallery.
 *
 * Loaded on product pages only, next to the Rent button.
 * Every rule is scoped to WooCommerce's own gallery markup, so themes that
 * replace the gallery (Elementor, custom templates) are left untouched.
 */

/* -------------------------------------------------------------------------
 * 1. Thumbnails: one scrollable row instead of a 4x4 block.
 * ---------------------------------------------------------------------- */

.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs,
.woocommerce div.product .flex-control-thumbs {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	max-width: 100%;
	/* Top padding keeps the 2px active ring from being clipped by overflow. */
	margin: 12px 0 0 !important;
	padding: 3px 3px 10px !important;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-padding: 0 3px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #c3c8bd transparent;
}

.woocommerce div.product .flex-control-thumbs::-webkit-scrollbar {
	height: 6px;
}

.woocommerce div.product .flex-control-thumbs::-webkit-scrollbar-track {
	background: transparent;
}

.woocommerce div.product .flex-control-thumbs::-webkit-scrollbar-thumb {
	background: #c3c8bd;
	border-radius: 999px;
}

.woocommerce div.product .flex-control-thumbs li {
	float: none !important;
	display: block !important;
	flex: 0 0 84px !important;
	width: 84px !important;
	margin: 0 !important;
	padding: 0 !important;
	scroll-snap-align: start;
}

.woocommerce div.product .flex-control-thumbs img {
	display: block;
	width: 84px !important;
	height: 84px !important;
	max-width: none !important;
	object-fit: cover;
	border-radius: 8px;
	opacity: 0.55;
	transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce div.product .flex-control-thumbs img:hover,
.woocommerce div.product .flex-control-thumbs img.flex-active {
	opacity: 1;
	box-shadow: 0 0 0 2px #111416;
}

/* Strip wrapper + its two scroll buttons (added by storefront.js). */

.woocommerce div.product .er-thumbs-wrap {
	position: relative;
	width: 100%;
	padding: 0 34px;
	box-sizing: border-box;
}

.woocommerce div.product .er-thumbs-wrap:not(.is-scrollable) {
	padding: 0;
}

.woocommerce div.product .er-thumbs-wrap:not(.is-scrollable) .er-thumbs-nav {
	display: none;
}

.woocommerce div.product .er-thumbs-nav {
	position: absolute;
	top: calc(50% - 5px);
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid #d7dbd2;
	border-radius: 50%;
	background: #ffffff;
	color: #111416;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.woocommerce div.product .er-thumbs-nav:hover {
	background: #111416;
	border-color: #111416;
	color: #ffffff;
}

.woocommerce div.product .er-thumbs-nav:disabled {
	opacity: 0.3;
	cursor: default;
	background: #ffffff;
	border-color: #d7dbd2;
	color: #111416;
}

.woocommerce div.product .er-thumbs-nav::before {
	content: "";
	width: 6px;
	height: 6px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.woocommerce div.product .er-thumbs-nav--prev {
	left: 0;
}

.woocommerce div.product .er-thumbs-nav--prev::before {
	transform: rotate(-135deg);
	margin-left: -1px;
}

.woocommerce div.product .er-thumbs-nav--next {
	right: 0;
}

.woocommerce div.product .er-thumbs-nav--next::before {
	transform: rotate(45deg);
	margin-right: -1px;
}

/* -------------------------------------------------------------------------
 * 2. Main image arrows.
 *
 * WooCommerce ships flexslider with `directionNav: false`, so these elements
 * only exist because the plugin turns that option on (PHP). They are styled
 * here to always show, instead of appearing only on hover.
 *
 * storefront.js draws its own pair only when a theme disables flexslider; in
 * that case .er-gallery-ready hides the native list to avoid duplicates.
 * ---------------------------------------------------------------------- */

.woocommerce div.product .woocommerce-product-gallery {
	position: relative;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 15;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav li {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav a {
	position: absolute;
	top: 50%;
	z-index: 16;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -22px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 20, 22, 0.55);
	color: #ffffff;
	opacity: 1 !important;
	visibility: visible !important;
	overflow: hidden;
	font-size: 0;
	line-height: 0;
	text-indent: 0;
	text-shadow: none;
	pointer-events: auto;
	cursor: pointer;
	transition: background 0.15s ease;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav a:hover,
.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav a:focus,
.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav a:focus-visible {
	background: #111416;
	color: #ffffff;
	outline: none;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav a::before {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev {
	left: 12px;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev::before {
	transform: rotate(-135deg);
	margin-left: -3px;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-next {
	right: 12px;
}

.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-next::before {
	transform: rotate(45deg);
	margin-right: -3px;
}

/* At the first/last slide flexslider disables one arrow; keep it visible. */
.woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-disabled {
	opacity: 0.32 !important;
	cursor: default;
}

.woocommerce div.product .er-gallery-ready .flex-direction-nav {
	display: none !important;
}

.woocommerce div.product .er-gal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 20, 22, 0.55);
	color: #ffffff;
	cursor: pointer;
	transition: background 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.woocommerce div.product .er-gal-nav:hover,
.woocommerce div.product .er-gal-nav:focus-visible {
	background: #111416;
}

.woocommerce div.product .er-gal-nav::before {
	content: "";
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.woocommerce div.product .er-gal-nav--prev {
	left: 12px;
}

.woocommerce div.product .er-gal-nav--prev::before {
	transform: rotate(-135deg);
	margin-left: -3px;
}

.woocommerce div.product .er-gal-nav--next {
	right: 12px;
}

.woocommerce div.product .er-gal-nav--next::before {
	transform: rotate(45deg);
	margin-right: -3px;
}

@media (max-width: 544px) {
	.woocommerce div.product .flex-control-thumbs li {
		flex: 0 0 72px !important;
		width: 72px !important;
	}

	.woocommerce div.product .flex-control-thumbs img {
		width: 72px !important;
		height: 72px !important;
	}

	.woocommerce div.product .er-gal-nav {
		width: 36px;
		height: 36px;
	}

	.woocommerce div.product .er-thumbs-wrap {
		padding: 0 30px;
	}
}
