.three-d-viewer-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
}

.three-d-viewer-wrapper model-viewer {
    width: 100%;
    height: 100%;
    background: transparent;
}

.three-d-viewer-wrapper .three-js-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.three-d-viewer-wrapper model-viewer::part(poster) {
    background: transparent;
}

.three-d-viewer-wrapper .viewer-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    color: rgba(15, 23, 42, 0.65);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.85), rgba(226, 232, 240, 0.75));
    font-weight: 600;
    padding: 1.5rem;
}

.three-d-viewer-wrapper .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fullscreen support */
.three-d-viewer-wrapper:fullscreen,
.three-d-viewer-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    max-width: none;
}

.three-d-viewer-fullscreen-button {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 0.35em 0.7em;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    z-index: 2;
}

.three-d-viewer-fullscreen-button:hover,
.three-d-viewer-fullscreen-button:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: none;
}

/* Pan navigation arrows */
.three-d-viewer-nav {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    grid-template-columns: repeat(3, 2em);
    grid-template-rows: 2em 2em;
    gap: 0.2em;
    z-index: 2;
}

.three-d-viewer-nav-btn {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.three-d-viewer-nav-btn:hover,
.three-d-viewer-nav-btn:focus {
    background: rgba(0, 0, 0, 0.85);
    outline: none;
}

.three-d-viewer-nav-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 1px;
}

.three-d-viewer-nav-left {
    grid-column: 1;
    grid-row: 2;
}
.three-d-viewer-nav-up {
    grid-column: 2;
    grid-row: 1;
}
.three-d-viewer-nav-down {
    grid-column: 2;
    grid-row: 2;
}
.three-d-viewer-nav-right {
    grid-column: 3;
    grid-row: 2;
}
