
.se3d-viewer-container {
    position: relative;
    width: 100%;
    background: transparent;
    overflow: hidden;
    z-index: 1;
    pointer-events: auto;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0;
    display: block;
    height: 100%;
    min-height: 320px;
    flex: 1 1 auto;
    align-self: stretch;
}

/* Compact rendering for cart/kurv thumbnail cells */
.woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer {
    width: 130px;
    height: 130px;
    min-height: 130px;
    margin: 0 auto;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.10) 42%, rgba(255, 255, 255, 0.02) 100%),
        linear-gradient(145deg, rgba(248, 252, 255, 0.62), rgba(227, 236, 246, 0.28));
    box-shadow: 0 10px 24px rgba(15, 40, 72, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer .se3d-fullscreen-btn,
.woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer .se3d-loading-text {
    display: none !important;
}

.woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer .se3d-interaction-overlay {
    cursor: default;
}

@media (max-width: 1024px) {
    .woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer {
        width: 108px;
        height: 108px;
        min-height: 108px;
    }
}

@media (max-width: 767px) {
    .woocommerce td.product-thumbnail .se3d-viewer-container.se3d-cart-viewer {
        width: 92px;
        height: 92px;
        min-height: 92px;
    }
}

/* Interaction overlay - covers the container (red border removed) */
.se3d-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: grab;
    z-index: 2;
    border: none !important;
    outline: none !important;
}

.se3d-interaction-overlay.dragging {
    cursor: grabbing !important;
}

.se3d-viewer-container.dragging::before {
    cursor: grabbing;
}

.se3d-viewer-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent !important;
    z-index: 1;
    pointer-events: none;
}

/* Preserve the shortcode viewport when a product has no usable 3D model. */
.se3d-viewer-container.se3d-fallback-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.se3d-fallback-image__image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    object-position: center center;
}

/* Variable-product fallback markup is painted before WooCommerce resolves the
   selected variation. Keep that parent image hidden to avoid a wrong-image
   flash; variation-frontend.js reveals either the resolved image or fallback. */
.se3d-fallback-image.se3d-awaiting-variation .se3d-fallback-image__image {
    visibility: hidden;
}

/* A selected variation without its own model falls back to its WooCommerce
   image while retaining the exact shortcode viewer dimensions and framing. */
.se3d-variation-image {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 15;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center center;
    background: transparent;
}

.se3d-viewer-container.se3d-showing-variation-image .se3d-variation-image {
    display: block;
}

.se3d-viewer-container.se3d-showing-variation-image .se3d-fallback-image__image {
    visibility: hidden;
}

.se3d-viewer-container.se3d-showing-variation-image canvas,
.se3d-viewer-container.se3d-showing-variation-image .se3d-interaction-overlay,
.se3d-viewer-container.se3d-showing-variation-image .se3d-fullscreen-btn {
    visibility: hidden;
}

/* Fullscreen button (top-right inside the shortcode container) */
.se3d-fullscreen-btn {
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    /* Keep the hit-area large; we pin the SVG via absolute positioning */
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    pointer-events: auto;
    z-index: 20;
    padding: 0;
    outline: none;
    text-decoration: none;
    overflow: visible;
    --se3d-fs-icon-size: 30px;
    --se3d-fs-icon-inset: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile/tablet: give breathing room from the screen edge and hide the tooltip label */
@media (max-width: 1024px) {
    .se3d-fullscreen-btn {
        right: 12px;
        top: 8px;
    }
    .se3d-fullscreen-label {
        display: none !important;
    }
}

/* Touch devices: never show the hover label; also prevent any theme focus background */
@media (hover: none), (pointer: coarse) {
    .se3d-fullscreen-btn:hover .se3d-fullscreen-label,
    .se3d-fullscreen-btn:focus .se3d-fullscreen-label,
    .se3d-fullscreen-btn:focus-visible .se3d-fullscreen-label {
        opacity: 0 !important;
        transform: translateY(-50%) translateX(0) !important;
    }
    .se3d-fullscreen-btn:active,
    .se3d-fullscreen-btn:focus {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        outline: none !important;
    }
}

.se3d-fullscreen-btn:hover { opacity: 0.96; }
.se3d-fullscreen-btn:active { opacity: 0.85; }
.se3d-fullscreen-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.se3d-fullscreen-btn svg,
.se3d-fullscreen-btn .se3d-fullscreen-icon {
    width: var(--se3d-fs-icon-size);
    height: var(--se3d-fs-icon-size);
    fill: none;
    stroke: rgba(0, 0, 0, 0.78);
    stroke-width: 2;
    position: absolute;
    top: var(--se3d-fs-icon-inset);
    right: var(--se3d-fs-icon-inset);
    z-index: 1;
    filter: none;
}

.se3d-fullscreen-label {
    position: absolute;
    top: calc(var(--se3d-fs-icon-inset) + (var(--se3d-fs-icon-size) / 2));
    /* Place label relative to the icon, not the button box */
    right: calc(var(--se3d-fs-icon-inset) + var(--se3d-fs-icon-size) + 4px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.82);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(0);
    transition: opacity 180ms ease, transform 240ms ease;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.se3d-fullscreen-btn:hover .se3d-fullscreen-label,
.se3d-fullscreen-btn:focus-visible .se3d-fullscreen-label {
    opacity: 1;
    transform: translateY(-50%) translateX(-6px);
}

/* Fullscreen modal */
.se3d-modal-backdrop {
    position: fixed;
    inset: 0;
    /* Lightly darken behind the window (no blur) */
    background: rgba(0, 0, 0, 0.18);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Keep modal away from notches / rounded corners on mobile */
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: calc(12px + env(safe-area-inset-left));
}

.se3d-modal {
    position: relative;
        width: min(1472px, calc(100vw - 24px));
        height: min(1200px, calc(100vh - 24px));
    /* Only the fullscreen modal should be solid; the embedded product viewer stays transparent. */
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 16px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

/* When using the global glassy container class, keep canvas clipped */
.se3d-modal.glassy1,
.se3d-modal.se-liquid-glass {
    overflow: hidden;
}

/* Match search-results glass intensity knobs (optional overrides) */
.se3d-modal.glassy1 {
    --se-lg-container-blur: 40px;
    --se-lg-container-bg: rgba(255, 255, 255, 0.32);
}

.se3d-modal .se3d-viewer-container {
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.se3d-modal .se3d-viewer-container canvas {
    background: #ffffff !important;
}

.se3d-modal-actions {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    left: auto;
    display: inline-flex;
    gap: 10px;
    padding: 0;
    z-index: 40;
    align-items: center;
}

/* When set (by JS via visualViewport), this pushes actions below browser UI overlays (Chrome URL bar). */
.se3d-modal {
    --se3d-ui-top: 0px;
}

@media (max-width: 1024px) {
    .se3d-modal-actions {
        top: calc(14px + env(safe-area-inset-top) + var(--se3d-ui-top, 0px) + 40px);
        right: calc(14px + env(safe-area-inset-right));
    }
}

/* Glassy container module sets `.glassy1 > * { position: relative; }`.
   Ensure our overlay controls stay absolutely positioned in the modal. */
.se3d-modal.glassy1 > .se3d-modal-actions,
.se3d-modal.se-liquid-glass > .se3d-modal-actions {
    position: absolute !important;
    z-index: 40 !important;
}

.se3d-modal-btn {
    height: 44px;
    padding: 0 14px;
    /* Some themes override button layout; enforce perfect centering */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    box-sizing: border-box;

    /* Visual styling comes from the glassy submodule via `.glassy-btn1` */
    border-radius: 10px !important; /* fallback if glassy CSS isn't loaded */
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    /* Some themes force white button text; override strongly */
    color: rgba(0, 0, 0, 0.92) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1 !important;
    text-transform: none;
    white-space: nowrap;
}

.se3d-modal-btn > span {
    display: block;
    line-height: 1 !important;
}

.se3d-modal-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 2px;
}

.se3d-modal-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 auto;
    fill: none;
    stroke: rgba(0, 0, 0, 0.78) !important;
    stroke-width: 2;
}


.se3d-viewer-container.hovering { cursor: grab; }
.se3d-viewer-container.dragging { cursor: grabbing !important; }

/* Loading indicator - centered in container with model offset (applied via JS) */
.se3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.10) 42%, rgba(255, 255, 255, 0.02) 100%),
        linear-gradient(135deg, rgba(237, 247, 255, 0.50), rgba(190, 223, 246, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: 0 10px 28px rgba(22, 67, 112, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.46);
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.se3d-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 2px solid rgba(108, 173, 214, 0.20);
    border-top-color: rgba(67, 147, 198, 0.96);
    border-right-color: rgba(117, 188, 229, 0.72);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
    animation: se3d-spin 0.72s linear infinite;
}

@keyframes se3d-spin {
    to { transform: rotate(360deg); }
}

.se3d-loading-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #1f4f75;
    white-space: nowrap;
    font-family: var(--e-global-typography-text-font-family, "Poppins", sans-serif);
}

.se3d-loading--error {
    background: linear-gradient(135deg, rgba(255, 244, 244, 0.88), rgba(255, 229, 229, 0.62));
    border-color: rgba(228, 133, 133, 0.35);
}

.se3d-loading--error .se3d-spinner {
    border-color: rgba(216, 94, 94, 0.18);
    border-top-color: rgba(185, 48, 48, 0.88);
    border-right-color: rgba(216, 94, 94, 0.58);
}

.se3d-loading--error .se3d-loading-text {
    color: #8d2d2d;
}
