/* ==========================================================================
   UNIFIED CONCEPTS - RESPONSIVE BREAKPOINTS
   (1600, 1440, 1366, 1280, 1024, 768, 576, 430, 390, 375, 320)
   ========================================================================== */

/* Large Desktop & Laptop (>= 1280px maintains 5 columns) */
@media (max-width: 1280px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .split-60-40 {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet Landscape & Small Laptop (<= 1024px) */
@media (max-width: 1024px) {
  .nav-menu, .nav-cta {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .split-60-40 {
    grid-template-columns: 1fr;
  }
  .sticky-container {
    position: static;
  }
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .timeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait & Mobile (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  main,
  .container,
  .section,
  .split-60-40,
  .sticky-container,
  .form-card,
  .header,
  .header-container {
    max-width: 100%;
    min-width: 0;
  }

  .section {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
    overflow-x: clip;
  }

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

  .faq-trigger {
    font-size: 0.98rem;
    padding: 1rem 1.05rem;
  }

  .faq-answer {
    padding-left: 1.05rem;
    padding-right: 1.05rem;
  }

  .top-bar {
    display: none;
  }

  /* Quote form: stack phone/email; fit viewport */
  .form-row-2,
  .form-card .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .form-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: var(--space-4);
  }

  .form-card .form-input,
  .form-card .form-textarea,
  .form-card .btn {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .form-card .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    min-height: 52px;
  }

  .h2,
  .body-text,
  .section-header,
  .hero-headline,
  .hero-subheading {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Horizontal card sliders — contained, no page bleed */
  .services-grid,
  .why-grid,
  .timeline-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-3);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-3);
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    padding-inline: 0;
    margin-inline: 0;
    max-width: 100%;
    grid-template-columns: none;
    scrollbar-width: none;
  }

  .services-grid::-webkit-scrollbar,
  .why-grid::-webkit-scrollbar,
  .timeline-grid::-webkit-scrollbar {
    display: none;
  }

  .services-grid > .service-card,
  .why-grid > .why-card,
  .timeline-grid > .timeline-card {
    flex: 0 0 min(85%, 300px);
    max-width: min(85%, 300px);
    scroll-snap-align: start;
    min-height: 220px;
    box-sizing: border-box;
  }

  .testimonials-slider {
    padding: 0 2.75rem;
    max-width: 100%;
  }

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

  .hero-headline {
    font-size: 2.4rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
    white-space: normal;
  }

  .service-list-bullets {
    grid-template-columns: 1fr;
  }

  .comparison-wrapper {
    aspect-ratio: 4/3;
    max-width: 100%;
  }

  .lightbox-prev,
  .lightbox-next {
    display: none;
  }

  .header-container {
    gap: var(--space-2);
  }

  .brand-logo {
    min-width: 0;
    flex-shrink: 1;
  }

  .cta-actions,
  .cta-box .flex {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Mobile Devices (<= 576px) */
@media (max-width: 576px) {
  .hero-arrows {
    display: none;
  }

  .hero-content {
    padding-bottom: var(--space-12);
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .cta-box {
    padding: var(--space-8) var(--space-4);
  }

  .testimonials-slider {
    padding: 0;
  }

  .testimonials-nav {
    display: none;
  }

  .testimonial-card {
    min-height: 200px;
    padding: var(--space-5);
  }

  .form-card {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
  }
}

/* Micro-screens & Small Mobiles (<= 430px) */
@media (max-width: 430px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

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

  /* Full-width only for section CTAs — not every button site-wide */
  .hero-cta .btn,
  .cta-box .btn,
  .form-card .btn,
  .section .btn-lg {
    width: 100%;
  }

  .hero-headline {
    font-size: 2.15rem;
  }

  .brand-logo img {
    height: 36px;
  }

  .services-grid > .service-card,
  .why-grid > .why-card,
  .timeline-grid > .timeline-card {
    flex: 0 0 88%;
    max-width: 88%;
  }
}
