/* ============================================
   The Chimney Xperts - Design System
   ============================================ */

:root {
  --primary: #1a1a2e;
  --primary-light: #22223a;
  --accent: #e85d04;
  --secondary: #f48c06;
  --gold: #faa307;
  --light: #f8f9fa;
  --text: #212529;
  --text-light: #e0e0e0;
  --white: #ffffff;
  --gray: #6c757d;
  --gray-light: #dee2e6;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
  --max-width: 1200px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

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

/* ============================================
   Emergency Banner
   ============================================ */
.emergency-banner {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1000;
}
.emergency-banner a {
  color: var(--white);
  text-decoration: underline;
  font-weight: 800;
}
.emergency-banner .pulse-icon {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--white);
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 1.5s infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ============================================
   CSS Logo
   ============================================ */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
}
.logo-icon {
  position: relative;
  width: 36px; height: 44px;
}
.logo-chimney {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 28px;
  background: var(--light);
  border-radius: 2px 2px 0 0;
}
.logo-chimney::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px;
  width: 28px; height: 6px;
  background: var(--light);
  border-radius: 2px;
}
.logo-flame {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 18px;
  background: var(--accent);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 1.5s ease-in-out infinite alternate;
}
.logo-flame::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 10px;
  background: var(--gold);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
@keyframes flicker {
  0% { transform: translateX(-50%) scaleY(1) scaleX(1); }
  50% { transform: translateX(-50%) scaleY(1.1) scaleX(0.9); }
  100% { transform: translateX(-50%) scaleY(0.95) scaleX(1.05); }
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text-top {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-light);
}
.logo-text-main {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.logo-text-main .x { color: var(--accent); }

/* ============================================
   Navigation
   ============================================ */
.header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links a {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-cta {
  background: var(--accent);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
}
.nav-cta:hover { background: var(--secondary); transform: translateY(-1px); }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 26px; height: 3px;
  background: var(--light);
  border-radius: 2px;
  transition: var(--transition);
}
.header-phone {
  display: none;
  color: var(--gold) !important;
  font-weight: 700;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: var(--primary);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
  }
  .nav-links.open { right: 0; }
  .menu-toggle { display: flex; z-index: 1002; }
  .header-phone { display: block; }
  .menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
  }
  .menu-overlay.open { display: block; }
}

/* ============================================
   Hero
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #16162b 60%, #0d0d1a 100%);
  color: var(--white);
  padding: 5rem 1.25rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,93,4,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  position: relative;
}
.hero h1 .highlight { color: var(--accent); }
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--gray-light);
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: rgba(250,163,7,0.15);
  color: var(--gold);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(250,163,7,0.3);
  position: relative;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: #d14e00; color: var(--white); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(232,93,4,0.4); }
.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}
.btn-secondary:hover { background: var(--white); color: var(--primary); }
.btn-gold {
  background: var(--gold);
  color: var(--primary);
}
.btn-gold:hover { background: var(--secondary); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.9rem; }

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 4rem 1.25rem;
}
.section-dark {
  background: var(--primary);
  color: var(--white);
}
.section-light {
  background: var(--light);
}
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.section-dark .section-title h2 { color: var(--white); }
.section-title p {
  color: var(--gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}
.section-dark .section-title p { color: var(--gray-light); }
.section-title .accent { color: var(--accent); }

/* ============================================
   Services Grid
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--gray-light);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.service-card p {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.service-card a { font-weight: 700; font-size: 0.9rem; }

/* Dark variant */
.section-dark .service-card {
  background: var(--primary-light);
  border-color: rgba(255,255,255,0.08);
}
.section-dark .service-card h3 { color: var(--white); }
.section-dark .service-card p { color: var(--gray-light); }

/* ============================================
   Why Choose Us
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.feature {
  text-align: center;
  padding: 1.5rem;
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}
.feature h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature p {
  font-size: 0.95rem;
  color: var(--gray);
}
.section-dark .feature p { color: var(--gray-light); }

/* ============================================
   How It Works
   ============================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  counter-reset: step;
}
.step {
  text-align: center;
  position: relative;
  padding: 1.5rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px; height: 50px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.step p {
  font-size: 0.95rem;
  color: var(--gray);
}

/* ============================================
   Testimonials
   ============================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.testimonial {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.testimonial-stars {
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.testimonial p {
  font-style: italic;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.testimonial-author {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--gray-light);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: color var(--transition);
}
.faq-question:hover { color: var(--accent); }
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item.open .faq-question::after { content: '\2212'; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner {
  padding: 0 0 1.25rem;
  color: var(--gray);
  line-height: 1.7;
}
.section-dark .faq-question { color: var(--white); }
.section-dark .faq-item { border-color: rgba(255,255,255,0.1); }
.section-dark .faq-answer-inner { color: var(--gray-light); }

/* ============================================
   Contact Form
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.section-dark .form-group label { color: var(--text-light); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition);
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { min-height: 120px; resize: vertical; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Service Areas
   ============================================ */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.area-tag {
  background: rgba(232,93,4,0.08);
  color: var(--accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: all var(--transition);
}
.area-tag:hover { background: var(--accent); color: var(--white); }

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 3rem 1.25rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto 2rem;
}
.footer h4 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer a { color: var(--gray-light); font-size: 0.9rem; }
.footer a:hover { color: var(--accent); }
.footer ul li { margin-bottom: 0.5rem; }
.footer-phone {
  color: var(--gold) !important;
  font-size: 1.2rem !important;
  font-weight: 700;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-bottom a { color: var(--gray-light); }

/* ============================================
   Floating Call Button
   ============================================ */
.floating-call {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  background: var(--accent);
  color: var(--white);
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 20px rgba(232,93,4,0.5);
  transition: all var(--transition);
  text-decoration: none;
  animation: float-pulse 2s infinite;
}
.floating-call:hover {
  transform: scale(1.1);
  background: #d14e00;
  color: var(--white);
}
@keyframes float-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(232,93,4,0.5); }
  50% { box-shadow: 0 4px 30px rgba(232,93,4,0.8); }
}
@media (min-width: 901px) {
  .floating-call { display: none; }
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumbs {
  padding: 0.75rem 1.25rem;
  background: var(--light);
  font-size: 0.85rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  list-style: none;
}
.breadcrumbs li::after { content: ' / '; color: var(--gray); margin: 0 0.25rem; }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--accent); }
.breadcrumbs li:last-child { color: var(--gray); }

/* ============================================
   Page Hero (Interior Pages)
   ============================================ */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #16162b 100%);
  color: var(--white);
  padding: 3rem 1.25rem;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.page-hero p {
  color: var(--gray-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Content Pages
   ============================================ */
.content { max-width: 800px; margin: 0 auto; padding: 3rem 1.25rem; }
.content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--primary);
}
.content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--primary);
}
.content p { margin-bottom: 1rem; color: var(--text); line-height: 1.8; }
.content ul, .content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li { margin-bottom: 0.5rem; line-height: 1.7; }

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: var(--white);
  padding: 3rem 1.25rem;
  text-align: center;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}
.cta-banner h2 { color: var(--white); font-size: 1.75rem; margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.9); margin-bottom: 1.5rem; font-size: 1.1rem; }
.cta-banner .btn { margin: 0.25rem; }

/* Full-width CTA section */
.section-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #c44d00 100%);
  padding: 3.5rem 1.25rem;
  text-align: center;
  color: var(--white);
}
.section-cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 0.75rem; }
.section-cta p { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: 0.9; }
.section-cta .btn { margin: 0.25rem; }

/* ============================================
   Blog
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.blog-empty {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

/* ============================================
   Map
   ============================================ */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-container iframe { width: 100%; height: 100%; border: 0; }

/* ============================================
   Service Area Cards
   ============================================ */
.area-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.area-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.area-card h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.5rem; }
.area-card p { color: var(--gray); font-size: 0.9rem; }

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   Thank You / 404
   ============================================ */
.message-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem;
}
.message-page h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.message-page p { color: var(--gray); font-size: 1.1rem; margin-bottom: 2rem; max-width: 500px; }
.message-page .big-icon { font-size: 4rem; margin-bottom: 1rem; display: block; }

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
