/*****************************************************************
    MOBILE FIX CSS - Comprehensive Mobile Styling Fix
    This file ensures proper CSS rendering on mobile devices
*****************************************************************/

/* Force proper box-sizing for all elements */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* Base HTML and Body Mobile Settings */
html {
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    overflow-x: hidden !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Container and Row fixes for mobile
   NOTE: no overflow-x:hidden here! It would clip the absolutely
   positioned mobile menu dropdown (overflow-x:hidden forces
   vertical clipping too). Body handles horizontal overflow. */
.container, .container-fluid {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

/* Image responsiveness (mobile only — do not override desktop navbar logo) */
@media only screen and (max-width: 991px) {
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }
}

/* Mobile Typography */
@media only screen and (max-width: 767px) {
    
    /* Basic typography */
    body {
        font-size: 15px !important;
    }
    
    h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    
    h3 {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
    }
    
    h4 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
    
    h5 {
        font-size: 16px !important;
        line-height: 1.3 !important;
    }
    
    h6 {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }
    
    p {
        font-size: 15px !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }
    
    /* Navigation fixes */
    .navbar-section {
        padding: 10px 0 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    .techvio-responsive-nav {
        display: block !important;
    }
    
    .techvio-responsive-menu {
        position: relative !important;
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 5px 0 !important;
    }
    
    .techvio-responsive-menu .logo {
        flex: 0 0 auto !important;
    }
    
    .techvio-responsive-menu .logo img {
        max-height: 40px !important;
        height: 40px !important;
        width: auto !important;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
    }
    
    /* Mobile Menu Toggle Button (Hamburger) - ALWAYS VISIBLE */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 50px !important;
        height: 50px !important;
        background: #7b68ee !important;
        border: none !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        padding: 12px 10px !important;
        z-index: 9999 !important;
        position: relative !important;
        flex-shrink: 0 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4) !important;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95) !important;
    }
    
    .mobile-menu-toggle .bar,
    .mobile-menu-toggle span {
        display: block !important;
        width: 100% !important;
        height: 4px !important;
        background: #ffffff !important;
        border-radius: 4px !important;
        transition: all 0.3s ease !important;
        pointer-events: none !important;
    }
    
    .mobile-menu-toggle.active {
        background: #6250d4 !important;
    }
    
    .mobile-menu-toggle.active .bar:nth-child(1),
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 10px) !important;
    }
    
    .mobile-menu-toggle.active .bar:nth-child(2),
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .mobile-menu-toggle.active .bar:nth-child(3),
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(10px, -10px) !important;
    }
    
    /* Mobile Menu Dropdown */
    .mobile-menu-dropdown {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease, box-shadow 0.3s ease !important;
        z-index: 99999 !important;
        border-radius: 0 0 12px 12px !important;
    }
    
    .mobile-menu-dropdown.active {
        max-height: 80vh !important;
        overflow-y: auto !important;
        box-shadow: 0 12px 32px rgba(123, 104, 238, 0.2) !important;
    }
    
    .mobile-nav-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mobile-nav-list li {
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .mobile-nav-list li a {
        display: block !important;
        padding: 15px 20px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
        position: relative !important;
    }
    
    .mobile-nav-list li a:hover {
        background: linear-gradient(90deg, #f8f9fa, #fff) !important;
        color: #7b68ee !important;
        padding-left: 25px !important;
        border-left: 3px solid #7b68ee !important;
    }
    
    .mobile-menu-cta {
        padding: 15px 20px !important;
        background: linear-gradient(135deg, #f8f9fa, #fff) !important;
        border-top: 2px solid #7b68ee !important;
    }
    
    .mobile-menu-cta .default-btn {
        width: 100% !important;
        text-align: center !important;
        display: block !important;
        background: linear-gradient(135deg, #7b68ee, #6250d4) !important;
        color: #fff !important;
        padding: 14px 20px !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3) !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-cta .default-btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(123, 104, 238, 0.4) !important;
    }
    
    .navbar-brand img {
        max-height: 50px !important;
        width: auto !important;
    }
    
    /* Hero/Banner section mobile */
    .home-section {
        min-height: 500px !important;
        padding: 80px 0 60px !important;
    }
    
    .main-banner-content {
        padding: 30px 15px !important;
        text-align: center !important;
    }
    
    .main-banner-content h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }
    
    .main-banner-content p {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }
    
    .banner-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .banner-btn a, .default-btn-one, .default-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 14px 20px !important;
        font-size: 15px !important;
        display: block !important;
    }
    
    /* Section spacing */
    section, .section {
        padding: 50px 0 !important;
    }
    
    .ptb-100 {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
    
    .pt-100 {
        padding-top: 50px !important;
    }
    
    .pb-100 {
        padding-bottom: 50px !important;
    }
    
    .pt-70 {
        padding-top: 40px !important;
    }
    
    .pb-70 {
        padding-bottom: 40px !important;
    }
    
    /* Section titles */
    .section-title {
        margin-bottom: 30px !important;
    }
    
    .section-title h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
    }
    
    .section-title p {
        font-size: 15px !important;
        margin-top: 10px !important;
    }
    
    /* Service items */
    .single-services-item {
        margin-bottom: 20px !important;
        padding: 20px !important;
    }
    
    .services-icon {
        margin-bottom: 15px !important;
    }
    
    .services-content h3 {
        font-size: 19px !important;
        margin-bottom: 10px !important;
    }
    
    .services-content p {
        font-size: 14px !important;
    }
    
    /* About section */
    .about-content {
        padding: 20px 0 !important;
    }
    
    .about-image {
        margin-bottom: 30px !important;
    }
    
    .about-image img {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Features/Overview section */
    .overview-content {
        padding: 20px 0 !important;
    }
    
    .overview-image {
        margin-bottom: 30px !important;
    }
    
    .features-list li {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
        font-size: 14px !important;
    }
    
    /* Portfolio/Project items */
    .single-portfolio {
        margin-bottom: 20px !important;
    }
    
    .portfolio-item img {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Testimonial section */
    .single-testimonial {
        padding: 25px 15px !important;
        margin-bottom: 20px !important;
    }
    
    .testimonial-content {
        font-size: 14px !important;
    }
    
    /* Blog section */
    .blog-single-item {
        margin-bottom: 20px !important;
    }
    
    .blog-description {
        padding: 20px !important;
    }
    
    .blog-text h3 {
        font-size: 19px !important;
        line-height: 1.3 !important;
    }
    
    /* Contact section */
    .contact-form {
        padding: 25px 15px !important;
    }
    
    .form-group {
        margin-bottom: 15px !important;
    }
    
    .form-control {
        padding: 12px 15px !important;
        font-size: 15px !important;
        width: 100% !important;
    }
    
    .contact-details-box {
        margin-bottom: 30px !important;
        padding: 25px 20px !important;
    }
    
    .contact-form-box {
        padding: 25px 20px !important;
    }
    
    /* Footer */
    .footer-area {
        padding: 50px 0 30px !important;
    }
    
    .footer-logo img {
        max-height: 50px !important;
        height: 50px !important;
        width: auto !important;
        margin-bottom: 15px !important;
    }
    
    .google-footer-trust img {
        max-height: 55px !important;
    }
    
    .single-footer-widget {
        margin-bottom: 30px !important;
    }
    
    .footer-heading h2, .footer-heading h3 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }
    
    .footer-quick-links li {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .copyright-area {
        padding: 20px 15px !important;
        text-align: center !important;
    }
    
    .copyright-area p {
        font-size: 13px !important;
        line-height: 1.6 !important;
        margin-bottom: 10px !important;
    }
    
    /* Buttons */
    .btn, button, .default-btn, .default-btn-one {
        padding: 12px 25px !important;
        font-size: 15px !important;
        border-radius: 5px !important;
    }
    
    /* Cards and boxes */
    .single-pricing-box,
    .single-technology-item,
    .single-counter,
    .workprocess-single-item {
        margin-bottom: 20px !important;
        padding: 20px !important;
    }
    
    /* Partner/Client logos */
    .partner-section {
        padding: 50px 0 30px !important;
    }
    
    .partner-title {
        text-align: center !important;
        margin-bottom: 30px !important;
    }
    
    .partner-title h6 {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }
    
    .partner-title h2 {
        font-size: 26px !important;
    }
    
    .partner-list {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
    }
    
    .partner-list .partner-item {
        flex: 0 0 calc(50% - 15px) !important;
        max-width: calc(50% - 15px) !important;
        padding: 15px !important;
        text-align: center !important;
        background: #fff !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }
    
    .partner-list .partner-item img {
        max-width: 100% !important;
        max-height: 60px !important;
        height: auto !important;
        width: auto !important;
        margin: 0 auto !important;
        display: block !important;
        object-fit: contain !important;
    }
    
    /* Newsletter section */
    .newsletter-form {
        display: block !important;
    }
    
    .newsletter-form input {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 12px 15px !important;
        font-size: 15px !important;
    }
    
    .newsletter-form button {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 15px !important;
    }
    
    /* Table responsiveness */
    table {
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
    }
    
    /* Prevent horizontal scroll */
    .row > * {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Page title area */
    .page-title-area {
        height: 250px !important;
        padding: 80px 0 40px !important;
    }
    
    .page-title-content h2 {
        font-size: 28px !important;
        margin-bottom: 10px !important;
    }
    
    /* Breadcrumb */
    .page-title-content ul li {
        font-size: 13px !important;
    }
    
    /* Widget area */
    .widget-area {
        margin-top: 40px !important;
    }
    
    .widget {
        margin-bottom: 30px !important;
        padding: 20px !important;
    }
    
    /* FAQ Section */
    .faq-accordion .accordion-item {
        margin-bottom: 15px !important;
    }
    
    .accordion-title {
        padding: 15px !important;
        font-size: 15px !important;
    }
    
    .accordion-content {
        padding: 15px !important;
        font-size: 14px !important;
    }
    
    /* CTA/Call to action section */
    .hire-content {
        padding: 30px 20px !important;
        text-align: center !important;
    }
    
    .hire-content h2 {
        font-size: 26px !important;
        margin-bottom: 15px !important;
    }
    
    .hire-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .hire-btn a {
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
    }
    
    /* Video and iframe responsiveness */
    iframe, video {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Owl carousel mobile */
    .owl-carousel .owl-item img {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Swiper mobile */
    .swiper-container {
        width: 100% !important;
    }
    
    .swiper-slide {
        width: 100% !important;
    }
    
    /* Modal mobile */
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-content {
        padding: 20px !important;
    }
    
    /* Visibility utilities for mobile */
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: block !important;
    }
    
    /* Spacing utilities */
    .mb-mobile-20 {
        margin-bottom: 20px !important;
    }
    
    .mt-mobile-20 {
        margin-top: 20px !important;
    }
    
    /* Text alignment mobile */
    .text-center-mobile {
        text-align: center !important;
    }
    
    /* Hero badge and trust elements */
    .hero-badge {
        font-size: 12px !important;
        padding: 6px 14px !important;
        margin-bottom: 15px !important;
    }
    
    .hero-trust-indicator {
        padding: 8px 14px !important;
        margin-top: 20px !important;
    }
    
    .google-hero-badge {
        height: 32px !important;
    }
    
    .trust-text {
        font-size: 11px !important;
        margin-left: 10px !important;
    }
    
    .trust-text .stars {
        font-size: 12px !important;
    }
    
    /* WhatsApp FAB */
    .wa-fab {
        padding: 14px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .wa-fab-text {
        display: none !important;
    }
    
    .wa-fab {
        border-radius: 50% !important;
        width: 56px !important;
        height: 56px !important;
        justify-content: center !important;
    }
    
    .wa-fab svg {
        width: 26px !important;
        height: 26px !important;
    }
    
    /* Go to top button */
    .go-top {
        width: 48px !important;
        height: 48px !important;
        bottom: 85px !important;
        right: 20px !important;
        font-size: 18px !important;
    }
    
    /* Counter section */
    .counter-area {
        padding: 40px 0 !important;
    }
    
    .single-counter {
        margin-bottom: 30px !important;
        padding: 20px 15px !important;
    }
    
    .counter-contents h1 {
        font-size: 36px !important;
    }
    
    .counter-contents p {
        font-size: 15px !important;
    }
    
    /* Sub-titles */
    .sub-title {
        font-size: 13px !important;
    }
    
    /* Google trust section */
    .google-trust-section {
        padding: 50px 0 !important;
    }
    
    .google-trust-card {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .google-trust-card img {
        max-width: 100% !important;
    }
    
    .trust-bullets li {
        font-size: 14px !important;
        padding-left: 25px !important;
        margin-bottom: 12px !important;
    }
    
    .trust-bullets li i {
        font-size: 16px !important;
    }
    
    /* Subscribe section */
    .subscribe-area {
        padding: 40px 0 !important;
    }
    
    .subscribe-content {
        text-align: center !important;
        margin-bottom: 25px !important;
    }
    
    .subscribe-content h2 {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }
    
    .subscribe-content p {
        font-size: 14px !important;
    }
    
    /* Floating Google badge */
    .floating-google-badge {
        bottom: 20px !important;
        left: 20px !important;
        padding: 10px !important;
        border-radius: 50% !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    .floating-google-text {
        display: none !important;
    }
    
    .floating-google-icon {
        height: 24px !important;
        width: 24px !important;
    }
}

/* Extra small mobile devices (< 480px) */
@media only screen and (max-width: 479px) {
    
    body {
        font-size: 14px !important;
    }
    
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .techvio-responsive-menu .logo img {
        max-height: 35px !important;
        height: 35px !important;
    }
    
    .mobile-menu-toggle {
        width: 32px !important;
        height: 28px !important;
    }
    
    .mobile-menu-toggle span {
        height: 2.5px !important;
    }
    
    .main-banner-content h1 {
        font-size: 26px !important;
    }
    
    .section-title h2 {
        font-size: 22px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    p {
        font-size: 14px !important;
    }
    
    .partner-list .partner-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .partner-list .partner-item img {
        max-height: 50px !important;
    }
    
    .footer-logo img {
        max-height: 45px !important;
        height: 45px !important;
    }
    
    .google-footer-trust img {
        max-height: 50px !important;
    }
    
    /* Reduce padding for very small screens */
    section, .section {
        padding: 40px 0 !important;
    }
    
    .single-services-item,
    .single-testimonial,
    .contact-details-box,
    .contact-form-box {
        padding: 15px !important;
    }
    
    .hero-badge {
        font-size: 11px !important;
        padding: 5px 12px !important;
    }
    
    .hero-trust-indicator {
        padding: 6px 12px !important;
        margin-top: 15px !important;
    }
    
    .google-hero-badge {
        height: 28px !important;
    }
    
    .trust-text {
        font-size: 10px !important;
    }
    
    .subscribe-content h2 {
        font-size: 20px !important;
    }
    
    .section-title h2 {
        font-size: 20px !important;
    }
    
    .partner-title h2 {
        font-size: 22px !important;
    }
    
    .single-counter {
        padding: 15px 10px !important;
    }
    
    .counter-contents h1 {
        font-size: 32px !important;
    }
    
    .counter-contents p {
        font-size: 14px !important;
    }
}

/* Tablet devices (768px - 991px) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    
    .partner-list .partner-item {
        flex: 0 0 calc(33.333% - 15px) !important;
        max-width: calc(33.333% - 15px) !important;
    }
    
    .features-list li {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .main-banner-content h1 {
        font-size: 42px !important;
    }
    
    .section-title h2 {
        font-size: 32px !important;
    }
    
    .navbar-section {
        padding: 12px 0 !important;
    }
    
    .techvio-responsive-menu .logo img {
        max-height: 45px !important;
        height: 45px !important;
    }
    
    .home-section {
        min-height: 600px !important;
        padding: 100px 0 80px !important;
    }
    
    .single-services-item {
        padding: 25px !important;
    }
    
    .footer-logo img {
        max-height: 55px !important;
        height: 55px !important;
    }
    
    .google-footer-trust img {
        max-height: 60px !important;
    }
}

/* Ensure proper rendering on all devices */
@media screen and (max-width: 991px) {
    /* Hide desktop menu, show mobile menu */
    .techvio-nav {
        display: none !important;
    }
    
    .techvio-responsive-nav {
        display: block !important;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }
}

@media screen and (min-width: 992px) {
    /* Show desktop menu, hide mobile menu */
    .techvio-nav {
        display: block !important;
    }
    
    .techvio-responsive-nav {
        display: none !important;
    }
    
    /* Desktop menu visible */
    .techvio-nav .collapse {
        display: flex !important;
    }
    
    /* Hide mobile menu toggle on desktop */
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Desktop navbar logo — always visible (same logo on hero + scrolled) */
    .techvio-nav .navbar-brand .site-logo,
    .techvio-nav .navbar-brand img#desktopLogo {
        max-width: 200px !important;
        height: 60px !important;
        width: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Hero overlay: light backdrop so colored logo reads on purple banner */
    .navbar-section.is-sticky.navbar-at-top .techvio-nav .navbar-brand {
        background: rgba(255, 255, 255, 0.94) !important;
        padding: 6px 14px !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12) !important;
    }

    .navbar-section.is-sticky:not(.navbar-at-top) .techvio-nav .navbar-brand {
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
}
