/* ==========================================================================
   All American Spa Repair Services - Responsive Design
   Mobile-first responsive breakpoints and media queries
   ========================================================================== */

/* ==========================================================================
   Breakpoint Reference
   - Mobile: Default (< 640px)
   - Tablet: 640px - 1023px
   - Desktop: 1024px - 1279px
   - Large Desktop: 1280px+
   ========================================================================== */

/* ==========================================================================
   Small Tablets and Large Phones (640px and up)
   ========================================================================== */

@media (min-width: 640px) {
  /* Typography Scaling */
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .section-title {
    font-size: var(--text-4xl);
  }

  /* Grid Layouts */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hero Section */
  .hero {
    padding: var(--space-24) 0;
  }

  .hero-cta {
    justify-content: flex-start;
  }

  /* Container Padding */
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  /* Button Groups */
  .hero-cta .btn {
    flex: 0 0 auto;
  }
}

/* ==========================================================================
   Tablets (768px and up)
   ========================================================================== */

@media (min-width: 768px) {
  /* Typography */
  .hero-title {
    font-size: var(--text-6xl);
  }

  /* Grid Layouts */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Navigation - Show desktop nav */
  .main-nav {
    display: block;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }

  /* Footer Grid */
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cards */
  .card-body {
    padding: var(--space-8);
  }

  /* Forms */
  .contact-form,
  .quote-form {
    padding: var(--space-10);
  }

  /* Section Spacing */
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .section-lg {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }
}

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

@media (min-width: 1024px) {
  /* Container Padding */
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  /* Grid Layouts */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer Grid */
  .footer-top {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hero Section */
  .hero {
    min-height: 600px;
    display: flex;
    align-items: center;
  }

  /* Two Column Layouts */
  .two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
  }

  /* Service Cards - Hover Effects Enhanced */
  .service-card:hover {
    transform: translateY(-8px);
  }

  /* Navigation Spacing */
  .nav-list {
    gap: var(--space-8);
  }

  /* Section Spacing */
  .section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }
}

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

@media (min-width: 1280px) {
  /* Typography - Maximum sizes */
  .hero-title {
    font-size: 4rem;
  }

  h1 {
    font-size: var(--text-6xl);
  }

  /* Hero Section */
  .hero-content {
    max-width: 900px;
  }

  /* Grid Gaps */
  .grid-2,
  .grid-3,
  .grid-4 {
    gap: var(--space-8);
  }
}

/* ==========================================================================
   Extra Large Screens (1536px and up)
   ========================================================================== */

@media (min-width: 1536px) {
  /* Container max width enforced */
  .container {
    max-width: var(--container-2xl);
  }
}

/* ==========================================================================
   Print Specific Responsive Adjustments
   ========================================================================== */

@media print {
  /* Hide navigation and non-essential elements */
  .site-header,
  .mobile-menu-toggle,
  .site-footer,
  .btn,
  .hero-cta {
    display: none;
  }

  /* Ensure good contrast */
  body {
    color: #000;
    background: #fff;
  }

  /* Page breaks */
  .section {
    page-break-inside: avoid;
  }

  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ==========================================================================
   Reduced Motion (Accessibility)
   ========================================================================== */

@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;
  }

  /* Disable pulse animation for emergency button */
  .btn-emergency {
    animation: none;
  }
}

/* ==========================================================================
   Dark Mode Support (Future Enhancement)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  /* Reserved for future dark mode implementation */
  /* Currently maintaining light theme for trust and professionalism */
}

/* ==========================================================================
   Landscape Orientation Adjustments (Mobile)
   ========================================================================== */

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: var(--space-12) 0;
    min-height: auto;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }

  .nav-link,
  .mobile-nav-link {
    padding: var(--space-4);
  }

  .form-input,
  .form-textarea,
  .form-select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .service-card:hover .service-icon {
    transform: none;
  }

  /* Disable dropdown hover - use click instead */
  .nav-dropdown:hover .dropdown-menu {
    opacity: 0;
    visibility: hidden;
  }
}

/* ==========================================================================
   High DPI Displays (Retina)
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimizations for high-resolution displays */
  /* Ensure crisp rendering of borders and lines */
  .card,
  .btn,
  .form-input,
  .form-textarea,
  .form-select {
    border-width: 1px;
  }
}

/* ==========================================================================
   Specific Component Responsive Adjustments
   ========================================================================== */

/* Service Cards - Stacking on Mobile */
@media (max-width: 639px) {
  .service-card {
    padding: var(--space-6);
  }

  .service-icon {
    width: 56px;
    height: 56px;
    font-size: var(--text-2xl);
  }
}

/* Footer - Mobile Stacking */
@media (max-width: 767px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-column {
    text-align: center;
  }

  .footer-contact-item {
    justify-content: center;
  }
}

/* Hero - Mobile Optimizations */
@media (max-width: 767px) {
  .hero {
    padding: var(--space-16) 0;
    text-align: center;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

/* Navigation Dropdown - Mobile Alternative */
@media (max-width: 767px) {
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0;
    margin-top: var(--space-2);
  }

  .dropdown-item {
    padding: var(--space-3);
  }
}

/* Forms - Mobile Optimizations */
@media (max-width: 639px) {
  .form-group {
    margin-bottom: var(--space-4);
  }

  .contact-form,
  .quote-form {
    padding: var(--space-6);
  }
}

/* Testimonial Cards - Mobile */
@media (max-width: 639px) {
  .testimonial-card {
    padding: var(--space-6);
  }

  .testimonial-quote {
    font-size: var(--text-base);
  }

  .testimonial-quote::before {
    font-size: var(--text-4xl);
  }
}

/* Section Headers - Mobile */
@media (max-width: 639px) {
  .section-header {
    margin-bottom: var(--space-8);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-description {
    font-size: var(--text-base);
  }
}

/* Trust Badges - Mobile Stacking */
@media (max-width: 639px) {
  .trust-badge {
    flex-direction: column;
    text-align: center;
  }
}

/* Emergency Button - Always Prominent on Mobile */
@media (max-width: 767px) {
  .btn-emergency {
    width: 100%;
    justify-content: center;
    font-size: var(--text-lg);
    padding: var(--space-5);
  }
}

/* Click-to-Call - Enhanced on Mobile */
@media (max-width: 767px) {
  .btn-call {
    width: 100%;
    font-size: var(--text-lg);
  }

  .btn-call::before {
    font-size: var(--text-2xl);
  }
}
