/**
 * Modern Product Gallery Styles
 * Professional image gallery with lightbox, zoom, and thumbnails
 */

/* Gallery Container */
.product-gallery-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

/* Main Gallery */
.product-gallery-main {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1 / 1;
}

.product-main-swiper {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.product-main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.product-main-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-image-container:hover .product-main-image {
    transform: scale(1.05);
}

.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.product-image-container:hover .product-image-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

.product-zoom-btn-inner {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
    position: relative;
}

.product-zoom-btn-inner:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-zoom-btn-inner i {
    font-size: 24px;
    color: #333;
}

/* Navigation Buttons */
.product-gallery-next,
.product-gallery-prev {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.product-gallery-next:hover,
.product-gallery-prev:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.product-gallery-next::after,
.product-gallery-prev::after {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.product-zoom-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.product-zoom-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.product-zoom-btn i {
    font-size: 20px;
    color: #333;
}

/* Thumbnail Gallery */
.product-gallery-thumbs {
    width: 100%;
    margin-top: 1rem;
}

.product-thumbs-swiper {
    width: 100%;
    height: auto;
}

.product-thumb-slide {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
}

.product-thumb-slide:hover {
    opacity: 1;
}

.product-thumb-slide.swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--ar-primary, #007bff);
}

.product-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}

/* Placeholder */
.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 400px;
}

/* Lightbox */
.product-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-lightbox.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.product-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.product-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-lightbox-swiper {
    width: 100%;
    height: 100%;
}

.product-lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.product-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-lightbox-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-lightbox-close i {
    font-size: 24px;
    color: #333;
}

.product-lightbox-swiper .swiper-button-next,
.product-lightbox-swiper .swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-lightbox-swiper .swiper-button-next::after,
.product-lightbox-swiper .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .product-gallery-main {
        aspect-ratio: 1 / 1;
    }
    
    .product-gallery-next,
    .product-gallery-prev {
        width: 32px;
        height: 32px;
        margin-top: -16px;
    }
    
    .product-gallery-next::after,
    .product-gallery-prev::after {
        font-size: 14px;
    }
    
    .product-zoom-btn {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .product-zoom-btn i {
        font-size: 18px;
    }
    
    .product-lightbox-content {
        width: 95%;
        height: 85vh;
    }
    
    .product-lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

