/* ==========================================================================
   Air Conditioning Contractors - Master Stylesheet
   HVAC Helpline Massachusetts
   ========================================================================== */

/* Design Tokens & CSS Variables */
:root {
  --primary-navy: #0f2537;
  --primary-navy-dark: #091724;
  --accent-blue: #0088cc;
  --accent-orange: #e65c00;
  --accent-orange-hover: #cf5300;
  --whatsapp-green: #25d366;
  --whatsapp-green-hover: #1ebc57;
  
  --bg-light: #f4f7f9;
  --bg-white: #ffffff;
  --bg-slate: #1c2b36;
  --bg-card: #ffffff;

  --text-dark: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;

  --border-color: #e2e8f0;
  --border-radius-sm: 6px;
  --border-radius: 10px;
  --border-radius-lg: 16px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);

  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 76px;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* Focus States for Accessibility */
:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 3px;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section-padding {
  padding: 4rem 0;
}

.section-padding-sm {
  padding: 2.5rem 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.bg-white { background-color: var(--bg-white); }
.bg-light { background-color: var(--bg-light); }
.bg-navy { background-color: var(--primary-navy); color: var(--text-light); }
.bg-slate { background-color: var(--bg-slate); color: var(--text-light); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary-navy);
  margin-bottom: 1rem;
}

.bg-navy h1, .bg-navy h2, .bg-navy h3,
.bg-slate h1, .bg-slate h2, .bg-slate h3 {
  color: var(--bg-white);
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw + 0.5rem, 2.35rem); letter-spacing: -0.01em; margin-top: 1.5rem; }
h3 { font-size: clamp(1.25rem, 2vw + 0.3rem, 1.6rem); margin-top: 1.25rem; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.25rem;
  color: #334155;
  font-size: 1.05rem;
}

.bg-navy p, .bg-slate p {
  color: #cbd5e1;
}

.lead {
  font-size: 1.2rem;
  font-weight: 400;
  color: #475569;
  max-width: 800px;
}

.bg-navy .lead { color: #e2e8f0; }

/* Buttons & CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--border-radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.btn-phone {
  background-color: var(--accent-orange);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(230, 92, 0, 0.35);
}

.btn-phone:hover {
  background-color: var(--accent-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 92, 0, 0.45);
}

.btn-whatsapp {
  background-color: var(--whatsapp-green);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background-color: var(--whatsapp-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary-navy);
  color: var(--primary-navy) !important;
}

.btn-outline:hover {
  background-color: var(--primary-navy);
  color: #ffffff !important;
}

.btn-lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.15rem;
}

.btn-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-navy);
  text-decoration: none !important;
}

.brand-logo svg {
  width: 34px;
  height: 34px;
  color: var(--accent-blue);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 1.15rem;
  color: var(--primary-navy);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0.5rem 0.25rem;
  text-decoration: none !important;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-blue);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--primary-navy);
}

/* Mobile sticky CTA bar */
.mobile-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background-color: var(--primary-navy);
  padding: 0.6rem 0.8rem;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
}

.mobile-sticky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Hero Banner */
.hero {
  background: linear-gradient(135deg, var(--primary-navy-dark) 0%, var(--primary-navy) 100%);
  color: var(--text-light);
  padding: 4.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 1.25rem;
}

.hero-cta-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  align-items: center;
}

.hero-phone-display {
  display: inline-flex;
  flex-direction: column;
  background: rgba(255,255,255,0.08);
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
}

.hero-phone-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.hero-phone-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none !important;
}

.hero-card {
  background-color: #ffffff;
  color: var(--text-dark);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-card h3 {
  color: var(--primary-navy);
  margin-top: 0;
}

.hero-card-list {
  margin: 1.25rem 0;
}

.hero-card-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.hero-card-list svg {
  color: var(--accent-blue);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Service & Location Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.card-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-link {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Location Directory Search UI */
.search-container {
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: 1.05rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: #ffffff;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 1.25rem 0;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-blue);
}

.breadcrumb-separator {
  color: #94a3b8;
}

.breadcrumb-active {
  color: var(--primary-navy);
  font-weight: 600;
}

/* FAQ Accordion */
.faq-accordion {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: #ffffff;
  overflow: hidden;
}

.faq-button {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  color: var(--accent-blue);
}

.faq-button[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-panel {
  display: none;
  padding: 0 1.5rem 1.25rem;
  color: #334155;
  border-top: 1px solid transparent;
}

.faq-button[aria-expanded="true"] + .faq-panel {
  display: block;
}

/* CTA Banner Box */
.cta-box {
  background: linear-gradient(135deg, var(--primary-navy) 0%, #173753 100%);
  color: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  margin: 3.5rem 0;
  box-shadow: var(--shadow-lg);
}

.cta-box h2 {
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.cta-box p {
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto 1.75rem;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Contact Form UI */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Trust Badges Bar */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1.5rem;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--primary-navy);
}

.trust-item svg {
  width: 24px;
  height: 24px;
  color: var(--accent-blue);
}

/* Footer */
.site-footer {
  background-color: var(--primary-navy-dark);
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent-orange);
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }
  
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: #ffffff;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    display: none;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu.is-active {
    display: flex;
  }

  .header-actions .btn-phone {
    display: none;
  }

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

  body {
    padding-bottom: 60px; /* space for sticky bar */
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

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

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-cta-box {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
}
