/* ============================================
   Compare Home Services - Main Stylesheet
   ============================================ */

/* CSS Custom Properties */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #16a34a;
  --color-secondary-dark: #15803d;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-bg: #f8fafc;
  --color-bg-white: #ffffff;
  --color-border: #e2e8f0;
  --color-hero-overlay: rgba(30, 41, 59, 0.5);
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'DM Sans', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }

/* ========== Header & Navigation ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}
.logo-link {
  display: flex;
  align-items: center;
  color: var(--color-text);
}
.logo-link:hover { color: var(--color-text); }
.logo-link img { height: 40px; width: auto; }
@media (min-width: 768px) { .logo-link img { height: 44px; } }

.nav-desktop {
  display: none;
}
@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  .nav-desktop a {
    color: var(--color-text);
    font-weight: 500;
  }
  .nav-desktop a:hover { color: var(--color-primary); }
  .nav-desktop .btn { color: white; }
  .nav-desktop .btn:hover { color: white; opacity: 0.95; }
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}
@media (min-width: 768px) { .hamburger { display: none; } }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: var(--transition);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--color-bg-white);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  padding: 5rem 1.5rem 1.5rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 99;
}
.nav-mobile.is-open { transform: translateX(0); }
.nav-mobile a {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-text);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.nav-mobile .btn { text-align: center; margin-top: 1rem; }
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 98;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4); }
.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
  color: white;
}
.btn-secondary:hover { box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: white; }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background: var(--color-primary) url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=1600&q=80') center/cover no-repeat;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.85) 0%, rgba(30, 41, 59, 0.7) 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: white; margin-bottom: 0.5rem; }
.hero p {
  font-size: 1.1rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}
.hero .btn { margin: 0 0.25rem; }
@media (min-width: 768px) { .hero { min-height: 480px; } .hero p { font-size: 1.2rem; } }

/* ========== Sections ========== */
.section {
  padding: 3rem 0;
}
@media (min-width: 768px) { .section { padding: 4rem 0; } }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 { margin-bottom: 0.5rem; }
.section-title p { color: var(--color-text-muted); max-width: 560px; margin-left: auto; margin-right: auto; }

/* How it works */
.steps {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  background: var(--color-bg-white);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.step-number {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}
.step-card h3 { margin-bottom: 0.5rem; }
.step-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* Feature highlights / Why choose us */
.features {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature-card {
  background: var(--color-bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.feature-card .icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(22, 163, 74, 0.12));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.feature-card p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }

/* Category cards (services grid) */
.categories {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 500px) { .categories { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .categories { grid-template-columns: repeat(4, 1fr); } }
.category-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-card a { color: inherit; display: block; }
.category-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.category-card .category-content { padding: 1.25rem; }
.category-card h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.category-card p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }

/* Testimonials */
.testimonials {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 768px) { .testimonials { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .testimonials { grid-template-columns: repeat(3, 1fr); } }
.testimonial-card {
  background: var(--color-bg-white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.testimonial-card p { font-style: italic; color: var(--color-text); margin-bottom: 1rem; }
.testimonial-card .author { font-weight: 600; font-size: 0.95rem; }
.testimonial-card .role { font-size: 0.85rem; color: var(--color-text-muted); }

/* CTA block */
.cta-block {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}
.cta-block h2 { color: white; margin-bottom: 0.5rem; }
.cta-block p { opacity: 0.95; margin-bottom: 1.5rem; }
.cta-block .btn-secondary { margin: 0 0.25rem; }

/* ========== Footer ========== */
.site-footer {
  background: var(--color-text);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand .logo-link img { filter: brightness(0) invert(1); }
.footer-brand p { font-size: 0.95rem; margin-top: 0.75rem; max-width: 280px; opacity: 0.9; }
.footer-links h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
  color: #cbd5e1;
  font-size: 0.95rem;
}
.footer-links a:hover { color: white; }
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ========== Page header (inner pages) ========== */
.page-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  padding: 2.5rem 0;
  text-align: center;
}
.page-header h1 { color: white; margin-bottom: 0.25rem; }
.page-header p { margin: 0; opacity: 0.95; }

/* ========== Services page cards ========== */
.services-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 768px) { .services-list { grid-template-columns: repeat(2, 1fr); } }
.service-card {
  display: flex;
  gap: 1.25rem;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.service-card img {
  width: 140px;
  min-width: 140px;
  height: 140px;
  object-fit: cover;
}
.service-card .service-body { padding: 1.25rem; flex: 1; }
.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { font-size: 0.95rem; color: var(--color-text-muted); margin: 0; }

/* ========== Contact form ========== */
.contact-wrap {
  max-width: 560px;
  margin: 2rem auto;
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-white);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.contact-form .btn { width: 100%; margin-top: 0.5rem; }
@media (min-width: 768px) { .contact-form .btn { width: auto; } }

/* ========== Subscribe / Unsubscribe ========== */
.subscribe-box, .unsubscribe-box {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--color-bg-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.subscribe-box h2, .unsubscribe-box h2 { margin-bottom: 0.5rem; }
.subscribe-box p, .unsubscribe-box p { color: var(--color-text-muted); margin-bottom: 1.5rem; }
.subscribe-form .form-group { margin-bottom: 1rem; }
.subscribe-form input { padding: 0.85rem 1rem; }
.subscribe-form .btn { width: 100%; }

/* ========== Legal (Terms, Privacy) ========== */
.legal-content {
  max-width: 720px;
  margin: 2rem auto;
  background: var(--color-bg-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.legal-content h2 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.25rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { font-size: 0.95rem; color: var(--color-text-muted); }
.legal-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content li { margin-bottom: 0.35rem; list-style: disc; }

/* ========== About page ========== */
.about-intro { margin: 2rem 0; }
.about-intro p { max-width: 720px; margin-left: auto; margin-right: auto; color: var(--color-text-muted); }
.about-values {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 768px) { .about-values { grid-template-columns: repeat(3, 1fr); } }
.about-values .feature-card { height: 100%; }
