/* ===== MOBILE-FIRST RESPONSIVE ENHANCEMENTS ===== */

/* === EXTRA SMALL DEVICES (320px - 479px) === */
@media (max-width: 479px) {
  /* Base typography improvements */
  html {
    font-size: 16px; /* Increased for better readability */
  }
  
  /* Container and spacing improvements */
  .container {
    padding: 0 20px; /* More padding */
    max-width: 100%;
  }
  
  /* Hero section mobile optimization */
  .solutions-showcase {
    padding: 2rem 1.5rem; /* Much more padding */
    margin: 1rem;
    min-height: auto; /* Remove fixed height */
    max-height: none;
    border-radius: 1rem;
  }
  
  .showcase-header {
    margin-bottom: 2.5rem;
  }
  
  .showcase-title {
    font-size: 1.75rem !important; /* Larger title */
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
  }
  
  .showcase-subtitle {
    font-size: 1rem !important; /* Larger subtitle */
    line-height: 1.4;
    margin-bottom: 0;
  }
  
  .solution-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important; /* More gap */
    margin-bottom: 2rem;
  }
  
  .solution-card {
    padding: 2rem 1.5rem !important; /* Much more padding */
    border-radius: 1rem;
    min-height: 200px; /* Ensure adequate height */
  }
  
  .solution-card .icon {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto 1.5rem auto;
    font-size: 2rem;
  }
  
  .solution-card h3 {
    font-size: 1.375rem !important; /* Much larger title */
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
  }
  
  .solution-card p {
    font-size: 1rem !important; /* Larger description */
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
  }
  
  .solution-card .btn {
    width: 100% !important;
    padding: 1rem 2rem !important;
    /*
    font-size: 1rem !important;
    font-weight: 600;
    border-radius: 0.75rem;
    min-height: 48px; /* Touch-friendly */
  }
  
  /* Major Clients mobile improvements */
  .major-clients-section {
    padding: 80px 0;
  }
  
  .clients-image-hero {
    height: 200px;
    margin-bottom: 30px;
    border-radius: 15px;
  }
  
  .clients-overlay {
    padding: 30px 15px 15px;
  }
  
  .clients-overlay h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  .client-stats {
    gap: 20px;
    margin: 25px 0;
  }
  
  .stat-item {
    text-align: center;
  }
  
  .stat-number {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
  
  /* Statement section mobile */
  .statement-section {
    padding: 60px 0;
  }
  
  .statement-section h2 {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  /* OEM Partners carousel mobile */
  .partners-section {
    padding: 60px 0;
  }
  
  .oem-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .oem-logo {
    height: 60px;
    padding: 15px;
  }
  
  /* Navigation mobile improvements */
  .nav-container {
    padding: 0 15px;
  }
  
  .logo-img {
    height: 50px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  /* HERO SECTION RESPONSIVENESS */
  .hero-section {
    padding: 2.5rem 0.5rem 1.5rem 0.5rem; /* More compact padding */
  }
  .hero-title, .showcase-title, .hero-section h1 {
    font-size: 2rem !important; /* Scale down headline */
    line-height: 1.15 !important;
    word-break: break-word; /* Prevent overflow */
    overflow-wrap: break-word;
    text-align: left;
    margin-bottom: 1rem;
  }
  .hero-section p, .hero-description, .showcase-subtitle {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: left;
    margin-bottom: 1.25rem;
  }
  /* Stats section responsiveness */
  .hero-stats, .stats-section {
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  .hero-stat, .stat-card {
    font-size: 1.25rem !important;
    padding: 1rem;
    border-radius: 1rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  /* Ensure all text wraps and scales */
  .hero-section *, .stats-section * {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  .nav-links {
    padding: 20px 15px;
    top: 75px;
  }
  
  .nav-link {
    padding: 15px 0;
    font-size: 0.95rem;
  }
  
  /* Button improvements */
  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    min-width: auto;
  }
  
  .btn-primary {
    width: 100%;
    text-align: center;
  }
  
  /* Form improvements */
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-control {
    padding: 12px 15px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* === SMALL DEVICES (480px - 767px) === */
@media (min-width: 480px) and (max-width: 767px) {
  /* Hero section tablet optimization */
  .solutions-showcase {
    padding: 2.5rem 2rem;
    margin: 1rem 0.5rem;
    min-height: auto;
  }
  
  .showcase-title {
    font-size: 1.875rem !important;
    margin-bottom: 1.25rem;
    font-weight: 700;
  }
  
  .showcase-subtitle {
    font-size: 1.1rem !important;
    margin-bottom: 1rem;
  }
  
  .solution-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }
  
  .solution-card {
    padding: 2.25rem 1.75rem !important;
    min-height: 220px;
  }
  
  .solution-card .icon {
    width: 70px !important;
    height: 70px !important;
    margin: 0 auto 1.5rem auto;
    font-size: 2.25rem;
  }
  
  .solution-card h3 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem;
    font-weight: 600;
  }
  
  .solution-card p {
    font-size: 1.05rem !important;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }
  
  .solution-card .btn {
    width: 100% !important;
    padding: 1.125rem 2rem !important;
    font-size: 1.05rem !important;
    font-weight: 600;
    min-height: 50px;
  }
  
  /* Major Clients section */
  .major-clients-section {
    padding: 100px 0;
  }
  
  .clients-image-hero {
    height: 280px;
    margin-bottom: 40px;
  }
  
  .clients-overlay {
    padding: 40px 25px 20px;
  }
  
  .client-stats {
    gap: 30px;
    margin: 30px 0;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  /* OEM Partners */
  .oem-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
  
  .oem-logo {
    height: 70px;
    padding: 20px;
  }
}

/* === MEDIUM DEVICES (768px - 1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Container adjustments */
  .container {
    max-width: 750px;
    padding: 0 30px;
  }
  
  /* Hero section */
  .solutions-showcase {
    padding: 100px 0 80px;
  }
  
  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
  
  /* Major Clients */
  .clients-image-hero {
    height: 350px;
  }
  
  .clients-overlay {
    padding: 50px 40px 30px;
  }
  
  /* OEM Partners */
  .oem-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
  /* Improve touch targets */
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .solution-card {
    transition: transform 0.2s ease;
  }
  
  .solution-card:active {
    transform: scale(0.98);
  }
  
  /* Remove hover effects on touch devices */
  .solution-card:hover {
    transform: none;
  }
  
  .oem-logo:hover {
    transform: none;
  }
}

/* === LANDSCAPE ORIENTATION IMPROVEMENTS === */
@media (max-width: 767px) and (orientation: landscape) {
  .solutions-showcase {
    padding: 40px 0 30px;
  }
  
  .major-clients-section {
    padding: 60px 0;
  }
  
  .clients-image-hero {
    height: 200px;
  }
  
  .clients-overlay {
    padding: 25px 20px 15px;
  }
  
  .nav-links {
    top: 70px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .oem-grid {
    animation: none !important;
  }
}

/* === HIGH DPI DISPLAY OPTIMIZATION === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .clients-image-hero {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .oem-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* === VERY LARGE MOBILE DEVICES (414px+) === */
@media (min-width: 414px) and (max-width: 767px) {
  /* iPhone XR, iPhone 11, iPhone 12, etc. */
  .solutions-showcase {
    padding: 2.75rem 2rem !important;
    margin: 1rem 0.75rem;
    border-radius: 1.25rem;
  }
  
  .showcase-title {
    font-size: 2rem !important;
    margin-bottom: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
  }
  
  .showcase-subtitle {
    font-size: 1.125rem !important;
    margin-bottom: 1.25rem;
    line-height: 1.4;
  }
  
  .solution-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin-bottom: 2.5rem;
  }
  
  .solution-card {
    padding: 2.5rem 2rem !important;
    min-height: 240px;
    border-radius: 1.125rem;
  }
  
  .solution-card .icon {
    width: 75px !important;
    height: 75px !important;
    margin: 0 auto 1.75rem auto;
    font-size: 2.5rem;
  }
  
  .solution-card h3 {
    font-size: 1.625rem !important;
    margin-bottom: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
  }
  
  .solution-card p {
    font-size: 1.125rem !important;
    line-height: 1.5;
    margin-bottom: 1.75rem;
  }
  
  .solution-card .btn {
    width: 100% !important;
    padding: 1.25rem 2rem !important;
    font-size: 1.125rem !important;
    font-weight: 600;
    min-height: 52px;
    border-radius: 0.875rem;
  }
  
  /* Navigation improvements for large mobile */
  .nav-container {
    padding: 0 1.5rem;
  }
  
  .logo-img {
    height: 55px;
  }
  
  .logo-text {
    font-size: 1.35rem;
  }
}

/* === PERFORMANCE OPTIMIZATIONS === */
@media (max-width: 767px) {
  /* Reduce expensive effects on mobile */
  .solution-card {
    will-change: transform;
  }
  
  .clients-image-hero {
    will-change: auto;
  }
  
  /* Optimize fonts for mobile */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
  }
}

/* === MOBILE UTILITY CLASSES === */
.mobile-device {
  /* Mobile-specific optimizations applied via JavaScript */
}

.mobile-device .oem-grid {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.mobile-device .solution-card,
.mobile-device .btn,
.mobile-device .nav-link {
  -webkit-tap-highlight-color: rgba(255, 183, 43, 0.2);
  tap-highlight-color: rgba(255, 183, 43, 0.2);
}

/* === PROGRESSIVE ENHANCEMENT === */
@supports (display: grid) {
  .solutions-grid {
    display: grid;
  }
}

@supports (backdrop-filter: blur(10px)) {
  .mobile-device .nav-links {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.9);
  }
}

/* === PRINT STYLES === */
@media print {
  .nav-links,
  .hamburger,
  .btn,
  .oem-grid {
    display: none !important;
  }
  
  .major-clients-section,
  .solutions-showcase {
    page-break-inside: avoid;
  }
}

/* === Statement Section Two-Column Layout === */
/* Keep internal styles unchanged, only change container layout */
.statement-section .container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap; /* try side-by-side by default */
}
.statement-section .statement-content {
  flex: 1 1 55%;
  min-width: 280px;
}
/* === Contact Methods Section: Force text color to black === */
.contact-methods, .contact-methods * {
  color: #000 !important;
}
.statement-section .hero-visual {
  flex: 1 1 40%;
  min-width: 260px;
}

/* On small screens, stack back vertically */
@media (max-width: 767px) {
  .statement-section .container {
    flex-direction: column;
    gap: 1.25rem;
  }
  .statement-section .statement-content,
  .statement-section .hero-visual {
    flex: none;
    width: 100%;
  }
}