:root {
  --navy: #0A1628;
  --navy-mid: #132243;
  --navy-light: #1E3A6E;
  --orange: #F97316;
  --orange-dark: #EA580C;
  --gray: #64748B;
  --gray-light: #94A3B8;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --text: #0F172A;
  --border: #E2E8F0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* NAV */
nav {
  background: var(--navy);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.nav-logo { flex-shrink: 0; display: flex; align-items: center; margin-right: 2.5rem; }
.nav-logo img { height: 52px; width: auto; max-width: none; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--orange); }
.nav-cta {
  background: var(--orange);
  color: white !important;
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  font-weight: 700 !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--orange-dark) !important; color: white !important; }
.nav-mobile-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a2e5a 100%);
  color: white;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.4);
  color: var(--orange);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}
.hero h1 span { color: var(--orange); }
.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--orange);
  color: white;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(249,115,22,0.4); }
.btn-secondary {
  background: transparent;
  color: white;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.2s;
  display: inline-block;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.08); }

/* HERO VISUAL */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hero-tank-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
}
.tank-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(249,115,22,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.tank-card-info { flex: 1; }
.tank-card-info h4 { font-size: 1rem; font-weight: 700; color: white; }
.tank-card-info p { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 0.15rem; }
.tank-card-price { text-align: right; }
.tank-card-price .price { font-size: 1.3rem; font-weight: 900; color: var(--orange); }
.tank-card-price .avail { font-size: 0.75rem; color: #4ADE80; font-weight: 600; margin-top: 0.2rem; }
.hero-compare-badge {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}
.hero-compare-badge .label { color: rgba(255,255,255,0.7); }
.hero-compare-badge .val-bad { color: #F87171; font-weight: 700; text-decoration: line-through; }
.hero-compare-badge .val-good { color: #4ADE80; font-weight: 700; font-size: 1rem; }

/* STATS BAR */
.stats-bar {
  background: var(--navy-mid);
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stats-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}
.stat-item { text-align: center; }
.stat-item .num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--orange);
  display: block;
  line-height: 1;
}
.stat-item .lbl { font-size: 0.75rem; color: rgba(255,255,255,0.6); letter-spacing: 0.5px; text-transform: uppercase; }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }

/* SECTIONS */
section { padding: 5rem 2rem; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-sub {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 3rem;
}
.section-dark { background: var(--navy); }
.section-dark .section-title { color: white; }
.section-dark .section-sub { color: rgba(255,255,255,0.65); }

/* TANK CARDS */
.tanks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.tank-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.tank-card:hover { transform: translateY(-3px); box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.tank-card-img {
  height: 200px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tank-card-img img { width: 100%; height: 100%; object-fit: cover; }
.tank-card-img .tank-placeholder { opacity: 0.3; }
.tank-badge-avail {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #4ADE80;
  color: #052e16;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tank-badge-coming {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  text-transform: uppercase;
}
.tank-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.tank-card-body h3 { font-size: 1.15rem; font-weight: 800; color: var(--navy); margin-bottom: 0.3rem; }
.tank-config { font-size: 0.82rem; color: var(--gray); font-weight: 500; margin-bottom: 1rem; }
.tank-specs-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.spec-mini { background: var(--bg); border-radius: 6px; padding: 0.4rem 0.6rem; }
.spec-mini .sk { font-size: 0.68rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.spec-mini .sv { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.tank-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.tank-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.tank-footer-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.tank-price .was { font-size: 0.8rem; color: var(--gray); text-decoration: line-through; margin-bottom: 0.1rem; }
.tank-price .now { font-size: 1.6rem; font-weight: 900; color: var(--navy); line-height: 1; }
.tank-price .per { font-size: 0.72rem; color: var(--gray); margin-top: 0.2rem; }
.tank-qty { font-size: 0.78rem; color: #16a34a; font-weight: 700; background: rgba(74,222,128,0.12); padding: 0.3rem 0.65rem; border-radius: 6px; white-space: nowrap; }
.btn-specs { background: none; border: 1px solid var(--border); color: var(--navy); padding: 0.55rem 0.9rem; border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.btn-specs:hover { background: var(--bg); }
.btn-quote { flex: 1; text-align: center; font-size: 0.85rem; padding: 0.6rem 1rem; }

/* SERVICES */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  transition: all 0.2s;
}
.service-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(249,115,22,0.4);
  transform: translateY(-2px);
}
.service-icon {
  width: 56px;
  height: 56px;
  background: rgba(249,115,22,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
}
.service-card h3 { font-size: 1.05rem; font-weight: 800; color: white; margin-bottom: 0.6rem; }
.service-card p { font-size: 0.88rem; color: rgba(255,255,255,0.6); line-height: 1.6; }
.service-card .service-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.service-card .service-detail li {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.3rem;
  padding-left: 1rem;
  position: relative;
  list-style: none;
}
.service-card .service-detail li::before { content: '→'; position: absolute; left: 0; color: var(--orange); }

/* CERTIFICATIONS */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.cert-card {
  background: white;
  border-radius: 14px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.cert-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.cert-card h3 { font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: 0.5rem; }
.cert-card p { font-size: 0.85rem; color: var(--gray); line-height: 1.6; }
.cert-file { font-size: 0.75rem; color: var(--orange); font-weight: 600; margin-top: 0.75rem; }

/* COMPARE TABLE */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.compare-table th {
  padding: 1rem 1.5rem;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
}
.compare-table th:first-child { text-align: left; }
.compare-table th.th-us { background: var(--navy); color: white; }
.compare-table th.th-them { background: var(--bg); color: var(--gray); }
.compare-table th.th-feature { background: #f1f5f9; color: var(--navy); }
.compare-table td { padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.compare-table td.feature-col { font-weight: 600; color: var(--navy); background: #f8fafc; }
.compare-table td.us-col { text-align: center; background: rgba(249,115,22,0.04); font-weight: 700; }
.compare-table td.them-col { text-align: center; color: var(--gray); }
.compare-table .good { color: #16a34a; }
.compare-table .bad { color: #dc2626; }
.compare-table tr:last-child td { border-bottom: none; }

/* CONTACT FORM */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 4rem; align-items: start; }
.contact-info h2 { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: 1rem; }
.contact-info p { color: var(--gray); line-height: 1.7; margin-bottom: 2rem; }
.contact-detail { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.contact-detail .icon {
  width: 44px; height: 44px;
  background: rgba(249,115,22,0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-detail .detail-text .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); font-weight: 600; }
.contact-detail .detail-text .value { font-size: 1rem; font-weight: 700; color: var(--navy); }
.contact-form-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: white;
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* FOOTER */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3rem 2rem 1.5rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand p { font-size: 0.85rem; line-height: 1.7; margin-top: 1rem; color: rgba(255,255,255,0.5); }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--orange); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 0.85rem; color: rgba(255,255,255,0.6); text-decoration: none; margin-bottom: 0.5rem; transition: color 0.2s; }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-bottom p { font-size: 0.8rem; }
.cert-strip { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.cert-strip span {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--navy);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  border-left: 4px solid var(--orange);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .certs-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--navy); padding: 1.5rem; gap: 1rem; z-index: 99; }
  .hero { padding: 3rem 1.5rem; }
  .services-grid { grid-template-columns: 1fr; }
  .certs-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .compare-table { font-size: 0.8rem; }
  .compare-table th, .compare-table td { padding: 0.6rem 0.8rem; }
}

/* ============================================================
   RESPONSIVE — MOBILE/TABLET FIXES
   Breakpoints: 768px (tablet), 480px (mobile)
   Rules here only ADD mobile overrides; desktop is untouched.
   ============================================================ */

/* ---------- Global images ---------- */
img { max-width: 100%; height: auto; }

/* ---------- NAV ---------- */
/* Make sure nav doesn't clip the logo on very small screens */
@media (max-width: 480px) {
  nav { padding: 0 1rem; }
  .nav-logo img { height: 38px; }
  .nav-inner { height: 60px; }
  /* Keep open menu anchored to 60px bar */
  .nav-links.open { top: 60px; }
}

/* ---------- HERO ---------- */
@media (max-width: 768px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .hero p { font-size: 1rem; }
  .hero-btns { flex-direction: column; gap: 0.75rem; }
  .hero-btns .btn-primary,
  .hero-btns .btn-secondary { width: 100%; text-align: center; }
  /* Hero visual cards — don't let price overflow */
  .hero-tank-card { flex-wrap: wrap; gap: 0.75rem; }
  .tank-card-price { min-width: 0; }
  .tank-card-price .price { font-size: 1.1rem; }
}

/* ---------- STATS BAR ---------- */
@media (max-width: 768px) {
  .stats-bar { padding: 1rem 1rem; }
  .stats-bar-inner { gap: 0.75rem; justify-content: space-evenly; }
  .stat-divider { display: none; }
  .stat-item .num { font-size: 1.3rem; }
  .stat-item .lbl { font-size: 0.65rem; }
}

/* ---------- SECTIONS ---------- */
@media (max-width: 768px) {
  section { padding: 3rem 1.25rem; }
  .section-inner { padding: 0; }
  .section-title { font-size: clamp(1.5rem, 5vw, 2rem); }
  .section-sub { font-size: 0.95rem; margin-bottom: 2rem; }
}

/* ---------- TANKS GRID ---------- */
@media (max-width: 768px) {
  .tanks-grid { grid-template-columns: 1fr; }
}

/* ---------- COMPARE TABLE (main page) ---------- */
/* Already wrapped in overflow-x:auto in HTML; make sure text stays readable */
@media (max-width: 480px) {
  .compare-table { font-size: 0.78rem; min-width: 480px; }
  .compare-table th, .compare-table td { padding: 0.5rem 0.7rem; }
}

/* ---------- FOOTER ---------- */
@media (max-width: 480px) {
  footer { padding: 2.5rem 1.25rem 1.25rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .cert-strip { justify-content: center; }
}

/* ---------- INDEX — inline-style grids ---------- */
/* Project gallery: 3-col -> 1-col on mobile */
@media (max-width: 768px) {
  /* Project gallery grid */
  .photo-gallery-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  /* CTA banner heading */
  .cta-heading { font-size: 1.6rem !important; }
}

/* ---------- ABOUT — story section ---------- */
/* .section-inner inline grid: 1fr 1fr -> stack */
@media (max-width: 768px) {
  /* Story two-col grid */
  .about-story-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
  /* Constrain story image height on mobile */
  .about-story-img { height: 240px !important; }
}

/* ---------- SERVICES — service detail pairs ---------- */
@media (max-width: 768px) {
  /* Each service detail pair (1fr 1fr) -> stack */
  .service-detail-pair { grid-template-columns: 1fr !important; gap: 2rem !important; }
  /* Reverse stacked order for pairs where image comes first */
  .service-detail-pair > div[style*="order:1"] { order: 0 !important; }
  .service-detail-pair > div[style*="order:2"] { order: 1 !important; }
  /* Remove photo height cap — let it be natural */
  .service-photo { height: 220px !important; }
  /* Process track — hide horizontal line, go vertical */
  .process-track { grid-template-columns: 1fr 1fr !important; }
  .process-track::before { display: none; }
}
@media (max-width: 480px) {
  .process-track { grid-template-columns: 1fr !important; }
}

/* ---------- CERTIFICATIONS — UL 2-col grid ---------- */
@media (max-width: 768px) {
  /* UL listing pair */
  .ul-cert-grid { grid-template-columns: 1fr !important; }
  /* EPA compliance mini-grid already uses auto-fit */
}

/* ---------- CONTACT FORM ---------- */
@media (max-width: 480px) {
  .contact-form-card { padding: 1.5rem; }
  .contact-info h2 { font-size: 1.6rem; }
}

/* ---------- INVENTORY — spec modal grid ---------- */
@media (max-width: 600px) {
  /* Modal spec grid — override inline style */
  #modal-content [style*="grid-template-columns:1fr 1fr"],
  #modal-content [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- BLOG ARTICLES ---------- */
@media (max-width: 768px) {
  .article-body { padding: 2rem 1.25rem; }
  .article-body h2 { font-size: 1.2rem; }
  .article-body h3 { font-size: 1rem; }
}
/* Blog tables — horizontal scroll */
@media (max-width: 600px) {
  .compare-tbl,
  .vs-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 380px;
  }
  /* Wrap table in a scrollable container via CSS */
  .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- PAGE HEADERS (inline h1 font sizes) ---------- */
/* Applied via selector on common page-header h1 elements */
@media (max-width: 768px) {
  /* All inline-styled page hero h1s use 2.6rem — scale down */
  div[style*="padding:4rem"] h1,
  div[style*="padding: 4rem"] h1 { font-size: clamp(1.7rem, 5.5vw, 2.2rem) !important; }

  /* Blog article h1s */
  div[style*="padding:3rem"] h1,
  div[style*="padding: 3rem"] h1 { font-size: clamp(1.5rem, 5vw, 2rem) !important; }
}

/* ---------- INLINE GRID OVERRIDES — catch remaining cases ---------- */
/* About page stats row: auto-fit already handles it, but ensure min wrapping */
@media (max-width: 480px) {
  /* Inline div grids with fixed minmax — force wrap */
  div[style*="grid-template-columns:repeat(auto-fit"] { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 360px) {
  div[style*="grid-template-columns:repeat(auto-fit"] { grid-template-columns: 1fr !important; }
}

/* ---------- INDEX — project gallery (inline repeat(3,1fr)) ---------- */
@media (max-width: 768px) {
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}
@media (min-width: 481px) and (max-width: 768px) {
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ---------- ABOUT — story 1fr 1fr ---------- */
@media (max-width: 768px) {
  /* The story section uses .section-inner with inline display:grid 1fr 1fr */
  .section-inner[style*="grid-template-columns:1fr 1fr"],
  .section-inner[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* ---------- CERTIFICATIONS — UL pair (inline 1fr 1fr) ---------- */
@media (max-width: 768px) {
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- SERVICES — service pair divs (inline 1fr 1fr) ---------- */
/* Already covered by the broad selector above */

/* ---------- INVENTORY — filter bar wraps ---------- */
@media (max-width: 480px) {
  div[style*="display:flex;align-items:center;gap:1rem;flex-wrap:wrap"] { gap: 0.5rem; }
  .filter-btn { font-size: 0.78rem; padding: 0.35rem 0.75rem; }
}

/* ---------- TOAST — keep on screen on small devices ---------- */
@media (max-width: 480px) {
  .toast { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}

/* ---------- GENERAL — prevent text overflow ---------- */
@media (max-width: 768px) {
  h1, h2, h3, h4 { overflow-wrap: break-word; word-break: break-word; }
  p, li, td, th { overflow-wrap: break-word; }
}

/* ---------- CERTIFICATIONS — EPA inline grid ---------- */
/* Already uses repeat(auto-fit, minmax(180px,1fr)) — will wrap automatically */

/* ---------- ABOUT + INDEX — inline CTA flex buttons ---------- */
@media (max-width: 480px) {
  div[style*="display:flex;gap:1rem;justify-content:center;flex-wrap:wrap"] {
    flex-direction: column;
    align-items: center;
  }
  div[style*="display:flex;gap:1rem;justify-content:center;flex-wrap:wrap"] .btn-primary,
  div[style*="display:flex;gap:1rem;justify-content:center;flex-wrap:wrap"] .btn-secondary {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* ---------- ABOUT page inline stat numbers — scale on very small screens ---------- */
@media (max-width: 360px) {
  div[style*="font-size:2.8rem"] { font-size: 2rem !important; }
}

/* ---------- CTA section headings — inline font-size:2.2rem ---------- */
@media (max-width: 480px) {
  h2[style*="font-size:2.2rem"],
  h2[style*="font-size: 2.2rem"],
  h2[style*="font-size:2rem"],
  h2[style*="font-size: 2rem"],
  h2[style*="font-size:1.8rem"],
  h2[style*="font-size: 1.8rem"] {
    font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
  }
}

/* ---------- About page h1 and service/cert/inventory page h1s ---------- */
@media (max-width: 480px) {
  h1[style*="font-size:2.6rem"],
  h1[style*="font-size: 2.6rem"],
  h1[style*="font-size:2.2rem"],
  h1[style*="font-size: 2.2rem"] {
    font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
    line-height: 1.2 !important;
  }
}
