/* ============================================================================
   Melton Plumbing & Heating — Navy-Slate & Sky-Blue Theme (Zero External CDNs)
   ============================================================================ */
:root {
  --brand-primary: #0F172A;
  --brand-primary-dark: #090F1C;
  --brand-accent: #0284C7;
  --brand-accent-hover: #0369A1;
  --surface-bg: #F8FAFC;
  --surface-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --radius: 16px;
  --stone-border: #CBD5E1;
  --muted: var(--text-muted);
  --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sans: var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; font-family: var(--font-body); background: var(--surface-bg); color: var(--text-main); line-height: 1.6; padding-bottom: 72px; }
img, video, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--brand-primary-dark); line-height: 1.18; margin: 0; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-band { background: var(--surface-card); border-top: 1px solid var(--stone-border); border-bottom: 1px solid var(--stone-border); }
.eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; font: 800 .76rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-accent-hover); background: rgba(2, 132, 199, .12); margin-bottom: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 22px; border-radius: 999px; font: 700 .94rem/1.1 var(--font-body); text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: background-color .16s ease, border-color .16s ease; }
.btn-accent { background: var(--brand-accent); color: #FFFFFF; }
.btn-accent:hover { background: var(--brand-accent-hover); }
.btn-outline { background: var(--surface-card); color: var(--brand-primary); border-color: var(--brand-primary); }

.preview-banner { background: var(--brand-primary-dark); color: #fff; padding: 9px 16px; font-size: .84rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-banner[hidden] { display: none; }
.preview-banner button { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: 700 .78rem/1 var(--font-body); min-height: 36px; }
.promo-bar { background: var(--brand-primary); color: #fff; text-align: center; padding: 10px 16px; font-weight: 700; font-size: .9rem; }
.promo-bar[hidden] { display: none; }

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--stone-border); }
.nav-row { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 16px; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-primary-dark); font-weight: 800; font-size: 1.04rem; }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 600; font-size: .92rem; }
.nav-links a:hover { color: var(--brand-accent-hover); }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--stone-border); background: var(--surface-card); cursor: pointer; font-weight: 800; }
.mobile-drawer { display: none; flex-direction: column; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--stone-border); background: var(--surface-card); }
.mobile-drawer.is-open { display: flex; }
.mobile-drawer a { text-decoration: none; color: var(--text-main); font-weight: 700; min-height: 44px; display: flex; align-items: center; }

.hero-sec { padding: 54px 0; background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 62%, #0369A1 100%); color: #fff; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 32px; align-items: center; }
.hero-sec h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; }
.hero-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .82rem; font-weight: 700; margin-bottom: 14px; }
.hero-sub { color: rgba(255,255,255,.92); margin: 0 0 22px; max-width: 56ch; }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-frame { border-radius: var(--radius); overflow: hidden; border: 2px solid rgba(255,255,255,.22); box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.hero-frame img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface-card); border: 1px solid var(--stone-border); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 16px rgba(15,23,42,.06); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); font-size: .94rem; }
.card-price { display: inline-block; margin-top: 12px; font-weight: 700; font-size: .84rem; color: var(--brand-accent-hover); }

.ba-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.ba-card { background: var(--surface-card); border: 1px solid var(--stone-border); border-radius: var(--radius); overflow: hidden; }
.ba-stage { position: relative; aspect-ratio: 4 / 3; overflow: hidden; touch-action: pan-y; user-select: none; }
.ba-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.ba-divider { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: #fff; pointer-events: none; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; touch-action: pan-y; }
.ba-caption { padding: 14px 16px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gallery-btn { padding: 0; border: 1px solid var(--stone-border); border-radius: var(--radius); overflow: hidden; background: var(--surface-card); cursor: pointer; }
.gallery-btn img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.quote-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: calc(var(--radius) * 0.7); border: 1.5px solid #CBD5E1; font: inherit; background: var(--surface-card); color: var(--text-main); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 12px; padding: 12px; border-radius: 10px; font-weight: 600; background: #E0F2FE; color: #0C4A6E; border: 1px solid #7DD3FC; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--stone-border); background: var(--surface-card); font-size: .86rem; font-weight: 700; }

.site-footer { background: var(--brand-primary-dark); color: #E2E8F0; padding: 38px 0 92px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.sticky-mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none; grid-template-columns: repeat(3, 1fr); background: var(--surface-card); border-top: 1px solid var(--stone-border); }
.sticky-mobile-bar a { display: flex; align-items: center; justify-content: center; min-height: 54px; font-weight: 800; text-decoration: none; color: var(--brand-primary-dark); }
.sticky-mobile-bar a.is-primary { background: var(--brand-accent); color: #fff; }
dialog.lightbox { border: 0; border-radius: var(--radius); padding: 12px; max-width: min(92vw, 960px); background: var(--brand-primary-dark); color: #fff; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.8); }

@media (max-width: 860px) { .hero-grid, .cards-3, .quote-grid { grid-template-columns: 1fr; } .nav-links { display: none; } .nav-toggle { display: inline-flex; align-items: center; justify-content: center; } .sticky-mobile-bar { display: grid; } }
@media (max-width: 580px) { .form-grid { grid-template-columns: 1fr; } }
