/**
 * Product Carousels CSS
 * Styling for bestsellers and recently viewed product carousels
 */

/* Carousel Wrapper */
.ppservis-carousel-wrapper {
    width: 100%;
}

.ppservis-carousel-wrapper .carousel-title {
    font-family: "Poppins", Sans-serif;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 34px;
    color: #3E3E3E;
    text-align: center;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
}

/* Track Wrapper - handles overflow */
.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
    /* Ensure only fully visible cards are shown */
    scroll-snap-type: x mandatory;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.3s ease-in-out;
}

/* Product Cards in Carousel */
.carousel-track .product-card {
    flex: 0 0 calc(25% - 15px); /* 4 cards on desktop */
    max-width: calc(25% - 15px);
    scroll-snap-align: start;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
}

.carousel-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active, .carousel-nav:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #ddd;
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
}

.carousel-nav svg {
    width: 40px;
    height: 40px;
}

.carousel-nav svg path {
    fill: #333;
}

.carousel-prev {
    left: -24px;
}

.carousel-next {
    right: -24px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .carousel-prev {
        left: 0;
    }

    .carousel-next {
        right: 0;
    }

    .carousel-track .product-card {
        flex: 0 0 calc(33.333% - 13.33px); /* 3 cards on medium screens */
        max-width: calc(33.333% - 13.33px);
    }
}

@media (max-width: 768px) {
    .carousel-track {
        gap: 15px;
    }

    .carousel-track .product-card {
        flex: 0 0 calc(50% - 7.5px); /* 2 cards on tablet */
        max-width: calc(50% - 7.5px);
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-nav svg {
        width: 40px;
        height: 40px;
    }

    .ppservis-carousel-wrapper .carousel-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .carousel-track .product-card {
        flex: 0 0 100%; /* 1 card on mobile - full width */
        max-width: 100%;
    }

    .carousel-track {
        gap: 10px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-nav svg {
        width: 40px;
        height: 40px;
    }
}
