/**
 * Mobile Overflow Fix - Prevents horizontal scrolling
 * Critical fixes for mobile viewport issues
 */

/* Critical Overflow Prevention - ORIGINAL RULE */
* {
    max-width: 100vw !important;
}

/* Team page specific exclusions - SADECE TEAM KARTLARI */
body.post-type-archive-team .vtc-modern-team-grid,
body.post-type-archive-team .vtc-modern-team-card,
body.post-type-archive-team .vtc-modern-team-photo,
body.post-type-archive-team .vtc-modern-team-photo img {
    max-width: none !important;
}

/* Root level fixes */
html {
    overflow-x: hidden !important;
    width: 100% !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
}

/* Main wrapper constraints */
.body_wrap {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* Specific problem areas that cause overflow */
@media (max-width: 767px) {
    /* Hero/Banner sections often cause overflow */
    .hero,
    .banner,
    .slider-area,
    .xb-banner {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Shape and decoration elements */
    .shape,
    .shape-inner,
    .decoration,
    .pattern,
    .circle,
    .bg-shape,
    .element {
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Images that might overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Absolute positioned elements */
    [style*="position: absolute"] {
        max-width: 100% !important;
    }
    
    /* Swiper specific fixes */
    .swiper-container {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .swiper-wrapper {
        width: auto !important;
    }
    
    .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Partners slider specific */
    .brand-slider .swiper-slide,
    .partners-slider .swiper-slide,
    .xb-brand__slider .swiper-slide {
        width: auto !important;
        min-width: auto !important;
        max-width: 150px !important;
    }
    
    /* Team slider */
    .team-slider .swiper-slide {
        width: 100% !important;
    }
    
    /* Remove negative margins that cause overflow */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .row > * {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Container adjustments */
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Header specific fixes */
    .header__main,
    .header-area,
    .xb-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Mobile menu */
    .mobile-menu,
    .vt-mobile-menu {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Footer */
    footer,
    .site-footer {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Forms that might overflow */
    form {
        max-width: 100% !important;
    }
    
    input,
    textarea,
    select {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Tables */
    table {
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Breadcrumb */
    .breadcrumb,
    .breadcrumb__area {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* CTA sections */
    .cta,
    .xb-cta {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* Contact sections */
    .contact,
    .xb-contact {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* About sections */
    .about,
    .xb-about {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* Service sections */
    .service,
    .xb-service {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* Counter sections */
    .counter,
    .xb-counter {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* FAQ sections */
    .faq,
    .xb-faq {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* Blog sections */
    .blog,
    .xb-blog {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* Testimonial sections */
    .testimonial,
    .xb-testimonial {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    /* WhatsApp button */
    .whatsapp-button,
    .floating-whatsapp,
    .vtc-whatsapp-button {
        position: fixed !important;
        max-width: 60px !important;
    }
    
    /* Back to top button */
    .xb-backtotop {
        position: fixed !important;
        max-width: 50px !important;
    }
}

/* Specific element fixes that commonly cause issues */
@media (max-width: 767px) {
    /* Parallax elements */
    [data-parallax] {
        transform: none !important;
        position: relative !important;
    }
    
    /* Animation elements */
    .wow,
    [data-wow-delay] {
        animation: none !important;
    }
    
    /* Fixed background attachments */
    [style*="background-attachment: fixed"] {
        background-attachment: scroll !important;
    }
    
    /* Long words that don't break */
    h1, h2, h3, h4, h5, h6,
    p, span, a, li, td, th {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    /* Inline styles that set width */
    [style*="width:"] {
        max-width: 100% !important;
    }
    
    /* Inline styles that set min-width */
    [style*="min-width:"] {
        min-width: auto !important;
    }
}

/* Emergency overflow fix - last resort */
@media (max-width: 767px) {
    body > * {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Hide elements that consistently cause problems */
    .shape-1,
    .shape-2,
    .shape-3,
    .shape-4,
    .pattern-1,
    .pattern-2,
    .decoration-1,
    .decoration-2 {
        display: none !important;
    }
}