/* ===== Toolbar (Result Count / Sorting) ===== */
.wcepg-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 12px;
	margin-bottom: 16px;
}

.wcepg-result-count {
	font-size: 14px;
	color: #666;
	flex: 0 1 auto;
}

.wcepg-sorting-select {
	font-size: 14px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	/* Kai themes global form styling me select/input par width:100% force karte hain (mobile-first
	   forms ke liye) - jiski wajah se ye dropdown desktop par bhi full-width, apni alag line par
	   chala jaata tha. !important se us theme-level reset ko yahan override karte hain. */
	width: auto !important;
	max-width: 60%;
	flex: 0 0 auto;
}

@media (max-width: 767px) {
	.wcepg-toolbar {
		flex-wrap: wrap;
	}

	.wcepg-sorting-select {
		width: 100% !important;
		max-width: 100%;
	}
}

/* ===== Grid ===== */
.wcepg-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

/* ===== Card ===== */
.wcepg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wcepg-card-image {
	position: relative;
	overflow: hidden;
}

.wcepg-card-image img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.wcepg-card:hover .wcepg-card-image img {
	transform: scale(1.04);
}

.wcepg-overlay-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
}

.wcepg-sale-badge {
	display: inline-block;
	background: #e53935;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 3px;
}

.wcepg-card-content {
	padding: 14px 4px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wcepg-card-category {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
}

.wcepg-card-category a {
	color: inherit;
	text-decoration: none;
}

.wcepg-card-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.wcepg-card-title a {
	color: #222;
	text-decoration: none;
}

.wcepg-card-rating {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wcepg-stars .star-rating {
	overflow: hidden;
	position: relative;
	height: 1em;
	line-height: 1;
	font-size: 14px;
	width: 5.4em;
	font-family: star;
}

.wcepg-rating-count {
	font-size: 13px;
	color: #777;
}

.wcepg-card-attribute {
	font-size: 13px;
	color: #555;
}

.wcepg-attribute-label {
	font-weight: 600;
}

.wcepg-card-price {
	font-size: 16px;
	font-weight: 700;
}

.wcepg-card-price del {
	opacity: 0.6;
	font-weight: 400;
	margin-right: 6px;
}

.wcepg-price-discount {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 6px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	color: #fff;
	background: #2e7d32;
	border-radius: 3px;
	vertical-align: middle;
}

.wcepg-card-description {
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}

.wcepg-card-add-to-cart {
	margin-top: 8px;
}

.wcepg-add-to-cart-btn {
	display: inline-block;
	padding: 10px 18px;
	background: #222;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wcepg-add-to-cart-btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ===== Wishlist (CT Wishlist module button, positioned as overlay on the card image) ===== */
.wcepg-card-image .ct-wishlist-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ===== Carousel ===== */
.wcepg-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
}

.wcepg-carousel-viewport {
	overflow: hidden;
	flex: 1;
}

.wcepg-carousel-track {
	display: flex;
	gap: 20px;
	transition: transform 0.35s ease;
}

/* Slide width is derived from --wcepg-cols and the real gap (--wcepg-gap,
   kept in sync with the "Gap Between Items" control) instead of the old
   fixed-per-count rules below, which hardcoded a 20px gap into the formula.
   That mismatch is what caused slides to visibly get cut off whenever the
   gap was changed away from 20px - the JS scroll step and this width no
   longer agreed. */
.wcepg-carousel-slide {
	--wcepg-cols: 4;
	flex: 0 0 auto;
	flex-basis: calc((100% - (var(--wcepg-cols) - 1) * var(--wcepg-gap, 20px)) / var(--wcepg-cols));
	box-sizing: border-box;
	min-width: 0;
}

.wcepg-layout-carousel[data-slides-desktop="1"] .wcepg-carousel-slide { --wcepg-cols: 1; }
.wcepg-layout-carousel[data-slides-desktop="2"] .wcepg-carousel-slide { --wcepg-cols: 2; }
.wcepg-layout-carousel[data-slides-desktop="3"] .wcepg-carousel-slide { --wcepg-cols: 3; }
.wcepg-layout-carousel[data-slides-desktop="4"] .wcepg-carousel-slide { --wcepg-cols: 4; }
.wcepg-layout-carousel[data-slides-desktop="5"] .wcepg-carousel-slide { --wcepg-cols: 5; }
.wcepg-layout-carousel[data-slides-desktop="6"] .wcepg-carousel-slide { --wcepg-cols: 6; }

.wcepg-carousel-arrow {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid #ddd;
	background: #fff;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s ease, color 0.15s ease;
}

.wcepg-carousel-arrow:hover {
	background: #f5f5f5;
}

/* Overlay mode: arrows float on top of the carousel edges instead of sitting beside it */
.wcepg-arrows-overlay .wcepg-carousel {
	display: block;
}
.wcepg-arrows-overlay .wcepg-carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}
.wcepg-arrows-overlay .wcepg-carousel-prev {
	left: 10px;
}
.wcepg-arrows-overlay .wcepg-carousel-next {
	right: 10px;
}

.wcepg-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.wcepg-carousel-dots .wcepg-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ccc;
	cursor: pointer;
	border: none;
	padding: 0;
}

.wcepg-carousel-dots .wcepg-dot.wcepg-active {
	background: #222;
}

/* ===== Pagination ===== */
.wcepg-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 24px;
}

.wcepg-pagination a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border-radius: 4px;
	background: #f2f2f2;
	color: #333;
	text-decoration: none;
	font-size: 14px;
}

.wcepg-pagination a.wcepg-current {
	background: #222;
	color: #fff;
}

.wcepg-load-more-wrap {
	text-align: center;
	margin-top: 24px;
}

.wcepg-load-more-btn {
	padding: 12px 28px;
	background: #222;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}

.wcepg-load-more-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.wcepg-infinite-loading {
	text-align: center;
	padding: 16px;
	color: #777;
}

.wcepg-no-products {
	text-align: center;
	padding: 40px 0;
	color: #777;
}

.wcepg-hidden {
	display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
	.wcepg-layout-carousel[data-slides-tablet="1"] .wcepg-carousel-slide { --wcepg-cols: 1; }
	.wcepg-layout-carousel[data-slides-tablet="2"] .wcepg-carousel-slide { --wcepg-cols: 2; }
	.wcepg-layout-carousel[data-slides-tablet="3"] .wcepg-carousel-slide { --wcepg-cols: 3; }
	.wcepg-layout-carousel[data-slides-tablet="4"] .wcepg-carousel-slide { --wcepg-cols: 4; }
}

@media (max-width: 600px) {
	.wcepg-layout-carousel[data-slides-mobile="1"] .wcepg-carousel-slide { --wcepg-cols: 1; }
	.wcepg-layout-carousel[data-slides-mobile="2"] .wcepg-carousel-slide { --wcepg-cols: 2; }
}
