/* Responsive Design — Mobile-first (320px → 1440px+) */

/* Small devices (320px) */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
  }

  .hero {
    min-height: 80vh;
  }

  .hero-content {
    padding: 1rem;
  }

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

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .img-card.large {
    grid-row: auto;
  }

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

  .progress-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .estimator-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .trust-metrics {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .wa-fab {
    bottom: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }
}

@media (max-width: 1024px) {
  .nav-inner {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
  }

  html[data-theme='dark'] .nav-links {
    background: var(--color-surface);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 8px;
  }

  .nav-links a:hover {
    background: var(--color-surface);
  }

  .nav-actions {
    gap: 0.45rem;
  }

  .logo-text {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Tablets (480px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .tab-panels {
    display: grid;
  }
}

/* Medium devices (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* Large devices (1025px+) */
@media (min-width: 1025px) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

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

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

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }
}

/* High-res displays */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* Accessibility — Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

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

  .carpet-roll-core {
    animation: none !important;
  }
}

/* Accessibility — High contrast */
@media (prefers-contrast: more) {
  :root {
    --color-border: #333;
  }

  html[data-theme='dark'] {
    --color-border: #ccc;
  }

  .btn,
  .opt-grid label {
    border-width: 2px;
  }
}
