/* =========================
   RESPONSIVE OVERRIDES
   Breakpoints: tablet <= 900px, mobile <= 600px, small mobile <= 400px
========================= */

/* =========================
   TABLET (<= 900px)
========================= */
@media (max-width: 900px) {

  /* --- Header --- */
  .header-grid {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem 0;
    row-gap: 0.75rem;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* --- Hero --- */
  .hero {
    padding: 70px 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-visual {
    margin-top: 2rem;
  }

  .hero-visual img {
    margin: 0 auto;
  }

  /* --- Featured Services --- */
  .featured-services {
    padding: 60px 0;
  }

  .section-subtitle {
    white-space: normal;
  }

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

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

  /* --- Testimonials --- */
  .testimonials {
    padding: 60px 0;
  }

  .testimonials-track-wrapper {
    max-width: 100%;
  }

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

/* =========================
   MOBILE (<= 600px)
========================= */
@media (max-width: 600px) {

  .container {
    padding: 0 1.25rem;
  }

  section {
    padding: 50px 0;
  }

  /* --- Header --- */
  .logo img {
    height: 26px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.75rem 1.25rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .btn-outline,
  .btn-primary {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
  }

  /* --- Hero --- */
  .hero {
    padding: 50px 0;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions button {
    width: 100%;
  }

  /* --- Featured Services --- */
  .section-title {
    font-size: 1.8rem;
  }

  .services-filter {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .filter-pill {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

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

  .service-card {
    text-align: center;
    padding: 1.5rem;
  }

  /* --- Testimonials --- */
  .testimonials-inner {
    gap: 0.5rem;
  }

  .testimonial-card {
    min-width: 260px;
    max-width: 80vw;
    padding: 1.25rem;
  }

  .testimonial-arrow {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  /* --- Footer --- */
  .main-footer {
    padding: 50px 0 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .footer-links ul,
  .footer-contact ul {
    align-items: center;
  }
}

/* =========================
   SMALL MOBILE (<= 400px)
========================= */
@media (max-width: 400px) {

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-eyebrow {
    font-size: 0.8rem;
  }

  .nav-links {
    justify-content: center;
    width: 100%;
  }

  .testimonial-card {
    min-width: 220px;
  }
}

/* =========================
   HAMBURGER MENU
========================= */

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--deep-slate-blue, #0F172A);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel — hidden by default, shown via JS */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.75rem;
  background: var(--pure-white, #fff);
  border-top: 1px solid var(--border-line, #E2E8F0);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-links a {
  color: var(--primary-text, #1E293B);
  font-weight: 500;
  font-size: 1rem;
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-actions .btn-outline,
.mobile-nav-actions .btn-primary {
  width: 100%;
  text-align: center;
}

/* Prevent background scroll when menu open */
body.nav-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  /* Hide desktop nav + actions, show hamburger instead */
  .header-right {
    display: none;
  }

  .header-grid {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .mobile-nav.open {
    max-height: 400px;
  }
}


/* Homepage featured-grid safety: never keep the desktop 3-column layout on phones. */
@media (max-width: 600px) {
  #featuredServicesGrid {
    grid-template-columns: 1fr !important;
  }
}
