/* ── Trigger button ─────────────────────────────────────────────────────── */

.datalean-3d-viewer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    /* Intentionally unstyled — let the theme handle colours/padding */
}

.datalean-3d-viewer-btn__icon {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
}

/* ── Full-screen modal ──────────────────────────────────────────────────── */

.datalean-3d-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.datalean-3d-viewer-modal[hidden] {
    display: none;
}

.datalean-3d-viewer-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.datalean-3d-viewer-modal__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Close button ───────────────────────────────────────────────────────── */

.datalean-3d-viewer-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
}

.datalean-3d-viewer-modal__close:hover,
.datalean-3d-viewer-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

/* ── Progress loader ────────────────────────────────────────────────────── */

.datalean-3d-viewer-modal__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.datalean-3d-viewer-modal__loader[hidden] {
    display: none;
}

.datalean-3d-viewer-modal__loader--done {
    opacity: 0;
}

.datalean-3d-viewer-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(320px, 80vw);
}

.datalean-3d-viewer-progress__percent {
    color: #fff;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    font-family: system-ui, sans-serif;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.datalean-3d-viewer-progress__bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    overflow: hidden;
}

.datalean-3d-viewer-progress__bar-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.15s ease-out;
}

/* ── Viewer container ───────────────────────────────────────────────────── */

.datalean-3d-viewer-modal__viewer {
    width: 100%;
    height: 100%;
    flex: 1;
}
