/* ==========================================================================
   Peters Safety Kwik – Responsive
   Mobile-first adjustments layered on style.css
   ========================================================================== */

@media (max-width: 1100px) {
  .why-grid,
  .services-grid,
  .fleet-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 900px) {
  :root {
    --header-h: 70px;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.5rem;
    gap: 0.5rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  }

  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .primary-nav a {
    display: block;
    padding: 0.85rem 0.9rem;
    font-size: 1rem;
  }

  .btn-nav {
    text-align: center;
    margin-top: 0.5rem;
  }

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

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

  .emergency-inner {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .hero {
    min-height: min(88vh, 700px);
  }

  .hero-content {
    padding: 4rem 0 3.5rem;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 64px; /* room for mobile emergency bar */
  }

  .why-grid,
  .services-grid,
  .fleet-grid,
  .gallery-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .float-actions {
    right: 0.85rem;
    bottom: 5.2rem;
  }

  .float-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .float-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .mobile-emergency {
    display: block;
  }

  .back-to-top {
    bottom: 5.2rem;
    left: 0.85rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 42px;
    height: 42px;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .contact-actions {
    flex-direction: column;
  }

  .contact-actions .btn {
    width: 100%;
  }

  .section-header {
    margin-bottom: 2rem;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Large / ultra-wide */
@media (min-width: 1600px) {
  :root {
    --container: 1280px;
  }

  .hero {
    min-height: min(90vh, 900px);
  }
}
