/* Mobile Optimization Fixes */

/* Prevent horizontal scroll on all devices */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Container responsive fixes */
@media (max-width: 767px) {
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .row {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
    
    [class*="col-"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Hero/Banner Section Mobile Fixes */
@media (max-width: 767px) {
    #home {
        padding-top: 80px;
    }
    
    .banner_content {
        text-align: center;
        padding: 0 10px;
    }
    
    .banner_content h1 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .banner_content .cd-headline {
        font-size: inherit;
    }
    
    .banner-images {
        margin-top: 20px;
        text-align: center;
    }
}

/* Navigation Mobile Fixes */
@media (max-width: 767px) {
    .navbar {
        padding: 8px 0 !important;
    }
    
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        padding: 10px 15px;
        margin-top: 10px;
        border-radius: 5px;
    }
    
    .navbar-nav {
        margin: 0;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    
    .navbar-nav .nav-link {
        color: #fff !important;
        padding: 8px 0 !important;
    }
    
    .dropdown-menu {
        background: rgba(50, 50, 50, 0.95) !important;
        border: none;
        position: static !important;
        float: none;
        width: 100%;
        margin: 0;
        box-shadow: none;
    }
}

/* Services Section Mobile */
@media (max-width: 767px) {
    .services-item {
        margin-bottom: 20px;
    }
    
    .services-item .icon img {
        max-width: 60px;
        height: auto;
    }
}

/* Blog Section Mobile */
@media (max-width: 767px) {
    .single_blog {
        margin-bottom: 25px;
    }
    
    .blog-thumb {
        margin-bottom: 20px;
    }
    
    .blog-info {
        padding: 15px !important;
    }
    
    .blog-image img {
        width: 100%;
        height: auto;
    }
}

/* Contact Form Mobile */
@media (max-width: 767px) {
    .contact-form-area {
        padding: 20px 10px !important;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .contact_form {
        padding: 0;
    }
}

/* Footer Mobile */
@media (max-width: 767px) {
    .footer-area {
        padding: 30px 0;
    }
    
    .social-icons {
        margin-bottom: 15px;
    }
    
    .social-icons .fa {
        margin: 5px !important;
    }
    
    .footer-text p {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Funfacts Section Mobile */
@media (max-width: 767px) {
    .funfact {
        margin-bottom: 20px;
        padding: 30px 10px;
    }
}

/* Diwali Theme Mobile Fixes */
@media (max-width: 767px) {
    .diwali-greeting {
        padding: 10px 5px !important;
    }
    
    .diwali-greeting h4 {
        font-size: 14px !important;
        margin: 0;
    }
    
    .diwali-greeting p {
        font-size: 10px !important;
        margin: 0;
    }
}

/* Image Responsiveness */
@media (max-width: 767px) {
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    .img-responsive {
        width: 100%;
        height: auto;
    }
}

/* Typography Mobile Scaling */
@media (max-width: 480px) {
    h1 { font-size: 24px !important; line-height: 1.3; }
    h2 { font-size: 22px !important; line-height: 1.3; }
    h3 { font-size: 18px !important; line-height: 1.4; }
    h4 { font-size: 16px !important; line-height: 1.4; }
    h5 { font-size: 14px !important; line-height: 1.4; }
    h6 { font-size: 13px !important; line-height: 1.4; }
    
    p {
        font-size: 13px;
        line-height: 1.6;
    }
}

/* Fix text overflow */
@media (max-width: 767px) {
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Back to top button mobile */
@media (max-width: 767px) {
    a.back-to-top {
        bottom: 15px;
        right: 10px;
    }
    
    a.back-to-top i {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 16px;
    }
}

/* Landscape mode fixes for phones */
@media (max-width: 767px) and (orientation: landscape) {
    .banner_content {
        margin-top: 80px !important;
    }
    
    .banner-images {
        display: none; /* Hide image in landscape to save space */
    }
    
    #home {
        min-height: auto;
    }
}
