/**
 * Products Carousel Widget Styles
 * Surplus Général Tardif
 */

.products-carousel-wrapper {
    position: relative;
    width: 100%;
}

.products-carousel-placeholder {
    padding: 40px;
    text-align: center;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    color: #666;
    font-size: 14px;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.carousel-viewport {
    overflow: hidden;
    width: calc(100% + 20px);
    /* Add padding to show card shadows, compensate with negative margin */
    padding: 15px;
    margin: -15px -10px;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s ease-out;
}

.carousel-slide {
    flex-shrink: 0;
}

/* Product card inside carousel - the li.product-card from content-product.php */
.products-carousel-wrapper .carousel-slide .product-card {
    list-style: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure carousel track properly contains li elements */
.products-carousel-wrapper .carousel-track {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Navigation Arrows */
.carousel-arrow {
    flex-shrink: 0;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 10px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    outline: none !important;
}

.carousel-arrow:focus,
.carousel-arrow:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.carousel-arrow:hover {
    transform: scale(1.1);
}

.carousel-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-arrow svg {
    display: block;
    height: 32px;
    width: auto;
}

.carousel-arrow svg path {
    transition: stroke 0.3s ease, fill 0.3s ease;
}

/* Dots Navigation */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot:hover {
    background: #bbb;
}

.carousel-dot.active {
    background: #CE2222;
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .carousel-container {
        gap: 10px;
    }

    .carousel-arrow {
        padding: 5px;
    }

    .carousel-arrow svg {
        height: 24px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        position: relative;
    }

    .carousel-viewport {
        width: 100%;
        padding: 15px 0;
        margin: -15px 0;
    }

    .carousel-arrow {
        position: absolute;
        top: 30%;
        transform: translateY(-50%);
        z-index: 10;
        background: rgba(255, 255, 255, 0.9) !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50%;
        padding: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        width: 40px;
        height: 40px;
    }

    .carousel-arrow svg {
        height: 20px;
    }

    .carousel-arrow:hover {
        transform: translateY(-50%) scale(1.1);
    }

    .carousel-arrow-prev {
        left: 5px;
    }

    .carousel-arrow-next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .carousel-arrow {
        width: 36px;
        height: 36px;
        padding: 6px;
        top: 25%;
    }

    .carousel-arrow svg {
        height: 18px;
    }

    .carousel-arrow-prev {
        left: 3px;
    }

    .carousel-arrow-next {
        right: 3px;
    }
}
