/**
 * Proteção universal simplificada para imagens de produtos
 * Abordagem baseada em CSS global para maior eficácia
 */

/* Seletores universais para imagens de produtos */
.js-product-slide img,
.product-slide img,
.js-swiper-product-thumbs img,
.swiper-product-thumb img,
.js-related-products img,
#related-products img,
.section-products-related img,
.products-section-slider-container img,
.js-item-product img,
.item-product img,
.js-product-container img,
.product-container img,
.js-quickshop-container img,
.product-thumb img,
.thumb img,
.item-image img,
.item-image-container img,
.product-item img,
.product-box img,
.product-card img,
.product-grid-item img,
.js-section-products-featured img,
.section-featured-home img,
.section-featured-products-home img,
[data-product-id] img,
[data-store*="product"] img {
    /* Proteção básica contra seleção e arrasto */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    
    /* Desabilitar eventos de ponteiro para evitar interações diretas */
    pointer-events: none !important;
}

/* Proteção para imagens quadradas (formato 1:1) */
img[style*="padding-bottom: 100%"],
img[style*="aspect-ratio: 1"],
img[style*="aspect-ratio: 1/1"],
.square-image img,
.ratio-1-1 img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important;
}

/* Garantir que links continuem funcionando (Regra geral) */
a img {
    pointer-events: none !important;
}

/* Adicionar pointer-events aos links para manter clicáveis (Regra geral) */
a {
    pointer-events: auto !important;
}

/* Proteção para imagens em modal/lightbox */
.fancybox-slide img, 
.fancybox-content img,
.fancybox-image,
.fancybox-container img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

/* Proteção para modal/lightbox */
.fancybox-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: transparent;
    pointer-events: auto;
}

/* Bloquear menu de contexto em imagens (Regra geral) */
img {
    -webkit-touch-callout: none !important;
}

/* --- EXCEÇÃO PARA CARROSSEL DA HOME (MAIOR ESPECIFICIDADE) --- */
body .js-home-slider img { /* Adicionado 'body' para aumentar especificidade */
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    -webkit-user-drag: auto !important;
    -khtml-user-drag: auto !important;
    -moz-user-drag: auto !important;
    -o-user-drag: auto !important;
    user-drag: auto !important;
    pointer-events: auto !important;
    -webkit-touch-callout: default !important;
}

/* Garantir que links dentro do carrossel funcionem (MAIOR ESPECIFICIDADE) */
body .js-home-slider a { /* Adicionado 'body' */
    pointer-events: auto !important;
}

body .js-home-slider a img { /* Adicionado 'body' */
    pointer-events: auto !important; /* Permitir eventos na imagem dentro do link do carrossel */
    /* Reverter outras proteções explicitamente */
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    -webkit-user-drag: auto !important;
    -khtml-user-drag: auto !important;
    -moz-user-drag: auto !important;
    -o-user-drag: auto !important;
    user-drag: auto !important;
    -webkit-touch-callout: default !important;
}

