/* ============================================
   Franklin Mechanical Systems - Responsive Styles
   Mobile-First Approach
   ============================================ */

/* ============================================
   Tablet Styles (768px and up)
   ============================================ */

@media (max-width: 1023px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  /* Typography */
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  h3 {
    font-size: 1.75rem;
  }
  
  /* Hero */
  .hero {
    min-height: 600px;
  }
  
  .hero h1 {
    font-size: 3.5rem;
  }
  
  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Desktop Styles (1024px and up)
   ============================================ */

@media (min-width: 1024px) {
  /* Typography */
  h1 {
    font-size: 3.5rem;
  }
  
  .hero h1 {
    font-size: 4rem;
  }
  
  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   Mobile Styles (767px and below)
   ============================================ */

@media (max-width: 767px) {
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  /* Header */
  .header-top .container {
    flex-direction: column;
    text-align: center;
  }
  
  .header-contact {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  .logo img {
    height: 50px;
  }
  
  /* Navigation */
  .nav-toggle {
    display: block;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-white);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }
  
  .main-nav.active {
    max-height: 500px;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--spacing-md);
  }
  
  .main-nav li {
    width: 100%;
  }
  
  .main-nav a {
    display: block;
    padding: var(--spacing-sm);
    border-radius: 0;
  }
  
  /* Hero */
  .hero {
    min-height: 400px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  /* Buttons */
  .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  /* Contact */
  .map-container {
    height: 300px;
  }
  
  /* Spacing adjustments */
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
}

/* ============================================
   Small Mobile (480px and below)
   ============================================ */

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .hero {
    min-height: 350px;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .btn-large {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
  }
}

/* ============================================
   Large Desktop (1440px and up)
   ============================================ */

@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
  
  .hero {
    min-height: 700px;
  }
}

/* ============================================
   Landscape Mobile
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 400px;
  }
}

/* ============================================
   High DPI Displays
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays */
  .logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Can be implemented if needed */
}
