/* ============================================
   Responsive Styles
   Dependable Auto Repair Website
   Mobile First Approach
   ============================================ */

/* ==================== Base Mobile Styles (320px - 767px) ==================== */
/* These are the default styles, no media query needed */

/* ==================== Tablet Styles (768px - 1023px) ==================== */

@media (min-width: 768px) {
  /* Typography */
  h1 {
    font-size: var(--font-size-5xl);
  }
  
  h2 {
    font-size: var(--font-size-4xl);
  }
  
  h3 {
    font-size: var(--font-size-3xl);
  }
  
  /* Container */
  .container {
    padding-left: var(--container-padding-tablet);
    padding-right: var(--container-padding-tablet);
  }
  
  /* Grid */
  .grid-cols-2-md {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .grid-cols-3-md {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  /* Header */
  .header-container {
    min-height: var(--height-header);
  }
  
  /* Hero */
  .hero {
    min-height: 500px;
  }
  
  .hero h1 {
    font-size: var(--font-size-5xl);
  }
  
  /* Service Cards */
  .service-card-image {
    height: 220px;
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Before/After */
  .before-after {
    gap: var(--spacing-6);
  }
  
  /* Process Steps */
  .process-steps {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== Desktop Styles (1024px+) ==================== */

@media (min-width: 1024px) {
  /* Typography */
  h1 {
    font-size: var(--font-size-6xl);
  }
  
  /* Container */
  .container {
    padding-left: var(--container-padding-desktop);
    padding-right: var(--container-padding-desktop);
  }
  
  /* Grid */
  .grid-cols-2-lg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .grid-cols-3-lg {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .grid-cols-4-lg {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  
  /* Hero */
  .hero {
    min-height: 600px;
  }
  
  .hero h1 {
    font-size: var(--font-size-6xl);
  }
  
  /* Service Cards */
  .service-card-image {
    height: 240px;
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Process Steps */
  .process-steps {
    grid-template-columns: repeat(5, 1fr);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Two Column Layout */
  .two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-12);
    align-items: start;
  }
}

/* ==================== Large Desktop (1280px+) ==================== */

@media (min-width: 1280px) {
  /* Section spacing */
  .section {
    padding-top: var(--spacing-20);
    padding-bottom: var(--spacing-20);
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==================== Mobile Specific Styles ==================== */

@media (max-width: 767px) {
  /* Typography */
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
  
  h3 {
    font-size: var(--font-size-xl);
  }
  
  /* Header */
  .header-container {
    min-height: var(--height-header-mobile);
  }
  
  .logo {
    font-size: var(--font-size-lg);
  }
  
  /* Navigation */
  .nav-menu {
    position: fixed;
    top: var(--height-header-mobile);
    left: 0;
    right: 0;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--spacing-4);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    max-height: calc(100vh - var(--height-header-mobile));
    overflow-y: auto;
  }
  
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-item {
    border-bottom: 1px solid var(--color-gray-200);
  }
  
  .nav-link {
    display: block;
    padding: var(--spacing-4);
  }
  
  .nav-link::after {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .header-cta {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-2);
  }
  
  .header-cta .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Hero */
  .hero {
    min-height: 500px;
    margin-top: var(--height-header-mobile);
  }
  
  .hero h1 {
    font-size: var(--font-size-3xl);
  }
  
  .hero p {
    font-size: var(--font-size-lg);
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Sections */
  .section {
    padding-top: var(--spacing-12);
    padding-bottom: var(--spacing-12);
  }
  
  .section-hero {
    padding-top: var(--spacing-16);
    padding-bottom: var(--spacing-16);
  }
  
  /* Grid */
  .grid {
    gap: var(--spacing-4);
  }
  
  /* Cards */
  .card-body {
    padding: var(--spacing-4);
  }
  
  /* Service Cards */
  .service-card-content {
    padding: var(--spacing-4);
  }
  
  .service-card-footer {
    padding: var(--spacing-3) var(--spacing-4);
  }
  
  /* Before/After */
  .before-after {
    grid-template-columns: 1fr;
    gap: var(--spacing-2);
  }
  
  /* Process Steps */
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }
  
  /* CTA Section */
  .cta-section {
    padding: var(--spacing-12) var(--spacing-4);
  }
  
  .cta-section h2 {
    font-size: var(--font-size-3xl);
  }
  
  .cta-section p {
    font-size: var(--font-size-lg);
  }
  
  /* Contact Info */
  .contact-info-box {
    padding: var(--spacing-6);
  }
  
  /* Map */
  .map-container {
    height: 300px;
  }
  
  /* Footer */
  .footer {
    padding-top: var(--spacing-12);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }
  
  .footer-legal-links {
    flex-direction: column;
    gap: var(--spacing-3);
  }
  
  /* Page Header */
  .page-header {
    padding: var(--spacing-16) 0 var(--spacing-8);
    margin-top: var(--height-header-mobile);
  }
  
  .page-header h1 {
    font-size: var(--font-size-3xl);
  }
  
  .page-header p {
    font-size: var(--font-size-lg);
  }
  
  /* Legal Content */
  .legal-content {
    padding: var(--spacing-8) var(--spacing-4);
  }
  
  /* Buttons */
  .btn-large {
    padding: var(--spacing-3) var(--spacing-6);
    font-size: var(--font-size-base);
  }
  
  /* Stats */
  .stat-number {
    font-size: var(--font-size-4xl);
  }
  
  .stat-label {
    font-size: var(--font-size-base);
  }
  
  /* Section Header */
  .section-header h2 {
    font-size: var(--font-size-3xl);
  }
  
  .section-header p {
    font-size: var(--font-size-base);
  }
}

/* ==================== Small Mobile (320px - 479px) ==================== */

@media (max-width: 479px) {
  /* Typography */
  h1 {
    font-size: var(--font-size-2xl);
  }
  
  h2 {
    font-size: var(--font-size-xl);
  }
  
  /* Container */
  .container {
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
  }
  
  /* Hero */
  .hero h1 {
    font-size: var(--font-size-2xl);
  }
  
  .hero p {
    font-size: var(--font-size-base);
  }
  
  /* Buttons */
  .btn {
    padding: var(--spacing-2-5) var(--spacing-4);
    font-size: var(--font-size-sm);
  }
  
  /* Gallery */
  .gallery {
    grid-template-columns: 1fr;
  }
  
  /* CTA Section */
  .cta-section h2 {
    font-size: var(--font-size-2xl);
  }
  
  .cta-section p {
    font-size: var(--font-size-base);
  }
}

/* ==================== Tablet Portrait (768px - 1023px) ==================== */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Navigation */
  .nav-menu {
    gap: var(--spacing-4);
  }
  
  /* Hero */
  .hero-buttons {
    flex-direction: row;
  }
  
  /* Service Cards */
  .service-card-image {
    height: 200px;
  }
}

/* ==================== Print Styles ==================== */

@media print {
  /* Hide non-essential elements */
  .header,
  .footer,
  .nav-menu,
  .mobile-menu-toggle,
  .btn,
  .cookie-banner,
  .hero-buttons,
  .cta-section {
    display: none !important;
  }
  
  /* Adjust layout */
  .hero,
  .page-header {
    margin-top: 0;
    padding: var(--spacing-8) 0;
  }
  
  /* Ensure content is visible */
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1 {
    font-size: 24pt;
  }
  
  h2 {
    font-size: 20pt;
  }
  
  h3 {
    font-size: 16pt;
  }
  
  /* Avoid page breaks inside elements */
  .card,
  .service-card,
  .feature-box,
  .process-step {
    page-break-inside: avoid;
  }
  
  /* Show URLs for links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
  
  /* Remove shadows and transitions */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    transition: none !important;
  }
}

/* ==================== Landscape Orientation ==================== */

@media (orientation: landscape) and (max-height: 500px) {
  /* Reduce hero height on landscape mobile */
  .hero {
    min-height: 400px;
  }
  
  .page-header {
    padding: var(--spacing-8) 0 var(--spacing-6);
  }
}

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

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for retina displays */
  /* This would be handled in HTML with srcset */
}

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

@media (prefers-reduced-motion: reduce) {
  /* Remove animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero::before {
    animation: none;
  }
}

/* ==================== Dark Mode (Optional - for future) ==================== */

@media (prefers-color-scheme: dark) {
  /* Dark mode styles would go here if needed */
  /* Currently not implemented as per requirements */
}

/* ==================== Container Queries (Future Enhancement) ==================== */

/* Container queries for more granular responsive design */
/* Not widely supported yet, but included for future use */

@supports (container-type: inline-size) {
  .card-container {
    container-type: inline-size;
  }
  
  @container (min-width: 400px) {
    .card {
      display: grid;
      grid-template-columns: 150px 1fr;
    }
  }
}
