/* ==========================================================================
   SafeCool Air Systems - Responsive Stylesheet & Mobile CTA Bar
   ========================================================================== */

/* Sticky Mobile Bottom Action Bar - Zero-Blur GPU Composited */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #071524;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  transform: translateZ(0);
  will-change: transform;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) 0.85rem;
}

.mobile-sticky-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-sticky-call {
  flex: 1;
  background-color: #107C41;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 10px rgba(16, 124, 65, 0.3);
  border: 1px solid #107C41;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background-color 150ms ease;
  user-select: none;
}

.mobile-sticky-call:active {
  background-color: #0B5C30;
  transform: scale(0.97);
  color: #FFFFFF;
}

.mobile-sticky-quote {
  flex: 1;
  background-color: var(--color-cta);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 10px rgba(217, 83, 30, 0.3);
  border: 1px solid var(--color-cta);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background-color 150ms ease;
  user-select: none;
}

.mobile-sticky-quote:active {
  background-color: var(--color-cta-hover);
  transform: scale(0.97);
  color: #FFFFFF;
}

/* Mobile Navigation Overlay / Drawer - GPU Accelerated */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(85vw, 360px);
  height: 100vh;
  height: 100dvh;
  background-color: #FFFFFF;
  z-index: 2100;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 280ms ease;
  will-change: transform, visibility;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  box-shadow: -6px 0 30px rgba(13, 35, 58, 0.25);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 35, 58, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.mobile-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-subtle);
  flex-shrink: 0;
}

.mobile-drawer-close {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-main);
  border-radius: var(--radius-sm);
  touch-action: manipulation;
}

.mobile-drawer-close:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-drawer-content {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 0.85rem 1.25rem 0.35rem 1.25rem;
  margin: 0;
}

.mobile-drawer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.mobile-drawer-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  color: var(--color-text-heading);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.975rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  touch-action: manipulation;
}

.mobile-drawer-links a:active,
.mobile-drawer-links a[aria-current="page"],
.mobile-drawer-links a.active {
  background-color: var(--color-ice-blue);
  color: var(--color-cta);
  font-weight: 700;
}

.mobile-quick-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 0.5rem 1.25rem;
}

.mobile-quick-call, .mobile-quick-quote {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

.mobile-quick-call {
  background-color: #107C41;
  color: #FFFFFF;
}

.mobile-quick-quote {
  background-color: var(--color-cta);
  color: #FFFFFF;
}

.mobile-drawer-footer {
  margin-top: auto;
  padding: 1.25rem;
  background-color: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet & Compact Desktop Screens (max-width: 1140px) */
@media (max-width: 1080px) {
  .desktop-nav-wrapper {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .nav-container {
    padding: 0.75rem 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .local-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

  .service-sidebar {
    position: static;
    margin-top: 2rem;
  }

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

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); /* Space for fixed sticky bottom bar */
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .mobile-sticky-bar {
    display: block;
  }

  .header-topbar {
    display: none; /* Streamline mobile header for speed & minimal clutter */
  }

  .header-cta-group .header-quote-btn {
    display: none; /* Accessible in mobile menu and bottom sticky bar */
  }

  .header-cta-group {
    gap: 0.5rem;
    align-items: center;
  }

  .header-phone-label {
    display: none;
  }

  .header-phone-btn {
    padding: 0.35rem 0.65rem;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .header-phone-num {
    font-size: 0.925rem;
  }

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

  .brand-tagline {
    font-size: 0.65rem;
  }

  /* Compact header on mobile screens (< 640px) */
  @media (max-width: 640px) {
    .header-phone-btn {
      width: 42px;
      height: 42px;
      min-height: 42px;
      padding: 0;
      border-radius: 50%;
      justify-content: center;
      flex-shrink: 0;
      background: rgba(16, 124, 65, 0.1);
      border: 1.5px solid #107C41;
    }

    .header-phone-details {
      display: none;
    }

    .header-phone-icon {
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #107C41;
    }

    .brand-logo-icon {
      width: 32px;
      height: 32px;
    }

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

    .brand-tagline {
      font-size: 0.625rem;
    }
  }

  .page-hero {
    padding: 1.5rem 0 1.75rem 0;
  }

  .page-hero h1 {
    font-size: clamp(1.65rem, 6.2vw, 2.15rem);
    line-height: 1.22;
    margin-bottom: 0.65rem;
  }

  .page-hero-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .page-hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }

  .page-hero-actions .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    min-height: 48px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    justify-content: center;
  }

  .page-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .page-hero-media img {
    height: 190px;
  }

  .hero-section {
    padding: 1.75rem 0 2rem 0;
  }

  .hero-headline {
    font-size: clamp(1.85rem, 6.5vw, 2.35rem);
    line-height: 1.2;
    margin-bottom: 0.65rem;
  }

  .hero-subheadline {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

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

  .hero-phone-highlight {
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.85rem;
  }

  .hero-chips {
    gap: 0.5rem;
  }

  .hero-chip {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  .hero-card {
    padding: 1.15rem 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  }

  .hero-card-title {
    font-size: 1.25rem;
  }

  .trust-section {
    padding: 1.75rem 0;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .section {
    padding: 1.75rem 0;
  }

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

  .service-grid, .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .services-featured-banner {
    grid-template-columns: 1fr;
    gap: 1.15rem;
    padding: 1.15rem 1rem;
    margin-bottom: 1.5rem;
  }

  .services-featured-actions .btn {
    width: 100%;
    justify-content: center;
  }

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

  .local-grid {
    gap: 1.5rem;
  }

  .cta-banner {
    padding: 1.5rem 1rem !important;
    margin: 1.25rem 0 !important;
  }

  .faq-summary {
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    min-height: 48px;
  }

  .faq-body {
    padding: 0.85rem 1rem;
    font-size: 0.925rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Small Screens (max-width: 480px) */
@media (max-width: 480px) {
  .hero-card {
    padding: 1.15rem 0.85rem;
  }

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

  .local-card-box {
    padding: 1.25rem 1rem;
  }
}

/* Universal Containment to Prevent Horizontal Overflow Without Scroll Hijacking */
body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

main, section, header, footer {
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, svg, iframe, video {
  max-width: 100%;
}

@media (max-width: 768px) {
  .btn {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print Stylesheet */
@media print {
  .site-header, .site-footer, .mobile-sticky-bar, .btn, .faq-item {
    display: none !important;
  }
  body {
    color: #000;
    background: #FFF;
    font-size: 12pt;
  }
}
