/* Carousel Container */
.mpl-carousel-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    overflow: hidden;
    margin-bottom: 0px;
    padding-bottom: 10px;
}

/* Main Carousel */
.mpl-products-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Carousel Track */
.mpl-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

/* Individual Slide */
.mpl-carousel-slide {
    flex: 0 0 25%; /* Default: 4 per row */
    padding: 0 10px;
    box-sizing: border-box;
    min-height: 1px;
}

/* Product Styling */
.mpl-carousel-slide .product {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    margin-bottom: 0;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;

}

/* Product Hover Effects */
/* .mpl-carousel-slide .product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #d0d0d0;
} */

/* Product Image Container */
.mpl-carousel-slide .product .woocommerce-loop-product__link {
    display: block;
    overflow: hidden;
    position: relative;
    border-radius: 12px 12px 0 0;
    background: white;
    height: 220px; /* Fixed height for container */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product Image */
.mpl-carousel-slide .product img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Changed from cover to contain */
    display: block;
    transition: transform 0.3s ease;
}

.mpl-carousel-slide .product:hover img {
    transform: scale(1.05);
}

/* Product Content */
.mpl-carousel-slide .product .woocommerce-loop-product__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 25px 15px 8px; /* Increased top margin from 15px to 25px */
    padding: 0;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.mpl-carousel-slide .product .price {
    color: #e91e63;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0 15px;
    margin: 0 0 15px;
    display: block;
}

.mpl-carousel-slide .product .price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

.mpl-carousel-slide .product .price ins {
    text-decoration: none;
}

/* Add to Cart Button */
.mpl-carousel-slide .product .add_to_cart_button {
    margin: auto 15px 15px;
    width: calc(100% - 30px);
    padding: 12px;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.85rem;
}

.mpl-carousel-slide .product .add_to_cart_button:hover {
    transform: translateY(-2px);
}

/* Navigation Buttons */
.mpl-carousel-prev,
.mpl-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #353535;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.mpl-carousel-prev:hover,
.mpl-carousel-next:hover {
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.mpl-carousel-prev:disabled,
.mpl-carousel-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

.mpl-carousel-prev {
    left: 10px;
}

.mpl-carousel-next {
    right: 10px;
}

/* Add arrow content */
.mpl-carousel-prev::after {
    content: "‹";
}

.mpl-carousel-next::after {
    content: "›";
}

/* Dots Navigation - Positioned at top right */
.mpl-carousel-dots {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
}

.mpl-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px; /* Changed from 50% to 2px for square with slight rounding */
    border: 2px solid #333; /* Dark border */
    background: white; /* White background for inactive */
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.mpl-carousel-dot:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.mpl-carousel-dot.active {
    background: #333; /* Dark grey background for active */
    border-color: #333;
    transform: scale(1.1);
}

/* No Products Message */
.mpl-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .mpl-carousel-slide {
        flex: 0 0 33.333%; /* 3 per row */
    }
}

@media (max-width: 768px) {
    .mpl-carousel-wrapper {
        padding: 0 50px;
    }
    
    .mpl-carousel-slide {
        flex: 0 0 50%; /* 2 per row */
        padding: 0 8px;
    }
    
    .mpl-carousel-slide .product .woocommerce-loop-product__link {
        height: 200px; /* Adjusted for mobile */
    }
    
    .mpl-carousel-prev,
    .mpl-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .mpl-carousel-prev {
        left: 5px;
    }
    
    .mpl-carousel-next {
        right: 5px;
    }
    
    .mpl-carousel-dots {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .mpl-carousel-wrapper {
        padding: 0 45px;
    }
    
    .mpl-carousel-slide {
        flex: 0 0 100%; /* 1 per row on mobile */
        padding: 0 5px;
    }
    
    .mpl-carousel-slide .product .woocommerce-loop-product__link {
        height: 250px; /* Adjusted for small mobile */
    }
    
    .mpl-carousel-slide .product .woocommerce-loop-product__title {
        font-size: 1.1rem;
        margin: 25px 15px 10px; /* Maintained increased margin */
    }
    
    .mpl-carousel-slide .product .price {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .mpl-carousel-prev,
    .mpl-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .mpl-carousel-dots {
        top: 10px;
        right: 10px;
    }
    
    .mpl-carousel-dot {
        width: 10px;
        height: 10px;
    }
}

/* Loading State */
.mpl-carousel-wrapper.loading .mpl-carousel-slide {
    opacity: 0.6;
}

/* Accessibility */
.mpl-carousel-prev:focus,
.mpl-carousel-next:focus,
.mpl-carousel-dot:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* RTL Support */
.rtl .mpl-carousel-prev {
    left: auto;
    right: 10px;
}

.rtl .mpl-carousel-next {
    right: auto;
    left: 10px;
}

.rtl .mpl-carousel-dots {
    right: auto;
    left: 20px;
}

/* Print Styles */
@media print {
    .mpl-carousel-prev,
    .mpl-carousel-next,
    .mpl-carousel-dots {
        display: none;
    }
    
    .mpl-carousel-track {
        display: flex;
        flex-wrap: wrap;
    }
    
    .mpl-carousel-slide {
        flex: 0 0 50%;
        break-inside: avoid;
    }
}

/* Disable hover effects on mobile */
@media (max-width: 576px) {
    .mpl-carousel-slide .product:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .mpl-carousel-slide .product:hover img {
        transform: none;
    }
    
    .mpl-carousel-slide .product .add_to_cart_button:hover {
        transform: none;
        box-shadow: none;
    }
}