﻿/**
 * Homepage Carousels Styles
 * 
 * Styles for the product carousels on the homepage
 * Compatible with Slick Carousel
 */

/* Carousel Container Styling */
.trending-products-carousel,
.price-drops-carousel {
    width: 100%;
    margin: 0 auto;
    padding-bottom: 50px; /* Extra space for dots navigation */
    display: block;
    position: relative;
    visibility: visible;
    min-height: 200px; /* Minimum height to ensure visibility */
}

/* Fix for slick initialization */
.slick-initialized {
    visibility: visible;
}

/* Ensure each slide has proper dimensions */
.slick-slide {
    margin: 0 10px;
    height: auto;
    min-height: 200px;
}

/* Main product card styling */
.product-card {
    height: 100%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Image container styling */
.product-image-container {
    padding-top: 15px;
    padding-bottom: 15px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product info section */
.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 500;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Slick Arrow Styling */
.slick-prev,
.slick-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    color: #333;
    border: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1 !important; /* Ensure arrows are visible */
}

    .slick-prev:hover,
    .slick-next:hover {
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

.slick-prev {
    left: -22px;
}

.slick-next {
    right: -22px;
}

    .slick-prev:before,
    .slick-next:before {
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 20px;
        color: #333;
        opacity: 0.8;
        -webkit-font-smoothing: antialiased;
        display: inline-block; /* Ensure visible */
    }

.slick-prev:before {
    content: '\f053'; /* fa-chevron-left */
}

.slick-next:before {
    content: '\f054'; /* fa-chevron-right */
}

/* Override any potential conflicting styles */
.slick-arrow {
    display: block !important;
    visibility: visible !important;
}

/* Slick Dots Styling */
.slick-dots {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

    .slick-dots li {
        margin: 0 5px;
        display: inline-block;
    }

        .slick-dots li button {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background-color: #ddd;
            border: none;
            font-size: 0;
            padding: 0;
            cursor: pointer;
            transition: all 0.3s ease;
            display: block;
        }

        .slick-dots li.slick-active button {
            background-color: #007bff;
            transform: scale(1.2);
        }

        .slick-dots li button:before {
            content: '';
            display: none;
        }

/* Fix for slick track */
.slick-track {
    display: flex !important;
    margin-left: 0;
    margin-right: 0;
}

    .slick-track .slick-slide {
        height: inherit !important;
        display: flex !important;
        flex-direction: column;
    }

        .slick-track .slick-slide > div {
            height: 100%;
            display: flex;
        }

/* Ensure arrows are always visible */
.trending-products-carousel .slick-prev,
.trending-products-carousel .slick-next,
.price-drops-carousel .slick-prev,
.price-drops-carousel .slick-next {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Move arrows outside of the carousel container */
.trending-section .slick-prev,
.price-drops-section .slick-prev {
    left: -25px;
}

.trending-section .slick-next,
.price-drops-section .slick-next {
    right: -25px;
}

/* Ensure tooltips are visible */
.tooltip {
    z-index: 9999;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .slick-prev {
        left: -15px;
    }

    .slick-next {
        right: -15px;
    }
}

@media (max-width: 992px) {
    .slick-prev {
        left: -10px;
    }

    .slick-next {
        right: -10px;
    }

    .product-image-container {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .slick-prev {
        left: -5px;
    }

    .slick-next {
        right: -5px;
    }

    .product-image-container {
        height: 150px;
    }
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    /* Prevent unwanted scrolling behavior */
    .slick-track {
        touch-action: pan-y;
        -ms-touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure smooth animations */
    .slick-slide {
        transition: opacity 0.5s ease;
        -webkit-transition: opacity 0.5s ease;
    }

    /* Prevent flash on mobile */
    .slick-slider {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Improve touch area for arrows */
    .slick-prev,
    .slick-next {
        width: 36px;
        height: 36px;
        padding: 0;
        touch-action: manipulation;
    }

    /* Adjust arrow positions */
    .slick-prev {
        left: -8px;
    }

    .slick-next {
        right: -8px;
    }
}
