#woo-ar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* FIX: Use visibility/opacity instead of display: none to fix model-viewer initialization */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#woo-ar-modal-overlay.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.woo-ar-modal-content {
    background: #fff;
    width: 90%;
    height: 80%;
    max-width: 800px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    /* Ensure flex context for children */
    display: flex;
    flex-direction: column;
}

#woo-ar-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 1000;
}

#woo-ar-viewer {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    --poster-color: transparent;
    display: block; /* Ensure it's not hidden */
    position: relative;
}

#woo-ar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #666;
    pointer-events: none;
}

.ar-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 20px;
    text-align: center;
    pointer-events: none;
    font-family: sans-serif;
    font-size: 14px;
}

#woo-ar-activate-btn {
    background-color: #333;
    color: white;
    border-radius: 4px;
    border: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    white-space: nowrap;
}
.gz-button-hover-effect {
    transition: all 0.3s ease;
}

/* Ensure model viewer works on mobile */
@media (max-width: 600px) {
    .woo-ar-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
