/*
================================================================================
STAR OLD SPARE PARTS — MOBILE-FIRST RESPONSIVE ARCHITECTURE (responsive.css)
================================================================================
Breakpoints:
1. MOBILE PHONES (320px - 767px) -> Single column stack, 16px container padding, 44px touch targets
2. TABLETS & IPADS (768px - 1023px) -> 2-column grid, 24px container padding
3. DESKTOPS & LAPTOPS (1024px+) -> 3-4 column grid, 32px container padding, 1240px max-width
================================================================================
*/

/* 1. VIEWPORT & BASE SAFETY */
*,
*::before,
*::after {
  box-sizing: border-box !important;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

:root {
  --font-h1: clamp(1.9rem, 7vw, 3.5rem);
  --font-h2: clamp(1.5rem, 4.5vw, 2.75rem);
  --font-body: clamp(0.95rem, 0.35vw + 0.85rem, 1.125rem);
  --section-pad-y: clamp(3.25rem, 7vw, 7rem);
}

body, p {
  font-size: var(--font-body);
  line-height: 1.6;
}

h1, .hero-title {
  font-size: var(--font-h1);
  line-height: 1.16;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h2, .section-title {
  font-size: var(--font-h2);
  line-height: 1.25;
  word-wrap: break-word;
}

.section-block {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

/* Minimum 44px Touch Target Size for Accessibility */
a, button, input, select, textarea, .btn, .nav-link, .part-chip {
  min-height: 44px;
  touch-action: manipulation;
  font-size: 16px; /* Prevents iOS auto-zoom on input focus */
}

/* Container Paddings */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Responsive Images & Media */
img, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}

/* Smooth Scrolling Anchor Offsets */
section[id], div[id] {
  scroll-margin-top: 85px;
}

/* ==========================================================================
   MOBILE PHONES STACKING (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Hero single column stack order */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
  }

  .hero-visual {
    order: 5; /* Hero image below text & buttons */
    width: 100%;
  }

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

  .hero-cta-group .specular-btn,
  .hero-cta-group .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Grid Layouts Stacked */
  .trust-bar-grid,
  .parts-grid,
  .godowns-grid,
  .steps-grid,
  .gallery-grid,
  .contact-grid,
  .footer-top-grid,
  .form-grid,
  .preference-options,
  .about-grid,
  .scrap-cars-grid,
  .why-us-grid,
  .reviews-grid,
  .showcase-final-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Footer stack */
  .footer-top-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

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

  /* Table / Wide Container Horizontal Scroll */
  .table-responsive-container,
  .cinematic-horizontal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Mobile Floating Action Bar */
  .mobile-floating-actions {
    display: flex;
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    right: 16px;
    z-index: 999;
    gap: 10px;
  }

  .mobile-float-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    min-height: 44px;
    transition: transform 0.2s ease;
  }

  .mobile-float-btn:active {
    transform: scale(0.95);
  }

  .float-call {
    background: #2563EB;
  }

  .float-wa {
    background: #16A34A;
  }
}

@media (min-width: 768px) {
  .mobile-floating-actions {
    display: none !important;
  }
}

/* ==========================================================================
   TABLETS & IPADS (768px - 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-grid,
  .about-grid,
  .scrap-cars-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
  }

  .parts-grid,
  .godowns-grid,
  .steps-grid,
  .gallery-grid,
  .why-us-grid,
  .footer-top-grid,
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

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

/* ==========================================================================
   DESKTOPS & LARGE DISPLAYS (1024px+)
   ========================================================================== */
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 3rem !important;
  }

  .parts-grid,
  .godowns-grid,
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.75rem !important;
  }

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

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

  .about-grid,
  .scrap-cars-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
  }
}

/* Disable Hover-Only Transform Effects on Touch Devices */
@media (hover: none) {
  .btn:hover,
  .part-card:hover,
  .godown-card:hover,
  .spotlight-card:hover {
    transform: none !important;
  }
}
