/* ============================================================
   Mountview Wholesale Hardware — styles.css
   Palette & type per research/design-language.md
   Light default on :root; dark override on [data-theme="dark"].
   Two-role colours kept as separate tokens:
     --on-brand  = text/icons on slate header/hero/footer/buttons
                   (near-white in BOTH themes — never remapped)
     --surface   = card/panel fill (flips light->dark)
   Verified dark contrast (WCAG):
     surface #2E4354 vs ground #152A38 = 1.44:1 (>=1.35 required)
     body #E7E9EA on surface = 8.42:1; muted #9AA3AA = 4.00:1
     dark orange link #F0873D on surface = 4.02:1
   ============================================================ */

:root {
  /* Brand */
  --slate: #1F3A4D;
  --slate-deep: #152A38;
  --orange: #E4610F;        /* CTA fills / icons / large display / rules ONLY */
  --orange-text: #B14A08;   /* small orange text on light (AA-safe) */
  --kraft: #C98A3C;

  /* Ground & surfaces (light) */
  --ground: #F4F2EE;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --grit: #E3E4E2;
  --border: #D9DAD7;

  /* Text (light) */
  --ink: #1B2024;
  --muted: #63696F;

  /* Roles that must NOT be remapped to a dark colour in dark theme */
  --on-brand: #F4F2EE;          /* text/icons on slate/hero/footer/buttons */
  --on-brand-muted: #C4CDD4;    /* secondary text on slate */

  /* Header/hero/footer grounds */
  --header-bg: var(--slate);
  --hero-bg: var(--slate-deep);
  --footer-bg: var(--slate-deep);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(21,42,56,.08), 0 1px 3px rgba(21,42,56,.06);
  --shadow-md: 0 4px 12px rgba(21,42,56,.10), 0 2px 4px rgba(21,42,56,.06);
  --card-border: 1px solid var(--border);

  /* Layout */
  --maxw: 1120px;
  --radius: 10px;
  --gap: 1.5rem;

  --font-head: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-breakpoint: 72rem; /* off-canvas below this (raised so inline nav+WA button fit; no h-scroll) */
}

[data-theme="dark"] {
  --ground: #152A38;
  --surface: #2E4354;       /* verified 1.44:1 vs ground */
  --surface-2: #274050;
  --grit: #24384A;
  --border: #3C5568;

  --ink: #E7E9EA;
  --muted: #9AA3AA;

  --orange-text: #F5945A;   /* lifted orange for small text/links in dark — ≥4.5:1 on --surface */

  --header-bg: var(--slate-deep);
  --hero-bg: #10222E;
  --footer-bg: #10222E;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
  --shadow-md: 0 6px 18px rgba(0,0,0,.5);
  --card-border: 1px solid var(--border);
  /* --on-brand / --on-brand-muted intentionally NOT remapped */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  overflow-x: hidden; /* guard against accidental h-scroll */
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--orange-text); }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  font-size: .8rem;
  color: var(--orange-text);
  margin: 0 0 .5rem;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.section--tight { padding: 2.25rem 0; }
.section--grit { background: var(--grit); }
.muted { color: var(--muted); }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* Numbers (phone/WhatsApp) — tabular, bold, large */
.num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- [TO CONFIRM] chip ---------- */
.confirm {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--orange-text);
  background: transparent;
  border: 1px dashed var(--orange-text);
  border-radius: 999px;
  padding: .05em .5em;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;       /* large text -> AA on orange fill at 3:1 */
  letter-spacing: .02em;
  line-height: 1;
  padding: .85rem 1.35rem;
  min-height: 48px;         /* tap target */
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s ease, filter .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-wa {                    /* primary orange CTA */
  background: var(--orange);
  color: #FFFFFF;            /* white on orange, large/bold -> AA */
  border-color: var(--orange);
}
.btn-wa:hover { filter: brightness(1.06); }

.btn-call {                  /* secondary — slate outline / solid on light */
  background: var(--slate);
  color: var(--on-brand);
  border-color: var(--slate);
}
.btn-call:hover { filter: brightness(1.12); }

.btn-ghost {                 /* on slate grounds */
  background: transparent;
  color: var(--on-brand);
  border-color: rgba(244,242,238,.55);
}
.btn-ghost:hover { background: rgba(244,242,238,.10); }

.btn-block { width: 100%; }

.btn svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  color: var(--on-brand);
  box-shadow: var(--shadow-md);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding: .5rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--on-brand);
  flex: 0 0 auto;
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.brand__mark svg { width: 100%; height: 100%; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .06em;
  color: var(--on-brand);
}
.brand__sub {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .62rem;
  letter-spacing: .22em;
  color: var(--on-brand-muted);
  margin-top: 2px;
}

/* Primary nav (inline on desktop) */
.nav {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.nav a:not(.btn) {
  color: var(--on-brand);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: .02em;
  white-space: nowrap;           /* guard: no mid-phrase wrap */
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover,
.nav a:not(.btn)[aria-current="page"] {
  color: #FFFFFF;
  border-bottom-color: var(--orange);
  text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }

/* Icon-only control buttons in header */
.icon-btn {
  display: flex;                 /* guard: fixed size needs flex */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  border: 1px solid rgba(244,242,238,.35);
  background: transparent;
  color: var(--on-brand);
  cursor: pointer;
}
.icon-btn:hover { background: rgba(244,242,238,.12); }
.icon-btn svg { width: 22px; height: 22px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Header WhatsApp button — compact on desktop */
.header-actions .btn-wa {
  font-size: .98rem;
  padding: .6rem 1rem;
  min-height: 44px;
}
/* Header WhatsApp button label: compact "Order" (icon carries the WhatsApp meaning;
   full aria-label kept on the anchor). The hero has the full "WhatsApp an order" CTA. */
.header-actions .btn-wa .btn-label-long { display: none; }
.header-actions .btn-wa .btn-label-short { display: inline; }

/* Hamburger */
.nav-toggle { display: none; }

/* ---------- Off-canvas / mobile nav ---------- */
@media (max-width: 72rem) {
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 320px);
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    background: var(--slate);
    padding: 5rem 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform .22s ease;
    box-shadow: -8px 0 24px rgba(0,0,0,.35);
    overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav a:not(.btn) {
    padding: .85rem .25rem;
    border-bottom: 1px solid rgba(244,242,238,.12);
  }
  .nav a:not(.btn):hover,
  .nav a:not(.btn)[aria-current="page"] { border-bottom-color: rgba(244,242,238,.12); color: var(--orange); }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid rgba(244,242,238,.35);
    border-radius: var(--radius);
    color: var(--on-brand);
    cursor: pointer;
    z-index: 60;
  }
  .nav-toggle svg { width: 24px; height: 24px; display: block; }
  .header-actions .btn-wa .btn-label-long { display: none; } /* shorten on small */
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(16,34,46,.55);
    opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 40;
  }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

/* Narrow phones: shrink the header so brand + actions fit inside the viewport
   (the WA button + call + toggle were overflowing past ~430px). */
@media (max-width: 30rem) {
  .header-row { gap: .5rem; }
  .header-actions { gap: .4rem; }
  .brand__sub { display: none; }               /* keep just "MOUNTVIEW" */
  .brand__name { font-size: 1.05rem; letter-spacing: .04em; }
  .header-actions .btn-wa .btn-label-short { display: none; }  /* icon-only; aria-label carries meaning */
  .header-actions .btn-wa { padding: .6rem .75rem; }
  .header-actions .btn-wa svg { margin: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-bg);
  color: var(--on-brand);
  position: relative;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3.5rem 0;
}
.hero h1 { color: var(--on-brand); }
.hero .eyebrow { color: #F0873D; }
/* chips sit on the dark hero ground — use the lifted orange, not the on-light --orange-text */
.hero .confirm { color: #F0873D; border-color: #F0873D; }
.hero__lead { color: var(--on-brand-muted); font-size: 1.2rem; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 1rem; }
.hero__status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .95rem; color: var(--on-brand-muted);
  margin-top: .5rem;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #6FBF73; flex: 0 0 auto; }
.status-dot--closed { background: #C46; }

/* Media placeholder block (no real photos yet) */
.imgph {
  position: relative;
  border-radius: var(--radius);
  border: 1px dashed rgba(244,242,238,.4);
  background:
    repeating-linear-gradient(45deg, rgba(228,97,15,.10) 0 12px, transparent 12px 24px),
    var(--slate);
  color: var(--on-brand);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  gap: .5rem;
}
.imgph.on-light {
  border-color: var(--border);
  background:
    repeating-linear-gradient(45deg, rgba(228,97,15,.08) 0 12px, transparent 12px 24px),
    var(--surface-2);
  color: var(--muted);
}
.imgph__label {
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
}
.imgph__note { font-size: .78rem; max-width: 34ch; }
.imgph svg { width: 40px; height: 40px; opacity: .8; }

/* ---------- Trust strip ---------- */
.trust {
  background: var(--slate);
  color: var(--on-brand);
}
.trust__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
  padding: 1.5rem 0;
}
.trust__item { display: flex; align-items: flex-start; gap: .6rem; font-size: .98rem; color: var(--on-brand); }
.trust__item .ic {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 auto; color: var(--orange);
}
.trust__item .ic svg { width: 22px; height: 22px; display: block; }
.trust__item .confirm { border-color: #F0873D; color: #F0873D; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  color: var(--ink);
}
.card h3 { color: var(--ink); }
.card__ic {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex: 0 0 auto;
  border-radius: var(--radius);
  background: rgba(228,97,15,.12);
  color: var(--orange);
  margin-bottom: .9rem;
}
.card__ic svg { width: 28px; height: 28px; display: block; }
a.card { text-decoration: none; transition: transform .1s ease, box-shadow .15s ease; }
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
a.card .card__more {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--orange-text); font-weight: 600; margin-top: .5rem;
}

/* Steps (how to order) */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.step { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 1.5rem 1.25rem; box-shadow: var(--shadow-sm); }
.step__n {
  counter-increment: step;
  font-family: var(--font-head); font-weight: 600; font-size: 1.5rem;
  color: var(--orange); display: block; margin-bottom: .4rem;
}
.step__n::before { content: counter(step); }

/* Range lists */
.rangelist { columns: 2; column-gap: 2.5rem; margin: 0; padding: 0; list-style: none; }
.rangelist li {
  break-inside: avoid;
  padding: .5rem 0 .5rem 1.6rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.rangelist li::before {
  content: ""; position: absolute; left: 0; top: 1rem;
  width: 10px; height: 10px; background: var(--orange);
  clip-path: polygon(0 100%, 50% 0, 100% 100%); /* small roof/chevron */
}

/* Areas band */
.areas { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.areas li {
  background: var(--surface); border: var(--card-border); border-radius: 999px;
  padding: .4rem 1rem; font-weight: 600; font-size: .95rem;
}

/* Callout / info panel */
.panel {
  background: var(--surface); border: var(--card-border); border-left: 4px solid var(--orange);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem;
}

/* Two-col split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

/* Rating line */
.rating-line { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.05rem; }
.rating-line .stars { color: var(--orange); letter-spacing: .05em; }

/* Map */
.map-embed { width: 100%; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); min-height: 340px; background: var(--grit); }

/* Hours table */
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
.hours th { font-family: var(--font-head); font-weight: 600; }
.hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-family: var(--font-head); letter-spacing: .01em; }
.req { color: var(--orange-text); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange);
}
.radio-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: .5rem; font-weight: 400; font-family: var(--font-body); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.form-note { font-size: .9rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--on-brand);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: var(--on-brand); font-size: 1.05rem; letter-spacing: .04em; }
.site-footer p, .site-footer li, .site-footer address { color: var(--on-brand-muted); font-style: normal; }
.site-footer a { color: var(--on-brand); text-decoration: none; }  /* guard: footer links explicit */
.site-footer a:hover { text-decoration: underline; color: #FFFFFF; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-contact { display: grid; gap: .5rem; }
.footer-contact .num { color: var(--on-brand); font-size: 1.1rem; }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(244,242,238,.18);
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
  font-size: .85rem; color: var(--on-brand-muted);
}
.footer-bottom a { color: var(--on-brand-muted); }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--orange); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Dark-mode link guard ----------
   Only unclassed anchors get remapped; .btn/.card/.nav/footer keep theirs. */
[data-theme="dark"] a:not([class]) { color: var(--orange-text); }

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  .hero__inner { grid-template-columns: 1fr; gap: 1.75rem; padding: 2.5rem 0; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 40rem) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .rangelist { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
  .hero__cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
