/* Desktop Layout Fixes */
@media (min-width: 1025px) {
    .elementor-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .elementor-section .elementor-container {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }
    
    .elementor-column {
        display: flex;
        flex-direction: column;
    }
    
    .elementor-widget-wrap {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        flex: 1;
    }
    
    /* Fix header and navigation */
    .site-header {
        position: relative;
        z-index: 999;
    }
    
    /* Fix main content layout */
    .site-main {
        overflow-x: hidden;
    }
    
    /* Fix Elementor page width */
    .elementor-page .elementor {
        overflow-x: hidden;
    }
    
    /* Ensure proper column layouts on desktop */
    .elementor-col-33 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
    
    .elementor-col-50 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .elementor-col-66 {
        flex: 0 0 66.666%;
        max-width: 66.666%;
    }
    
    /* Fix spacing and alignment */
    .elementor-section-boxed > .elementor-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
}

/* Force desktop layout rendering */
@media (min-width: 1200px) {
    .elementor-container {
        width: 100%;
        max-width: 1200px;
    }
    
    .elementor-section-full_width > .elementor-container {
        max-width: 100%;
    }
}

/* Additional Desktop Fixes */
@media (min-width: 1025px) {
    /* Force proper viewport handling */
    html {
        overflow-x: hidden;
    }
    
    body {
        min-width: 1200px;
        overflow-x: hidden;
    }
    
    /* Fix Best Shop theme container issues */
    .site-content {
        overflow-x: hidden;
    }
    
    .wrapper {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    /* Fix Elementor layout issues on desktop */
    .elementor-section-wrap {
        overflow-x: hidden;
    }
    
    /* Ensure proper flexbox behavior */
    .elementor-row {
        display: flex;
        flex-wrap: wrap;
    }
    
    /* Fix potential widget rendering */
    .elementor-widget {
        width: 100%;
    }
    
    /* Fix background attachment issues */
    .elementor-section[data-settings*="background_attachment":"fixed"] {
        background-attachment: fixed !important;
    }
}

/* Force layout refresh */
.elementor-element {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Critical Desktop Layout Fixes */
@media screen and (min-width: 1025px) {
    /* Force desktop layout */
    .elementor-section {
        width: 100% !important;
        overflow: visible !important;
    }
    
    .elementor-container {
        width: 100% !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    /* Fix column rendering */
    .elementor-column {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }
    
    /* Ensure widgets render properly */
    .elementor-widget-wrap {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    
    /* Fix layout constraints */
    .site-content, .content-area {
        width: 100% !important;
        overflow-x: visible !important;
    }
    
    /* Remove mobile-specific constraints */
    body.elementor-page {
        min-width: auto !important;
    }
}

/* Viewport fix */
@viewport {
    width: device-width;
    initial-scale: 1.0;
}

/* Final Desktop Rendering Fixes */
@media (min-width: 1025px) {
    /* Override any mobile-first constraints */
    * {
        -webkit-box-sizing: border-box !important;
        -moz-box-sizing: border-box !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure proper layout flow */
    .elementor-section-full_width .elementor-container {
        width: 100vw !important;
        max-width: none !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
    
    /* Fix any overflow issues */
    .elementor-section-boxed .elementor-container {
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
    
    /* Force desktop column behavior */
    .elementor-column .elementor-widget-wrap {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }
    
    /* Ensure text and elements are not constrained */
    .elementor-widget {
        width: auto !important;
        max-width: none !important;
    }
    
    /* Override any tablet/mobile specific CSS that might interfere */
    .elementor-element {
        transition: all 0.3s ease !important;
    }
}

/* Force browser to recognize this as desktop */
html.desktop,
html.no-touch {
    min-width: 1200px;
}
