/* ==========================================================================
   Responsive Overrides
   Mobile-first: base styles in components.css already target small screens.
   This file holds breakpoint-specific adjustments only, added per section.

   Breakpoints:
     --bp-sm: 480px  (large phones)
     --bp-md: 768px  (tablets)
     --bp-lg: 1024px (small laptops)
     --bp-xl: 1280px (desktop)
   ========================================================================== */

/* ---- Navigation: mobile (<768px) ---- */
@media (max-width: 768px) {
  .site-header__actions .btn--ghost,
  .site-header__actions .btn--primary {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: 76px 0 0 0;
    z-index: 40;
    background-color: var(--color-paper);
    padding: var(--space-4) var(--container-pad) calc(var(--space-7) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    transition: transform var(--duration-base) var(--ease-out),
                visibility 0s linear var(--duration-base);
  }

  .nav.nav--open {
    visibility: visible;
    transform: translateY(0);
    transition: transform var(--duration-base) var(--ease-out);
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .nav__link {
    font-size: var(--fs-body-lg);
  }

  /* Persistent bottom CTA bar replaces the header buttons on mobile */
  .mobile-cta-bar {
    display: flex;
  }

  /* Leaves room so the fixed bottom bar never covers the footer/last section */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- Hero: tablet and below (<1024px) ---- */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__content {
    order: 1;
  }

  .hero__visual {
    order: 2;
    margin-top: var(--space-4);
  }

  .hero__title,
  .hero__subtitle {
    max-width: none;
  }
}

/* ---- Hero: small phones (<480px) ---- */
@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
  }
}

/* ---- Advantages: tablet (<1024px) ---- */
@media (max-width: 1024px) {
  .advantages__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Advantages: phone (<640px) ---- */
@media (max-width: 640px) {
  .advantages__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- What We Buy: tablet (<1024px) ---- */
@media (max-width: 1024px) {
  .buy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- What We Buy: phone (<640px) ---- */
@media (max-width: 640px) {
  .buy-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Tow Truck: phone/tablet (<768px) ---- */
@media (max-width: 768px) {
  .tow-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- How It Works: phone (<480px) ---- */
@media (max-width: 480px) {
  .step {
    grid-template-columns: 44px 1fr;
    gap: var(--space-2);
    padding-bottom: var(--space-4);
  }

  .step__marker::after {
    bottom: calc(-1 * var(--space-4));
  }
}

/* ---- Contact Form: tablet (<1024px) ---- */
@media (max-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ---- Contact Form: phone (<640px) ---- */
@media (max-width: 640px) {
  .form-row,
  .form-row--three {
    grid-template-columns: 1fr;
  }

  .contact-form-card {
    padding: var(--space-4);
  }
}

/* ---- Footer: tablet/phone (<768px) ---- */
@media (max-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}