/* ==========================================================================
   AutoDrive - Responsive Media Queries & Mobile Polish
   Ensures 0 horizontal overflow and flawless mobile / tablet / desktop layouts
   ========================================================================== */

/* Prevent horizontal scroll globally */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* --------------------------------------------------------------------------
   Breakpoints: Large Desktop & Laptops (< 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  
  .details-layout {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
  }

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

/* --------------------------------------------------------------------------
   Breakpoints: Tablets & Below (< 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Show hamburger, hide desktop links & CTA in header */
  .nav-links {
    display: none;
  }

  .nav-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

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

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1.5rem;
  }

  .stat-item:nth-child(3),
  .stat-item:nth-child(4) {
    border-bottom: none;
    padding-bottom: 0;
  }

  .about-story-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .details-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .vehicle-details-panel {
    position: static;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .features-cat-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Breakpoints: Mobile & iPhone (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --navbar-height: 72px;
  }

  .site-header {
    padding: 1rem 0;
  }

  .site-header.scrolled {
    padding: 0.75rem 0;
  }

  .hero-content {
    padding: 3rem 1rem 5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-desc {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

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

  .hero-scroll-indicator {
    display: none;
  }

  .vehicles-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .about-mission-grid {
    grid-template-columns: 1fr;
  }

  .filter-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-select-wrapper {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  /* Table responsive wrapper */
  .spec-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spec-table th,
  .spec-table td {
    padding: 0.85rem 1rem;
    font-size: 0.825rem;
  }

  .modal-dialog {
    margin: 1rem;
    max-height: 85vh;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .modal-header {
    padding: 1.25rem;
  }

  .toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  .gallery-thumbnails-row {
    gap: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   Small Mobile (< 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2.15rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
  }

  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .vehicle-specs-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .details-quick-specs {
    grid-template-columns: 1fr;
  }

  .details-panel-price {
    font-size: 1.95rem;
  }
}
