/**
 * Product Gallery Carousel Styles
 * 
 * @package Product_Gallery_Carousel
 */

.product-gallery-carousel {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.product-gallery-carousel.no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 16px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Navigation Buttons */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: auto;
}

.product-gallery-carousel:hover .carousel-nav-btn {
    opacity: 1;
    visibility: visible;
}

.carousel-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.carousel-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* Dots Navigation */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cccccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.carousel-dot:hover {
    opacity: 1;
    transform: scale(1.2);
}

.carousel-dot.active {
    background-color: #000000;
    opacity: 1;
    transform: scale(1.2);
}

.carousel-dot:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-gallery-carousel {
        height: 300px;
    }
    
    .carousel-nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .carousel-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .carousel-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    .carousel-dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .product-gallery-carousel {
        height: 250px;
    }
    
    .carousel-nav-btn {
        width: 30px;
        height: 30px;
    }
    
    .carousel-nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .carousel-dots {
        gap: 4px;
    }
    
    .carousel-dot {
        width: 5px;
        height: 5px;
    }
}

/* Loading State */
.carousel-slide img {
    transition: opacity 0.3s ease;
}

/* Accessibility */
.carousel-nav-btn[aria-label],
.carousel-dot[aria-label] {
    position: relative;
}

.carousel-nav-btn[aria-label]:focus::after,
.carousel-dot[aria-label]:focus::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .carousel-nav-btn {
        opacity: 1;
        visibility: visible;
        display: flex !important;
        background-color: rgba(0, 0, 0, 0.6);
    }
    
    .carousel-nav-btn:hover {
        background-color: rgba(177, 177, 177, 0.6);
        transform: translateY(-50%);
    }
    
    .carousel-dot {
        opacity: 0.8;
    }
    
    .carousel-dot:hover {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* Ensure proper positioning - override any conflicting styles */
.product-gallery-carousel {
    position: relative !important;
    overflow: visible !important;
}

.carousel-container {
    position: relative !important;
    z-index: 1 !important;
}

.carousel-slide {
    position: absolute !important;
    z-index: 1 !important;
}

.carousel-nav-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999 !important;
    color: rgb(0, 0, 0) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.product-gallery-carousel:hover .carousel-nav-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

.carousel-prev {
    left: 15px !important;
}

.carousel-next {
    right: 15px !important;
}

 


/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .carousel-nav-btn {
        background-color: #000000;
     
    }
    
    .carousel-dot {
        background-color: #ffffff;
        border: 1px solid #000000;
    }
    
    .carousel-dot.active {
        background-color: #000000;
        border-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .carousel-slide,
    .carousel-nav-btn,
    .carousel-dot {
        transition: none;
    }
    
    .carousel-nav-btn:hover {
        transform: translateY(-50%);
    }
    
    .carousel-dot:hover,
    .carousel-dot.active {
        transform: scale(1);
    }
} 