/**
 * 3D Section Styles
 * 
 * Enhanced CSS for the full-width 3D product section
 * 
 * @package WooCommerce_3D_AR_Viewer
 * @since 2.0.0
 */

/* ===== MAIN SECTION STYLES ===== */
.wc-3d-full-section {
    position: relative;
    width: 100%;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    background: white;
    transition: all 0.3s ease;
}

/* ===== NATIVE FULLSCREEN MODE STYLES ===== */
.wc-3d-native-fullscreen-active {
    width: 100vw !important;
    height: 100vh !important;
    background: #fff !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-3d-native-fullscreen-active .wc-3d-section-container {
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    border-radius: 0 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-3d-native-fullscreen-active model-viewer {
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wc-3d-native-fullscreen-active .wc-3d-controls-panel {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10001 !important;
}

/* Fix AR button and View in 360° button positioning in fullscreen */
.wc-3d-native-fullscreen-active .ar-button,
.wc-3d-native-fullscreen-active .wc-3d-ar-button,
.wc-3d-native-fullscreen-active .wc-3d-ar-button-outside,
.wc-3d-native-fullscreen-active .wc-3d-ar-button-overlay {
    position: absolute !important;
    top: 20px !important;
    z-index: 10002 !important;
    transform: none !important;
    margin: 0 !important;
    width: 200px;
}

/* Hide interactive mode exit button in fullscreen */
.wc-3d-native-fullscreen-active .wc-3d-exit-button {
    display: none !important;
}

/* QR Modal positioning above fullscreen - comprehensive targeting */
[id*="qr-modal"].modal,
[id*="qr-modal"].modal-open,
div[id*="qr-modal"].modal,
.modal[id*="qr-modal"],
[id*="qr-modal"][style*="display: block"] {
    z-index: 9999999 !important;
    position: fixed !important;
}

/* Force QR modal above fullscreen when displayed */
[id*="qr-modal"].modal[style*="display: block"] {
    z-index: 99999999 !important;
    position: fixed !important;
}

/* Ensure QR modal appears above native fullscreen */
body:has(.wc-3d-native-fullscreen-active) [id*="qr-modal"].modal,
.wc-3d-native-fullscreen-active ~ [id*="qr-modal"].modal {
    z-index: 99999999 !important;
}

/* Mobile controls positioning in fullscreen */
@media (max-width: 768px) {
    .wc-3d-native-fullscreen-active .wc-3d-controls-panel {
        bottom: 20px !important;
        left: 20px !important;
        transform: none !important;
        display: block !important;
    }
}

/* ===== CUSTOM FULLSCREEN MODE STYLES (FALLBACK) ===== */
.wc-3d-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-3d-fullscreen-active .wc-3d-section-container {
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    border-radius: 0 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-3d-fullscreen-active model-viewer {
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wc-3d-fullscreen-active .wc-3d-controls-panel {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10001 !important;
}

/* Fix AR button and View in 360° button positioning in custom fullscreen */
.wc-3d-fullscreen-active .ar-button,
.wc-3d-fullscreen-active .wc-3d-ar-button,
.wc-3d-fullscreen-active .wc-3d-ar-button-outside,
.wc-3d-fullscreen-active .wc-3d-ar-button-overlay {
    position: absolute !important;
    top: 20px !important;
    z-index: 10002 !important;
    transform: none !important;
    margin: 0 !important;
    width: 200px;
}

/* Hide interactive mode exit button in custom fullscreen */
.wc-3d-fullscreen-active .wc-3d-exit-button {
    display: none !important;
}

/* QR Modal positioning above custom fullscreen */
body.wc-3d-fullscreen-mode [id*="qr-modal"].modal,
body.wc-3d-fullscreen-mode [id*="qr-modal"].modal-open,
body.wc-3d-fullscreen-mode [id*="qr-modal"][style*="display: block"],
.wc-3d-fullscreen-active ~ [id*="qr-modal"].modal {
    z-index: 99999999 !important;
    position: fixed !important;
}

/* Mobile controls positioning in custom fullscreen */
@media (max-width: 768px) {
    .wc-3d-fullscreen-active .wc-3d-controls-panel {
        bottom: 20px !important;
        left: 20px !important;
        transform: none !important;
        display: block !important;
    }
}

/* Hide page elements only for custom fullscreen mode - EXCEPT QR modals */
body.wc-3d-fullscreen-mode > *:not(.wc-3d-fullscreen-active):not([id*="qr-modal"]) {
    display: none !important;
}

/* Ensure QR modals are always visible in fullscreen mode */
body.wc-3d-fullscreen-mode [id*="qr-modal"] {
    display: block !important;
    z-index: 99999999 !important;
    position: fixed !important;
}

/* Ensure essential elements remain visible in custom fullscreen */
body.wc-3d-fullscreen-mode .wc-3d-fullscreen-active,
body.wc-3d-fullscreen-mode .wc-3d-fullscreen-active *,
body.wc-3d-fullscreen-mode script,
body.wc-3d-fullscreen-mode style,
body.wc-3d-fullscreen-mode link,
body.wc-3d-fullscreen-mode meta,
body.wc-3d-fullscreen-mode [id*="qr-modal"] {
    display: initial !important;
}

/* Prevent body scroll when in custom fullscreen */
body.wc-3d-fullscreen-mode {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
}

/* Fullscreen exit button styles */
.wc-3d-fullscreen-exit-btn {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1001 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.wc-3d-fullscreen-exit-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1) !important;
}

.wc-3d-fullscreen-exit-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

/* Ensure proper fullscreen backgrounds */
body.wc-3d-fullscreen-mode,
.wc-3d-fullscreen-active,
.wc-3d-native-fullscreen-active {
    background-color: #fff !important;
    background-image: none !important;
}

/* Fullscreen exit cleanup */
body:not(.wc-3d-fullscreen-mode) {
    background: initial !important;
    overflow: initial !important;
}

body:not(.wc-3d-fullscreen-mode) .wc-3d-full-section {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    z-index: initial !important;
    background: white !important;
    margin: 2rem 0 !important;
    border-radius: 8px !important;
    padding-top: 20px;
}

/* Control bar styles - positioned based on settings */
.wc-3d-controls-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
}

/* Position variations */
.wc-3d-section-bottom .wc-3d-controls-panel {
    bottom: 20px;
}

.wc-3d-section-top .wc-3d-controls-panel {
    top: 20px;
}

.wc-3d-section-center .wc-3d-controls-panel {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Unified Controls Container - Desktop */
.wc-3d-controls-container {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* Mobile responsive controls - JAVASCRIPT CONTROLLED */
@media (max-width: 768px) {
    /* Mobile controls panel container - hidden by default, shown only in interactive mode */
    .wc-3d-full-section .wc-3d-controls-panel {
        display: none !important;
        position: absolute;
        bottom: 20px;
        left: 20px;
        z-index: 1000;
        background: transparent;
        padding: 0;
        border: none;
        width: auto;
        height: 50px;
    }
    
    /* Show mobile controls panel only when in interactive mode */
    .wc-3d-full-section.wc-3d-interactive-mode .wc-3d-controls-panel {
        display: block !important;
    }
    
    /* Mobile menu toggle button */
    .wc-3d-mobile-menu-toggle {
        display: flex !important;
        width: 50px;
        height: 50px;
        min-width: 50px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
        z-index: 1001;
        flex-shrink: 0;
    }
    
    .wc-3d-mobile-menu-toggle:hover,
    .wc-3d-mobile-menu-toggle:active {
        background: rgba(0, 0, 0, 0.9);
        transform: scale(1.05);
    }
    
    .wc-3d-mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }
    
    /* Controls container - hidden by default, shown when active */
    .wc-3d-controls-container {
        display: none !important;
        position: absolute;
        bottom: 0;
        left: 74px; /* Position next to hamburger button (50px width + 12px gap + 12px padding) */
        flex-direction: row;
        align-items: center;
        gap: 12px;
        background: White;
        backdrop-filter: blur(10px);
        border-radius: 25px;
        padding: 8px 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        max-width: calc(100vw - 120px);
        scrollbar-width: none;
        -ms-overflow-style: none;
        height: 50px;
    }
    
    .wc-3d-controls-container::-webkit-scrollbar {
        display: none;
    }
    
    /* Show controls container when active */
    .wc-3d-controls-container.active {
        display: flex !important;
        animation: slideInLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Mobile control buttons styling */
    .wc-3d-controls-container .wc-3d-control-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        transition: all 0.2s ease !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        position: relative !important;
        overflow: hidden !important;
        box-shadow: 0 1.867px 3.734px #0000003d;
    }
    
    /* Ensure SVG icons are properly sized */
    .wc-3d-controls-container .wc-3d-control-btn svg {
        width: 20px !important;
        height: 20px !important;
        fill: #AE9164 !important;
    }
    
    /* Ensure all control buttons are visible */
    .wc-3d-controls-container .wc-3d-share,
    .wc-3d-controls-container .wc-3d-fullscreen,
    .wc-3d-controls-container .wc-3d-zoom-in,
    .wc-3d-controls-container .wc-3d-zoom-out,
    .wc-3d-controls-container .wc-3d-reset,
    .wc-3d-controls-container .wc-3d-measure {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .wc-3d-controls-container .wc-3d-control-btn:hover,
    .wc-3d-controls-container .wc-3d-control-btn:active {
        background: rgba(255, 255, 255, 0.2) !important;
        transform: scale(1.05) !important;
    }
    
    .wc-3d-controls-container .wc-3d-control-btn.active {
        background: rgba(174, 145, 100, 0.8) !important;
        border-color: rgba(174, 145, 100, 1) !important;
    }
    
    /* Animation for slide in from left */
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-50px) scaleX(0.3);
            max-width: 0;
            padding-left: 0;
            padding-right: 0;
        }
        to {
            opacity: 1;
            transform: translateX(0) scaleX(1);
            max-width: calc(100vw - 120px);
            padding-left: 16px;
            padding-right: 16px;
        }
    }
}

/* Desktop - hide mobile menu toggle, show controls inline */
@media (min-width: 769px) {
    .wc-3d-mobile-menu-toggle {
        display: none !important;
    }
    
    /* Ensure controls panel is visible on desktop */
    .wc-3d-controls-panel {
        display: flex !important;
    }
    
    /* Ensure controls container is visible on desktop */
    .wc-3d-controls-container {
        display: flex !important;
    }
}

/* Desktop controls styling */
.wc-3d-controls-container .wc-3d-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 0px solid rgba(0, 123, 186, 0.2);
    /* color: #007BBA; */ /* Removed to allow Elementor styling */
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: none;
    padding: 0;
    margin: 0 4px;
}

.wc-3d-controls-container .wc-3d-control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-3d-controls-container .wc-3d-control-btn svg {
    width: 20px;
    height: 20px;
    fill: #AE9164 !important;
    display: block !important;
    pointer-events: none;
}


/* Animation for mobile menu */
@keyframes mobileMenuSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .wc-3d-controls-container {
        min-width: 260px;
        padding: 12px;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .wc-3d-controls-panel {
        gap: 6px;
        padding: 10px 14px;
    }
    
    .wc-3d-control-btn {
        width: 42px;
        height: 42px;
    }
    
    .wc-3d-control-btn svg {
        width: 18px;
        height: 18px;
    }
}

.wc-3d-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-3d-model-viewer-inline {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* ===== NEW BOTTOM CONTROL BAR ===== */
.wc-3d-controls-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.wc-3d-controls-bottom:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.wc-3d-control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(174, 145, 100, 0.1);
    color: #AE9164;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wc-3d-control-btn:hover {
    background: rgba(174, 145, 100, 0.2);
    color: #AE9164;
    transform: scale(1.1);
}

.wc-3d-control-btn:active {
    transform: scale(0.95);
}

.wc-3d-control-btn.active {
    background: #AE9164;
    color: white;
}

.wc-3d-control-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.wc-3d-btn-text {
    display: none;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.wc-3d-control-btn i {
    display: block !important;
    font-size: 14px !important;
    pointer-events: none !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-weight: 900 !important; /* Font Awesome solid weight */
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
}

.wc-3d-control-btn img {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
}

/* Specific Font Awesome icon fixes */
.wc-3d-controls-container .wc-3d-control-btn i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
}

/* Ensure Font Awesome icons load properly */
.wc-3d-control-btn i[class*="fa-"],
.wc-3d-control-btn i[class*="fas "],
.wc-3d-control-btn i[class*="far "],
.wc-3d-control-btn i[class*="fab "] {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

/* Hide old control styles */
.wc-3d-controls-wrapper,
.wc-3d-control-group,
.wc-3d-model-info {
    display: none !important;
}

/* ===== MEASUREMENTS OVERLAY ===== */
.wc-3d-measurements-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ===== 3D MEASUREMENT LINES ===== */
.wc-3d-measurement-line {
    position: absolute;
    z-index: 999999;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #007cba;
}

.wc-3d-measurement-line-visual {
    background: #007cba;
    position: relative;
}

.wc-3d-measurement-line-visual:before,
.wc-3d-measurement-line-visual:after {
    content: '';
    position: absolute;
    background: #007cba;
}

/* Width measurement line (horizontal) */
.wc-3d-measurement-width .wc-3d-measurement-line-visual {
    width: 120px;
    height: 2px;
    margin-bottom: 8px;
}

.wc-3d-measurement-width .wc-3d-measurement-line-visual:before,
.wc-3d-measurement-width .wc-3d-measurement-line-visual:after {
    width: 2px;
    height: 12px;
    top: -5px;
}

.wc-3d-measurement-width .wc-3d-measurement-line-visual:before {
    left: 0;
}

.wc-3d-measurement-width .wc-3d-measurement-line-visual:after {
    right: 0;
}

/* Height measurement line (vertical) */
.wc-3d-measurement-height .wc-3d-measurement-line-visual {
    width: 2px;
    height: 80px;
    margin-right: 8px;
}

.wc-3d-measurement-height .wc-3d-measurement-line-visual:before,
.wc-3d-measurement-height .wc-3d-measurement-line-visual:after {
    width: 12px;
    height: 2px;
    left: -5px;
}

.wc-3d-measurement-height .wc-3d-measurement-line-visual:before {
    top: 0;
}

.wc-3d-measurement-height .wc-3d-measurement-line-visual:after {
    bottom: 0;
}

/* Depth measurement line (diagonal) */
.wc-3d-measurement-depth .wc-3d-measurement-line-visual {
    width: 80px;
    height: 2px;
    margin-right: 8px;
    transform: rotate(-30deg);
    transform-origin: left center;
}

.wc-3d-measurement-depth .wc-3d-measurement-line-visual:before,
.wc-3d-measurement-depth .wc-3d-measurement-line-visual:after {
    width: 2px;
    height: 12px;
    top: -5px;
}

.wc-3d-measurement-depth .wc-3d-measurement-line-visual:before {
    left: 0;
    transform: rotate(30deg);
}

.wc-3d-measurement-depth .wc-3d-measurement-line-visual:after {
    right: 0;
    transform: rotate(30deg);
}

.wc-3d-measurement-label {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 123, 186, 0.2);
    white-space: nowrap;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wc-3d-measurement-line {
        font-size: 12px;
    }
    
    .wc-3d-measurement-width .wc-3d-measurement-line-visual {
        width: 80px;
    }
    
    .wc-3d-measurement-height .wc-3d-measurement-line-visual {
        height: 60px;
    }
    
    .wc-3d-measurement-depth .wc-3d-measurement-line-visual {
        width: 60px;
    }
    
    .wc-3d-measurement-label {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Legacy dimension styles - kept for backward compatibility */
.wc-3d-dimension-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.wc-3d-dimension-item:last-child {
    margin-bottom: 0;
}

.wc-3d-dimension-label {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
}

.wc-3d-dimension-value {
    font-weight: 700;
    color: #007cba;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: rgba(0, 124, 186, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

/* ===== 3D MODEL VIEWER ===== */
.wc-3d-model-viewer-inline {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
}

/* Hide model-viewer progress bar */
model-viewer::part(default-progress-bar) {
    display: none !important;
}

model-viewer::part(default-progress-mask) {
    display: none !important;
}

/* Hide any blue progress indicators */
model-viewer .progress-bar,
model-viewer .loading-indicator,
model-viewer [slot="progress-bar"] {
    display: none !important;
}

.wc-3d-model-viewer-inline[loading] {
    opacity: 0.7;
}

/* ===== LOADING STATES ===== */
.wc-3d-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.wc-3d-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.wc-3d-loading-progress {
    position: relative;
    width: 80px;
    height: 80px;
    animation: wc3d-pulse 1.8s ease-in-out infinite;
}

.wc-3d-progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.wc-3d-progress-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 5;
}

.wc-3d-progress-ring-fill {
    fill: none;
    stroke: #AE9164;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 263.89;
    stroke-dashoffset: 263.89;
    transition: stroke-dashoffset 0.3s ease;
}

.wc-3d-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wc-3d-loading-label {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes wc3d-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.wc-3d-load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.wc-3d-retry-btn:hover {
    opacity: 0.85;
}

/* ===== PROGRESS BAR ===== */
.wc-3d-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.wc-3d-update-bar {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== CONTROLS PANEL ===== */
.wc-3d-controls-panel {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Control Panel Positions */
.wc-3d-controls-bottom {
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
}

.wc-3d-controls-top {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
}

.wc-3d-controls-left {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    max-height: calc(100% - 2rem);
}

.wc-3d-controls-right {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    max-height: calc(100% - 2rem);
}

.wc-3d-controls-floating {
    top: 1rem;
    right: 1rem;
    border-radius: 50px;
    padding: 0.5rem;
}

.wc-3d-controls-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.wc-3d-controls-left .wc-3d-controls-wrapper,
.wc-3d-controls-right .wc-3d-controls-wrapper {
    flex-direction: column;
    align-items: stretch;
}

/* ===== CONTROL GROUPS ===== */
.wc-3d-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.wc-3d-control-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ===== BUTTONS ===== */
.wc-3d-controls-panel button {
    background: #333333;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 12px;
    font-weight: 500;
    color: white;
    min-height: 36px;
    margin-left: 20px;
}

.wc-3d-controls-panel button:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.wc-3d-controls-panel button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 124, 186, 0.2);
}

.wc-3d-controls-panel button.active {
    background: #AE9164;
    border-color: #AE9164;
    color: #ffffff;
}

.wc-3d-controls-panel button svg {
    width: 16px;
    height: 16px;
    fill: currentColor !important;
}

.wc-3d-controls-panel button:hover svg {
    fill: currentColor !important;
}

/* ===== ZOOM CONTROLS ===== */
.wc-3d-zoom-controls .wc-3d-zoom-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wc-3d-zoom-slider {
    flex: 1;
    min-width: 80px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.wc-3d-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wc-3d-zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== ROTATION CONTROLS ===== */
.wc-3d-rotation-buttons {
    display: flex;
    gap: 0.25rem;
}

.wc-3d-auto-rotate.active {
    background: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

/* ===== VIEW PRESETS ===== */
.wc-3d-preset-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.wc-3d-preset-view {
    min-width: 50px;
    font-size: 11px;
}

/* ===== LIGHTING CONTROLS ===== */
.wc-3d-lighting-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wc-3d-slider-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wc-3d-slider-group label {
    font-size: 11px;
    min-width: 60px;
    color: #6c757d;
}

.wc-3d-lighting-slider,
.wc-3d-shadow-slider {
    flex: 1;
    min-width: 60px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.wc-3d-lighting-slider::-webkit-slider-thumb,
.wc-3d-shadow-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #ffc107;
    border-radius: 50%;
    cursor: pointer;
}

/* ===== ACTION BUTTONS ===== */
.wc-3d-action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wc-3d-ar-launch-btn {
    background: linear-gradient(135deg, #007cba, #00a0d2);
    border-color: #007cba;
    color: #ffffff;
}

.wc-3d-ar-launch-btn:hover {
    background: linear-gradient(135deg, #005a87, #007cba);
    border-color: #005a87;
    color: #ffffff;
}

.wc-3d-fullscreen-btn {
    position: relative;
}

.wc-3d-fullscreen-exit {
    display: none;
}

.wc-3d-full-section.wc-3d-fullscreen .wc-3d-fullscreen-enter {
    display: none;
}

.wc-3d-full-section.wc-3d-fullscreen .wc-3d-fullscreen-exit {
    display: block;
}

/* ===== MODEL INFO ===== */
.wc-3d-model-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 15;
    max-width: 250px;
}

.wc-3d-model-title h3 {
    margin: 0 0 0.25rem 0;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.wc-3d-model-size {
    font-size: 11px;
    color: #6c757d;
}

.wc-3d-model-variants {
    margin-top: 0.5rem;
}

.wc-3d-model-variants label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.wc-3d-model-selector {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    background: #ffffff;
}

/* ===== AR QR CODE ===== */
.wc-3d-ar-qr-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.wc-3d-ar-qr-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.wc-3d-ar-qr-content h4 {
    margin: 0 0 1rem 0;
    color: #212529;
}

.wc-3d-qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-3d-close-qr {
    background: #6c757d;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* ===== FALLBACK CONTENT ===== */
.wc-3d-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
}

.wc-3d-fallback-content {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

.wc-3d-fallback-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.wc-3d-fallback-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 18px;
    color: #495057;
}

.wc-3d-fallback-content p {
    margin: 0;
    font-size: 14px;
}

/* ===== FULLSCREEN MODE ===== */
.wc-3d-full-section.wc-3d-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    margin: 0;
    border-radius: 0;
    background: #000000;
}

.wc-3d-full-section.wc-3d-fullscreen .wc-3d-model-viewer-inline {
    background: #000000;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .wc-3d-full-section {
        margin: 1rem 0;
        border-radius: 6px;
    }
    
    .wc-3d-dimensions-overlay {
        top: 5px;
        right: 5px;
        padding: 8px;
        min-width: 100px;
        font-size: 12px;
    }
    
    .wc-3d-dimension-item {
        margin-bottom: 6px;
    }
    
    .wc-3d-controls-panel {
        padding: 0;
        border-radius: 8px;
    }
    
    .wc-3d-controls-bottom,
    .wc-3d-controls-top {
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
    }
    
    .wc-3d-controls-wrapper {
        gap: 0.5rem;
    }
    
    .wc-3d-control-group {
        gap: 0.25rem;
    }
    
    .wc-3d-controls-panel button {
        padding: 0.375rem;
        min-height: 32px;
        font-size: 11px;
    }
    
    .wc-3d-model-info {
        position: static;
        margin: 1rem;
        max-width: none;
    }
    
    .wc-3d-zoom-slider {
        min-width: 60px;
    }
    
    .wc-3d-preset-buttons {
        gap: 0.125rem;
    }
    
    .wc-3d-preset-view {
        min-width: 40px;
        font-size: 10px;
    }
    
    .wc-3d-action-buttons {
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .wc-3d-controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wc-3d-dimensions-overlay {
        position: static;
        margin: 10px;
        width: auto;
    }
    
    .wc-3d-control-group {
        width: 100%;
    }
    
    .wc-3d-zoom-buttons,
    .wc-3d-rotation-buttons,
    .wc-3d-preset-buttons,
    .wc-3d-action-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .wc-3d-ar-qr-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .wc-3d-qr-code {
        width: 150px;
        height: 150px;
    }
}

/* ===== MOBILE-ONLY ELEMENTS ===== */
.wc-3d-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .wc-3d-mobile-only {
        display: flex;
    }
}

.wc-3d-controls-toggle {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 25;
}

/* ===== ANIMATIONS ===== */
@keyframes wc3d-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wc3d-slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.wc-3d-controls-panel {
    animation: wc3d-fadeIn 0.3s ease;
}

.wc-3d-full-section.wc-3d-responsive {
    animation: wc3d-fadeIn 0.5s ease;
}

/* ===== MODEL VIEWER OPACITY FIX ===== */

/* Ensure model-viewer has full opacity when loaded */
.wc-3d-model-viewer-inline:not([loading]) {
    opacity: 1 !important;
}

/* Force full opacity after model loads */
.wc-3d-model-viewer-inline.loaded {
    opacity: 1 !important;
}

/* Hide default AR button inside model-viewer */
.wc-3d-model-viewer-inline::part(default-ar-button) {
    display: none !important;
}

.wc-3d-model-viewer-inline [slot="ar-button"] {
    display: none !important;
}


/* ===== ACCESSIBILITY ===== */

.wc-3d-zoom-slider:focus,
.wc-3d-lighting-slider:focus,
.wc-3d-shadow-slider:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .wc-3d-controls-panel {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .wc-3d-controls-panel button {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }
    
    .wc-3d-controls-panel button:hover {
        background: #000000;
        color: #ffffff;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .wc-3d-full-section,
    .wc-3d-controls-panel,
    .wc-3d-controls-panel button,
    .wc-3d-loading-overlay {
        transition: none;
        animation: none;
    }
    
    .wc-3d-spinner {
        animation: none;
    }
}

/* ===== AR QR MODAL STYLES ===== */
/* QR Modal inherits from the working modal styles */
/* QR container for 3D sections (not modal) */
.wc-3d-full-section .qr-container {
    padding: 30px !important;
    text-align: center !important;
    display: block !important;
    background: white !important;
}

/* Default AR button styles (can be overridden by Elementor) */
.wc-3d-ar-button-outside .ar-button {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #007cba;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #007cba;
    text-decoration: none;
}

.wc-3d-ar-button-outside .ar-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.wc-3d-ar-button-outside .ar-button:focus {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    outline: none;
}

.wc-3d-qr-code-container {
    background: white !important;
    border-radius: 12px !important;
    padding: 25px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 200px !important;
    margin-bottom: 20px !important;
    border: 0px solid #e9ecef !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

.wc-3d-qr-code-container:hover {
    transform: translateY(-2px) !important;
}

.wc-3d-qr-code-container img {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.3s ease !important;
}

.wc-3d-qr-code-container img:hover {
    transform: scale(1.05) !important;
}

.qr-container p {
    display: block !important;
    color: #6c757d !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    max-width: 300px !important;
    margin: 0 auto !important;
}

/* Additional styling for mobile responsiveness */
@media (max-width: 768px) {
    .qr-container {
        padding: 20px !important;
    }
    
    .wc-3d-qr-code-container {
        padding: 20px !important;
        margin-bottom: 15px !important;
    }
    
    .qr-container p {
        font-size: 14px !important;
    }
}
