/**
 * Image Protection CSS - v2.0 (Fixed)
 * Protección avanzada para imágenes de productos
 * Previene descarga, clic derecho y arrastrar
 * SIN bloquear navegación, Swiper, Fancybox ni thumbnails
 */

/* ============================================
   CONTENEDOR DE IMAGEN PROTEGIDA
   ============================================ */
.protected-image-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================================
   IMAGEN PROTEGIDA
   Protege contra arrastrar pero PERMITE clicks
   ============================================ */
.protected-image {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* NO usar pointer-events: none - bloquea navegación */
}

/* ============================================
   MARCA DE AGUA (WATERMARK)
   ============================================ */
.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.15;
    background-repeat: repeat;
    background-size: 200px 100px;
}

/* Marca de agua visible en diagonal */
.watermark-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 24px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    pointer-events: none;
    z-index: 6;
    text-transform: uppercase;
    letter-spacing: 5px;
    font-family: Arial, sans-serif;
}

/* Patrón de marca de agua repetido */
.watermark-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.watermark-pattern::before {
    content: 'PRODUCTOS Y SUMINISTROS · PRODUCTOS Y SUMINISTROS · PRODUCTOS Y SUMINISTROS · ';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 200%;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 102, 0, 0.06);
    white-space: nowrap;
    transform: rotate(-30deg);
    line-height: 80px;
    letter-spacing: 20px;
    font-family: 'Jost', Arial, sans-serif;
    word-spacing: 30px;
    text-transform: uppercase;
    pointer-events: none;
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA GALERÍAS
   Swiper slider - SIN bloquear interacción
   ============================================ */
.product-single__image .swiper-slide {
    position: relative;
}

/* Thumbnails - Permitir clicks para cambiar imagen */
.product-single__thumbnail .swiper-slide {
    cursor: pointer;
}

.product-single__thumbnail img {
    -webkit-user-drag: none;
    user-drag: none;
    /* NO usar pointer-events: none */
}

/* ============================================
   ESTILOS PARA FANCYBOX/LIGHTBOX
   ============================================ */
.fancybox__content img {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    user-drag: none;
    /* pointer-events permitido para zoom/pan en Fancybox */
}

/* Marca de agua en Fancybox */
.fancybox__slide::after {
    content: 'PRODUCTOS Y SUMINISTROS';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 12px;
    color: rgba(255, 102, 0, 0.3);
    font-weight: bold;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 9999;
    text-transform: uppercase;
    font-family: 'Jost', Arial, sans-serif;
}

/* ============================================
   TARJETAS DE PRODUCTO
   ============================================ */
.product-card .pc__img-wrapper {
    position: relative;
    overflow: hidden;
}

.product-card .pc__img {
    -webkit-user-drag: none;
    user-drag: none;
    /* NO usar pointer-events: none - permite navegación */
}

/* ============================================
   CARRITO DE COMPRAS
   ============================================ */
.cart-drawer-item img {
    -webkit-user-drag: none;
    user-drag: none;
}

/* ============================================
   CANVAS DE MARCA DE AGUA DINÁMICA
   ============================================ */
.watermark-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
    opacity: 1;
}

/* ============================================
   PROTECCIÓN GENERAL PARA IMÁGENES DE PRODUCTOS
   Solo bloquear arrastrar, NO clicks
   ============================================ */
img[src*="upload/imagen/producto"] {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    /* NO usar pointer-events: none */
}

/* ============================================
   RESPONSIVE - MÓVIL
   ============================================ */
@media (max-width: 768px) {
    .watermark-pattern::before {
        font-size: 10px;
        line-height: 50px;
        letter-spacing: 10px;
    }

    .watermark-text {
        font-size: 16px;
    }
}

/* ============================================
   DESHABILITAR PRINT SCREEN (parcial)
   ============================================ */
@media print {
    .protected-image-container,
    .protected-image,
    img[src*="upload/imagen/producto"] {
        display: none !important;
    }

    .protected-image-container::before {
        content: 'Imagen protegida - No disponible para impresión';
        display: block;
        padding: 50px;
        text-align: center;
        color: #999;
        font-style: italic;
    }
}
