/* Image Protection Styles */

.protected-image {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.protected-image:hover {
    cursor: default;
}

/* Watermark overlay */
.image-watermark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-watermark i {
    font-size: 10px;
}

.main-image-container:hover .image-watermark {
    opacity: 1;
}

/* Disable text selection on gallery */
.product-gallery-section {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Custom context menu prevention */
.product-gallery-section * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent image dragging */
.thumbnail-item img,
.main-image {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: auto;
}

/* Additional protection for zoomed images */
.main-image-container.zoomed .protected-image {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide any potential toolbar */
.product-gallery-section::-webkit-scrollbar {
    display: none;
}

/* Prevent print screen */
@media print {
    .product-gallery-section {
        display: none !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Add subtle overlay to indicate protection */
.main-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 5;
}

/* Disable right-click indicator */
.main-image-container,
.thumbnail-item {
    position: relative;
}

/* Enhanced touch-friendly mobile protection */
@media (max-width: 768px) {
    .image-watermark {
        top: 5px;
        right: 5px;
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .protected-image {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }
    
    /* Touch-friendly thumbnail interactions */
    .thumbnail-item {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .thumbnail-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Improved mobile zoom */
    .main-image-container.zoomed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }
    
    .main-image-container.zoomed .main-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 0;
    }
    
    .main-image-container.zoomed .zoom-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.9);
        color: #333;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        z-index: 10000;
    }
    
    .main-image-container.zoomed .image-watermark {
        display: none;
    }
}

/* Enhanced responsive design for product images */
@media (max-width: 1024px) {
    .image-watermark {
        top: 8px;
        right: 8px;
        padding: 7px 10px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .main-image-container {
        margin-bottom: 1rem;
    }
    
    .thumbnail-gallery {
        margin-top: 1rem;
    }
    
    .thumbnail-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .thumbnail-item {
        aspect-ratio: 1;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .image-watermark {
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }
}

@media (max-width: 480px) {
    .image-watermark {
        top: 4px;
        right: 4px;
        padding: 4px 6px;
        font-size: 9px;
        border-radius: 4px;
    }
    
    .thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.25rem;
    }
    
    .protected-image {
        border-radius: 4px;
    }
}

/* Prevent long-press on mobile */
.protected-image {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hide any download buttons that might appear */
.protected-image::-webkit-media-controls-panel,
.protected-image::-webkit-media-controls-play-button,
.protected-image::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}
