/* Frontend Styles for Product Carousel Block */
.gpw-product-carousel {
	margin: 30px 0;
	padding: 20px 0;
	direction: ltr;
}

.gpw-product-carousel .owl-carousel {
    position: relative;
}

.gpw-product-carousel .owl-stage {
    display: flex;
    align-items: stretch;
}

.gpw-product-carousel .owl-item {
    height: auto;
    display: flex;
}

.gpw-carousel-item {
	height: 100%;
	display: flex;
	flex-direction: column;
	width: 100%;
}

.gpw-carousel-item .gpw-product-widget {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	width: 100%;
}

.gpw-carousel-item .gpw-product-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gpw-carousel-item .gpw-product-image {
	height: 250px;
	background: #f8f9fa;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.gpw-carousel-item .gpw-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gpw-carousel-item .gpw-product-widget:hover .gpw-product-image img {
    transform: scale(1.05);
}

.gpw-carousel-item .gpw-product-content {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
}

.gpw-carousel-item .gpw-product-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 15px 0;
	color: #333;
	line-height: 1.4;
	height: 44px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	padding: 15px;
}

.gpw-carousel-item .gpw-product-attributes {
	margin-bottom: 15px;
	flex-grow: 1;
	padding: 15px;
}

.gpw-carousel-item .gpw-attribute {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.gpw-carousel-item .gpw-attribute:last-child {
    border-bottom: none;
}

.gpw-carousel-item .gpw-attribute-title {
    font-weight: 600;
    color: #666;
}

.gpw-carousel-item .gpw-attribute-value {
    color: #333;
}

.gpw-carousel-item .gpw-product-price {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.gpw-carousel-item .gpw-price {
    font-size: 16px;
    font-weight: 700;
}

.gpw-carousel-item .gpw-regular-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.gpw-carousel-item .gpw-sale-price {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

.gpw-carousel-item .gpw-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.gpw-carousel-item .gpw-view-button:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Owl Carousel Navigation */
.gpw-product-carousel .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
    z-index: 10;
}

.gpw-product-carousel .owl-prev,
.gpw-product-carousel .owl-next {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 24px !important;
    color: #333 !important;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gpw-product-carousel .owl-prev {
    left: -25px;
}

.gpw-product-carousel .owl-next {
    right: -25px;
}

.gpw-product-carousel .owl-prev:hover,
.gpw-product-carousel .owl-next:hover {
    background: white !important;
    color: #6f42c1 !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Owl Carousel Dots */
.gpw-product-carousel .owl-dots {
    text-align: center;
    margin-top: 20px;
}

.gpw-product-carousel .owl-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	margin: 0 5px;
	background: var(--color-divider) !important;
	border-radius: 50%;
	transition: all 0.3s ease;
}

.gpw-product-carousel .owl-dot.active {
    background:var(--color-secondary) !important;
    transform: scale(1.2);
}

.gpw-product-carousel .owl-dot:hover {
    background:var(--color-secondary) !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gpw-product-carousel .owl-prev {
        left: -15px;
    }
    
    .gpw-product-carousel .owl-next {
        right: -15px;
    }
}

@media (max-width: 768px) {
    .gpw-product-carousel {
        margin: 20px 0;
        padding: 10px 0;
    }
    
    .gpw-carousel-item .gpw-product-image {
        height: 200px;
    }
    
    .gpw-carousel-item .gpw-product-content {
        padding: 15px;
    }
    
    .gpw-carousel-item .gpw-product-title {
        font-size: 14px;
        height: 40px;
    }
    
.gpw-carousel-item .gpw-product-price {
	align-items: center;
	gap: 10px;
	flex-wrap: nowrap;
}
    
.gpw-carousel-item .gpw-view-button {
	width: 50%;
	justify-content: center;
	padding: 0;
}
    
    .gpw-product-carousel .owl-prev,
    .gpw-product-carousel .owl-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .gpw-product-carousel .owl-prev {
        left: -10px;
    }
    
    .gpw-product-carousel .owl-next {
        right: -10px;
    }
}

@media (max-width: 480px) {
    .gpw-carousel-item .gpw-product-image {
        height: 180px;
    }
    
    .gpw-carousel-item .gpw-product-content {
        padding: 12px;
    }
    
    .gpw-carousel-item .gpw-product-title {
        font-size: 13px;
        height: 36px;
    }
    
    .gpw-carousel-item .gpw-attribute {
        font-size: 12px;
        padding: 4px 0;
    }
    
    .gpw-product-carousel .owl-prev,
    .gpw-product-carousel .owl-next {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Loading Animation */
.gpw-product-carousel.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gpw-product-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6f42c1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.gpw-product-carousel:empty::before {
    content: 'هیچ محصولی انتخاب نشده است';
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}
