/* Mobile-First & Cross-Browser Compatibility */

/* CSS Reset for cross-browser consistency */
* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Mobile-first base styles */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Flexbox fallbacks for older browsers */
.flex-container {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

/* Grid fallbacks */
.grid-container {
  display: grid;
  display: -ms-grid;
  grid-template-columns: 1fr;
  -ms-grid-columns: 1fr;
  gap: 20px;
}

@supports (display: grid) {
  .grid-container {
    display: grid;
  }
}

/* Mobile navigation */
.mobile-nav {
  display: block;
  width: 100%;
  background: var(--primary-dark);
  position: fixed;
  top: 0;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav.active {
  transform: translateY(0);
}

.mobile-nav-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  padding: 15px;
  cursor: pointer;
}

/* Touch-friendly buttons */
.btn, .button, button {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container mobile-first */
.container, .containers {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Service icons mobile */
.ser-icon, .col-md-3.ser-icon {
  width: 100%;
  margin: 16px 0;
  padding: 20px;
  text-align: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Service grid mobile */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 20px 0;
}

/* Why us section mobile */
.whyus {
  width: 100%;
  margin: 16px 0;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Banner mobile */
#banners, #banner {
  padding: 60px 16px 40px 16px;
  text-align: center;
  background-size: cover;
  background-position: center;
  min-height: 50vh;
}

#banners h1, #banner h1 {
  font-size: clamp(24px, 6vw, 48px);
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

#banners p, #banner p {
  font-size: clamp(16px, 4vw, 20px);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Typography mobile */
h1 { font-size: clamp(28px, 5vw, 48px); }
h2 { font-size: clamp(24px, 4vw, 36px); }
h3 { font-size: clamp(20px, 3vw, 28px); }
h4 { font-size: clamp(18px, 2.5vw, 24px); }

p {
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Form elements mobile */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Tablet styles */
@media (min-width: 768px) {
  .container, .containers {
    padding: 0 32px;
  }
  
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .ser-icon, .col-md-3.ser-icon {
    width: calc(50% - 12px);
    display: inline-block;
    vertical-align: top;
    margin: 12px 6px;
  }
  
  .whyus {
    width: calc(50% - 16px);
    display: inline-block;
    vertical-align: top;
    margin: 8px;
  }
  
  .mobile-nav-toggle {
    display: none;
  }
}

/* Desktop styles */
@media (min-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
  
  .ser-icon, .col-md-3.ser-icon {
    width: calc(25% - 18px);
    margin: 12px 9px;
  }
  
  .whyus {
    width: calc(33.333% - 16px);
  }
  
  #banners, #banner {
    padding: 120px 0 80px 0;
    min-height: 70vh;
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  .container, .containers {
    padding: 0 40px;
  }
}

/* Cross-browser prefixes */
.transform {
  -webkit-transform: translateY(-8px);
  -moz-transform: translateY(-8px);
  -ms-transform: translateY(-8px);
  transform: translateY(-8px);
}

.transition {
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.border-radius {
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
}

.box-shadow {
  -webkit-box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  -moz-box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* IE11 fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .service-grid {
    display: -ms-grid;
    -ms-grid-columns: 1fr;
  }
  
  .flex-container {
    display: -ms-flexbox;
  }
}

/* Safari fixes */
@supports (-webkit-appearance: none) {
  input, textarea, select {
    -webkit-appearance: none;
  }
}

/* Firefox fixes */
@-moz-document url-prefix() {
  .service-grid {
    display: -moz-grid;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .no-print {
    display: none !important;
  }
}