/**
 * WC Product Grid – Elementor Widget (UPDATED)
 * Improved design with clearer arrows, dots, and 4-product layout
 */

.wpg-wrapper { width: 100%; }

.wpg-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	padding: 0 60px; /* Space for carousel arrows */
}

.wpg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpg-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wpg-card-media {
	position: relative;
	overflow: hidden;
}

.wpg-card-img {
	display: block;
	width: 100%;
	aspect-ratio: 3/4;
	overflow: hidden;
	background: #f2f2f2;
}

.wpg-card-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.wpg-card:hover .wpg-card-img img {
	transform: scale(1.05);
}

/* Badges */
.wpg-badges {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.wpg-badges-top-left     { top: 12px; left: 12px; align-items: flex-start; }
.wpg-badges-top-right    { top: 12px; right: 12px; align-items: flex-end; }
.wpg-badges-bottom-left  { bottom: 12px; left: 12px; align-items: flex-start; }
.wpg-badges-bottom-right { bottom: 12px; right: 12px; align-items: flex-end; }

.wpg-badge {
	display: inline-block;
	padding: 6px 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	border-radius: 4px;
	white-space: nowrap;
	backdrop-filter: blur(4px);
}

.wpg-badge-sale   { background: rgba(76, 175, 80, 0.95); border-radius: 4px; }
.wpg-badge-oos    { background: rgba(153, 153, 153, 0.95); }
.wpg-badge-custom { background: rgba(169, 216, 198, 0.95); color: #1a1a2e; }

/* Info block */
.wpg-card-info {
	padding: 16px 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex-grow: 1;
}

.wpg-card-category {
	font-size: 11px;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
}

.wpg-card-title {
	font-size: 13px!important;
	font-weight: 700;
	font-family:sans-serif !important;
	color: #1a1a2e;
	line-height: 1.5;
	margin: 0;
}

.wpg-card-desc {
	font-size: 12px;
	color: #999;
	line-height: 1.4;
	margin: 0;
}

.wpg-card-price {
	font-size: 14px;
	font-weight: 700;
	color: #d32f2f;
	margin: 6px 0;
}

.wpg-card-price del { 
	color: #bbb; 
	font-weight: 500; 
	margin-right: 8px; 
	text-decoration: line-through;
}

.wpg-card-price ins { text-decoration: none; }

.wpg-card-rating { 
	font-size: 12px; 
	color: #ffc107;
	margin: 4px 0;
}

.wpg-card-btn-wrap { 
	margin-top: auto;
	padding-top: 8px;
}

.wpg-card-btn {
	position: relative;
	z-index: 3;
	display: inline-block;
	width: 100%;
	text-align: center;
	padding: 11px 16px;
	background: #1a1a2e;
	color: #fff;
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border: 2px solid #1a1a2e;
	box-sizing: border-box;
	cursor: pointer;
	transition: all 0.3s ease;
}

.wpg-card-btn:hover { 
	background: #fff;
	color: #1a1a2e;
	border-color: #1a1a2e;
}

.wpg-card-btn.loading { 
	opacity: 0.6;
	cursor: not-allowed;
}

/* Whole-card wrapper link */
.wpg-wrapper-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Pagination */
.wpg-pagination {
	margin-top: 36px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.wpg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	color: #333;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.wpg-pagination .page-numbers.current {
	background: #1a1a2e;
	border-color: #1a1a2e;
	color: #fff;
}

.wpg-pagination .page-numbers:hover:not(.current) { 
	border-color: #1a1a2e;
	color: #1a1a2e;
}

/* View all button */
.wpg-view-all {
	margin-top: 36px;
	display: flex;
	justify-content: center;
}

.wpg-view-all-btn {
	display: inline-block;
	padding: 13px 40px;
	background: #1a1a2e;
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border: 2px solid #1a1a2e;
	transition: all 0.3s ease;
	cursor: pointer;
}

.wpg-view-all-btn:hover { 
	background: #fff;
	color: #1a1a2e;
}

/* ========== CAROUSEL STYLES (Pure JS Carousel) ========== */
.wpg-carousel-container {
	position: relative;
	width: 100%;
	overflow: visible;
}

.wpg-carousel {
	width: 100%;
	padding: 0 0 70px 0; /* Space for pagination */
	display: block;
	position: relative;
	overflow: hidden;
}

.wpg-carousel .swiper-wrapper {
	display: flex;
	gap: 24px;
	align-items: stretch;
	will-change: transform;
}

.wpg-carousel .swiper-slide {
	display: flex !important;
	flex-shrink: 0;
	width: auto;
	min-height: auto;
	align-items: stretch;
}

.wpg-carousel .wpg-card {
	width: 100%;
}

/* ========== NAVIGATION ARROWS - IMPROVED ========== */
.wpg-swiper-button-prev,
.wpg-swiper-button-next {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	background: #1a1a2e;
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	transition: all 0.3s ease;
	z-index: 10;
	padding: 0;
	outline: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wpg-swiper-button-prev:hover,
.wpg-swiper-button-next:hover {
	background: #d32f2f;
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 6px 16px rgba(211, 47, 47, 0.3);
}

.wpg-swiper-button-prev:disabled,
.wpg-swiper-button-next:disabled,
.wpg-swiper-button-prev.wpg-button-disabled,
.wpg-swiper-button-next.wpg-button-disabled {
	opacity: 0.4 !important;
	cursor: not-allowed !important;
	background: #ccc !important;
}

.wpg-swiper-button-prev {
	left: 16px;
}

.wpg-swiper-button-next {
	right: 16px;
}

/*.wpg-swiper-button-prev::before {
	content: '❮';
	font-size: 20px;
	font-weight: bold;
	line-height: 1;
}*/

/*.wpg-swiper-button-next::before {
	content: '❯';
	font-size: 20px;
	font-weight: bold;
	line-height: 1;
}*/

/* ========== PAGINATION DOTS - IMPROVED ========== */
.wpg-swiper-pagination {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	justify-content: center;
	gap: 10px;
	width: 100%;
	z-index: 5;
}

.wpg-pagination-dot {
	width: 12px;
	height: 12px;
	background: #ddd;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.3s ease;
	opacity: 0.8;
	border: 2px solid transparent;
	padding: 0;
	margin: 0;
	display: inline-block;
	box-shadow: none;
}

.wpg-pagination-dot:hover {
	background: #999;
	opacity: 1;
	transform: scale(1.15);
}

.wpg-pagination-dot.active {
	background: #1a1a2e;
	opacity: 1;
	transform: scale(1.25);
	border-color: #fff;
	box-shadow: 0 0 0 2px #1a1a2e;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 1200px) {
	.wpg-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 20px;
		padding: 0 50px;
	}

	.wpg-swiper-button-prev,
	.wpg-swiper-button-next {
		width: 44px;
		height: 44px;
		font-size: 22px;
	}

	.wpg-swiper-button-prev::before,
	.wpg-swiper-button-next::before {
		font-size: 18px;
	}
}

@media (max-width: 768px) {
	.wpg-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
		padding: 0 40px;
	}

	.wpg-carousel {
		padding: 0 0 60px 0;
	}

	.wpg-swiper-button-prev,
	.wpg-swiper-button-next {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}

	.wpg-swiper-button-prev::before,
	.wpg-swiper-button-next::before {
		font-size: 16px;
	}

	.wpg-swiper-button-prev {
		left: 8px;
	}

	.wpg-swiper-button-next {
		right: 8px;
	}

	.wpg-pagination-dot {
		width: 10px;
		height: 10px;
	}

	.wpg-card-title {
		font-size: 13px;
	}

	.wpg-card-price {
		font-size: 13px;
	}

	.wpg-card-btn {
		padding: 9px 14px;
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.wpg-grid {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 0 35px;
	}

	.wpg-carousel {
		padding: 0 0 50px 0;
	}

	.wpg-swiper-button-prev,
	.wpg-swiper-button-next {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.wpg-swiper-button-prev::before,
	.wpg-swiper-button-next::before {
		font-size: 12px;
	}

	.wpg-swiper-button-prev {
		left: 4px;
	}

	.wpg-swiper-button-next {
		right: 4px;
	}

	.wpg-pagination-dot {
		width: 8px;
		height: 8px;
		gap: 6px;
	}

	.wpg-card-info {
		padding: 8px 0;
		gap: 3px;
	}

	.wpg-card-title {
		font-size: 10px !important;
		line-height: 1.3;
	}

	.wpg-card-category {
		font-size: 9px;
	}

	.wpg-card-desc {
		font-size: 9px;
	}

	.wpg-card-price {
		font-size: 10px;
		margin: 3px 0;
	}

	.wpg-card-btn {
		padding: 6px 8px;
		font-size: 8px;
		letter-spacing: 0;
	}
}

/* ========== MOBILE CAROUSEL 2.5 ITEMS FIX ========== */
@media (max-width: 767px) {

    .wpg-carousel {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        overflow: hidden;
    }

    .wpg-carousel .swiper-wrapper {
        gap: 12px !important;
    }

    .wpg-carousel .swiper-slide {
        flex: 0 0 calc((100% - 12px) / 2.5) !important;
        max-width: calc((100% - 12px) / 2.5) !important;
        min-width: calc((100% - 12px) / 2.5) !important;
        width: calc((100% - 12px) / 2.5) !important;
        box-sizing: border-box;
    }

    .wpg-card,
    .wpg-card-media,
    .wpg-card-img {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Mobile image */
    .wpg-card-img {
        height: 120px !important;
        aspect-ratio: auto !important;
        overflow: hidden;
    }

    .wpg-card-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block;
    }

    .wpg-card-title {
        font-size: 11px !important;
        line-height: 1.2;
    }

    .wpg-card-category {
        font-size: 9px;
    }

    .wpg-card-desc {
        font-size: 9px;
        display: none;
    }

    .wpg-card-price {
        font-size: 11px;
        margin: 4px 0 2px 0;
    }

    .wpg-card-btn {
        padding: 7px 10px;
        font-size: 8px;
        line-height: 1;
    }
    .wpg-badge {
        padding: 4px 7px;
        font-size: 8px;
        letter-spacing: 0.03em;
        border-radius: 3px;
    }
}
