﻿/**
 * Slick Carousel - Custom styles for Blazor components
 * Overrides and customizations for Slick default theme
 */

/* ============================================
   Wrapper and Container
   ============================================ */
.slick-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.slick-carousel__slide {
    padding: 0 6px; /* Gap between slides */
}

/* ============================================
   Arrows - Hide on mobile, show on desktop
   ============================================ */
.slick-prev,
.slick-next {
    width: 40px;
    height: 40px;
    z-index: 10;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.slick-prev:hover,
.slick-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.slick-prev:before,
.slick-next:before {
    font-size: 20px;
    line-height: 1;
}

/* Position adjustments */
.slick-prev {
    left: 10px;
}

.slick-next {
    right: 10px;
}

/* Hide arrows on mobile/tablet */
@media (max-width: 1023px) {
    .slick-prev,
    .slick-next {
        display: none !important;
    }
}

/* ============================================
   Dots Navigation
   ============================================ */
.slick-dots {
    bottom: -30px;
    display: flex !important;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.slick-dots li {
    margin: 0;
    width: auto;
    height: auto;
}

.slick-dots li button {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slick-dots li button:before {
    display: none; /* Hide default Slick dot */
}

    .slick-dots li.slick-active button {
        width: 24px;
        border-radius: 12px;        
        background-color: var(--active-dot-color, var(--brand-color, #00a859));
    }

.slick-dots li button:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ============================================
   Loading State
   ============================================ */
.slick-carousel-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Product Cards Integration
   ============================================ */
.slick-carousel-wrapper .product-card-carousel--compact {
    height: 100%;
}

/* Ensure equal height slides */
.slick-carousel-wrapper .slick-track {
    display: flex !important;
}

.slick-carousel-wrapper .slick-slide {
    height: auto;
    display: flex !important;
}

.slick-carousel-wrapper .slick-slide > div {
    width: 100%;
    display: flex;
}

/* ============================================
   Image Gallery Specific
   ============================================ */
.product-image-gallery {
    max-width: 100%;
}

.product-image-gallery .slick-slide {
    text-align: center;
}

.product-image-gallery__image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (min-width: 768px) {
    .slick-dots li button {
        width: 12px;
        height: 12px;
    }

    .slick-dots li.slick-active button {
        width: 28px;
    }
}

@media (min-width: 1024px) {
    .slick-prev,
    .slick-next {
        width: 44px;
        height: 44px;
    }

    .slick-prev:before,
    .slick-next:before {
        font-size: 24px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.slick-carousel-wrapper .slick-slide:focus {
    outline: 2px solid var(--active-dot-color, var(--brand-color, #00a859));
    outline-offset: 2px;
}

.slick-carousel-wrapper button:focus-visible {
    outline: 2px solid var(--active-dot-color, var(--brand-color, #00a859));
    outline-offset: 2px;
}

/* ============================================
   Performance Optimization
   ============================================ */
.slick-carousel-wrapper .slick-track {
    will-change: transform;
}

.slick-carousel-wrapper img {
    will-change: auto; /* Prevent unnecessary repaints */
}
