/* =====================================================
   MOBILE BREAKPOINTS STANDARDIZATION
   Ensures consistent responsive behavior across all devices
   ===================================================== */

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .section-container {
        max-width: 1320px;
    }
}

/* Large Devices (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .section-container {
        max-width: 1140px;
    }
}

/* Medium Devices (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .section-container {
        max-width: 960px;
    }
}

/* Small Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .section-container {
        max-width: 720px;
    }
}

/* Large Phones (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .section-container {
        max-width: 540px;
    }
}

/* Small Phones (up to 575px) */
@media (max-width: 575px) {
    .section-container {
        max-width: 100%;
    }
}

/* =====================================================
   CRITICAL MOBILE FIXES
   ===================================================== */

/* Prevent horizontal scroll on all devices */
@media (max-width: 1400px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
}

/* Fix Bootstrap container issues */
@media (max-width: 768px) {
    .container,
    .container-fluid,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
    
    .row {
        --bs-gutter-x: 1rem;
    }
}

/* Fix specific problem areas */
@media (max-width: 768px) {
    /* Hero section fixes */
    .hero-section .row {
        margin: 0 !important;
    }
    
    .hero-section [class*="col-"] {
        padding: 0 0.5rem !important;
    }
    
    /* Trusted by section fixes */
    .trusted-by.section-sub {
        overflow: hidden !important;
    }
    
    /* Problem section fixes */
    .the-problem-nordic {
        overflow: hidden !important;
    }
    
    .problem-grid,
    .solution-advantage-grid {
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* Agent cards fixes */
    .ready-agents .row {
        margin: 0 !important;
    }
    
    /* Footer fixes */
    .footer .section-container {
        width: 100% !important;
    }
}

/* =====================================================
   ORIENTATION-SPECIFIC FIXES
   ===================================================== */

/* Landscape mode optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto !important;
        padding: 1rem 0 !important;
    }
    
    .section {
        padding: 30px 0 !important;
    }
    
    .hero-heading {
        font-size: 24px !important;
    }
    
    .hero-subtitle {
        font-size: 16px !important;
    }
}

/* Portrait mode optimizations */
@media (max-width: 768px) and (orientation: portrait) {
    /* Ensure content fits viewport */
    .section-container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =====================================================
   DEVICE-SPECIFIC FIXES
   ===================================================== */

/* iPhone SE, iPhone 8 and similar small devices */
@media (max-width: 375px) {
    .section-title {
        font-size: 24px !important;
    }
    
    .hero-heading {
        font-size: 22px !important;
    }
    
    .btn {
        font-size: 12px !important;
        padding: 8px 16px !important;
    }
}

/* iPhone 12 Pro Max, iPhone 13 Pro Max */
@media (max-width: 428px) {
    .section-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* iPad Mini and similar tablets */
@media (min-width: 768px) and (max-width: 834px) {
    .section-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* =====================================================
   FINAL OVERRIDES FOR CONSISTENCY
   ===================================================== */

/* Ensure all sections respect mobile viewport */
@media (max-width: 992px) {
    * {
        max-width: 100vw !important;
    }
    
    .section,
    .section-sub,
    section,
    main,
    header,
    footer {
        overflow-x: hidden !important;
    }
    
    /* Reset any negative margins */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Consistent padding for all column classes */
    [class*="col-"] {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* Ultra-small devices final fixes */
@media (max-width: 360px) {
    .section-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .section-title {
        font-size: 22px !important;
        line-height: 1.2 !important;
    }
    
    p {
        font-size: 13px !important;
    }
    
    .btn {
        width: 100% !important;
        font-size: 12px !important;
    }
}
