/* Product Multi-Image Gallery Styles */

/* Carousel Enhancements */
.product-carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.product-carousel-wrapper .carousel {
    height: 100%;
}

.product-carousel-wrapper .carousel-inner,
.product-carousel-wrapper .carousel-item {
    height: 100%;
}

.product-carousel-wrapper .carousel-control-prev,
.product-carousel-wrapper .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-carousel-wrapper:hover .carousel-control-prev,
.product-carousel-wrapper:hover .carousel-control-next {
    opacity: 1;
}

.product-carousel-wrapper .carousel-control-prev {
    left: 10px;
}

.product-carousel-wrapper .carousel-control-next {
    right: 10px;
}

.product-carousel-wrapper .carousel-control-prev-icon,
.product-carousel-wrapper .carousel-control-next-icon {
    width: 20px;
    height: 20px;
    background-size: 100%;
    filter: invert(1);
}

.product-carousel-wrapper .carousel-indicators {
    margin-bottom: 5px;
}

.product-carousel-wrapper .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    transition: all 0.3s ease;
}

.product-carousel-wrapper .carousel-indicators .active {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

/* Product Gallery Zoom */
.product-gallery .main-image-container {
    position: relative;
    overflow: hidden;
}

.product-gallery #mainImage {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.product-gallery #mainImage.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.product-gallery #zoomLens {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Thumbnail Navigation */
.product-gallery .thumbnail-container {
    margin-top: 1rem;
}

.product-gallery .thumbnail-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-gallery .thumbnail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-gallery .thumbnail-item.active img {
    border-color: var(--bs-primary) !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.2);
}

.product-gallery .thumbnail-item img {
    transition: all 0.3s ease;
}

/* Smooth Scrolling for Thumbnails */
.product-gallery .thumbnail-container > div {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.product-gallery .thumbnail-container > div::-webkit-scrollbar {
    height: 6px;
}

.product-gallery .thumbnail-container > div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.product-gallery .thumbnail-container > div::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.product-gallery .thumbnail-container > div::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.product-card .action-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.product-card:hover .action-buttons {
    opacity: 1;
}

.product-card .action-buttons .btn {
    transition: all 0.3s ease;
}

.product-card .action-buttons .btn:hover {
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-carousel-wrapper .carousel-control-prev,
    .product-carousel-wrapper .carousel-control-next {
        width: 30px;
        height: 30px;
    }
    
    .product-carousel-wrapper .carousel-control-prev-icon,
    .product-carousel-wrapper .carousel-control-next-icon {
        width: 15px;
        height: 15px;
    }
    
    .product-gallery #zoomLens {
        display: none !important;
    }
    
    .product-gallery #mainImage {
        cursor: default !important;
    }
    
    .product-card .action-buttons {
        opacity: 1;
        position: static;
        transform: none;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.image-loading {
    background: linear-gradient(to right, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Badge Styles */
.product-carousel-wrapper .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Smooth Transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

/* Accessibility */
.product-carousel-wrapper .carousel-control-prev:focus,
.product-carousel-wrapper .carousel-control-next:focus,
.product-gallery .thumbnail-item:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .product-carousel-wrapper .carousel-control-prev,
    .product-carousel-wrapper .carousel-control-next,
    .product-carousel-wrapper .carousel-indicators,
    .product-card .action-buttons {
        display: none !important;
    }
}
