/* Horizontal Scroll Fix for Homepage */

/* Global overflow fix */
html {
    overflow-x: hidden;
}

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

/* Mobile specific - allow vertical scroll */
@media (max-width: 767px) {
    html {
        overflow-y: visible !important;
        height: auto !important;
    }
    
    body {
        overflow-y: visible !important;
        height: auto !important;
    }
}

/* Main wrapper fix */
.main-wrapper,
.wrapper {
    overflow-x: hidden !important;
}

/* Container fixes */
.container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Row fixes */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

/* Newsletter section fix */
.newsletter {
    overflow: hidden !important;
}

.xb-newsletter {
    position: relative;
    overflow: hidden !important;
}

.xb-newsletter__img {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    max-width: 400px !important;
    height: auto;
    z-index: 1;
}

.xb-newsletter__img img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

@media (max-width: 991px) {
    .xb-newsletter__img {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        max-width: 100%;
        margin-top: 30px;
    }
}

/* Hero section overflow fix */
.hero__area,
.hero-section {
    overflow: hidden !important;
}

/* Shape and decoration fixes */
.shape,
.shape-inner,
.breadcrumb__shape,
.hero__shape {
    overflow: hidden;
}

/* Ensure shapes don't cause overflow */
.shape img,
.shape-inner img {
    max-width: 100%;
    height: auto;
}

/* Service section fix */
.service__area,
.service-section {
    overflow: hidden;
}

/* About section fix */
.about__area,
.about-section {
    overflow: hidden;
}

/* Feature section fix */
.feature__area,
.feature-section {
    overflow: hidden;
}

/* Country section fix */
.country__area,
.country-section {
    overflow: hidden;
}

/* Team section fix */
.team__area,
.team-section {
    overflow: hidden;
}

/* Blog section fix */
.blog__area,
.blog-section {
    overflow: hidden;
}

/* Contact section fix */
.contact__area,
.contact-section {
    overflow: hidden;
}

/* Swiper fixes */
.swiper-container,
.swiper-wrapper {
    overflow: hidden !important;
}

/* Animation elements fix */
[data-parallax],
.wow,
.animate__animated {
    overflow: hidden;
}

/* Circle decorations fix */
.breadcrumb__circle,
.hero__circle {
    overflow: hidden;
    position: absolute;
}

.breadcrumb__circle span,
.hero__circle span {
    display: block;
    overflow: hidden;
}

/* Glass effect elements */
.glass-effect {
    overflow: hidden;
}

/* Absolute positioned elements */
.pos-abs,
[class*="pos-abs"] {
    overflow: hidden;
}

/* Fix for sections with background images */
.bg_img {
    overflow: hidden;
}

/* Fix newsletter specific layout */
.newsletter {
    overflow: hidden;
}

.newsletter .container {
    position: relative;
}

/* Fix any element with negative margins */
*[style*="margin-left: -"],
*[style*="margin-right: -"] {
    overflow: hidden !important;
}

/* Responsive fixes */
@media (max-width: 1199px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    /* Mobile specific overflow fixes */
    .xb-newsletter__img {
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    
    /* Reset any large fixed widths */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix any element with fixed width */
    *[style*="width:"] {
        max-width: 100% !important;
    }
}

/* More aggressive fixes */
section {
    overflow-x: hidden !important;
}

.section {
    overflow-x: hidden !important;
}

/* Fix specific problematic elements */
.xb-newsletter__img {
    width: 400px !important;
    max-width: 45% !important;
}

/* Container max width enforcement */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px !important;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px !important;
    }
}

/* Fix for absolute positioned elements - only specific ones */
.xb-newsletter__img[style*="position: absolute"] {
    max-width: 100% !important;
}

/* Debug helper - uncomment to find overflow elements */
/*
* {
    outline: 1px solid red;
}
*/