/**
 * Complete Mobile Responsive Fix
 * Fixes all overflow and responsive issues for mobile devices
 */

/* Global Mobile Fixes */
@media (max-width: 767px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* Main wrapper constraint */
    .body_wrap,
    .site-wrapper,
    #wrapper {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* Container fixes */
    .container {
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Row fixes */
    .row {
        margin-left: -15px !important;
        margin-right: -15px !important;
    }
    
    /* Column fixes */
    [class*="col-"] {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Section padding adjustments */
    section {
        padding: 60px 0 !important;
    }
    
    .pt-130 {
        padding-top: 60px !important;
    }
    
    .pb-130 {
        padding-bottom: 60px !important;
    }
    
    .pt-120 {
        padding-top: 50px !important;
    }
    
    .pb-120 {
        padding-bottom: 50px !important;
    }
    
    /* Header fixes */
    .header-area,
    .vt-header,
    .xb-header {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .header__main {
        padding: 10px 0 !important;
    }
    
    /* Hero Section */
    .hero-section,
    .banner,
    .slider {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .hero__content h1,
    .banner__content h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    .hero__content p,
    .banner__content p {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    /* Service boxes */
    .service,
    .xb-service {
        margin-bottom: 30px !important;
    }
    
    .service__item,
    .xb-service-box {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    /* About section */
    .about__img,
    .xb-about__img {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    .about__img img,
    .xb-about__img img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Team section */
    .team__item,
    .xb-team {
        margin-bottom: 30px !important;
    }
    
    /* Partners/Brands slider */
    .brand-slider,
    .partners-slider {
        overflow: hidden !important;
    }
    
    .brand-slider .swiper-slide,
    .partners-slider .swiper-slide {
        width: auto !important;
    }
    
    /* Contact form */
    .contact__form,
    .xb-contact-form {
        padding: 20px !important;
    }
    
    .contact__form input,
    .contact__form textarea,
    .xb-contact-form input,
    .xb-contact-form textarea {
        font-size: 14px !important;
        padding: 12px 15px !important;
    }
    
    /* Footer */
    footer {
        overflow-x: hidden !important;
    }
    
    .footer__widget {
        margin-bottom: 30px !important;
    }
    
    .footer__copyright-wrapper {
        padding: 15px 0 !important;
    }
    
    .footer__copyright {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .footer__copyright-text {
        margin-bottom: 10px !important;
        font-size: 13px !important;
    }
    
    /* Buttons */
    .btn,
    .xb-btn,
    .bttn {
        padding: 12px 25px !important;
        font-size: 14px !important;
        min-width: auto !important;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px !important;
    }
    
    /* Cards and boxes */
    .card,
    .box {
        margin-bottom: 20px !important;
    }
    
    /* Tables - make responsive */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Titles */
    h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    h4 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
    
    /* Hide overflow elements */
    .shape,
    .decoration,
    .circle,
    .pattern {
        display: none !important;
    }
    
    /* Newsletter form */
    .newsletter__form {
        flex-direction: column !important;
    }
    
    .newsletter__form input {
        margin-bottom: 10px !important;
        width: 100% !important;
    }
    
    .newsletter__form button {
        width: 100% !important;
    }
    
    /* Stats/Counter */
    .counter__item,
    .xb-counter {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    /* Timeline */
    .timeline__item {
        padding-left: 0 !important;
        text-align: center !important;
    }
    
    /* Pricing tables */
    .pricing__item,
    .xb-pricing {
        margin-bottom: 30px !important;
    }
    
    /* Video sections */
    .video__wrapper {
        height: 250px !important;
    }
    
    /* Modal/Popup */
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 80px 0 20px !important;
    }
    
    .breadcrumb__title {
        font-size: 24px !important;
    }
    
    /* Blog posts */
    .blog__item,
    .post-item {
        margin-bottom: 30px !important;
    }
    
    /* Sidebar */
    .sidebar {
        margin-top: 40px !important;
    }
    
    /* Navigation fixes */
    .navbar-collapse {
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
    
    /* WhatsApp button */
    .whatsapp-button,
    .floating-whatsapp {
        bottom: 20px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Language switcher */
    .header__language {
        margin-top: 10px !important;
    }
    
    /* Search form */
    .search-form {
        padding: 15px !important;
    }
    
    /* Accordion */
    .accordion_box .block {
        margin-bottom: 15px !important;
    }
    
    .accordion_box .block .acc-btn {
        padding: 15px !important;
        font-size: 14px !important;
    }
    
    .accordion_box .block .content {
        padding: 15px !important;
        font-size: 14px !important;
    }
    
    /* Tab content */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap !important;
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
    
    /* Visa types grid */
    .visa-types {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Process steps */
    .process__item {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    /* CTA sections */
    .cta {
        padding: 40px 0 !important;
    }
    
    .cta__content h2 {
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }
    
    /* Portfolio/Gallery */
    .portfolio__item,
    .gallery__item {
        margin-bottom: 20px !important;
    }
    
    /* Map container */
    .map-container {
        height: 300px !important;
    }
    
    /* Social icons */
    .social-links {
        justify-content: center !important;
    }
    
    .social-links li {
        margin: 0 10px !important;
    }
    
    /* Back to top button */
    .xb-backtotop {
        width: 40px !important;
        height: 40px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
}

/* Extra small devices (phones < 480px) */
@media (max-width: 480px) {
    /* Container even smaller padding */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Smaller sections */
    section {
        padding: 40px 0 !important;
    }
    
    /* Smaller titles */
    h1 {
        font-size: 24px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    /* Smaller buttons */
    .btn,
    .xb-btn {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }
    
    /* Footer copyright smaller */
    .footer__copyright-text {
        font-size: 11px !important;
    }
}

/* Landscape phone orientation fixes */
@media (max-width: 767px) and (orientation: landscape) {
    /* Adjust heights for landscape */
    .hero-section,
    .banner {
        min-height: 60vh !important;
    }
    
    .video__wrapper {
        height: 200px !important;
    }
}

/* Specific component fixes */
@media (max-width: 767px) {
    /* Swiper pagination */
    .swiper-pagination {
        bottom: 10px !important;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Sticky header adjustment */
    .stricky-fixed {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
    }
    
    /* Mobile menu button */
    .mobile-menu-btn,
    .navbar-toggler {
        display: block !important;
        padding: 5px 10px !important;
    }
    
    /* Hide desktop elements */
    .desktop-only,
    .d-none-mobile {
        display: none !important;
    }
    
    /* Show mobile elements */
    .mobile-only,
    .d-block-mobile {
        display: block !important;
    }
}

/* Prevent specific elements from causing overflow */
@media (max-width: 767px) {
    /* Elements that might cause horizontal scroll */
    .sec-title,
    .section-title,
    .xb-section__title {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Long text content */
    p, li, span, a {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Pre and code blocks */
    pre, code {
        overflow-x: auto !important;
        max-width: 100% !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
    }
}

/* Z-index fixes for mobile */
@media (max-width: 767px) {
    .mobile-menu {
        z-index: 99999 !important;
    }
    
    .header-area {
        z-index: 9999 !important;
    }
    
    .modal {
        z-index: 99999 !important;
    }
    
    .modal-backdrop {
        z-index: 99998 !important;
    }
}