.wp3d-wrapper {
    /* Ensures the wrapper takes the available width */
    display: block;
    max-width: 100%;
    width: 100%;
    /* Crucial for accurate width calculations */
    box-sizing: border-box;
    position: relative; /* Needed for positioning the gyro button */

    /* Crucial: Hides overflow when layers are translated or extrapolated. */
    overflow: hidden;
}

.wp3d-container {
    display: block;
    position: relative;
    cursor: move;
    max-width: 100%;
    width: 100%;

    /* Prevents potential extra space below the canvas */
    line-height: 0;
    font-size: 0;
}

.wp3d-container canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    max-width: 100%;
    transform-origin: center center;
}

/* (v3.4) Dynamic Zoom based on Mode */

/* Layered Mode (Translation + Displacement): Requires 5% zoom to hide edges during sliding. */
.wp3d-mode-layered .wp3d-container canvas {
    transform: scale(1.10);
}

/* Single Image Mode (Displacement only): Requires 2% zoom to hide extrapolation seams. */
.wp3d-mode-single .wp3d-container canvas {
     transform: scale(1.10);
}


/* Styling for the loading indicator */
.wp3d-loader {
    font-size: 16px;
    line-height: 1.5;
    padding: 40px 20px;
    text-align: center;
    background-color: #f0f0f0;
    color: #333;
}

/* Styling for the Gyroscope Button */
.wp3d-gyro-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 100; /* Ensure it is above the image */
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

/* Hide the button by default. JavaScript will remove this class if supported. */
.wp3d-gyro-uninitialized {
     display: none;
}

.wp3d-gyro-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.wp3d-gyro-btn.active {
    background-color: #4CAF50; /* Green when active */
    color: white;
}

.wp3d-gyro-btn.error {
    background-color: #F44336; /* Red on error */
    color: white;
}