/* Mobile Optimization CSS for AC Repair Location Pages */

/* Mobile-First Base Styles */
:root {
  --touch-target-size: 44px;
  --mobile-padding: 16px;
  --mobile-font-base: 16px;
  --mobile-line-height: 1.6;
  --mobile-header-height: 60px;
}

/* Ensure no horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Optimize for mobile viewport */
@media (max-width: 768px) {
  /* Touch-friendly tap targets */
  a, button, .btn, input, select, textarea {
    min-height: var(--touch-target-size);
    min-width: var(--touch-target-size);
    padding: 12px 16px;
  }

  /* Mobile Typography Optimization */
  body {
    font-size: var(--mobile-font-base);
    line-height: var(--mobile-line-height);
  }

  h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 20px !important;
    line-height: 1.4 !important;
  }

  p, li {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }

  /* Mobile Header Optimization */
  header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: auto;
    min-height: var(--mobile-header-height);
  }
  
  /* Fix header layout on mobile */
  header .flex {
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
  }
  
  /* Adjust logo size on mobile */
  header img {
    height: 40px !important;
    width: auto !important;
    margin-right: 8px !important;
  }
  
  /* Ensure menu button is visible */
  #mobile-menu-btn {
    display: block !important;
    padding: 8px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  /* Add padding to body to account for fixed header */
  body {
    padding-top: 70px !important;
  }

  /* Mobile Navigation Enhancement */
  #mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 16px !important;
  }

  /* Override Tailwind's hidden class when menu should be visible */
  #mobile-menu:not(.hidden) {
    display: block !important;
  }

  /* Mobile Call Button Enhancement - DISABLED (using floating-contact-widget.js instead) */
  /* .mobile-call-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #EA580C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
    z-index: 1000;
    animation: pulse 2s infinite;
  } */

  /* @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  } */

  /* Hero Section Mobile Optimization */
  .hero-section {
    min-height: 100vh !important;
    padding: 20px var(--mobile-padding) !important;
    display: flex;
    align-items: center;
  }

  .hero-section h1 {
    font-size: 32px !important;
    margin-bottom: 20px !important;
  }

  .hero-section p {
    font-size: 18px !important;
    margin-bottom: 24px !important;
  }

  /* Mobile Button Optimization */
  .btn-primary, .btn-secondary {
    width: 100%;
    font-size: 18px !important;
    padding: 16px 24px !important;
    margin-bottom: 12px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
  }

  /* Service Cards Mobile Layout */
  .service-card {
    margin-bottom: 20px;
    padding: 20px !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  /* Mobile Form Optimization */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    width: 100% !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 14px !important;
    border-radius: 8px !important;
    border: 2px solid #e5e7eb !important;
    margin-bottom: 16px !important;
  }

  input:focus,
  select:focus,
  textarea:focus {
    outline: none !important;
    border-color: #1E40AF !important;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1) !important;
  }

  /* Mobile Grid Optimization */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Mobile Image Optimization */
  img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* Mobile Table Scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 100%;
  }

  /* Mobile Spacing Adjustments */
  section {
    padding: 40px var(--mobile-padding) !important;
  }

  .container,
  .max-w-7xl {
    padding-left: var(--mobile-padding) !important;
    padding-right: var(--mobile-padding) !important;
  }

  /* Reviews Section Mobile */
  .review-card {
    padding: 16px !important;
    margin-bottom: 16px !important;
  }

  /* FAQ Accordion Mobile */
  .faq-item {
    margin-bottom: 12px !important;
  }

  .faq-question {
    padding: 16px !important;
    font-size: 16px !important;
  }

  .faq-answer {
    padding: 16px !important;
    font-size: 15px !important;
  }

  /* Mobile Loading Optimization */
  .lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
  }

  .lazy-load.loaded {
    opacity: 1;
  }

  /* Mobile Touch Feedback */
  a:active,
  button:active,
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  /* Mobile Sticky CTA Bar - DISABLED (using floating-contact-widget.js instead) */
  /* .mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px var(--mobile-padding);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    z-index: 998;
  } */

  /* .mobile-sticky-cta .btn {
    flex: 1;
    margin: 0 !important;
  } */

  /* Hide desktop elements on mobile */
  .desktop-only {
    display: none !important;
  }

  /* Show mobile elements */
  .mobile-only {
    display: block !important;
  }

  /* Mobile Modal Optimization */
  .modal {
    padding: 20px !important;
  }

  .modal-content {
    width: 100% !important;
    margin: 20px 0 !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Mobile Swipe Indicators */
  .swipe-indicator {
    display: flex;
    justify-content: center;
    padding: 8px;
    gap: 8px;
  }

  .swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.3s;
  }

  .swipe-dot.active {
    background: #1E40AF;
    width: 24px;
    border-radius: 4px;
  }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 24px;
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  h1 {
    font-size: 36px !important;
  }

  h2 {
    font-size: 28px !important;
  }
}

/* Small Screen Optimization (very small phones) */
@media (max-width: 375px) {
  :root {
    --mobile-padding: 12px;
    --mobile-font-base: 14px;
  }

  h1 {
    font-size: 24px !important;
  }

  h2 {
    font-size: 20px !important;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 16px !important;
    padding: 14px 20px !important;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: auto !important;
    padding: 40px var(--mobile-padding) !important;
  }

  header {
    height: 50px;
  }

  body {
    padding-top: 50px;
  }

  #mobile-menu {
    top: 50px;
    max-height: calc(100vh - 50px);
  }
}

/* Performance Optimizations */
@media (max-width: 768px) {
  /* Disable animations on mobile for better performance */
  * {
    animation-duration: 0.3s !important;
  }

  /* Optimize scrolling performance */
  .scroll-container {
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
  }

  /* Reduce shadows for better performance */
  .shadow-lg {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  }

  .shadow-xl {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
  }
}

/* Accessibility Improvements for Mobile */
@media (max-width: 768px) {
  /* Ensure sufficient color contrast */
  .text-gray-600 {
    color: #4b5563 !important;
  }

  /* Focus indicators for mobile */
  *:focus {
    outline: 2px solid #1E40AF !important;
    outline-offset: 2px !important;
  }

  /* Skip navigation link for screen readers */
  .skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1E40AF;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
  }

  .skip-nav:focus {
    top: 0;
  }
}

/* Print styles for mobile */
@media print {
  header,
  footer,
  /* .mobile-sticky-cta,
  .mobile-call-btn, */
  #mobile-menu {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }
}/* Emergency Mobile Fixes */
@media (max-width: 768px) {
  /* Fix header container */
  header > div {
    padding: 8px 12px !important;
  }
  
  /* Fix logo and text alignment */
  header .flex:first-child {
    justify-content: space-between !important;
    width: 100% !important;
  }
  
  /* Smaller text on mobile */
  .text-lg {
    font-size: 16px !important;
  }
  
  .text-base {
    font-size: 14px !important;
  }
  
  .text-sm {
    font-size: 12px !important;
  }
  
  /* Fix promotional banner on mobile */
  .bg-red-600 {
    padding: 12px 16px !important;
    min-height: auto !important;
  }
  
  /* Fix gift icon and main text alignment */
  .bg-red-600 .flex.items-center {
    gap: 10px !important;
    margin-bottom: 6px !important;
    align-items: center !important;
  }
  
  .bg-red-600 .fa-gift {
    font-size: 20px !important;
    flex-shrink: 0;
  }
  
  .bg-red-600 .text-lg {
    font-size: 15px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
  }
  
  .bg-red-600 .text-sm {
    font-size: 12px !important;
    line-height: 1.4 !important;
    padding-left: 30px !important; /* Align with text above */
    opacity: 0.95 !important;
  }
  
  /* Fix hero section padding */
  .py-20 {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
  
  /* Ensure mobile menu items are properly sized */
  #mobile-menu a {
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
