/* ============================================
   PRODUCT IMAGE ZOOM GALLERY
   ============================================ */

/* Main Product Image Container */
.product-image-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* Main Display Image */
.main-product-image {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f8f9fa;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-product-image:hover img {
    transform: scale(1.05);
}

/* Zoom Icon Indicator */
.zoom-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 10;
}

.zoom-indicator i {
    font-size: 14px;
}

/* Image Thumbnails */
.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px 0;
}

.product-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.product-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.product-thumbnails::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.product-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.thumbnail-item {
    flex: 0 0 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.thumbnail-item.active {
    border-color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Image Badges */
.image-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-badge.sale {
    background: #e74c3c;
    color: #fff;
}

.image-badge.new {
    background: #27ae60;
    color: #fff;
}

.image-badge.featured {
    background: #f39c12;
    color: #fff;
}

/* Lightbox/Modal for Zoomed Image */
#imageZoomModal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
    margin: 30px auto;
}

#imageZoomModal .modal-content {
    background: #000;
    border: none;
    border-radius: 0;
}

#imageZoomModal .modal-body {
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

#imageZoomModal .zoomed-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    cursor: grab;
    user-select: none;
}

#imageZoomModal .zoomed-image.grabbing {
    cursor: grabbing;
}

/* Close Button */
#imageZoomModal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

#imageZoomModal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Navigation Arrows in Lightbox */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Image Counter */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 100;
}

/* Pan Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 70px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.zoom-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Loading Spinner */
.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.image-loading.active {
    display: block;
}

.spinner {
    border: 3px solid rgba(231, 76, 60, 0.3);
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .main-product-image {
        height: 350px;
    }
    
    .thumbnail-item {
        flex: 0 0 60px;
        height: 60px;
    }
    
    #imageZoomModal .modal-dialog {
        max-width: 100vw;
        width: 100vw;
        margin: 0;
    }
    
    #imageZoomModal .modal-body {
        min-height: 100vh;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    #imageZoomModal .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .main-product-image {
        height: 300px;
    }
    
    .zoom-indicator {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .image-counter {
        font-size: 12px;
        padding: 6px 15px;
    }
    
    .zoom-controls {
        bottom: 60px;
        right: 10px;
        gap: 8px;
    }
    
    .zoom-control-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}
