/* Mobile Responsive Fixes for Cubatica Site */

/* Base Mobile Styles */
@media screen and (max-width: 1024px) {
    /* Container adjustments */
    .ct-container,
    .elementor-container {
        max-width: 100% !important;
        padding: 0 20px !important;
    }
    
    /* Header fixes */
    .site-header,
    header[data-id="type-1"] {
        padding: 10px 0 !important;
    }
    
    .site-branding img {
        max-width: 180px !important;
        height: auto !important;
    }
    
    /* Hide desktop navigation */
    .site-nav-container,
    .desktop-menu,
    nav.site-nav {
        display: none !important;
    }
    
    /* Show mobile menu trigger */
    [data-id="trigger"] {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 10px;
        cursor: pointer;
    }
    
    /* Elementor columns stack on tablet */
    .elementor-column {
        width: 100% !important;
    }
    
    .elementor-col-33 {
        width: 100% !important;
    }
    
    .elementor-col-50 {
        width: 100% !important;
    }
    
    .elementor-col-25 {
        width: 50% !important;
    }
}

/* Mobile Phone Styles */
@media screen and (max-width: 768px) {
    /* Typography scaling */
    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;
    }
    
    p, body {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    
    /* Container padding */
    .ct-container,
    .elementor-container {
        padding: 0 15px !important;
    }
    
    /* Section spacing */
    .elementor-section {
        padding: 30px 0 !important;
    }
    
    .elementor-section-boxed > .elementor-container {
        max-width: 100% !important;
    }
    
    /* Column stacking */
    .elementor-column,
    .elementor-col-20,
    .elementor-col-25,
    .elementor-col-33,
    .elementor-col-50,
    .elementor-col-66,
    .elementor-col-100 {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Reverse column order fix */
    .elementor-reverse-mobile > .elementor-container {
        flex-direction: column-reverse !important;
    }
    
    /* Forms mobile optimization */
    .gform_wrapper {
        padding: 0 !important;
    }
    
    .gfield {
        margin-bottom: 15px !important;
    }
    
    .gfield input[type="text"],
    .gfield input[type="email"],
    .gfield input[type="tel"],
    .gfield input[type="url"],
    .gfield textarea,
    .gfield select {
        width: 100% !important;
        padding: 12px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .gf_left_half,
    .gf_right_half {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
    }
    
    /* Buttons mobile */
    .elementor-button,
    .button,
    .gform_button {
        width: 100% !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
        text-align: center !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Hide elements on mobile */
    .elementor-hidden-phone {
        display: none !important;
    }
    
    /* Footer mobile */
    .ct-footer .elementor-column {
        width: 100% !important;
        margin-bottom: 30px !important;
    }
    
    /* Blog posts grid */
    .elementor-posts-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Case study cards */
    .card,
    .elementor-widget-wrap {
        padding: 15px !important;
    }
    
    /* Navigation lists */
    ul.elementor-icon-list-items {
        padding-left: 0 !important;
    }
    
    /* Table responsive */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Video responsive */
    .elementor-widget-video,
    .wp-video,
    video,
    iframe {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Slider/Carousel mobile */
    .elementor-slides {
        height: auto !important;
    }
    
    .swiper-slide {
        height: auto !important;
    }
    
    /* Modal/Popup mobile */
    .elementor-popup-modal {
        width: 95% !important;
        margin: 10px !important;
    }
    
    /* Gravity Forms specific */
    .gform_page_footer {
        text-align: center !important;
    }
    
    .gform_page_footer input {
        margin: 5px !important;
    }
    
    #gform_wrapper_5 .gform_footer,
    #gform_wrapper_20 .gform_footer {
        padding: 20px 0 !important;
    }
    
    /* Fix overlapping elements */
    * {
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
    }
    
    /* Padding adjustments */
    .elementor-widget {
        margin-bottom: 20px !important;
    }
    
    /* Text alignment mobile */
    .elementor-widget-text-editor,
    .elementor-widget-heading {
        text-align: center !important;
    }
    
    /* Icon list mobile */
    .elementor-icon-list-items {
        text-align: left !important;
    }
    
    /* Social icons */
    .elementor-social-icons-wrapper {
        justify-content: center !important;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    /* Even smaller typography */
    h1 {
        font-size: 24px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    /* Reduce padding further */
    .elementor-section {
        padding: 20px 0 !important;
    }
    
    .ct-container,
    .elementor-container {
        padding: 0 10px !important;
    }
    
    /* Stack all columns */
    [class*="elementor-col-"] {
        width: 100% !important;
    }
    
    /* Form fields */
    .gfield_checkbox label,
    .gfield_radio label {
        font-size: 14px !important;
    }
}

/* Landscape orientation fixes */
@media screen and (max-width: 768px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    .elementor-section {
        padding: 20px 0 !important;
    }
    
    h1 {
        font-size: 24px !important;
    }
    
    /* Header adjustments */
    .site-header {
        padding: 5px 0 !important;
    }
}

/* iPad specific fixes */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    /* Two column layout on tablet */
    .elementor-col-25 {
        width: 50% !important;
    }
    
    .elementor-col-33 {
        width: 50% !important;
    }
    
    /* Keep some elements side by side on tablet */
    .gf_left_half,
    .gf_right_half {
        width: 48% !important;
    }
}

/* Fix specific Cubatica elements */
@media screen and (max-width: 768px) {
    /* Hero section mobile */
    .hero-section {
        padding: 40px 0 !important;
        text-align: center !important;
    }
    
    /* Stats/numbers section */
    .stats-number {
        font-size: 36px !important;
    }
    
    /* Client logos */
    .client-logos img {
        max-width: 120px !important;
        margin: 10px !important;
    }
    
    /* Team section */
    .team-member {
        margin-bottom: 30px !important;
    }
    
    /* Services grid */
    .service-box {
        margin-bottom: 20px !important;
    }
    
    /* Contact form in popup */
    #gform_wrapper_20 {
        padding: 10px !important;
    }
    
    /* Case study content */
    .case-study-content {
        padding: 20px !important;
    }
    
    /* Blog post cards */
    .blog-post-card {
        margin-bottom: 20px !important;
    }
    
    /* Performance metrics */
    .metric-box {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
}

/* Accessibility improvements for mobile */
@media screen and (max-width: 768px) {
    /* Larger touch targets */
    a, button, input, select, textarea {
        min-height: 44px !important;
    }
    
    /* Better spacing for clickable elements */
    .elementor-icon-list-item {
        padding: 10px 0 !important;
    }
    
    /* Improve readability */
    body {
        -webkit-text-size-adjust: 100% !important;
    }
}

/* Fix horizontal scroll issues */
@media screen and (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
    }
    
    .elementor-section,
    .elementor-container,
    .elementor-row {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Print styles for mobile */
@media print {
    .site-header,
    .ct-footer,
    [data-id="trigger"],
    #offcanvas {
        display: none !important;
    }
}