/* ===== 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%;
	}
}

.wcepg-toolbar-right {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.wcepg-view-toggle {
	display: flex;
	align-items: center;
	gap: 2px;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
}

.wcepg-view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: #fff;
	color: #999;
	cursor: pointer;
}

.wcepg-view-btn.is-active {
	background: #f0f0f0;
	color: #222;
}

.wcepg-view-btn + .wcepg-view-btn {
	border-left: 1px solid #ddd;
}

@media (max-width: 767px) {
	.wcepg-toolbar-right {
		width: 100%;
		justify-content: space-between;
	}
}

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

/* List view (toggled by the toolbar buttons above): single column, each
   card laid out horizontally (image left, details right) instead of the
   normal vertical product-card. The Elementor "Columns" control writes its
   own grid-template-columns rule with higher selector specificity
   (.elementor-element.elementor-<id> .wcepg-grid), so !important is needed
   here to reliably win over it regardless of markup order. */
.wcepg-grid.wcepg-view-list {
	grid-template-columns: 1fr !important;
	gap: 14px;
}

.wcepg-grid.wcepg-view-list .wcepg-card {
	flex-direction: row;
	align-items: stretch;
	gap: 16px;
}

.wcepg-grid.wcepg-view-list .wcepg-card-image {
	flex: 0 0 160px;
	max-width: 160px;
}

.wcepg-grid.wcepg-view-list .wcepg-card-content {
	flex: 1;
	padding: 10px 4px;
}

@media (max-width: 480px) {
	.wcepg-grid.wcepg-view-list .wcepg-card-image {
		flex-basis: 96px;
		max-width: 96px;
	}
}

/* ===== 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);
}

/* ===== Configurable Hover Effect (CTSuite_Grid_Widget "Hover Effect"
   controls) — layered on top of, and where needed overriding, the always-on
   1.04x image zoom above. When "Apply To" is left at its default of "None"
   none of these classes are ever rendered, so the original zoom above is
   completely untouched. ===== */
.wcepg-card.wcepg-hoverfx-card-zoom,
.wcepg-card.wcepg-hoverfx-card-lift,
.wcepg-card.wcepg-hoverfx-card-zoom_lift {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	will-change: transform;
}
.wcepg-card.wcepg-hoverfx-card-zoom:hover {
	transform: scale(var(--wcepg-hover-scale, 1.05));
	position: relative;
	z-index: 2;
}
.wcepg-card.wcepg-hoverfx-card-lift:hover {
	transform: translateY(calc(-1 * var(--wcepg-hover-lift, 8px)));
	position: relative;
	z-index: 2;
}
.wcepg-card.wcepg-hoverfx-card-zoom_lift:hover {
	transform: scale(var(--wcepg-hover-scale, 1.05)) translateY(calc(-1 * var(--wcepg-hover-lift, 8px)));
	position: relative;
	z-index: 2;
}
/* "Whole Card" is its own distinct effect — stop the built-in per-image zoom
   above from ALSO firing at the same time (would otherwise double up). */
.wcepg-card-image.wcepg-hoverfx-suppress-default img {
	transform: none !important;
}
/* "Image Only" target: same built-in zoom mechanism as above, just with a
   configurable amount instead of the fixed 1.04 default. Higher selector
   specificity than the built-in rule (one extra class) so it wins cleanly
   without needing !important. */
.wcepg-card:hover .wcepg-card-image.wcepg-hoverfx-image-zoom img {
	transform: scale(var(--wcepg-hover-scale, 1.08));
}

/* Product video (as main image) — see CTSuite_Product_Video_Frontend::get_grid_video_attrs(). */
.wcepg-card-image a.ctsuite-grid-video-playing img {
	opacity: 0;
}
.ctsuite-grid-video-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	background: #000;
}

/* Video sits UNDER badges/wishlist (.wcepg-overlay-badges is z-index:2) — the
   anchor becomes its own stacking context once it's playing a video, so it
   needs an explicit low z-index or it paints over the badges. */
.wcepg-card-image a.ctsuite-grid-video-playing {
	position: relative;
	z-index: 0;
}

.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 {
	/* Pushed to the bottom of the flex column (.wcepg-card-content is
	   display:flex;flex-direction:column) instead of a plain 8px gap, so the
	   button lines up on the same row across cards even when titles wrap to
	   a different number of lines or descriptions differ in length. */
	margin-top: auto;
	padding-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;
}

/* Edge Peek (CTSuite_Grid_Widget "Edge Peek" control) — padding sits INSIDE
   the viewport's own overflow:hidden edge, so the next/prev card's sliver
   shows through that reserved space instead of being clipped, without
   changing the track/step math the JS carousel already relies on. */
.wcepg-carousel-viewport.wcepg-peek-left   { padding-left: var(--wcepg-peek, 40px); }
.wcepg-carousel-viewport.wcepg-peek-right  { padding-right: var(--wcepg-peek, 40px); }
.wcepg-carousel-viewport.wcepg-peek-both   { padding-left: var(--wcepg-peek, 40px); padding-right: var(--wcepg-peek, 40px); }
/* Reserves vertical room so the "Whole Card" hover effect (zoom/lift) isn't
   clipped by this viewport's own overflow:hidden (needed for the
   horizontal slide) — see CTSuite_Grid_Widget "Hover Effect" controls. */
.wcepg-carousel-viewport.wcepg-hoverfx-viewport { padding-top: 28px; padding-bottom: 28px; margin-top: -28px; margin-bottom: -28px; }

.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;
}

/* Custom mode: Prev/Next positioned fully independently (own edge + offset
   each), e.g. both arrows sitting together above the carousel instead of on
   the image edges. See the matching Elementor controls in
   register_style_carousel_nav_controls() (arrow_position_type = "custom"). */
.wcepg-arrows-custom .wcepg-carousel-arrow {
	position: absolute;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	z-index: 3;
}
.wcepg-prev-h-left .wcepg-carousel-prev   { left: var( --wcepg-prev-h-offset, 10px ); }
.wcepg-prev-h-right .wcepg-carousel-prev  { right: var( --wcepg-prev-h-offset, 10px ); }
.wcepg-prev-v-top .wcepg-carousel-prev    { top: var( --wcepg-prev-v-offset, -50px ); }
.wcepg-prev-v-bottom .wcepg-carousel-prev { bottom: var( --wcepg-prev-v-offset, -50px ); }
.wcepg-next-h-left .wcepg-carousel-next   { left: var( --wcepg-next-h-offset, 10px ); }
.wcepg-next-h-right .wcepg-carousel-next  { right: var( --wcepg-next-h-offset, 10px ); }
.wcepg-next-v-top .wcepg-carousel-next    { top: var( --wcepg-next-v-offset, -50px ); }
.wcepg-next-v-bottom .wcepg-carousel-next { bottom: var( --wcepg-next-v-offset, -50px ); }

.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;
}

/* Per-device Arrows/Dots (responsive "Show Arrows" / "Show Dots" controls
   on CTSuite_Grid_Widget) — e.g. arrows on Desktop, Dots only on Mobile, so
   arrows never eat into mobile side-space. Same breakpoints ct-carousel.js
   itself uses for columns (≤767 mobile, 768–1024 tablet, ≥1025 desktop). */
@media (min-width: 1025px) {
	.wcepg-arrows-d-no .wcepg-carousel-arrow { display: none; }
	.wcepg-dots-d-no .wcepg-carousel-dots { display: none; }
}
@media (max-width: 1024px) and (min-width: 768px) {
	.wcepg-arrows-t-no .wcepg-carousel-arrow { display: none; }
	.wcepg-dots-t-no .wcepg-carousel-dots { display: none; }
}
@media (max-width: 767px) {
	.wcepg-arrows-m-no .wcepg-carousel-arrow { display: none; }
	.wcepg-dots-m-no .wcepg-carousel-dots { display: none; }
}

/* ===== 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 {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	padding: 20px;
	color: #777;
	font-size: 14px;
}

.wcepg-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #dcdcdc;
	border-top-color: #222;
	border-radius: 50%;
	display: inline-block;
	animation: wcepg-spin 0.7s linear infinite;
}

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

.wcepg-infinite-end {
	text-align: center;
	padding: 18px;
	color: #999;
	font-size: 13px;
	font-style: italic;
}

.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; }
}

/* ===== Click-to-expand video lightbox (shared with Card Grid / Product
   Carousel — see ctsuite-video-core.js CTSuiteVideo.openLightbox()). Kept
   here too since the CT Product Grid shortcode can load this stylesheet
   without ct-widgets.css also being present. ===== */
.ctsuite-video-lightbox { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; padding: 16px; }
.ctsuite-video-lightbox.is-open { display: flex; }
.ctsuite-video-lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.85); }
.ctsuite-video-lightbox__box { position: relative; background: #000; z-index: 1; width: min(900px, 96vw); max-width: 96vw; aspect-ratio: 16/9; max-height: 92vh; }
.ctsuite-video-lightbox__body, .ctsuite-video-lightbox__body video, .ctsuite-video-lightbox__body iframe { width: 100%; height: 100%; border: 0; display: block; }
.ctsuite-video-lightbox__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; }
.ctsuite-video-lightbox__close:hover { background: rgba(0,0,0,.85); }
body.ctsuite-video-lightbox-open { overflow: hidden; }
