/**
 * WooCommerce Visor 3D Modelos - Estilos CSS
 */

/* Contenedor principal */
.wc-3d-viewer-container {
    position: relative;
    width: 100%;
    background-color: rgba(240, 240, 240, 0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 500px !important;
}

/* Canvas para renderizado 3D */
.wc-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
    min-height: 500px !important;
}

/* Controles del visor */
.wc-3d-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 12px;
    z-index: 100;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.wc-3d-viewer-container:hover .wc-3d-controls {
    opacity: 1;
}

/* Botones de control */
.wc-3d-controls button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    padding: 0;
    color: #333;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.wc-3d-controls button:hover {
    background-color: white;
    transform: scale(1.15);
}

.wc-3d-controls button:active {
    transform: scale(0.95);
}

.wc-3d-controls .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Barra de navegación para rotación manual */
.wc-3d-navigation-bar {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 5px;
    background-color: rgba(200, 200, 200, 0.3);
    border-radius: 5px;
    cursor: pointer;
    z-index: 100;
}

.wc-3d-navigation-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: grab;
    z-index: 101;
}

.wc-3d-navigation-handle:active {
    cursor: grabbing;
}

/* Indicador de carga */
.wc-3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 245, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    color: #333;
    font-weight: bold;
}

/* Spinner de carga */
.wc-3d-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2196F3;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .wc-3d-controls button {
        width: 38px;
        height: 38px;
    }
    
    .wc-3d-controls .dashicons {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
    
    .wc-3d-spinner {
        width: 40px;
        height: 40px;
    }
    
    .wc-3d-navigation-bar {
        width: 60%;
    }
}

/* Integraciones con temas WooCommerce */
.woocommerce div.product div.images .wc-3d-viewer-container {
    margin-bottom: 1.618em;
}

/* Compatibilidad con Elementor */
.elementor-widget-woocommerce-product-images .wc-3d-viewer-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px !important;
}