/* ==========================================================================
   AMAN ENVIRO ENGINEERING CONSULTANT - RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1024px) {
  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .leader-card {
    grid-template-columns: 1fr;
  }

  .leader-img-wrapper {
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
  }

  .leader-img-wrapper img {
    height: auto;
    object-fit: contain;
  }

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

  .grid-2,
  .grid-3 {
    gap: 1.5rem;
  }

  .hero-stats-mini {
    gap: 2rem;
  }

  .stats-bar-card {
    grid-template-columns: 1fr 1fr;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Layout rhythm */
  .section {
    padding-block: clamp(2.75rem, 7vw, 4rem);
  }

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

  .section-subtitle {
    font-size: 0.98rem;
  }

  .container {
    padding-inline: 1rem;
  }

  .grid {
    gap: 1.25rem;
  }

  /* Critical: auto-fit minmax(320px) overflows 360px phones - force single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Kill large inline gaps on phones */
  .grid[style*="gap"] {
    gap: 2rem !important;
  }

  .grid > * {
    min-width: 0;
  }

  /* Header: compact, no crowding */
  .navbar {
    padding-block: 0.8rem;
    gap: 0.75rem;
  }

  .brand-logo img {
    height: 48px !important;
    width: auto !important;
  }

  .nav-actions .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  /* Hero: tight, stacked, thumb-friendly */
  .hero-section {
    min-height: auto;
    padding-top: 2.75rem;
    padding-bottom: 3.25rem;
  }

  html.nav-overlay .hero-section {
    padding-top: calc(2.75rem + var(--header-h, 76px));
  }

  .hero-badge {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.8rem;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  .hero-title {
    font-size: clamp(1.9rem, 8.5vw, 2.4rem);
    line-height: 1.15;
  }

  .hero-description {
    font-size: 0.96rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    max-width: 440px;
  }

  .hero-actions .btn {
    min-height: 48px;
    width: 100%;
  }

  .hero-actions .btn-hero-primary {
    padding: 0.7rem 1.15rem !important;
    font-size: 0.92rem !important;
    border-radius: var(--radius-md);
  }

  .hero-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .hero-actions .btn-hero-secondary {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-md);
    white-space: nowrap;
    justify-content: center;
    gap: 0.35rem !important;
  }

  /* 2x2 stat mini-grid instead of cramped row */
  .hero-stats-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    padding-top: 1.5rem;
    margin-top: 2rem;
  }

  .hero-stat-item h3 {
    font-size: 1.6rem;
  }

  .hero-stat-item p {
    font-size: 0.72rem;
  }

  .stats-bar {
    margin-top: -1.5rem;
    padding-inline: 1rem;
  }

  .stats-bar-card {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1.25rem;
  }

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

  /* Cards: comfortable reading, no squeeze */
  .service-card {
    padding: 1.35rem 1.25rem 1.2rem;
  }

  .quote-card {
    padding: 1.4rem !important;
    border-radius: 18px;
  }

  .quote-card .grid-2 {
    grid-template-columns: 1fr;
    gap: 0 !important;
  }

  .quote-card .form-group {
    margin-bottom: 1rem;
  }

  .btn {
    min-height: 44px;
  }

  .btn-lg {
    padding: 0.8rem 1.4rem;
    font-size: 0.95rem;
    width: 100%;
  }

  /* Client tabs → swipeable row inside the sticky glass bar */
  .client-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .client-tabs::-webkit-scrollbar {
    display: none;
  }

  .client-tab-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

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

  .client-logo-card {
    min-height: 96px;
    padding: 0.8rem 0.6rem;
  }

  .client-logo-card img {
    max-height: 60px;
    max-width: 100%;
  }

  /* Inline image heights from page builders */
  img[style*="height: 420px"],
  img[style*="height:420px"] {
    height: 260px !important;
  }

  div[style*="height: 260px"],
  div[style*="height:260px"] {
    height: 210px !important;
  }

  .leader-card {
    border-radius: 18px;
  }

  .leader-img-wrapper {
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
  }

  .leader-img-wrapper img {
    height: auto;
    object-fit: contain;
  }

  .leader-content {
    padding: 1.5rem 1.25rem;
  }

  .leader-quote {
    font-size: 0.92rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .floating-actions {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    gap: 8px;
  }

  .to-top {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: 42px;
    height: 42px;
  }

  .floating-btn {
    width: 48px;
    height: 48px;
  }

  .floating-btn svg {
    width: 24px;
    height: 24px;
  }

  .floating-btn-whatsapp svg {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  h2 {
    font-size: 1.6rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
  }

  /* Secondary CTAs stack full-width on narrow phones (no truncated phone number) */
  .hero-actions-row {
    grid-template-columns: 1fr;
  }

  .hero-stats-mini {
    gap: 0.9rem;
  }

  .nav-actions .btn {
    display: none;
  }

  .client-tabs {
    gap: 0.4rem;
  }

  .client-tab-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .client-grid {
    gap: 0.65rem;
  }

  .quote-card {
    padding: 1.1rem !important;
  }

  .form-control {
    font-size: 16px; /* stops iOS auto-zoom on focus */
    padding: 0.75rem 0.9rem;
  }

  .mobile-drawer {
    width: min(88vw, 340px);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-link {
    padding: 0.85rem 0.75rem;
    font-size: 1rem;
  }

  .footer-grid {
    gap: 1.5rem;
  }

  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  .hero-stat-item h3 {
    font-size: 1.4rem;
  }

  .stats-bar-card {
    padding: 1rem;
  }

  .service-card {
    padding: 1.15rem 1rem 1rem;
  }

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