/* ============================================
   Charter Oak Chimney — Responsive Breakpoints
   Mobile-first approach
   ============================================ */

/* ── Mobile: < 768px ── */
@media (max-width: 767px) {

  /* Typography scaling */
  h1, .hero-title {
    font-size: var(--text-3xl);
  }
  h2, .section-title {
    font-size: var(--text-2xl);
  }
  h3 {
    font-size: var(--text-xl);
  }

  /* Header */
  #main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--header-height) + var(--space-6)) var(--space-6) var(--space-6);
    gap: var(--space-4);
    transition: right var(--transition-base);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    z-index: var(--z-modal);
    overflow-y: auto;
  }

  #main-nav.open {
    right: 0;
  }

  #main-nav a {
    color: var(--color-charcoal);
    font-size: var(--text-md);
    padding: var(--space-3) 0;
    width: 100%;
    border-bottom: 1px solid var(--color-gray-100);
  }

  .nav-toggle {
    display: flex;
    z-index: calc(var(--z-modal) + 1);
    position: relative;
  }

  .header-cta .btn-primary {
    display: none;
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: var(--z-overlay);
    transition: opacity var(--transition-base);
  }
  .nav-overlay.active {
    display: block;
  }

  /* When nav is open, boost header above the overlay so the
     drawer (child of header) isn't trapped behind the overlay */
  body.nav-open #site-header {
    z-index: calc(var(--z-modal) + 2);
  }

  /* Hero — show mobile video, hide desktop */
  #hero-video { display: none; }
  #hero-video-mobile { display: block; }

  .hero-content {
    padding-top: calc(var(--header-height) + var(--space-10));
    padding-bottom: var(--space-10);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-ctas {
    flex-direction: column;
    margin-bottom: var(--space-8);
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-pair {
    flex-direction: column;
    align-items: center;
  }
  .cta-pair .btn {
    width: 100%;
    max-width: 340px;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .hero-stats .stat-block {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-align: left;
  }

  .hero-stats .stat-num {
    font-size: var(--text-2xl);
    margin-bottom: 0;
  }

  /* Trust bar */
  .trust-items {
    gap: var(--space-4);
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-2);
  }
  .trust-items::-webkit-scrollbar { display: none; }
  .trust-divider { display: none; }

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

  .cities-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .steps-grid::before { display: none; }

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

  .why-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .why-image-box img {
    height: 300px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

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

  /* Sticky CTA */
  .sticky-cta-desktop { display: none !important; }
  .sticky-cta-mobile { display: block; }

  /* Scheduling */
  .schedule-form-body {
    padding: var(--space-5);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-nav {
    padding: var(--space-4) var(--space-5);
  }

  .form-nav .btn {
    min-width: auto;
  }

  .time-windows {
    grid-template-columns: 1fr;
  }

  .confirmation-ctas {
    flex-direction: column;
    align-items: center;
  }

  .confirmation-ctas .btn {
    width: 100%;
    max-width: 280px;
  }

  /* Footer mobile fixes */
  .footer-brand .logo {
    flex-wrap: nowrap;
  }

  .footer-brand .logo-img {
    width: 40px;
    height: 40px;
  }

  footer {
    padding: var(--space-8) var(--space-5) var(--space-6);
    overflow: hidden;
  }

  /* Section spacing */
  .section {
    padding: var(--space-12) 0;
  }

  .seasonal-title {
    font-size: var(--text-2xl);
  }

  /* Value cards */
  .value-cards-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Strip */
  .strip-content {
    flex-direction: column;
    text-align: center;
  }

  /* Service pages */
  .sp-two-col {
    grid-template-columns: 1fr;
  }
  .sp-hero-content h1 {
    font-size: var(--text-2xl);
  }
}

/* ── Tablet: 768px – 1024px ── */
@media (min-width: 768px) and (max-width: 1023px) {

  h1, .hero-title {
    font-size: var(--text-4xl);
  }

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

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

  .why-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .sticky-cta-mobile { display: block; }
  .sticky-cta-desktop { display: none !important; }

  /* Hero — show mobile video on tablet too */
  #hero-video { display: none; }
  #hero-video-mobile { display: block; }

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

  .sp-two-col {
    grid-template-columns: 1fr;
  }

  /* Nav adjustments */
  #main-nav {
    gap: var(--space-5);
  }

  #main-nav a {
    font-size: var(--text-xs);
  }

  .header-cta .btn-primary {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
  }
}

/* ── Desktop: > 1024px ── */
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cities-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  /* Hero — show desktop video, hide mobile */
  #hero-video { display: block; }
  #hero-video-mobile { display: none; }
}

/* ── Large: > 1440px ── */
@media (min-width: 1440px) {
  .container {
    padding: 0 var(--space-10);
  }

  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cities-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
