/**
 * WooCommerce Custom Styles for MXR Configurator
 */

/* 3D Customize Button */
.mxr-3d-customize-wrapper {
    margin: 1.5em 0;
    text-align: left;
}

.mxr-3d-customize-button {
    background-color: #ec1a4b !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: inline-block !important;
    text-decoration: none !important;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    -webkit-tap-highlight-color: transparent; /* Better mobile experience */
    touch-action: manipulation; /* Prevent zoom on double-tap */
}

.mxr-3d-customize-button:hover {
    background-color: #d31641 !important;
    transform: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15) !important;
    text-decoration: none !important;
}

.mxr-3d-customize-button:active,
.mxr-3d-customize-button:focus {
    outline: none !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

/* Product iframe */
.mxr-product-iframe-wrapper {
    margin-bottom: 2em;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    /* Add aspect ratio container for better performance */
    aspect-ratio: 16 / 9;
}

/* Adjust variation product gallery width */
.woo-variation-product-gallery {
    max-width: 35% !important;
}

.mxr-product-iframe-wrapper iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    /* Improve iframe performance */
    will-change: transform;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mxr-3d-customize-button {
        width: 100%;
        padding: 14px 12px !important; /* Slightly larger touch target */
        min-width: unset;
        font-size: 16px !important; /* Prevent iOS zoom on focus */
    }
    
    .mxr-product-iframe-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        aspect-ratio: 4 / 3; /* Better for mobile */
    }
    
    .woo-variation-product-gallery {
        max-width: 100% !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .mxr-3d-customize-button {
        padding: 16px 12px !important; /* Even larger touch target */
    }
    
    .mxr-product-iframe-wrapper {
        aspect-ratio: 1 / 1; /* Square for very small screens */
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .mxr-product-iframe-wrapper {
        aspect-ratio: 16 / 10;
    }
}

/* Loading state */
.mxr-3d-customize-button.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .mxr-3d-customize-button {
        transition: none !important;
    }
}
