/* ============================================================
   VISUALISEUR 3D — STL Viewer
   ============================================================ */
.viewer3d-wrapper {
    max-width: 48rem;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.625rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.viewer3d-wrapper:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(5, 64, 242, 0.06);
}

.viewer3d-container {
    width: 100%;
    height: 28rem;
    cursor: grab;
    position: relative;
    background: linear-gradient(180deg, #f8f9fa 0%, #eef0f4 100%);
}

.viewer3d-container:active {
    cursor: grabbing;
}

.viewer3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Contrôles */
.viewer3d-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}

.viewer3d-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.25s ease;
}

.viewer3d-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(5, 64, 242, 0.12);
}

.viewer3d-hint {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Loading */
.viewer3d-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #eef0f4 100%);
    z-index: 2;
    transition: opacity 0.4s ease;
}

.viewer3d-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.viewer3d-spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(5, 64, 242, 0.15);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: viewer3d-spin 0.8s linear infinite;
}

.viewer3d-loading span {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

@keyframes viewer3d-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 48rem) {
    .viewer3d-container {
        height: 22rem;
    }
}

@media (max-width: 30rem) {
    .viewer3d-container {
        height: 18rem;
    }
}