.cpg-widget { position: relative; }

.cpg-widget-title {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 600;
	color: #1a1a1a;
}

.cpg-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(var(--cpg-cols, 4), 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
	transition: opacity 0.15s ease;
}

.cpg-columns-1 { --cpg-cols: 1; }
.cpg-columns-2 { --cpg-cols: 2; }
.cpg-columns-3 { --cpg-cols: 3; }
.cpg-columns-4 { --cpg-cols: 4; }
.cpg-columns-5 { --cpg-cols: 5; }
.cpg-columns-6 { --cpg-cols: 6; }

.cpg-product {
	display: flex;
	flex-direction: column;
}

.cpg-thumb-wrap {
	position: relative;
	overflow: hidden;
	background: #f4f4f4;
	aspect-ratio: 1 / 1;
	border-radius: 4px;
}

.cpg-thumb-link {
	display: block;
	width: 100%;
	height: 100%;
}

.cpg-main-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.2s ease;
}

/* Overlay: description/video OR gallery-scroller fallback */
.cpg-desc-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.97);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	overflow-y: auto;
	padding: 14px;
	box-sizing: border-box;
	z-index: 5;
}

.cpg-thumb-wrap.cpg-active .cpg-desc-overlay {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.cpg-desc-inner {
	font-size: 13px;
	line-height: 1.5;
	height: 100%;
}

.cpg-desc-inner iframe,
.cpg-desc-inner video {
	max-width: 100%;
}

.cpg-desc-loading,
.cpg-desc-error {
	display: block;
	font-size: 12px;
	color: #777;
}

/* Gallery-scroller fallback */
.cpg-gallery-scroller {
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
}

.cpg-gallery-track {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding: 4px 30px;
	width: 100%;
	box-sizing: border-box;
}

.cpg-gallery-track::-webkit-scrollbar {
	height: 6px;
}

.cpg-gallery-img {
	flex: 0 0 auto;
	height: 100%;
	max-height: 100%;
	width: auto;
	max-width: 140px;
	object-fit: cover;
	border-radius: 3px;
}

.cpg-gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 50%;
	width: 26px;
	height: 26px;
	padding: 0;
	line-height: 1;
	color: #333;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cpg-gallery-nav:hover {
	background: #f0f0f0;
}

.cpg-gallery-prev { left: 0; }
.cpg-gallery-next { right: 0; }

.cpg-product-title {
	font-size: 14px;
	margin: 10px 0 4px;
}

.cpg-product-title a {
	text-decoration: none;
	color: inherit;
}

.cpg-price {
	font-size: 13px;
	margin-bottom: 8px;
}

.cpg-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cpg-swatch {
	display: inline-block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	border: 2px solid transparent;
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.cpg-swatch:hover,
.cpg-swatch:focus,
.cpg-swatch.cpg-swatch-active {
	border-color: #333;
	transform: scale(1.08);
	outline: none;
}

.cpg-empty {
	font-size: 13px;
	color: #777;
}

/* Pagination — circular numbered buttons, matching a pill-style page indicator */
.cpg-pagination-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 28px;
}

.cpg-page-numbers {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.cpg-page-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-width: 36px;
	width: auto;
	height: 36px;
	padding: 0 8px;
	margin: 0;
	background: #f4f5f7;
	color: #333333;
	border: 1px solid #f4f5f7;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cpg-page-btn:hover:not(:disabled):not(.cpg-page-current) {
	background: #e9eaed;
}

.cpg-page-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.cpg-page-arrow {
	width: 36px;
	padding: 0;
	background: #fff;
	border-color: #e4e5e8;
	color: #333;
}

.cpg-page-arrow svg {
	display: block;
}

.cpg-page-current {
	background: #14213d;
	color: #ffffff;
	border-color: #14213d;
	border-radius: 10px;
	font-weight: 600;
}

.cpg-page-dots {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: #999;
	font-size: 16px;
	letter-spacing: 1px;
}
