/* DFW HVAC Supply House - brand layer on top of styles.css.
   Palette (Brand Guidelines v1.0):
     Furnace Navy   #0D324D  - type, UI, large fields (the 70%)
     Ember Orange   #C44900  - accent, links, CTAs (the 10%, used like sparks)
     Warm Sand      #EFD6AC  - soft backgrounds
     Cool Slate     #A7ACB4  - lines & muted UI
     Signal Green   #306B34  - success / in-stock
     White #FFFFFF · Ink #111111
   Loaded AFTER styles.css so these rules win. */

:root {
  /* Brand tokens */
  --navy: #0D324D;        /* Furnace Navy */
  --ember: #C44900;       /* Ember Orange */
  --sand: #EFD6AC;        /* Warm Sand */
  --slate: #A7ACB4;       /* Cool Slate */
  --signal: #306B34;      /* Signal Green */
  --ink: #111111;

  /* Map brand tokens onto the shared template variables */
  --navy-2: #0a2a41;
  --navy-ink: #0a2233;
  --accent: #C44900;
  --accent-soft: #F6E4D9;   /* ember tint - soft accent backgrounds */
  --green: #306B34;         /* success / in-stock */
  --grey-200: #e3e3e1;

  /* DM Sans (self-hosted via next/font) with a safe fallback stack */
  --font: var(--font-dm, "DM Sans"), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body { font-family: var(--font); color: var(--navy-ink); }
h1, h2, h3 { letter-spacing: -.02em; }

/* ---------- Buttons (pill everywhere) ---------- */
.btn, .btn-sm, .btn-lg { border-radius: 999px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #a83e00; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--navy); }
.btn-primary:hover { background: var(--navy-2); }

/* ---------- Logo ---------- */
.brand-logo { height: 44px; width: auto; display: block; }
.footer-logo { height: 40px; width: auto; display: block; }
@media (max-width: 560px) { .brand-logo { height: 34px; } }

/* ---------- Header nav (desktop pills right, drawer on mobile) ---------- */
.header-nav a {
  font-size: 14.5px; font-weight: 600; color: var(--navy);
  padding: 9px 14px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.header-nav a:hover { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 861px) {
  .header-nav { position: static; left: auto; top: auto; transform: none; margin-left: auto; gap: 4px; }
}
.header-cta { flex: none; }
@media (max-width: 700px) { .header-cta { display: none; } }
/* under 860px the nav collapses and the logo is absolutely centered: push the CTA to the right edge */
@media (max-width: 860px) { .header-cta { margin-left: auto; } }
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.mobile-menu { pointer-events: none; }
body.menu-open .mobile-menu { pointer-events: auto; }
.mm-brand { height: 30px; width: auto; display: block; margin: 2px 4px 18px; }

/* ---------- Hero (warehouse photo under a Furnace Navy + Ember wash) ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(900px 620px at 88% 6%, rgba(196,73,0,.32), transparent 55%),
    linear-gradient(100deg, rgba(10,34,53,.95) 0%, rgba(11,43,66,.88) 36%, rgba(13,50,77,.62) 66%, rgba(13,50,77,.36) 100%),
    linear-gradient(180deg, rgba(10,34,53,.34) 0%, rgba(10,34,53,0) 34%, rgba(7,22,35,.74) 100%),
    url("hero.jpg") center/cover no-repeat,
    var(--navy);
}
@media (max-width: 768px) {
  /* stronger top-to-bottom wash so the headline stays legible over the photo on small screens */
  .hero {
    background:
      linear-gradient(180deg, rgba(9,28,44,.90) 0%, rgba(11,43,66,.72) 46%, rgba(7,22,35,.90) 100%),
      url("hero.jpg") center/cover no-repeat,
      var(--navy);
  }
}
.hero:after { opacity: .30; }
.hero-scroll { color: #cdd8e1; }
.hero-scroll:hover { color: #eef3f7; }
.hero-scroll svg { color: var(--sand); }
.hero-glow { background: radial-gradient(circle, rgba(196,73,0,.42), transparent 62%); }
.hero-eyebrow {
  color: #f4d9c6; background: rgba(196,73,0,.20); border-color: rgba(231,132,46,.45);
}
.hero-pulse { background: #e7842e; }
@keyframes heroPulse {
  0%   { box-shadow: 0 0 0 0 rgba(231,132,46,.6); }
  70%  { box-shadow: 0 0 0 9px rgba(231,132,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,132,46,0); }
}
.hero-accent {
  background: linear-gradient(100deg, #EFD6AC 0%, #F3C39A 52%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-trust div svg { color: var(--sand); }
.hero-trust b { color: #fff; }

/* ---------- Trust strip ---------- */
/* Desktop: centered horizontal row that wraps if needed. */
.trust-strip .wrap { display: block; }
.trust-track {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 34px;
}
.trust-item svg { color: var(--signal); }
.trust-clone { display: none; }

/* Mobile: endless carousel, one item at a time. The 5th slide is a copy of the
   first, so when the track resets from -400% back to 0% the swap is invisible -
   no blank slides, just continuous cycling. */
@media (max-width: 700px) {
  .trust-strip .wrap { overflow: hidden; padding: 14px 0; }
  .trust-track {
    flex-wrap: nowrap; gap: 0; width: 100%;
    animation: trustCycle 12s infinite; will-change: transform;
  }
  .trust-track .trust-item { flex: 0 0 100%; justify-content: center; font-size: 13.5px; }
  .trust-clone { display: flex; }
}
@keyframes trustCycle {
  0%, 18%   { transform: translateX(0%); }
  22%, 42%  { transform: translateX(-100%); }
  46%, 66%  { transform: translateX(-200%); }
  70%, 90%  { transform: translateX(-300%); }
  100%      { transform: translateX(-400%); }
}
/* Accessibility: if the visitor prefers reduced motion, stop the auto-cycle and
   let them swipe through instead. */
@media (prefers-reduced-motion: reduce) and (max-width: 700px) {
  .trust-track {
    animation: none; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .trust-track::-webkit-scrollbar { display: none; }
  .trust-track .trust-item { scroll-snap-align: center; }
  .trust-clone { display: none; }
}

/* ---------- Section rhythm + headings ---------- */
.section { padding-top: clamp(48px, 7vw, 78px); padding-bottom: clamp(48px, 7vw, 78px); }
.catalog-head h2, .cta-band h2 { letter-spacing: -.02em; }
.catalog-head h2 { margin: 0; color: var(--navy); font-size: clamp(1.55rem, 1.2rem + 1vw, 2.05rem); font-weight: 800; }
.section-lead { max-width: 680px; margin: 8px 0 2px; color: var(--grey-500); font-size: 15.5px; line-height: 1.6; }

/* ---------- Category cards ---------- */
.cats { display: grid; gap: 18px; margin-top: 26px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cat-card {
  display: flex; flex-direction: column; gap: 12px; padding: 22px;
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .18s, border-color .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.cat-ic { width: 48px; height: 48px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cat-card h3 { margin: 0; font-size: 16.5px; color: var(--navy); letter-spacing: -.01em; }
.cat-card p { margin: 0; font-size: 13.5px; color: var(--grey-500); line-height: 1.55; }
.cat-count { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }

/* ---------- Contact CTA band (navy field, no photo) ---------- */
.cta-band {
  margin-top: 8px; text-align: center; color: #fff;
  background:
    radial-gradient(900px 500px at 82% 0%, rgba(196,73,0,.26), transparent 60%),
    linear-gradient(120deg, #0d324d 0%, #0a2a41 100%),
    var(--navy);
  border-radius: 16px; padding: clamp(30px, 5vw, 52px); box-shadow: var(--shadow-md);
}
.cta-band h2 { margin: 0 0 10px; color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); text-shadow: 0 2px 18px rgba(0,0,0,.4); }
.cta-band p { max-width: 560px; margin: 0 auto 22px; color: #dbe4ec; font-size: 16px; line-height: 1.6; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer (navy, white logo) ---------- */
.site-footer { background: var(--navy); color: #b9c6d3; border-top: none; }
.site-footer h4 { color: #fff; }
.site-footer a { color: #b9c6d3; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-tagline { color: #93a6b8; }
.footer-copy { color: #7d92a6; }
.footer-bar { border-top: 1px solid rgba(255,255,255,.12); }
.site-footer .footer-badges span { color: #93a6b8; }
.site-footer .footer-badges svg { color: var(--sand); }
.site-footer .footer-social a { background: rgba(255,255,255,.1); color: #fff; }
.site-footer .footer-social a:hover { background: var(--accent); color: #fff; }

/* ---------- Desktop content width ---------- */
:root { --maxw: 1240px; }

/* ---------- Catalog grid + product cards ---------- */
.grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card-cat { background: rgba(13,50,77,.92); color: #fff; border-color: transparent; }
.card-price b { color: var(--navy-ink); }
.badge-stock {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--signal);
}
.badge-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }

/* ---------- Subpage hero (light navy/sand wash) ---------- */
.subhero {
  background: linear-gradient(120deg, #f5f8fa 0%, #eef3f6 55%, #e8eef2 100%);
  border-bottom: 1px solid var(--grey-200);
}
.subhero-eyebrow { color: var(--accent); }
.subhero h1 { color: var(--navy); }
.subhero .breadcrumb a:hover { color: var(--accent); }

/* ---------- Product detail (PDP) ---------- */
.pdp-cat { color: var(--accent); background: var(--accent-soft); }
.pdp .lead { color: var(--navy-ink); }
.feature-badges { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.feature-badges li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy); background: var(--accent-soft); border: 1px solid #f0cdb6; padding: 6px 11px; border-radius: 999px; }
.feature-badges svg { color: var(--accent); flex: none; }
.pdp-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 24px; }
.detail-copy { font-size: 15px; line-height: 1.75; color: var(--grey-700); margin: 0 0 14px; max-width: 74ch; }

/* ---------- Panels / info cards (light ember tint) ---------- */
.info-card:hover { border-color: var(--accent); }
.panel { background: rgba(196,73,0,.05); border: 1px solid rgba(196,73,0,.14); border-radius: 16px; padding: clamp(22px, 2.5vw, 30px); }
.panel-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--navy); margin: 0 0 18px; }
.panel-head svg { color: var(--accent); flex: none; }
.fact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.fact-list li { display: flex; gap: 11px; align-items: center; font-size: 14.5px; color: var(--grey-700); }
.fact-list li svg { color: var(--accent); flex: none; }
.fact-list b { color: var(--navy); font-weight: 700; }

/* ---------- Simple contact / quote form ---------- */
.quote-form { display: grid; gap: 14px; }
.quote-form .field { margin: 0; }
.quote-form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--navy-ink); }
.quote-form input, .quote-form textarea, .quote-form select {
  width: 100%; font-family: var(--font); font-size: 15px; color: var(--navy-ink);
  padding: 12px 14px; border: 1.5px solid var(--grey-300); border-radius: 10px; background: #fff;
}
.quote-form textarea { min-height: 130px; resize: vertical; }
.quote-form input:focus, .quote-form textarea:focus, .quote-form select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Contact detail rail ---------- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-ic { width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.contact-list b { display: block; color: var(--navy); font-size: 15px; margin-bottom: 2px; }
.contact-list span, .contact-list a { color: var(--grey-700); font-size: 14.5px; }
.contact-list a:hover { color: var(--accent); }

/* ---------- Feature grid (about / home) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 8px; }
.feature-grid .feature-card .fc-ic { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }

@media (max-width: 560px) {
  .header-nav a { padding: 8px 11px; font-size: 14px; }
}

/* ============================================================
   RESPONSIVE / UX FIXES (visual QA pass)
   ============================================================ */

/* ---------- Mobile drawer ---------- */
/* Hidden from the tab order while closed; the delay lets the slide-out finish. */
.mobile-menu { visibility: hidden; transition: visibility 0s .3s; }
body.menu-open .mobile-menu { visibility: visible; transition-delay: 0s; }
/* While open, <body> is position:fixed (see site-header.js) and the header goes
   position:fixed too, so pad the body by the header height to avoid a jump. */
@media (max-width: 860px) { body.menu-open { padding-top: 69px; } }
@media (max-width: 768px) { body.menu-open { padding-top: 61px; } }

/* ---------- Mobile hero ---------- */
/* styles.css layers a blurred ::before copy of the photo on phones; the brand wash
   above already handles legibility, and the blur turned the warehouse into mud. */
@media (max-width: 700px) { .hero::before { content: none; } }

/* ---------- Catalog grid: two-up on phones ---------- */
/* The auto-fill rule above forces one 358px-wide card per row on a phone, which
   made the homepage ~8,500px tall. Restore the base system's 2-col phone grid. */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 12px 12px 14px; }
  .card-name { font-size: 14px; line-height: 1.3; }
  .card-spec { font-size: 12.5px; margin-bottom: 12px; }
  .card-price b { font-size: 17px; }
}

/* ---------- Category cards: 3x2 on desktop, 2-up on phones ---------- */
/* auto-fill minmax(220px) gave 5 columns at 1240px, orphaning the 6th card. */
.cats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
  .cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-card { padding: 16px; gap: 10px; }
  .cat-card h3 { font-size: 15px; }
  .cat-card p { display: none; } /* title + count is enough at this width */
}

/* ---------- About: brand story split ---------- */
.about-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
@media (max-width: 760px) { .about-split { grid-template-columns: 1fr; } }

/* ---------- PDP on phones ---------- */
@media (max-width: 560px) {
  .pdp-cta .btn { flex: 1 1 100%; justify-content: center; }
  .breadcrumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- PDP: parsed product copy (scripts/import-products.py blocks) ---------- */
.detail-block.pd { max-width: 78ch; }
.pd-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 26px 0 8px; }
.pd-h { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; margin: 22px 0 8px; line-height: 1.35; }
.pd-label + .pd-h, .pd-h + .pd-label { margin-top: 6px; }
.pd-list { list-style: none; margin: 0 0 14px; padding: 0; }
.pd-list li { position: relative; padding-left: 22px; margin: 0 0 7px; font-size: 15px; line-height: 1.6; color: var(--grey-700); }
.pd-list li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pd-list li b { color: var(--navy-ink); font-weight: 650; }
.sku-line { overflow-wrap: anywhere; }

/* ---------- Catalog cards: long sheet names ---------- */
.card-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Spec table: keep labels on one line; values take the slack ---------- */
.spec-table td:first-child { white-space: nowrap; vertical-align: top; padding-right: 18px; }
.spec-table td:last-child { overflow-wrap: anywhere; }

/* ---------- PDP: collapsible product copy ---------- */
.pd-wrap { position: relative; }
.pd-body { overflow: hidden; transition: max-height .2s ease; }
.pd-wrap.is-collapsed .pd-body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 85%);
}
.pd-wrap.is-collapsed { padding-bottom: 0; }
.pd-toggle { margin-top: 14px; gap: 8px; }
.pd-wrap.is-collapsed .pd-toggle { position: relative; z-index: 1; }
