/**
 * Luxury Jewelry Product Gallery Widget Styles
 */

.luxury-product-gallery-widget {
	width: 100% !important;
	max-width: 100% !important;
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
	isolation: isolate;
}

.luxury-product-gallery-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 15px;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	flex-wrap: nowrap;
}

/* Thumbnails Gallery (Left Side) */
.luxury-gallery-thumbnails {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 8px;
	max-width: 100%;
	box-sizing: border-box;
	width: fit-content;
	min-width: 80px;
}

.luxury-gallery-thumb {
	cursor: pointer;
	border: 2px solid #E0E0E0;
	border-radius: 4px;
	overflow: hidden;
	transition: border-color 0.3s ease, transform 0.2s ease;
	background: #FFFFFF;
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.luxury-gallery-thumb:hover {
	transform: scale(1.05);
	border-color: #B4996C;
}

.luxury-gallery-thumb.active {
	border-color: #B4996C;
	box-shadow: 0 0 0 2px rgba(180, 153, 108, 0.2);
}

.luxury-gallery-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s ease;
	border-radius: 2px;
}

.luxury-gallery-thumb:hover img {
	opacity: 0.8;
}

/* Main Image (Right Side) */
.luxury-gallery-main-image {
	flex: 1 1 auto;
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	position: relative !important;
	overflow: hidden;
	box-sizing: border-box;
	align-self: flex-start;
	/* Height: set by Elementor control (data-sync-height=false) or synced to thumbnails by JS */
}

.luxury-gallery-main-container {
	position: relative;
	width: 100% !important;
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden;
	background: #FFFFFF;
	box-sizing: border-box;
	/* Height will be set dynamically by JavaScript to match thumbnails */
}

.luxury-gallery-main-container img {
	position: absolute;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.5s ease-in-out;
	pointer-events: none;
	box-sizing: border-box;
	margin: 0 !important;
	padding: 0 !important;
}

/* First image should be visible by default */
.luxury-gallery-main-container img:first-child {
	opacity: 1;
	z-index: 1;
	pointer-events: auto;
}

.luxury-gallery-main-container img.active {
	opacity: 1 !important;
	pointer-events: auto;
	z-index: 2;
}

/* When an image is active, hide others */
.luxury-gallery-main-container img.active ~ img {
	opacity: 0;
	z-index: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.luxury-product-gallery-wrapper {
		flex-direction: column !important;
	}
	
	.luxury-gallery-thumbnails {
		flex-direction: row;
		overflow-x: auto;
		width: 100%;
		padding-bottom: 10px;
		-webkit-overflow-scrolling: touch;
	}
	
	.luxury-gallery-thumb {
		flex-shrink: 0;
		margin-bottom: 0 !important;
		margin-left: 10px;
	}
	
	.luxury-gallery-thumb:first-child {
		margin-left: 0;
	}
	
	.luxury-gallery-main-image {
		width: 100% !important;
	}
	
	.luxury-gallery-main-container {
		padding: 0 !important;
		margin: 0 !important;
	}
	
	.luxury-gallery-main-container img {
		width: 100% !important;
		height: 100% !important;
	}
}

@media (max-width: 480px) {
	.luxury-gallery-main-image {
		width: 100% !important;
	}
	
	.luxury-gallery-main-container {
		padding: 0 !important;
		margin: 0 !important;
	}
	
	.luxury-gallery-main-container img {
		width: 100% !important;
		height: 100% !important;
	}
}

/* Loading State */
.luxury-product-gallery-widget.loading .luxury-gallery-main-container img {
	opacity: 0.5;
}

/* Loading and Empty States */
.luxury-gallery-loading,
.luxury-gallery-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	text-align: center;
	color: #666;
}

.luxury-gallery-loading p,
.luxury-gallery-empty p {
	margin: 0;
	font-size: 16px;
}

/* Smooth transitions */
.luxury-product-gallery-widget * {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

