/* Responsive Fixes - Centered Mobile-like Layout for All Screens */

/* Reset and base */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* MAIN CHANGE: Center everything like mobile on all screens */
.container,
main,
section > div:first-child,
[class*="container"],
[class*="wrapper"] {
  max-width: 800px !important; /* Mobile-like width on all screens */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

/* Hero sections can be wider for visual impact */
header,
.hero,
[class*="hero"],
section:first-of-type {
  max-width: 100% !important;
}

header .container,
.hero .container,
[class*="hero"] .container {
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Consistent spacing across all devices */
section {
  padding: 3rem 1.5rem !important;
}

/* Typography - consistent across screens */
h1, .hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem) !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
  text-align: center !important;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem) !important;
}

p {
  font-size: clamp(0.95rem, 2vw, 1.1rem) !important;
  line-height: 1.7 !important;
}

/* Buttons - mobile style on all screens */
button, .button, .btn, a.btn {
  display: block !important;
  width: 100% !important;
  max-width: 400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 1rem 2rem !important;
  font-size: 1rem !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.button-group,
.btn-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  align-items: center !important;
  max-width: 400px !important;
  margin: 0 auto !important;
}

/* Services/Cards Grid - Single column like mobile */
.services-grid,
.card-grid,
.grid,
[class*="grid"] {
  display: grid !important;
  grid-template-columns: 1fr !important; /* Always single column */
  gap: 2rem !important;
  max-width: 600px !important;
  margin: 0 auto !important;
}

/* Cards styling */
.card,
.service-card,
[class*="card"] {
  max-width: 100% !important;
  margin: 0 auto !important;
}

/* Images - centered and responsive */
img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Forms - centered */
form {
  width: 100% !important;
  max-width: 500px !important;
  margin: 0 auto !important;
}

form input,
form textarea,
form select {
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 16px !important; /* Prevents zoom on iOS */
}

/* Navigation - mobile style */
nav {
  max-width: 100% !important;
  padding: 1rem !important;
}

nav ul {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 1rem !important;
  list-style: none !important;
  padding: 0 !important;
}

/* Text alignment - center everything */
section,
.section {
  text-align: center !important;
}

/* Footer */
footer {
  text-align: center !important;
  padding: 2rem 1rem !important;
}

footer .container {
  max-width: 600px !important;
}

/* Prevent horizontal scroll */
*, *::before, *::after {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* Better line height */
p, li {
  line-height: 1.7 !important;
}

/* Links */
a {
  text-decoration: none !important;
}

a:hover {
  opacity: 0.8 !important;
}

/* Focus states for accessibility */
:focus-visible {
  outline: 2px solid #00e1ff !important;
  outline-offset: 2px !important;
}

/* Smooth transitions */
* {
  transition: opacity 0.2s ease !important;
}

button, .button, .btn {
  transition: all 0.3s ease !important;
}

/* Contact section specific */
.contact,
[class*="contact"] {
  max-width: 600px !important;
  margin: 0 auto !important;
}

/* Social links */
.social-links,
[class*="social"] {
  display: flex !important;
  justify-content: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

/* Photo upload preview */
.photo-preview-container {
  display: flex !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

/* Desktop specific adjustments (optional wider margins) */
@media (min-width: 1200px) {
  section {
    padding: 4rem 2rem !important;
  }
  
  .container,
  main {
    max-width: 900px !important; /* Slightly wider on large screens */
  }
}

/* Tablet - still centered */
@media (min-width: 768px) and (max-width: 1199px) {
  .container,
  main {
    max-width: 700px !important;
  }
}

/* Mobile refinements */
@media (max-width: 767px) {
  section {
    padding: 2rem 1rem !important;
  }
  
  .container,
  main {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* Print styles */
@media print {
  nav, footer, .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  * {
    max-width: 100% !important;
  }
}

/* Animation performance */
* {
  animation-fill-mode: backwards !important;
}

/* Remove any conflicting max-widths from original styles */
[style*="max-width"] {
  max-width: 800px !important;
}
