.woo-product-carousel-wrapper {
    position: relative;
    margin: 20px 0;
    width: 100%;
}

.woo-product-carousel-container {
    overflow: hidden;
    width: 100%;
    cursor: grab;
}

.woo-product-carousel-container:active {
    cursor: grabbing;
}

.woo-product-carousel-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: transform 0.5s ease;
}

.woo-product-carousel-track li.product {
    margin: 0 !important;
    padding: 15px !important;
    box-sizing: border-box !important;
    float: none !important;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
}

.woo-product-carousel-track li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.woo-product-carousel-track li.product img {
    max-width: var(--woo-carousel-img-max-width, 100%) !important;
    max-height: var(--woo-carousel-img-max-height, none) !important;
    height: auto !important;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 15px;
    transition: transform 0.3s ease-in-out !important;
    /* Default values for randomized hover effect */
    --woo-hover-scale: 1.25;
    --woo-hover-rotate: 5deg;
}

.woo-product-carousel-track li.product:hover img {
    transform: scale(var(--woo-hover-scale)) rotate(var(--woo-hover-rotate)) !important;
}

/* Columns */
.columns-1 li.product { flex: 0 0 100%; max-width: 100%; }
.columns-2 li.product { flex: 0 0 50%; max-width: 50%; }
.columns-3 li.product { flex: 0 0 33.333%; max-width: 33.333%; }
.columns-4 li.product { flex: 0 0 25%; max-width: 25%; }
.columns-5 li.product { flex: 0 0 20%; max-width: 20%; }
.columns-6 li.product { flex: 0 0 16.666%; max-width: 16.666%; }

/* Controls */
.woo-product-carousel-controls {
    display: none !important;
}

.woo-product-carousel-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-color, #fff);
    border: 1px solid var(--primary-color, #ccc);
    color: var(--primary-color, #333);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.woo-product-carousel-controls button:hover {
    background: var(--primary-color, #fff);
    color: var(--button-text-color, #fff);
}

.woo-carousel-prev {
    left: -20px;
}

.woo-carousel-next {
    right: -20px;
}

@media (max-width: 768px) {
    .woo-product-carousel-track li.product {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .woo-carousel-prev { left: 0; }
    .woo-carousel-next { right: 0; }
}

@media (max-width: 480px) {
    .woo-product-carousel-track li.product {
        flex: 0 0 100%;
        max-width: 100%;
    }
}


/* Visibility toggles */
.hide-title .woocommerce-loop-product__title { display: none !important; }
.hide-price .price { display: none !important; }
.hide-rating .star-rating { display: none !important; }
.star-rating { margin-left: auto !important; margin-right: auto !important; }
.hide-add-to-cart .add_to_cart_button { display: none !important; }

/* New Title and Load More Button styles */
.woo-product-carousel-title {
    margin-bottom: 20px;
    text-align: center;
}

.woo-product-carousel-load-more {
    margin-top: 20px;
    text-align: center;
}

/* Replace Mode Styles */
.woo-product-carousel-wrapper.mode-replace .woo-product-carousel-track {
    display: flex !important;
    flex-wrap: wrap !important;
    transform: none !important;
    transition: none !important;
}

.woo-product-carousel-wrapper.mode-replace .woo-product-carousel-controls {
    display: none;
}

.woo-product-carousel-wrapper.mode-replace .flip-hidden {
    display: none !important;
}

.woo-product-carousel-wrapper.mode-replace .flip-visible {
    display: flex !important;
    perspective: 1000px;
    backface-visibility: hidden;
}

.woo-product-carousel-wrapper.mode-replace li.product.flipping-out {
    animation: wooFlipOut 0.6s forwards;
}

.woo-product-carousel-wrapper.mode-replace li.product.flipping-in {
    animation: wooFlipIn 0.6s forwards;
}

@keyframes wooFlipOut {
    0% { transform: rotateY(0deg); opacity: 1; }
    100% { transform: rotateY(90deg); opacity: 0; }
}

@keyframes wooFlipIn {
    0% { transform: rotateY(-90deg); opacity: 0; }
    100% { transform: rotateY(0deg); opacity: 1; }
}
