/* AEM Labs Limited - Product Carousel Module */
/* ========================================== */

.carousel-container {
    position: relative;
    width: 100%;
    margin: 12px 0 0;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.carousel-container .carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    /* Firefox - transparent by default */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding: 0;
    scroll-behavior: smooth;
    width: 100%;
    flex-wrap: nowrap;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}

/* Show scrollbar on carousel hover */
.carousel-container:hover .carousel-track {
    scrollbar-color: rgba(var(--accent-color-rgb), 0.3) rgba(242, 242, 242, 0.3);
}

/* Custom Scrollbar for Webkit browsers (Chrome, Safari, Edge) */
.carousel-container .carousel-track::-webkit-scrollbar {
    height: 8px;
}

.carousel-container .carousel-track::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
    transition: background 0.2s;
}

/* Show scrollbar track on carousel hover for Webkit */
.carousel-container:hover .carousel-track::-webkit-scrollbar-track {
    background: var(--accent-color) !important;
}

.carousel-container .carousel-track::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.2s;
}

/* Show scrollbar thumb on carousel hover for Webkit */
.carousel-container:hover .carousel-track::-webkit-scrollbar-thumb {
    background: var(--accent-color) !important;
}

.carousel-container .carousel-track::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color) !important;
}

.carousel-arrow {
    position: absolute;
    top: calc(30px + 55px);
    transform: translateY(-50%);
    background-color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.carousel-container:hover .carousel-arrow {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.carousel-arrow:hover {
    background-color: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    left: -15px;
}

.carousel-next {
    right: -15px;
}

.carousel-container .product-card {
    min-width: 160px;
    max-width: 160px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
}

.carousel-container .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    background-color: rgb(238, 236, 236);
    border-radius: 16px;
}

.carousel-container .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.carousel-container .product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.carousel-container .badge {
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.carousel-container .badge.discount {
    background: linear-gradient(135deg, var(--accent-color) 0%, #6907c5 100%);
    color: white;
}

.carousel-container .badge.popular {
    background: #ff9500;
    color: white;
}

.carousel-container .badge.new {
    background: #00b894;
    color: white;
    width: fit-content;
}

.carousel-container .badge.out-of-stock {
    background: #ff4444;
    color: white;
}

.carousel-container .product-title-link {
    text-decoration: none;
    color: inherit;
}

.carousel-container .product-card:hover .product-image img {
    transform: scale(1.02);
}

.carousel-container .product-details {
    padding: 12px 0 0;
    position: relative;
}

.carousel-container .product-title {
    font-size: 13px;
    margin: 0 0 4px 0;
    color: #333;
    line-height: 1.4;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.carousel-container .product-link:hover,
.carousel-container .product-seller:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.carousel-container .product-link,
.carousel-container .seller-link {
    text-decoration: none;
    color: #333;
}

.carousel-container .product-price {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
    font-size: 14px;
}

.carousel-container .product-seller {
    font-size: 11px;
    color: #777;
}

.carousel-container .wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.carousel-container .wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

.carousel-container .wishlist-btn i {
    color: black;
    font-size: 13px;
    transition: all 0.2s ease;
}

.carousel-container .wishlist-btn:hover i {
    color: var(--accent-color);
}

.carousel-container .wishlist-btn.active i {
    color: var(--accent-color);
    font-weight: 900;
}

.carousel-container .add-to-cart-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: linear-gradient(270deg, #a71c1c, #6907c5, #a71c1c, #6907c5);
    background-size: 300% 100%;
    background-position: 0% 0%;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    width: 28px;
    height: 28px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease, background-position 0.6s ease;
    z-index: 2;
}

.carousel-container .add-to-cart-btn:hover {
    background-position: 100% 0%;
    transform: scale(1.1);
}

@media (max-width: 1440px) {
    .carousel-container .product-card {
        min-width: 140px;
        max-width: 140px;
    }

    .carousel-container .product-details {
        padding: 10px 0 0;
    }

    .carousel-container .carousel-arrow {
        width: 38px;
        height: 38px;
        top: calc(30px + 90px);
    }
}

@media (max-width: 992px) {
    .carousel-container {
        margin: 0;
    }

    .carousel-wrapper {
        width: 100%;
    }

    .carousel-container .carousel-track {
        padding: 0;
        width: 100%;
        gap: 12px;
    }

    .carousel-container .product-card {
        min-width: 165px;
        max-width: 165px;
    }

    .carousel-container .product-title {
        font-size: 12px;
    }

    .carousel-container .product-price {
        font-size: 13px;
    }

    .carousel-container .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
        top: calc(30px + 80px);
    }

    .carousel-container .carousel-prev {
        left: -12px;
    }

    .carousel-container .carousel-next {
        right: -12px;
    }
}

@media (max-width: 768px) {
    .carousel-container .product-card {
        min-width: 145px;
        max-width: 145px;
    }

    .carousel-container .product-details {
        padding: 8px 0 0;
    }

    .carousel-container .product-title {
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }

    .carousel-container .product-price {
        font-size: 13px;
    }

    .carousel-container .product-seller {
        font-size: 10px;
    }

    .carousel-container .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
        top: calc(30px + 70px);
    }

    .carousel-container .carousel-prev {
        left: -10px;
    }

    .carousel-container .carousel-next {
        right: -10px;
    }

    .carousel-container .wishlist-btn {
        width: 24px;
        height: 24px;
    }

    .carousel-container .wishlist-btn i {
        font-size: 12px;
    }

    .carousel-container .add-to-cart-btn {
        width: 26px;
        height: 26px;
    }

    .badge {
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .carousel-container .carousel-track {
        gap: 10px;
    }

    .carousel-container .product-card {
        min-width: 125px;
        max-width: 125px;
    }

    .carousel-container .product-details {
        padding: 6px 0 0;
    }

    .carousel-container .product-title {
        font-size: 11px;
        line-height: 1.3;
    }

    .carousel-container .product-price {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .carousel-container .product-seller {
        font-size: 9px;
    }

    .carousel-container .carousel-arrow {
        width: 28px;
        height: 28px;
        font-size: 10px;
        top: calc(30px + 60px);
        display: none;
    }

    .carousel-container .carousel-prev {
        left: -8px;
    }

    .carousel-container .carousel-next {
        right: -8px;
    }

    .carousel-container .wishlist-btn {
        width: 22px;
        height: 22px;
        top: 8px;
        right: 8px;
    }

    .carousel-container .wishlist-btn i {
        font-size: 10px;
    }

    .carousel-container .add-to-cart-btn {
        width: 24px;
        height: 24px;
        font-size: 9px;
        bottom: 8px;
        right: 8px;
    }

    .badge {
        font-size: 8px;
        padding: 2px 4px;
    }
}