/* Mobile Detection Fix for All Pages
   Ensures proper mobile/desktop detection across all pages */

/* Force proper viewport behavior */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Ensure containers are responsive */
@media (max-width: 991.98px) {
    /* Force mobile detection on all pages */
    html, body {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .container, .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    
    /* Fix for search page, hakkimizda, iletisim, imalat, urunler */
    #primary.content-area,
    .content-area,
    .site-main,
    .site-content {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Hide sidebar on mobile for shop pages */
    .col-lg-3.col-md-4:has(.sidebar-shop),
    .col-lg-3.col-md-4 .sidebar-shop {
        display: none !important;
    }
    
    /* Make main content full width on mobile */
    .col-lg-9.col-md-8,
    .col-lg-9,
    .col-md-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Fix row spacing */
    .row {
        margin-left: -15px !important;
        margin-right: -15px !important;
    }
    
    .row > * {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Ensure shop products wrapper is responsive */
    .shop-products-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Fix breadcrumb on mobile */
    .woocommerce-breadcrumb {
        font-size: 12px !important;
        padding: 10px 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* Fix page headers */
    .page-header,
    .page-title {
        font-size: 20px !important;
        padding: 0 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* Fix search form on mobile */
    .search-form,
    .search-refine-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
    }
    
    .search-refine-wrapper .input-group {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix products grid on mobile */
    .products.row-cols-2,
    .products.row-cols-md-3,
    .products.row-cols-xl-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 0 15px !important;
    }
    
    /* Fix about page */
    .about-page {
        padding: 20px 15px !important;
    }
    
    .about-page .row {
        margin: 0 !important;
    }
    
    .about-page .col-lg-6 {
        width: 100% !important;
        padding: 0 15px !important;
        margin-bottom: 20px !important;
    }
    
    /* Fix contact page */
    .contact-page-title {
        padding: 0 15px !important;
        margin-bottom: 20px !important;
    }
    
    .contact-page-title h1 {
        font-size: 24px !important;
    }
    
    /* Fix imalat page */
    .imalat-categories {
        padding: 0 15px !important;
    }
    
    /* Fix B2B login page */
    .b2b-login-container,
    section.container {
        padding: 20px 15px !important;
    }
    
    .b2b-login-container .row,
    section.container .row {
        margin: 0 !important;
    }
    
    .b2b-login-container .col-lg-5,
    section.container .col-lg-5 {
        width: 100% !important;
        padding: 0 15px !important;
        margin-bottom: 20px !important;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .col-lg-3.col-md-4 {
        width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px !important;
    }
    
    .col-lg-9.col-md-8 {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Desktop - ensure proper behavior */
@media (min-width: 992px) {
    .container {
        max-width: 1200px !important;
    }
}


