.fmaclab-gallery {
	--fmaclab-main-height-desktop: 520px;
	--fmaclab-main-height-tablet: 430px;
	--fmaclab-main-height-mobile: 320px;
	--fmaclab-selector-width-desktop: 105px;
	--fmaclab-selector-width-tablet: 90px;
	--fmaclab-selector-width-mobile: 76px;
	--fmaclab-swatch-size-desktop: 48px;
	--fmaclab-swatch-size-tablet: 44px;
	--fmaclab-swatch-size-mobile: 40px;
	--fmaclab-view-width-desktop: 82px;
	--fmaclab-view-width-tablet: 74px;
	--fmaclab-view-width-mobile: 64px;
	--fmaclab-warranty-width-desktop: 170px;
	--fmaclab-warranty-width-tablet: 155px;
	--fmaclab-warranty-width-mobile: 135px;
	--fmaclab-main-height-current: var(--fmaclab-main-height-desktop);
	--fmaclab-selector-width-current: var(--fmaclab-selector-width-desktop);
	--fmaclab-swatch-size-current: var(--fmaclab-swatch-size-desktop);
	--fmaclab-view-width-current: var(--fmaclab-view-width-desktop);
	--fmaclab-warranty-width-current: var(--fmaclab-warranty-width-desktop);
	--fmaclab-active-border: #1e88c9;
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	text-align: center;
}

.fmaclab-gallery:focus-visible {
	outline: 2px solid var(--fmaclab-active-border);
	outline-offset: 4px;
}

.fmaclab-gallery.fmaclab-is-tablet {
	--fmaclab-main-height-current: var(--fmaclab-main-height-tablet);
	--fmaclab-selector-width-current: var(--fmaclab-selector-width-tablet);
	--fmaclab-swatch-size-current: var(--fmaclab-swatch-size-tablet);
	--fmaclab-view-width-current: var(--fmaclab-view-width-tablet);
	--fmaclab-warranty-width-current: var(--fmaclab-warranty-width-tablet);
}

.fmaclab-gallery.fmaclab-is-mobile {
	--fmaclab-main-height-current: var(--fmaclab-main-height-mobile);
	--fmaclab-selector-width-current: var(--fmaclab-selector-width-mobile);
	--fmaclab-swatch-size-current: var(--fmaclab-swatch-size-mobile);
	--fmaclab-view-width-current: var(--fmaclab-view-width-mobile);
	--fmaclab-warranty-width-current: var(--fmaclab-warranty-width-mobile);
}

.fmaclab-main-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--fmaclab-stage-height, var(--fmaclab-main-height-current));
	min-height: 260px;
	overflow: hidden;
	touch-action: pan-y;
}

.fmaclab-is-tablet .fmaclab-main-stage { min-height: 220px; }
.fmaclab-is-mobile .fmaclab-main-stage { min-height: 180px; }

.fmaclab-main-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: zoom-in;
}

.fmaclab-gallery[data-lightbox="no"] .fmaclab-main-button { cursor: default; }

.fmaclab-main-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	opacity: 1;
	transition: opacity .18s ease;
}

.fmaclab-main-image.is-changing { opacity: 0; }

.fmaclab-loader {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(0, 0, 0, .13);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: fmaclab-spin .8s linear infinite;
}

.fmaclab-gallery.is-ready .fmaclab-loader,
.fmaclab-loader[hidden] { display: none !important; }

@keyframes fmaclab-spin { to { transform: rotate(360deg); } }

.fmaclab-nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	width: 42px;
	height: 52px;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 4px;
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

.fmaclab-nav[hidden] { display: none !important; }
.fmaclab-prev { left: 8px; }
.fmaclab-next { right: 8px; }

.fmaclab-is-mobile .fmaclab-nav {
	width: 34px;
	height: 44px;
	font-size: 28px;
}

.fmaclab-image-counter {
	position: absolute;
	z-index: 5;
	min-width: 46px;
	padding: 5px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .62);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	pointer-events: none;
}

.fmaclab-image-counter[hidden] { display: none !important; }
.fmaclab-counter-top-left .fmaclab-image-counter { top: 12px; left: 12px; }
.fmaclab-counter-top-right .fmaclab-image-counter { top: 12px; right: 12px; }
.fmaclab-counter-bottom-left .fmaclab-image-counter { bottom: 12px; left: 12px; }
.fmaclab-counter-bottom-right .fmaclab-image-counter { right: 12px; bottom: 12px; }

.fmaclab-color-name {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 5px;
	margin: 12px 0 14px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

.fmaclab-color-name[hidden],
.fmaclab-color-name-prefix[hidden] { display: none !important; }
.fmaclab-color-name-prefix { font-weight: 400; }
.fmaclab-color-name-value { font-weight: 700; }

.fmaclab-warranty-wrap,
.fmaclab-divider-wrap {
	display: flex;
	width: 100%;
}

.fmaclab-align-left { justify-content: flex-start; }
.fmaclab-align-center { justify-content: center; }
.fmaclab-align-right { justify-content: flex-end; }

.fmaclab-warranty-image {
	display: block;
	width: var(--fmaclab-warranty-width-current);
	max-width: 100%;
	height: auto;
}

.fmaclab-divider {
	flex: 0 0 auto;
	max-width: 100%;
}

.fmaclab-controls {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.fmaclab-controls-above .fmaclab-color-selectors {
	margin-top: 18px;
	margin-bottom: 8px;
}

.fmaclab-controls-above .fmaclab-view-thumbnails { margin-top: 0; }
.fmaclab-controls-below .fmaclab-view-thumbnails { margin-bottom: 0; }

.fmaclab-view-thumbnails,
.fmaclab-color-selectors,
.fmaclab-color-image-row,
.fmaclab-color-swatch-row {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	max-width: 100%;
	min-width: 0;
}

.fmaclab-view-thumbnails {
	margin: 12px 0 18px;
}

.fmaclab-view-thumbnails[hidden],
.fmaclab-color-selectors[hidden],
.fmaclab-view-thumbnails:empty,
.fmaclab-color-selectors:empty,
.fmaclab-color-image-row:empty,
.fmaclab-color-swatch-row:empty {
	display: none !important;
}

.fmaclab-color-selectors {
	flex-direction: column;
	margin-top: 18px;
}

.fmaclab-color-image-row,
.fmaclab-color-swatch-row { width: 100%; }
.fmaclab-selector-both .fmaclab-color-swatch-row { margin-top: 8px; }

.fmaclab-selector-both[data-swatch-position="above"] .fmaclab-color-swatch-row {
	order: 1;
	margin-top: 0;
	margin-bottom: 8px;
}
.fmaclab-selector-both[data-swatch-position="above"] .fmaclab-color-image-row { order: 2; }
.fmaclab-selector-both[data-swatch-position="below"] .fmaclab-color-image-row { order: 1; }
.fmaclab-selector-both[data-swatch-position="below"] .fmaclab-color-swatch-row { order: 2; }

.fmaclab-view-button,
.fmaclab-color-image-button,
.fmaclab-color-swatch-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 4px;
	border: 2px solid transparent;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.fmaclab-view-button,
.fmaclab-color-image-button { border-radius: 5px; }

.fmaclab-view-button {
	width: var(--fmaclab-view-width-current);
	height: calc(var(--fmaclab-view-width-current) * .71);
}

.fmaclab-color-image-button {
	width: var(--fmaclab-selector-width-current);
	height: calc(var(--fmaclab-selector-width-current) * .64);
}

.fmaclab-color-swatch-button {
	width: var(--fmaclab-swatch-size-current);
	height: var(--fmaclab-swatch-size-current);
	padding: 6px;
	border-radius: 50%;
}

.fmaclab-view-button:hover,
.fmaclab-color-image-button:hover,
.fmaclab-color-swatch-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}

.fmaclab-view-button[aria-selected="true"],
.fmaclab-color-image-button[aria-selected="true"],
.fmaclab-color-swatch-button[aria-selected="true"] {
	border-color: var(--fmaclab-active-border);
}

.fmaclab-view-button:focus-visible,
.fmaclab-color-image-button:focus-visible,
.fmaclab-color-swatch-button:focus-visible,
.fmaclab-nav:focus-visible,
.fmaclab-main-button:focus-visible,
.fmaclab-lightbox button:focus-visible {
	outline: 3px solid var(--fmaclab-active-border);
	outline-offset: 2px;
}

.fmaclab-view-button img,
.fmaclab-color-image-button img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.fmaclab-swatch {
	display: block;
	width: 100%;
	height: 100%;
	border: 1px solid rgba(0, 0, 0, .22);
	border-radius: 50%;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45);
}

/* Horizontal scrolling uses the actual element width, also inside Avada Live Builder. */
.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-view-thumbnails,
.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-color-image-row,
.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-color-swatch-row,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-view-thumbnails,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-color-image-row,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-color-swatch-row {
	justify-content: flex-start;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 2px 8px;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-view-button,
.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-color-image-button,
.fmaclab-controls-layout-scroll.fmaclab-is-tablet .fmaclab-color-swatch-button,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-view-button,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-color-image-button,
.fmaclab-controls-layout-scroll.fmaclab-is-mobile .fmaclab-color-swatch-button {
	scroll-snap-align: center;
}

.fmaclab-is-tablet .fmaclab-color-selectors,
.fmaclab-is-tablet .fmaclab-color-image-row,
.fmaclab-is-tablet .fmaclab-color-swatch-row,
.fmaclab-is-tablet .fmaclab-view-thumbnails,
.fmaclab-is-mobile .fmaclab-color-selectors,
.fmaclab-is-mobile .fmaclab-color-image-row,
.fmaclab-is-mobile .fmaclab-color-swatch-row,
.fmaclab-is-mobile .fmaclab-view-thumbnails {
	gap: 7px;
}

.fmaclab-source-data,
.fmaclab-color-item { display: none !important; }

.fmaclab-lightbox[hidden] { display: none !important; }

.fmaclab-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 50px 70px;
	background: rgba(0, 0, 0, .88);
}

.fmaclab-lightbox-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.fmaclab-lightbox-close,
.fmaclab-lightbox-prev,
.fmaclab-lightbox-next {
	position: absolute;
	z-index: 2;
	border: 0;
	background: transparent;
	color: #fff;
	box-shadow: none;
	cursor: pointer;
}

.fmaclab-lightbox-close {
	top: 12px;
	right: 18px;
	font-size: 44px;
	line-height: 1;
}

.fmaclab-lightbox-prev,
.fmaclab-lightbox-next {
	top: 50%;
	width: 58px;
	height: 74px;
	transform: translateY(-50%);
	font-size: 54px;
	line-height: 1;
}

.fmaclab-lightbox-prev[hidden],
.fmaclab-lightbox-next[hidden] { display: none !important; }
.fmaclab-lightbox-prev { left: 6px; }
.fmaclab-lightbox-next { right: 6px; }
body.fmaclab-lightbox-open { overflow: hidden; }

.fmaclab-empty {
	padding: 20px;
	border: 1px dashed #b7b7b7;
	text-align: center;
}

.fmaclab-main-error {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-size: 15px;
	line-height: 1.4;
	color: #666;
	text-align: center;
}

.fmaclab-main-error[hidden] { display: none !important; }

.fmaclab-is-mobile .fmaclab-lightbox { padding: 46px 42px; }
.fmaclab-is-mobile .fmaclab-color-name { font-size: 15px; }
.fmaclab-is-mobile .fmaclab-image-counter { top: 8px; right: 8px; bottom: auto; left: auto; }
.fmaclab-is-mobile.fmaclab-counter-top-left .fmaclab-image-counter { top: 8px; right: auto; left: 8px; }
.fmaclab-is-mobile.fmaclab-counter-bottom-left .fmaclab-image-counter { top: auto; right: auto; bottom: 8px; left: 8px; }
.fmaclab-is-mobile.fmaclab-counter-bottom-right .fmaclab-image-counter { top: auto; right: 8px; bottom: 8px; left: auto; }

@media (prefers-reduced-motion: reduce) {
	.fmaclab-main-image,
	.fmaclab-view-button,
	.fmaclab-color-image-button,
	.fmaclab-color-swatch-button {
		transition: none;
	}
	.fmaclab-loader { animation: none; }
}

/* Central model manager: color metadata and actions. */
.fmaclab-color-details {
	margin: 8px 0 14px;
	text-align: center;
}

.fmaclab-color-meta {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

.fmaclab-color-badge,
.fmaclab-color-availability,
.fmaclab-color-supplement {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.25;
}

.fmaclab-color-badge {
	background: #1e88c9;
	color: #fff;
	font-weight: 700;
}

.fmaclab-color-availability {
	background: #eef7ee;
	color: #216e2b;
	border: 1px solid #cfe6d1;
}

.fmaclab-color-supplement {
	background: #f4f4f5;
	color: #3c434a;
	border: 1px solid #dcdcde;
}

.fmaclab-color-description {
	max-width: 760px;
	margin: 8px auto 0;
	font-size: 14px;
	line-height: 1.5;
	color: #50575e;
}

.fmaclab-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.fmaclab-copy-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid #1e88c9;
	border-radius: 4px;
	background: #fff;
	color: #1e88c9;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.fmaclab-copy-link:hover {
	background: #f1f8fc;
}

.fmaclab-copy-status {
	width: 100%;
	min-height: 20px;
	font-size: 13px;
	color: #50575e;
}

.fmaclab-model-gallery .fmaclab-cta {
	text-decoration: none;
}

@media (max-width: 640px) {
	.fmaclab-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.fmaclab-actions .fmaclab-cta,
	.fmaclab-copy-link {
		width: 100%;
	}
}
