/* ============================================
   GreenLeaf Roofing - Main Stylesheet
   Mobile-first responsive design
   ============================================ */

/* CSS Custom Properties */
:root {
  --green-dark: #1B5E20;
  --green-primary: #2E7D32;
  --green-accent: #4CAF50;
  --green-light: #81C784;
  --green-bg: #E8F5E9;
  --dark: #1a1a1a;
  --dark-secondary: #2c2c2c;
  --dark-text: #333333;
  --gray: #666666;
  --gray-light: #999999;
  --gray-bg: #f5f5f5;
  --white: #ffffff;
  --font-heading: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Open Sans', 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --header-height: 120px;
  --transition: 0.3s ease;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-text);
  background: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--green-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--green-accent);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
  text-transform: uppercase;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.btn-green {
  background: var(--green-accent);
  color: var(--white);
}

.btn-green:hover {
  background: var(--green-primary);
  color: var(--white);
}

.btn-dark {
  background: var(--dark);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--dark-secondary);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
}

.btn-outline:hover {
  background: var(--green-primary);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--green-primary);
}

.btn-white:hover {
  background: var(--gray-bg);
  color: var(--green-dark);
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
  background: var(--green-primary);
  color: var(--white);
  padding: 8px 0;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-bar a {
  color: var(--white);
  font-weight: 600;
}

.top-bar a:hover {
  color: var(--green-light);
}

/* ============================================
   Header / Navigation
   ============================================ */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo img {
  height: 80px;
  width: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-primary);
  text-transform: uppercase;
}

.logo .logo-text-green {
  color: var(--green-primary);
}

.logo .logo-text-dark {
  color: var(--dark);
}

.main-nav {
  display: none;
}

.main-nav.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  padding: 20px;
  z-index: 999;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.main-nav li {
  border-bottom: 1px solid var(--gray-bg);
}

.main-nav a {
  display: block;
  padding: 12px 0;
  color: var(--dark-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-nav a:hover {
  color: var(--green-primary);
}

.nav-cta {
  margin-top: 15px;
}

.mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--dark);
  border-radius: 2px;
  transition: all var(--transition);
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown {
  display: none;
  padding-left: 20px;
}

.has-dropdown.open .dropdown {
  display: block;
}

.dropdown a {
  font-size: 0.85rem;
  padding: 8px 0;
  font-weight: 400;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--dark) 100%);
  min-height: 400px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-bg.active {
  opacity: 0.4;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  color: var(--white);
  font-size: 2.2rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero .hero-subtitle {
  color: var(--green-light);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.hero .hero-tagline {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 25px;
  max-width: 600px;
}

.hero .btn {
  font-size: 1.1rem;
  padding: 14px 32px;
}

/* Service Icons Row */
.service-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.service-icon-item {
  text-align: center;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-icon-item .icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--green-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  transition: all var(--transition);
}

.service-icon-item:hover .icon-circle {
  background: var(--green-accent);
}

.service-icon-item .icon-circle svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
}

.service-icon-item span {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Call Now Bar
   ============================================ */
.call-bar {
  background: var(--dark);
  padding: 15px 0;
  text-align: center;
}

.call-bar a {
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.call-bar a:hover {
  color: var(--green-accent);
}

.call-bar .call-icon {
  width: 36px;
  height: 36px;
  background: var(--green-accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.call-bar .call-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--white);
}

/* ============================================
   Contact Form Section
   ============================================ */
.contact-form-section {
  background: var(--gray-bg);
  padding: 40px 0;
}

.contact-form-section h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.5rem;
}

.contact-form-section .green-text {
  color: var(--green-primary);
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: var(--white);
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--green-primary);
}

.contact-form .btn {
  justify-self: end;
}

/* ============================================
   Services Grid Section
   ============================================ */
.services-section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title .subtitle {
  color: var(--green-primary);
  font-family: var(--font-heading);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.section-title h2 {
  margin-bottom: 15px;
}

.section-title p {
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.service-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.service-card-content {
  padding: 20px;
}

.service-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.service-card p {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.service-card .btn {
  font-size: 0.85rem;
  padding: 8px 20px;
}

/* ============================================
   Why Choose Us Section
   ============================================ */
.why-choose {
  padding: 60px 0;
  background-size: cover;
  background-position: center;
  position: relative;
}

.why-choose::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}

.why-choose .container {
  position: relative;
  z-index: 2;
}

.why-choose .section-title .subtitle,
.why-choose .section-title h2 {
  color: var(--white);
}

.why-choose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.why-choose-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  color: var(--white);
}

.why-choose-item .icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--green-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-choose-item .icon svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
}

.why-choose-item h4 {
  color: var(--white);
  margin-bottom: 5px;
  font-size: 1rem;
}

.why-choose-item p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ============================================
   Badges / Partners Section
   ============================================ */
.badges-section {
  padding: 40px 0;
  background: var(--gray-bg);
}

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.badges-grid img {
  height: 50px;
  width: auto;
  filter: grayscale(30%);
  transition: filter var(--transition);
}

.badges-grid img:hover {
  filter: grayscale(0%);
}

/* ============================================
   Testimonials Section
   ============================================ */
.testimonials-section {
  padding: 60px 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.testimonial-card {
  background: var(--white);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  position: relative;
}

.testimonial-card .quote-icon {
  color: var(--green-accent);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 15px;
}

.testimonial-card p {
  font-style: italic;
  color: var(--gray);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.testimonial-card .author {
  font-weight: 700;
  color: var(--dark);
}

.testimonial-card .location {
  color: var(--gray-light);
  font-size: 0.85rem;
}

/* ============================================
   Feature Badges Row
   ============================================ */
.feature-badges {
  padding: 40px 0;
  background: var(--white);
}

.feature-badges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.feature-badge {
  text-align: center;
  width: 100px;
}

.feature-badge .badge-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--green-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  background: var(--white);
}

.feature-badge .badge-icon svg {
  width: 30px;
  height: 30px;
  fill: var(--green-primary);
}

.feature-badge span {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--dark);
  letter-spacing: 0.3px;
}

/* ============================================
   Gallery Section
   ============================================ */
.gallery-section {
  padding: 40px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding: 50px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding-bottom: 30px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-logo .green {
  color: var(--green-accent);
}

.footer-links h4 {
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #ccc;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--green-accent);
}

.footer-contact p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #ccc;
}

.footer-contact svg {
  width: 18px;
  height: 18px;
  fill: var(--green-accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-contact a {
  color: #ccc;
}

.footer-contact a:hover {
  color: var(--green-accent);
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.footer-social a.fb { background: #3b5998; }
.footer-social a.yelp { background: #d32323; }
.footer-social a.bbb { background: #005a78; }
.footer-social a.google { background: #DB4437; }

.footer-social a:hover {
  opacity: 0.85;
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: var(--white);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding: 20px 0;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

.footer-bottom a {
  color: var(--green-accent);
}

/* ============================================
   Floating Buttons
   ============================================ */
.floating-quote {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: var(--green-accent);
  color: var(--white);
  padding: 15px 10px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 4px 0 0 4px;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.floating-quote:hover {
  background: var(--green-primary);
  color: var(--white);
  padding-right: 15px;
}

.floating-chat {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 900;
  width: 60px;
  height: 60px;
  background: var(--green-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.floating-chat:hover {
  background: var(--green-primary);
  transform: scale(1.1);
}

.floating-chat svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
}

/* ============================================
   Page Header (for inner pages)
   ============================================ */
.page-header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--dark) 100%);
  padding: 50px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 10px;
}

.page-header p {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--green-accent);
}

.breadcrumb span {
  color: rgba(255,255,255,0.6);
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
  padding: 60px 0;
}

.content-section.alt-bg {
  background: var(--gray-bg);
}

.content-section.dark-bg {
  background: var(--dark);
  color: var(--white);
}

.content-section.dark-bg h2,
.content-section.dark-bg h3 {
  color: var(--white);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

.content-grid img {
  border-radius: 8px;
  width: 100%;
}

/* ============================================
   Blog / Article Styles
   ============================================ */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 30px 0 15px;
  color: var(--green-primary);
}

.article-content h3 {
  font-size: 1.2rem;
  margin: 25px 0 12px;
}

.article-content p {
  margin-bottom: 15px;
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  margin-bottom: 15px;
  padding-left: 25px;
  list-style: disc;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--green-accent);
  padding: 20px 25px;
  margin: 25px 0;
  background: var(--green-bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.article-content .cta-box {
  background: var(--green-primary);
  color: var(--white);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  margin: 30px 0;
}

.article-content .cta-box h3 {
  color: var(--white);
  margin-bottom: 10px;
}

.article-content .cta-box p {
  margin-bottom: 15px;
  opacity: 0.9;
}

/* Article sidebar / related posts */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
}

.article-sidebar {
  background: var(--gray-bg);
  padding: 25px;
  border-radius: 8px;
}

.article-sidebar h3 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--green-primary);
}

.article-sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-sidebar a {
  color: var(--dark-text);
  font-size: 0.9rem;
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}

.article-sidebar a:hover {
  color: var(--green-primary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
  padding: 60px 0;
}

.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--green-primary);
  transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  display: none;
  padding-top: 15px;
  color: var(--gray);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  display: block;
}

/* ============================================
   Scroll to Top
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 100px;
  right: 25px;
  z-index: 800;
  width: 44px;
  height: 44px;
  background: var(--green-accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all var(--transition);
}

.scroll-top.visible {
  display: flex;
}

.scroll-top:hover {
  background: var(--green-primary);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
  fill: var(--white);
}

/* ============================================
   Quote Page
   ============================================ */
.quote-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

@media (min-width: 768px) {
  .quote-form {
    grid-template-columns: 1fr 1fr;
  }

  .quote-content-grid {
    grid-template-columns: 2fr 1fr;
  }
}

@media (min-width: 1024px) {
  .contact-form.quote-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.4rem; }

  .contact-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-form .btn {
    grid-column: span 2;
    justify-self: center;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-choose-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* Content grid — stacks on mobile/tablet, side-by-side on 900px+ */
@media (min-width: 900px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Image+text 2-col grids: vertically center image with text */
  .content-grid:has(img) {
    align-items: center;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }

  .hero {
    min-height: 500px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .main-nav {
    display: flex;
    align-items: center;
  }

  .main-nav > ul {
    flex-direction: row;
    gap: 5px;
  }

  .dropdown {
    flex-direction: column;
  }

  .main-nav li {
    border-bottom: none;
  }

  .main-nav a {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .nav-cta {
    margin-top: 0;
    margin-left: 15px;
  }

  .mobile-toggle {
    display: none;
  }

  .dropdown {
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 10px 0;
    min-width: 220px;
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .has-dropdown.open-desktop .dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .dropdown a {
    padding: 8px 20px;
    white-space: nowrap;
  }

  .dropdown a:hover {
    background: var(--gray-bg);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-choose-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-content {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  }

  .contact-form {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-form .btn {
    grid-column: auto;
    justify-self: stretch;
  }

  .page-header {
    padding: 70px 0;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .container {
    padding: 0 40px;
  }
}

/* ============================================
   Mobile Overrides
   Uses !important to override inline styles
   ============================================ */
@media (max-width: 899px) {

  /* Force ALL grids to single column — catches every inline style */
  .content-grid,
  .content-grid[style],
  .content-grid[style*="repeat("],
  .content-grid[style*="1fr 1fr"],
  .content-grid[style*="2fr 1fr"],
  .content-grid[style*="repeat(3"],
  .content-grid[style*="repeat(4"],
  .content-grid[style*="repeat(5"] {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* Images in content grids: full width, proportional height */
  /* Only apply to large photos, not badges/logos/icons */
  .content-grid > div:has(> img:only-child) > img,
  .content-grid > div > img:only-child {
    width: 100% !important;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
  }

  /* Badge/logo images inside cards — keep them small and readable */
  .content-grid img[style*="max-width"],
  .content-grid img[alt*="Certified"],
  .content-grid img[alt*="Rating"],
  .content-grid img[alt*="Reviews"],
  .content-grid img[alt*="Partner"],
  .content-grid img[alt*="Authorized"],
  .badges-grid img {
    width: auto !important;
    height: auto !important;
    max-width: 100px !important;
    max-height: 60px !important;
    object-fit: contain;
    margin: 0 auto 10px;
  }

  /* Move images after text so text always reads first */
  .content-grid img,
  .content-grid > div:has(img) {
    order: 2;
  }
  .content-grid > div:not(:has(img)) {
    order: 1;
  }

  /* Card grids — stretch cards to equal height */
  .content-grid > div {
    align-self: stretch;
  }

  /* Improve text readability in content sections */
  .content-section p,
  .content-grid p {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .content-section h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
  }

  .content-section h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
  }

  /* Card-style content blocks — better mobile padding */
  .content-grid > div[style*="padding"] {
    padding: 20px !important;
  }

  /* Page header smaller on mobile */
  .page-header {
    padding: 40px 0;
  }
  .page-header h1 {
    font-size: 1.6rem;
  }
  .page-header p {
    font-size: 0.95rem;
  }

  /* Services list on homepage — single col on small phones, 2 cols on larger */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Contact form — single column */
  .contact-form,
  form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .contact-form [style*="grid-column"] {
    grid-column: 1 !important;
  }
  .contact-form .btn {
    grid-column: 1 !important;
    width: 100%;
  }

  /* Hero section adjustments */
  .hero {
    min-height: 350px;
    padding: 40px 20px;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 0.95rem;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Service icons row — 2x2 on mobile instead of cramped 4-col */
  .service-icons {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  /* Why choose grid — 1 col */
  .why-choose-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr !important;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Table-style business hours on contact page */
  table {
    font-size: 0.9rem;
  }

  /* Badges/partners — wrap nicely */
  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .badges-grid img {
    height: 50px !important;
  }

  /* Section padding reduction */
  .content-section {
    padding: 40px 0;
  }

  /* CTA buttons in sections */
  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  /* Inline-styled flex containers — stack vertically */
  .content-grid > div[style*="display:flex"],
  .content-grid > div[style*="display: flex"] {
    flex-direction: column !important;
  }

  /* Floating quote tab — hide on mobile to prevent overlap */
  .floating-quote {
    display: none;
  }


  /* Floating chat — smaller and tighter on mobile */
  .floating-chat {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
  .floating-chat svg {
    width: 22px;
    height: 22px;
  }

  /* Scroll-to-top — adjust position */
  .scroll-top {
    bottom: 80px;
    right: 15px;
    width: 38px;
    height: 38px;
  }

  /* ---- Mobile Accordion for multi-item card grids ---- */
  .content-grid.mobile-accordion > * {
    cursor: pointer;
    position: relative;
  }

  /* Tap indicator arrow on h3 */
  .content-grid.mobile-accordion > * > h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0 !important;
  }

  .content-grid.mobile-accordion > * > h3::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--green-primary);
    margin-left: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
  }

  .content-grid.mobile-accordion > .accordion-open > h3::after {
    content: '\2212';
  }

  /* Hide content below h3 by default */
  .content-grid.mobile-accordion > * > p,
  .content-grid.mobile-accordion > * > ul,
  .content-grid.mobile-accordion > * > a.btn {
    display: none;
  }

  /* Show content when card is expanded */
  .content-grid.mobile-accordion > .accordion-open > p,
  .content-grid.mobile-accordion > .accordion-open > ul,
  .content-grid.mobile-accordion > .accordion-open > a.btn {
    display: block;
    margin-top: 12px;
  }

  /* For cards wrapped in <a> tags (services.php overview) */
  .content-grid.mobile-accordion > a > div > p,
  .content-grid.mobile-accordion > a > div > ul {
    display: none;
  }

  .content-grid.mobile-accordion > a.accordion-open > div > p,
  .content-grid.mobile-accordion > a.accordion-open > div > ul {
    display: block;
    margin-top: 12px;
  }

  .content-grid.mobile-accordion > a > div > h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0 !important;
  }

  .content-grid.mobile-accordion > a > div > h3::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--green-primary);
    margin-left: 10px;
    flex-shrink: 0;
  }

  .content-grid.mobile-accordion > a.accordion-open > div > h3::after {
    content: '\2212';
  }

  /* Quote process step numbers — always visible */
  .content-grid.mobile-accordion > * > div[style*="font-size:2.5rem"] {
    display: block;
  }

  /* CTA card (green bg "Not sure what you need?") — no accordion, always show */
  .content-grid.mobile-accordion > .no-accordion > p,
  .content-grid.mobile-accordion > .no-accordion > a.btn,
  .content-grid.mobile-accordion > div[style*="background:var(--green-primary)"] > p,
  .content-grid.mobile-accordion > div[style*="background:var(--green-primary)"] > a {
    display: block !important;
  }
  .content-grid.mobile-accordion > div[style*="background:var(--green-primary)"] > h3::after {
    display: none;
  }
  .content-grid.mobile-accordion > div[style*="background:var(--green-primary)"] {
    cursor: default;
  }
}

/* Small phones — extra optimizations */
@media (max-width: 480px) {

  body {
    font-size: 15px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

  .container {
    padding: 0 15px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero .hero-tagline {
    font-size: 0.9rem;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  /* Service cards — single column on small phones */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Smaller image heights on tiny screens */
  .content-grid img {
    height: 180px;
  }

  /* Gallery — 2 col stays but smaller */
  .gallery-grid {
    gap: 8px;
  }
  .gallery-grid img {
    height: 140px;
  }

  /* Badges — 2 col on small phones */
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Section spacing tighter */
  .content-section {
    padding: 30px 0;
  }

  /* Floating elements already hidden/sized in 899px breakpoint */
}
