.cig-wrapper {
	width: 100%;
}

.cig-gallery-inner {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.cig-thumbpos-left .cig-gallery-inner {
	flex-direction: row;
}

.cig-thumbpos-left .cig-thumbs-wrap {
	flex-direction: column;
	width: auto;
}

.cig-thumbpos-left .cig-thumbs {
	flex-direction: column;
}

.cig-thumbpos-left .cig-arrow {
	transform: rotate(90deg);
}

.cig-thumbpos-left .cig-main {
	order: 2;
	flex: 1;
}

.cig-thumbpos-left .cig-thumbs-wrap {
	order: 1;
}

/* Main image */
.cig-main {
	position: relative;
	width: 100%;
	height: 420px;
	background: #f7f7f7;
	border: 1px solid #ececec;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	cursor: zoom-in;
}

.cig-main-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: opacity 0.2s ease;
}

/* Thumbnails row */
.cig-thumbs-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.cig-thumbs {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-behavior: smooth;
	flex: 1;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 4px 2px;
}

.cig-thumbs::-webkit-scrollbar {
	display: none;
}

.cig-thumb-item {
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.2s ease;
	background: #fff;
}

.cig-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cig-thumb-item.active,
.cig-thumb-item:hover {
	border-color: #0073e6;
}

/* Scroll arrows */
.cig-arrow {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #ddd;
	background: #fff;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0,0,0,0.12);
	transition: background 0.2s ease, transform 0.15s ease;
	padding: 0;
}

.cig-arrow:hover {
	background: #f0f0f0;
}

.cig-arrow:active {
	transform: scale(0.92);
}

.cig-arrow svg {
	pointer-events: none;
}

.cig-arrow.cig-hidden {
	visibility: hidden;
	pointer-events: none;
}

/* Popup / Lightbox */
.cig-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.92);
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.cig-popup.cig-open {
	display: flex;
}

.cig-popup-image-wrap {
	max-width: 85%;
	max-height: 85%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cig-popup-img {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	display: block;
	user-select: none;
	box-shadow: 0 5px 40px rgba(0,0,0,0.5);
}

.cig-popup-close {
	position: absolute;
	top: 20px;
	right: 30px;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
	padding: 5px 10px;
}

.cig-popup-prev,
.cig-popup-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255,255,255,0.1);
	border: none;
	color: #fff;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}

.cig-popup-prev:hover,
.cig-popup-next:hover {
	background: rgba(255,255,255,0.25);
}

.cig-popup-prev {
	left: 25px;
}

.cig-popup-next {
	right: 25px;
}

.cig-popup-counter {
	position: absolute;
	bottom: 25px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	opacity: 0.8;
	letter-spacing: 0.5px;
}

.cig-empty-notice {
	padding: 20px;
	background: #fff3cd;
	border: 1px solid #ffe69c;
	color: #664d03;
	border-radius: 4px;
	font-size: 14px;
}

@media (max-width: 767px) {
	.cig-main {
		height: 280px;
	}

	.cig-thumbpos-left .cig-gallery-inner {
		flex-direction: column;
	}

	.cig-thumbpos-left .cig-main {
		order: 1;
	}

	.cig-thumbpos-left .cig-thumbs-wrap {
		order: 2;
	}

	.cig-thumbpos-left .cig-thumbs {
		flex-direction: row;
	}

	.cig-thumbpos-left .cig-arrow {
		transform: none;
	}

	.cig-popup-prev,
	.cig-popup-next {
		width: 40px;
		height: 40px;
	}

	.cig-popup-close {
		top: 10px;
		right: 15px;
		font-size: 32px;
	}
}
