/* Fixed Lightbox CSS - No interference with zoom functionality */

/* Only target lightbox overlay specifically */
#imageLightboxOverlay.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 20, 0.65));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 0;
    animation: overlayFadeIn 0.4s ease-out;
}

/* Only target lightbox container specifically */
#imageLightboxOverlay .lightbox-container {
    position: relative;
    width: 98vw;
    height: 96vh;
    max-width: 1700px;
    max-height: 1100px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 15px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced Header - Only inside lightbox */
#imageLightboxOverlay .lightbox-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 70px;
    position: relative;
}

#imageLightboxOverlay .lightbox-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    max-width: 75%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#imageLightboxOverlay .lightbox-close {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    padding: 0;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

#imageLightboxOverlay .lightbox-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#imageLightboxOverlay .lightbox-close:hover {
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

#imageLightboxOverlay .lightbox-close:hover::before {
    left: 100%;
}

#imageLightboxOverlay .lightbox-close:active {
    transform: scale(0.95);
}

/* Enhanced Content Area - Only inside lightbox */
#imageLightboxOverlay .lightbox-content {
    display: flex;
    flex: 1;
    height: calc(96vh - 70px);
    min-height: 700px;
    position: relative;
}

#imageLightboxOverlay .lightbox-main-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    position: relative;
    padding: 30px;
    overflow: hidden;
}

#imageLightboxOverlay .lightbox-main-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

#imageLightboxOverlay .lightbox-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
}

#imageLightboxOverlay .lightbox-main-image img:hover {
    transform: scale(1.02);
}

/* Enhanced Sidebar - Only inside lightbox */
#imageLightboxOverlay .lightbox-sidebar {
    width: 300px;
    background: linear-gradient(180deg, #ffffff, #f8f9fa);
    border-left: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

#imageLightboxOverlay .lightbox-product-info {
    padding: 30px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    position: relative;
}

#imageLightboxOverlay .lightbox-product-details {
    font-size: 16px;
    color: #546e7a;
    line-height: 1.6;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(255, 107, 107, 0.05));
    padding: 15px;
    border-radius: 8px;
}

/* Enhanced Thumbnails Section - Only inside lightbox */
#imageLightboxOverlay .lightbox-thumbnails {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: linear-gradient(180deg, #f8f9fa, #ffffff);
}

/* Lightbox tabs */
#imageLightboxOverlay .lightbox-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

#imageLightboxOverlay .lightbox-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

#imageLightboxOverlay .lightbox-tab:hover {
    color: #2c3e50;
}

#imageLightboxOverlay .lightbox-tab.active {
    color: #2c3e50;
    border-bottom-color: #007bff;
}

/* Video thumbnail in lightbox */
#imageLightboxOverlay .lightbox-video-thumb {
    position: relative;
    cursor: pointer;
}

#imageLightboxOverlay .lightbox-video-thumb .lb-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

#imageLightboxOverlay .lightbox-video-thumb .lb-video-play svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Video iframe inside lightbox main area */
#imageLightboxOverlay .lightbox-video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#imageLightboxOverlay .lightbox-video-wrapper iframe {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    border: 0;
}

#imageLightboxOverlay .lightbox-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

#imageLightboxOverlay .lightbox-thumbnail {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#imageLightboxOverlay .lightbox-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0), rgba(0, 123, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

#imageLightboxOverlay .lightbox-thumbnail.active {
    border-color: #007bff;
    box-shadow: 
        0 0 0 4px rgba(0, 123, 255, 0.2),
        0 8px 16px rgba(0, 123, 255, 0.15);
    transform: scale(1.05);
}

#imageLightboxOverlay .lightbox-thumbnail.active::before {
    opacity: 1;
}

#imageLightboxOverlay .lightbox-thumbnail:hover:not(.active) {
    border-color: rgba(0, 123, 255, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

#imageLightboxOverlay .lightbox-thumbnail:hover::before {
    opacity: 0.5;
}

#imageLightboxOverlay .lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 0;
}

#imageLightboxOverlay .lightbox-thumbnail:hover img {
    transform: scale(1.1);
}

/* Premium Navigation Arrows - Only inside lightbox */
#imageLightboxOverlay .lightbox-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    color: #2c3e50;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#imageLightboxOverlay .lightbox-nav-arrow:hover {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 
        0 15px 40px rgba(0, 123, 255, 0.3),
        0 8px 20px rgba(0, 123, 255, 0.2);
}

#imageLightboxOverlay .lightbox-nav-arrow:active {
    transform: translateY(-50%) scale(1.05);
}

#imageLightboxOverlay .lightbox-nav-prev {
    left: 40px;
}

#imageLightboxOverlay .lightbox-nav-next {
    right: 340px;
}


#imageLightboxOverlay .lightbox-counter {
    position: absolute;
    bottom: 40px;
    left: calc(50% - 150px);
    transform: translateX(0); 
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(44, 62, 80, 0.9));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 80px;
    text-align: center;
}

/* REMOVED - No hover effects on main image container to avoid zoom conflicts */
/* The main-image-container hover effects have been completely removed */

/* Responsive Design - Only for lightbox */
@media (max-width: 1200px) {
    #imageLightboxOverlay .lightbox-container {
        width: 99vw;
        height: 97vh;
    }
    
    #imageLightboxOverlay .lightbox-sidebar {
        width: 280px;
    }
    
    #imageLightboxOverlay .lightbox-nav-next {
        right: 320px;
    }
}

@media (max-width: 768px) {
    #imageLightboxOverlay .lightbox-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        flex-direction: column;
    }

    #imageLightboxOverlay .lightbox-content {
        flex-direction: column;
        height: calc(100vh - 70px);
    }

    #imageLightboxOverlay .lightbox-sidebar {
        width: 100%;
        border-left: none;
        border-top: 2px solid rgba(0, 0, 0, 0.06);
        max-height: 280px;
        min-height: 220px;
    }

    #imageLightboxOverlay .lightbox-main-image {
        flex: 1;
        min-height: 65vh;
        padding: 20px;
    }

    #imageLightboxOverlay .lightbox-nav-next {
        right: 40px;
    }

    #imageLightboxOverlay .lightbox-nav-arrow {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    #imageLightboxOverlay .lightbox-thumbnails {
        padding: 20px;
    }

    #imageLightboxOverlay .lightbox-thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

/* Premium Animations - Only for lightbox */
#imageLightboxOverlay .lightbox-fade-in {
    animation: premiumFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#imageLightboxOverlay .lightbox-fade-out {
    animation: premiumFadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes premiumFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes premiumFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Custom Scrollbar - Only for lightbox */
#imageLightboxOverlay .lightbox-thumbnails::-webkit-scrollbar {
    width: 8px;
}

#imageLightboxOverlay .lightbox-thumbnails::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f1f1, #e1e1e1);
    border-radius: 4px;
}

#imageLightboxOverlay .lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #007bff, #0056b3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#imageLightboxOverlay .lightbox-thumbnails::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0056b3, #004085);
}

/* Loading Animation - Only for lightbox */
#imageLightboxOverlay .lightbox-main-image img[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Beautiful Professional Navigation Arrows */

#imageLightboxOverlay .lightbox-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    
    /* Beautiful Design */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    
    /* Typography */
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    line-height: 1;
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Hover Effects */
#imageLightboxOverlay .lightbox-nav-arrow:hover {
    background: linear-gradient(145deg, #4F46E5, #6366F1);
    color: white;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 
        0 12px 40px rgba(79, 70, 229, 0.25),
        0 4px 16px rgba(79, 70, 229, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Active/Click Effects */
#imageLightboxOverlay .lightbox-nav-arrow:active {
    transform: translateY(-50%) scale(1.02);
    transition-duration: 0.1s;
}

/* Focus for accessibility */
#imageLightboxOverlay .lightbox-nav-arrow:focus {
    outline: none;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Individual Arrow Positioning */
#imageLightboxOverlay .lightbox-nav-prev {
    left: 32px;
}

#imageLightboxOverlay .lightbox-nav-next {
    right: 32px;
}

/* Desktop positioning (account for sidebar) */
@media (min-width: 1024px) {
    #imageLightboxOverlay .lightbox-nav-next {
        right: 340px; /* Account for sidebar */
    }
}

/* Tablet positioning */
@media (max-width: 1023px) and (min-width: 769px) {
    #imageLightboxOverlay .lightbox-nav-next {
        right: 320px; /* Smaller sidebar */
    }
}

/* Mobile positioning */
@media (max-width: 768px) {
    #imageLightboxOverlay .lightbox-nav-arrow {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    #imageLightboxOverlay .lightbox-nav-prev {
        left: 20px;
    }
    
    #imageLightboxOverlay .lightbox-nav-next {
        right: 20px; /* Full width on mobile */
    }
}

/* Arrow Icons - Using better Unicode characters */
#imageLightboxOverlay .lightbox-nav-prev::before {
    content: "‹";
    font-size: 24px;
    font-weight: 300;
    margin-right: 2px; /* Slight optical adjustment */
}

#imageLightboxOverlay .lightbox-nav-next::before {
    content: "›";
    font-size: 24px;
    font-weight: 300;
    margin-left: 2px; /* Slight optical adjustment */
}

/* Subtle animation on appear */
@keyframes arrowFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

#imageLightboxOverlay .lightbox-nav-arrow {
    animation: arrowFadeIn 0.4s ease-out 0.2s both;
}

/* Hide arrows elegantly when only one image */
#imageLightboxOverlay .lightbox-nav-arrow.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
}

/* Glassmorphism enhancement for modern browsers */
@supports (backdrop-filter: blur(12px)) {
    #imageLightboxOverlay .lightbox-nav-arrow {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    
    #imageLightboxOverlay .lightbox-nav-arrow:hover {
        background: rgba(79, 70, 229, 0.9);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}

/* Tablet width (sidebar 280px) */
@media (max-width: 1200px) and (min-width: 769px) {
    #imageLightboxOverlay .lightbox-counter {
        left: calc(50% - 140px); /* 280 /2 */
    }
}

/* Mobile (sidebar full width) */
@media (max-width: 768px) {
    #imageLightboxOverlay .lightbox-counter {
        left: 50%;
        transform: translateX(-50%);
    }
}