/* Positioned ancestors for the loading overlay (standard WC gallery or
   woo-variation-gallery's slick wrapper). */
.woocommerce-product-gallery,
.woo-variation-product-gallery,
.woo-variation-gallery-wrapper {
    position: relative;
}

/* The 3D pane is a normal block that swaps with the gallery via the tabs -
   square, capped so it never towers over the page like the full
   gallery-plus-thumbnails block would. */
#pmvmp-canvas-wrap {
    display: none;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 560px;
    background: #fff;
    overflow: hidden;
    border-radius: 4px;
}

#pmvmp-canvas-wrap.pmvmp-ready {
    display: block;
}

/* Hide the gallery while the 3D tab is active WITHOUT display:none -
   slick/flexslider must still be able to measure the container's width
   while hidden, or their slides and thumbnails initialize collapsed. */
.pmvmp-gallery-hidden {
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#pmvmp-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

#pmvmp-canvas-wrap.pmvmp-dragging canvas {
    cursor: grabbing;
}

.pmvmp-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.pmvmp-tab {
    padding: 7px 16px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.pmvmp-tab:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.pmvmp-tab.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.pmvmp-loader {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

.pmvmp-loader-text {
    font-size: 14px;
    color: #444;
    text-shadow: 0 0 4px #fff;
}

.pmvmp-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: #444;
    border-radius: 50%;
    animation: pmvmp-spin 0.9s linear infinite;
}

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

#pmvmp-canvas-wrap .pmvmp-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #777;
    pointer-events: none;
    opacity: 0.85;
}
