/**
 * Estilos para el visor de galería mejorado
 */

/* Contenedor principal */
.dev360-gallery-viewer {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Al transformar un slider dev360 en viewer, ocultar el marcado original */
body.has-dev360-gallery-viewer .wp-block-dev360-slider { display:none; }

/* Contenedor principal en modo pantalla completa */
.dev360-gallery-viewer.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.95);
    border-radius: 0;
    margin: 0;
    padding: 0;
}

/* Área principal de la galería */
.dev360-gallery-main {
    flex: 1;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.fullscreen .dev360-gallery-main {
    height: 100vh;
    background-color: transparent;
}

/* Contenedor de la imagen */
.dev360-gallery-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Imagen principal */
.dev360-gallery-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.fullscreen .dev360-gallery-image {
    max-height: 90vh;
}

/* Leyenda de la imagen */
.dev360-gallery-caption {
    width: 100%;
    padding: 15px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    position: absolute;
    bottom: 0;
    left: 0;
}

.fullscreen .dev360-gallery-caption {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Controles de navegación */
.dev360-gallery-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.dev360-gallery-prev,
.dev360-gallery-next {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 10;
}

.fullscreen .dev360-gallery-prev,
.fullscreen .dev360-gallery-next {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.dev360-gallery-prev:hover,
.dev360-gallery-next:hover {
    background-color: rgba(244, 63, 94, 0.9);
    color: #fff;
}

/* Botón de pantalla completa */
.dev360-gallery-fullscreen-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.dev360-gallery-fullscreen {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fullscreen .dev360-gallery-fullscreen {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.dev360-gallery-fullscreen:hover {
    background-color: rgba(244, 63, 94, 0.9);
    color: #fff;
}

/* Barra lateral */
.dev360-gallery-sidebar {
    width: 300px;
    background-color: #fff;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen .dev360-gallery-sidebar {
    background-color: rgba(0, 0, 0, 0.8);
    border-left: 1px solid #333;
}

/* Espacio para publicidad */
.dev360-gallery-ad {
    width: 100%;
    height: 250px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.fullscreen .dev360-gallery-ad {
    background-color: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333;
}

.ad-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.fullscreen .ad-placeholder {
    color: #666;
}

/* Miniaturas */
.dev360-gallery-thumbnails {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Miniatura individual */
.dev360-gallery-thumbnail {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.dev360-gallery-thumbnail:hover {
    transform: scale(1.05);
}

.dev360-gallery-thumbnail.active {
    border: 2px solid #f43f5e;
}

.dev360-gallery-thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

/* Contador de imágenes */
.dev360-gallery-counter {
    padding: 10px 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #eee;
}

.fullscreen .dev360-gallery-counter {
    color: #ccc;
    border-top: 1px solid #333;
}

/* Responsive */
@media (max-width: 768px) {
    .dev360-gallery-viewer {
        flex-direction: column;
    }
    
    .dev360-gallery-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
    }
    
    .dev360-gallery-thumbnails {
        grid-template-columns: repeat(4, 1fr);
        max-height: 150px;
    }
    
    .dev360-gallery-main {
        min-height: 300px;
    }
    
    .fullscreen .dev360-gallery-sidebar {
        display: none;
    }
}

@media (max-width: 480px) {
    .dev360-gallery-thumbnails {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dev360-gallery-prev,
    .dev360-gallery-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
