/* WVTO Frontend CSS - Updated for Centered Overlay Button + Photo Capture Button */

/* Popup Styles (Unchanged) */
.wvto-popup-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7);
}

.wvto-popup-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 720px;
    position: relative;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.wvto-popup-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    line-height: 1;
}

.wvto-popup-close:hover,
.wvto-popup-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#wvto-canvas {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    max-width: 640px;
}

#wvto-video {
    display: none;
}

#wvto-error {
    color: red;
    margin-top: 10px;
    font-size: 0.9em;
}

/* --- Overlay Button Styles (Centering Added) --- */

/* Target the main gallery container. Ensure it has position: relative. */
.woocommerce-product-gallery {
    position: relative !important; /* Use !important cautiously */
}

/* Position the button absolutely within the relative parent */
.wvto-tryon-button-overlay {
    position: absolute;
    top: 15px; /* Adjust vertical position from the top */
    left: 50%; /* Position the left edge at the center */
    transform: translateX(-50%); /* Shift the button left by half its own width */
    z-index: 10; /* Keep it above images, below lightbox/zoom */
    padding: 8px 12px;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.4em; /* Adjusted font size */
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s ease;
    text-decoration: none;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.wvto-tryon-button-overlay:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
}

.wvto-tryon-button-overlay svg {
    vertical-align: middle;
    margin-right: 5px;
    width: 1em;
    height: 1em;
}

/* Hide original button style if the class was used elsewhere (fallback) */
.wvto-tryon-button {
    display: none;
}

/* --- Photo Capture Button Styles --- */
.wvto-capture-button {
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 15px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 140px;
}

.wvto-capture-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wvto-capture-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wvto-capture-button svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.wvto-capture-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wvto-capture-button {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 120px;
    }
    
    .wvto-tryon-button-overlay {
        font-size: 1.2em;
        padding: 6px 10px;
    }
}

