/* ============================================
   CARRUSEL DE GALERÍA DE CONTENIDOS
   ============================================ */

/* Contenedor principal del carrusel */
.galeria-carousel-container {
    position: relative;
    width: 100%;
    /* max-width: 900px; */
    margin: 20px auto;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Área de visualización de la imagen */
.galeria-carousel-viewer {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Aspect ratio 16:9 */
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

.galeria-carousel-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s ease;
    touch-action: pan-y pinch-zoom;
}

.galeria-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    cursor: pointer;
    /* Protección adicional contra descarga */
    -webkit-touch-callout: none;
}

/* Protección contra clic derecho */
.galeria-carousel-slide img::selection {
    background: transparent;
}

/* Flechas de navegación */
.galeria-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.galeria-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.galeria-carousel-arrow-left {
    left: 10px;
}

.galeria-carousel-arrow-right {
    right: 10px;
}

.galeria-carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Indicadores de posición (dots) */
.galeria-carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.galeria-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.galeria-carousel-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

/* Contador de imágenes */
.galeria-carousel-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    z-index: 10;
}

/* ============================================
   VISUALIZADOR A PANTALLA COMPLETA
   ============================================ */

.galeria-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.galeria-fullscreen-overlay.active {
    display: flex;
}

.galeria-fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.galeria-fullscreen-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    position: relative;
}

.galeria-fullscreen-image-container.zoomed {
    cursor: grab;
    transform: scale(2);
    overflow: visible;
}

.galeria-fullscreen-image-container.zoomed.dragging {
    cursor: grabbing;
    transition: none;
}

.galeria-fullscreen-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
    cursor: inherit; /* Heredar cursor del contenedor */
}

/* Botón de cerrar fullscreen */
.galeria-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #1b2c55;
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.galeria-fullscreen-close:hover {
    opacity: 1;
}

/* Flechas del fullscreen */
.galeria-fullscreen-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #1b2c55;
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    opacity: 0.5;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.galeria-fullscreen-arrow:hover {
    opacity: 1;
}

.galeria-fullscreen-arrow:disabled,
.galeria-fullscreen-arrow.disabled {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

.galeria-fullscreen-arrow-left {
    left: 20px;
}

.galeria-fullscreen-arrow-right {
    right: 20px;
}

/* Contador en fullscreen */
.galeria-fullscreen-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1b2c55;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.galeria-fullscreen-counter:hover {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .galeria-carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .galeria-fullscreen-arrow {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    .galeria-fullscreen-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .galeria-fullscreen-arrow-left {
        left: 10px;
    }
    
    .galeria-fullscreen-arrow-right {
        right: 10px;
    }
}

/* Mensaje de carga */
.galeria-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.galeria-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}
