/* Parts Details - Image Toggle and Zoom Styles */

/* Main Image Container */
.main_sub_img {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
    overflow: hidden;
}

/* Main Image Styles */
.main_img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); */
    transition: all 0.3s ease;
    cursor: zoom-in;
    object-fit: cover;
    /* background: #f8f9fa; */
    /* border: 2px solid #e9ecef; */
}

.main_img:hover {
    /* box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15); */
    transform: translateY(-2px);
}

.main_img.loaded {
    opacity: 1;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Sub Images Container */
.sub_imgs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 10px;
}

/* Sub Image Styles */
/* .sub_img_box,
.sub_img1_box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    object-fit: cover;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
} */

/* .sub_img_box:hover,
.sub_img1_box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.sub_img_box.active,
.sub_img1_box.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.sub_img_box.clicked,
.sub_img1_box.clicked {
    transform: scale(0.95);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
} */

.sub_img_box{
    cursor: pointer;
}

/* Zoom Lens (Flipkart Style) */
.zoom-lens {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(236, 28, 36, 0.8);
    background: rgba(236, 28, 36, 0.1);
    pointer-events: none;
    z-index: 10;
    display: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: crosshair;
}

/* Zoom Result Container (Flipkart Style) */
.zoom-result {
    position: absolute;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    box-sizing: border-box;
}

.zoom-result .zoomed-image {
    position: absolute;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    pointer-events: none;
}

/* Mobile Zoom Effect */
.main_img.mobile-zoom {
    transform: scale(3);
    transform-origin: center center;
    transition: transform 0.3s ease;
    z-index: 20;
    position: relative;
    border-radius: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main_sub_img {
        gap: 12px;
    }
    
    .main_img {
        max-width: 100%;
        border-radius: 8px;
    }
    
    .sub_img_box,
    .sub_img1_box {
        width: 60px;
        height: 60px;
        border-radius: 6px;
    }
    
    .sub_imgs {
        gap: 8px;
    }
    
    .zoom-result {
        width: 200px !important;
        height: 200px !important;
    }
    
    .zoom-lens {
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 480px) {
    .main_img {
        border-radius: 6px;
    }
    
    .sub_img_box,
    .sub_img1_box {
        width: 50px;
        height: 50px;
        border-radius: 4px;
    }
    
    .zoom-result {
        width: 120px;
        height: 120px;
    }
    
    .zoom-lens {
        width: 50px;
        height: 50px;
    }
}

/* Loading States */
.main_img:not(.loaded) {
   
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced Hover Effects */
.main_img:hover .zoom-lens {
    display: block;
}

/* Smooth Transitions for All Interactive Elements */
.sub_img_box,
.sub_img1_box,
.main_img {
    will-change: transform, box-shadow, border-color;
}

/* Focus States for Accessibility */
.sub_img_box:focus,
.sub_img1_box:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.main_img:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .main_img,
    .sub_img_box,
    .sub_img1_box {
        border: 2px solid #000;
    }
    
    .sub_img_box.active,
    .sub_img1_box.active {
        border-color: #000;
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .main_img,
    .sub_img_box,
    .sub_img1_box,
    .zoom-lens,
    .zoom-result {
        transition: none;
        animation: none;
    }
    
    .main_img.mobile-zoom {
        transform: none;
    }
}
