/* ==========================================================================
   Spokane EV Charging Specialists - Universal Mobile Responsive Framework
   Targets screen widths <= 1024px, <= 768px, <= 640px, and <= 480px
   Prevents horizontal overflow and optimizes mobile touch experience
   ========================================================================== */

/* Universal Overflow Prevention */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Category Badges, Hero Pills & Overlines */
.category-badge,
.hero-pill,
.section-tag,
.badge,
.lic-badge,
.top-bar-badge {
  max-width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
}

/* Flex & Grid item containment to prevent track blowout */
.hero-grid > *,
.hero-left,
.hero-right,
.split-grid-balanced > *,
.two-column-grid > *,
.intro-grid > *,
.why-grid > *,
.pricing-grid > *,
.process-grid > *,
.climate-grid > *,
.geology-grid > *,
.permits-grid > *,
.hoa-grid > *,
.area-grid > *,
.faq-grid > *,
.contact-grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Universal Table Horizontal Scroll Container */
.tech-table-wrap,
.table-container,
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: block !important;
  margin: 1.5rem 0 !important;
  position: relative !important;
}

.tech-table,
.comparison-table {
  min-width: 540px;
}

/* Tablet & Mobile Navigation Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
  /* Hide desktop text nav links in all header styles */
  ul.nav-links,
  nav.nav-links,
  nav:has(ul.nav-links),
  nav:has(.nav-link),
  .site-nav .nav-link,
  .nav-menu li:not(:last-child),
  ul.nav-menu li a:not(.nav-phone-btn):not(.nav-cta):not(.header-cta-btn) {
    display: none !important;
  }

  /* Top Bar adjustments */
  .top-bar-right {
    display: none !important;
  }
  .top-bar-inner {
    justify-content: center !important;
    text-align: center !important;
  }
}

/* Mobile Devices Breakpoint (<= 640px) */
@media (max-width: 640px) {
  /* Site Header & Logo */
  .site-header,
  .header-nav {
    padding: 0.5rem 0 !important;
  }
  .header-inner {
    height: auto !important;
    min-height: 52px !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    gap: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .site-logo,
  .brand-logo,
  .logo-area {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .site-logo-icon,
  .logo-icon,
  .brand-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.05rem !important;
    flex-shrink: 0 !important;
  }
  .site-logo-text,
  .logo-text,
  .logo-title {
    font-size: 0.95rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .logo-sub {
    font-size: 0.65rem !important;
  }

  /* Header Actions & Call Buttons */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }
  .header-phone span,
  .header-phone-text {
    display: none !important;
  }
  .header-actions .btn {
    height: 34px !important;
    padding: 0 0.65rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  .btn-phone-header,
  .nav-phone-btn,
  .nav-cta,
  .header-cta-btn,
  .header-cta,
  .phone-badge {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  /* Intro Floating Badge & Image Containment */
  .intro-image-wrapper {
    position: relative !important;
    max-width: 100% !important;
  }
  .intro-badge-float {
    right: 0 !important;
    bottom: -0.5rem !important;
    padding: 0.75rem 1rem !important;
  }
  .intro-badge-num {
    font-size: 1.75rem !important;
  }
  .intro-badge-label {
    font-size: 0.75rem !important;
  }

  /* Contact & Form Details */
  .contact-info-item,
  .contact-info-list {
    max-width: 100% !important;
    word-break: break-word !important;
  }

  /* Typography Scales for Mobile */
  h1, .hero-title, .page-title {
    font-size: clamp(1.75rem, 6.5vw, 2.25rem) !important;
    line-height: 1.2 !important;
  }
  h2, .section-title {
    font-size: clamp(1.45rem, 5vw, 1.8rem) !important;
    line-height: 1.25 !important;
  }
  h3 {
    font-size: 1.2rem !important;
  }
  .hero-desc,
  .hero-subtitle,
  .section-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  /* Grids to Single Column */
  .hero-grid,
  .split-grid-balanced,
  .two-column-grid,
  .stat-row-grid,
  .trust-bar-grid,
  .services-sub-grid,
  .four-card-grid,
  .three-card-grid,
  .neighborhood-links-grid,
  .footer-grid,
  .footer-columns-grid,
  .form-row,
  .pricing-cards-row,
  .reviews-grid,
  .rebates-cards-grid,
  .services-featured-grid,
  .pricing-grid,
  .process-grid,
  .climate-grid,
  .geology-grid,
  .geology-bento-grid,
  .permits-grid,
  .hoa-grid,
  .area-grid,
  .faq-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Form Padding on Mobile */
  .hero-form-header,
  .quote-form-header {
    padding: 1.25rem 1.25rem 1rem !important;
  }
  .hero-form-body,
  .quote-form-body {
    padding: 1.25rem 1.25rem 1.5rem !important;
  }

  /* Container padding */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Bottom fixed Call Bar */
  .mobile-call-bar {
    display: block !important;
  }
  body {
    padding-bottom: 60px !important;
  }
}

@media (max-width: 768px) {
  .geology-bento-grid {
    grid-template-columns: 1fr !important;
  }
  .process-stage-card {
    flex: 0 0 84% !important;
  }
}
