/* ============================================================
   TRUCK TRADERS — SITEWIDE STYLES
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-elev-2: #1c1c1c;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --red: #e63022;
  --red-glow: #ff3a2a;
  --red-deep: #a01a10;
  /* Status-ribbon accents (Clearance = blue, New = green). Vivid enough to pop
     against vehicle photos with white ribbon text; -deep shades are the folded
     ribbon tails. */
  --blue: #1670ff;
  --blue-deep: #0b3ea6;
  --green: #17a44a;
  --green-deep: #0d6e31;
  --text: #f5f5f5;
  --text-dim: #a8a8a8;
  --text-faint: #6a6a6a;
  --display: 'Cinzel', serif;
  --sans: 'Oswald', sans-serif;
  --body: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-top: 0;
}

img, svg, video, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { max-width: 100%; }

.container {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ============== CUSTOM T CHARACTER ============== */
/* The T artwork is 678×1028 (about 1.5x taller than wide).
   The "letter" portion (horns through stem) is ~70% of the height;
   the bottom ~30% is the protruding dagger spike.
   To make horns align with cap-height of surrounding text and let only the
   spike protrude below baseline: total image height needs to be ~1em,
   with the bottom 0.3em hanging below the baseline. */
.ttT {
  display: inline-block;
  height: 1em;
  width: auto;
  vertical-align: baseline;
  margin: 0 -0.04em -0.3em -0.04em;  /* negative bottom margin keeps the spike from pushing line-height */
  transform: translateY(-0.14em);  /* raise so the arch base (not the tip) aligns with cap height */
}
h1 .ttT, h2 .ttT, h3 .ttT {
  height: 1em;
  margin-bottom: -0.3em;
}
/* In small UI elements (nav, buttons), same proportions */
.nav-links .ttT, .eyebrow .ttT, .btn-primary .ttT, .btn-secondary .ttT,
.financing-cta .ttT, .dual-card-link .ttT, .view-all .ttT, .nav-cta .ttT,
.dual-card-eyebrow .ttT, .tagline .ttT, .lead-popup .ttT, .breadcrumb .ttT,
.contact-card .ttT, .form-field .ttT, .footer-col .ttT {
  height: 1em;
  margin-bottom: -0.28em;
}
.t-word { display: inline; white-space: nowrap; }

/* Bullet T (the T before section headings like "PERSONAL INFORMATION").
   Sized intentionally large — bigger than the heading text it sits next to. */
img.t-bullet {
  display: inline-block;
  height: 40px;
  width: auto;
  vertical-align: middle;
  margin-right: 10px;
  margin-bottom: 4px;
}

/* ============== TYPOGRAPHY ============== */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
h2.section-title { font-size: clamp(2rem, 5vw, 4rem); text-transform: uppercase; margin: 0.75rem 0 0; }
h2.section-title .red { color: var(--red); }

/* ============== BUTTONS ============== */
.btn-primary, .btn-secondary {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.1rem 2.2rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
  min-height: 44px;
  text-align: center;
  justify-content: center;
  white-space: normal;
}
.btn-primary { background: var(--red); border-color: var(--red); color: var(--text); }
.btn-primary:hover { background: transparent; color: var(--red); }
.btn-secondary { background: transparent; border-color: var(--text); color: var(--text); }
.btn-secondary:hover { background: var(--text); color: var(--bg); }
.btn-arrow { transition: transform 0.2s; }
.btn-primary:hover .btn-arrow, .btn-secondary:hover .btn-arrow { transform: translateX(4px); }

/* ============== NAV ============== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}
.nav-inner {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: clamp(0.45rem, 1.5vw, 0.75rem) clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 2vw, 2rem);
  position: relative;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; color: var(--text); }
.nav-logo-img { height: clamp(54px, 8vw, 120px); width: auto; display: block; }
.nav-links { display: flex; list-style: none; gap: clamp(1rem, 2.5vw, 2.25rem); align-items: center; min-width: 0; }
.nav-links a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:hover::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 2px;
  background: var(--red);
}
.nav-cta {
  background: var(--red);
  color: var(--text);
  padding: 0.7rem 1.4rem;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--red);
  transition: all 0.2s;
}
.nav-cta:hover { background: transparent; color: var(--red); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 24px; }

/* ============== PAGE HEADER (for non-home pages) ============== */
.page-header {
  position: relative;
  padding: clamp(8rem, 14vw, 12rem) 0 clamp(3rem, 6vw, 4rem);
  background: linear-gradient(180deg, rgba(10,10,10,0.5) 0%, var(--bg) 100%),
    url('/assets/img/aerial.jpg') center/cover no-repeat;
  border-bottom: 2px solid var(--red);
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: 0; right: -200px;
  width: min(700px, 90vw); height: 100%;
  background: url('/assets/img/logo.png') center/contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
}
.page-header-content { position: relative; z-index: 2; }
.page-header h1 {
  font-size: clamp(2.15rem, 7vw, 4.5rem);
  text-transform: uppercase;
  line-height: 0.95;
  margin: 1rem 0;
}
.page-header h1 .red { color: var(--red); }
.page-header p {
  font-family: var(--sans);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 300;
  color: var(--text-dim);
  max-width: 700px;
  margin-top: 1rem;
}
.breadcrumb {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.breadcrumb a { color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb .sep { margin: 0 8px; color: var(--border-strong); }

/* ============== SECTIONS ============== */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.section-head-text { max-width: 700px; }
.section-head-text p { color: var(--text-dim); font-size: clamp(0.98rem, 2vw, 1.05rem); margin-top: 1rem; }

/* ============== FORMS ============== */
.form-field {
  margin-bottom: 1.5rem;
}
.form-field label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.form-field label .req { color: var(--red); margin-left: 4px; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-family: var(--body);
  font-size: 14px;
  transition: border 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--red);
}
.form-field textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: clamp(1.25rem, 4vw, 2rem);
  margin-bottom: 2rem;
  min-width: 0;
}
.form-section h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--text);
  letter-spacing: 0.03em;
}
.form-error {
  color: #ff5544;
  font-size: 13px;
  margin-top: 6px;
  font-family: var(--sans);
}
.form-success {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: #6dd57a;
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 1.1rem;
}
.form-success h3 { color: #6dd57a; font-family: var(--display); margin-bottom: 0.5rem; }
.form-disclosure { font-size: 12px; color: var(--text-faint); line-height: 1.5; margin-top: 1.5rem; }

/* ============== FOOTER ============== */
.footer {
  background: #060606;
  border-top: 2px solid var(--red);
  padding: clamp(3rem, 6vw, 4rem) 0 2rem;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  bottom: -250px; left: -250px;
  width: 700px; height: 700px;
  background: url('/assets/img/logo.png') center/contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
  position: relative;
}
.footer-brand-img { height: clamp(140px, 18vw, 220px); width: auto; display: block; margin-bottom: 1.5rem; }
.footer-brand p { color: var(--text-dim); font-size: 14px; max-width: 360px; line-height: 1.7; }
.footer-col h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-dim); text-decoration: none; font-size: 14px; transition: color 0.2s; display: inline-block; }
.footer-col a:hover { color: var(--red); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
}
.footer-social a:hover { border-color: var(--red); color: var(--red); }

/* ============== LEAD POPUP ============== */
.lead-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lead-popup-backdrop.show { opacity: 1; pointer-events: auto; }
.lead-popup {
  position: fixed;
  bottom: max(30px, env(safe-area-inset-bottom)); right: max(30px, env(safe-area-inset-right));
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: min(720px, calc(100svh - 40px));
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--red);
  padding: 1.75rem;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.lead-popup.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.lead-popup-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}
.lead-popup-close:hover { color: var(--text); }
.lead-popup h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.lead-popup p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.lead-popup .form-field { margin-bottom: 0.75rem; }
.lead-popup label { font-size: 11px; margin-bottom: 4px; }
.lead-popup input { padding: 0.65rem 0.85rem; font-size: 14px; }
.lead-popup-actions {
  display: flex; gap: 0.75rem; margin-top: 1rem;
}
.lead-popup .btn-send {
  flex: 1;
  background: var(--red);
  color: var(--text);
  border: 1px solid var(--red);
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.lead-popup .btn-send:hover { background: var(--red-deep); }
.lead-popup .btn-cancel {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.lead-popup .btn-cancel:hover { color: var(--text); border-color: var(--text-dim); }
.lead-popup .form-error { font-size: 12px; }
.lead-popup-thanks {
  text-align: center;
  padding: 1rem 0;
}
.lead-popup-thanks h3 { color: var(--red); }

/* ============== ANALYTICS CONSENT ============== */
.analytics-consent {
  position: fixed;
  z-index: 1200;
  left: clamp(0.75rem, 3vw, 2rem);
  right: clamp(0.75rem, 3vw, 2rem);
  bottom: clamp(0.75rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 980px;
  margin-inline: auto;
  padding: 1rem 1.1rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
}
.analytics-consent-copy { display: grid; gap: 0.2rem; }
.analytics-consent-copy strong {
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.analytics-consent-copy span { color: var(--text-dim); font-size: 0.82rem; line-height: 1.45; }
.analytics-consent-copy a,
.footer-privacy-link { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.analytics-consent-copy a { width: fit-content; font-size: 0.78rem; }
.analytics-consent-copy a:hover,
.footer-privacy-link:hover { color: var(--text); }
.analytics-consent-actions { display: flex; flex: 0 0 auto; gap: 0.65rem; }
.analytics-consent-actions button {
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-strong);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.analytics-consent-decline { background: transparent; color: var(--text-dim); }
.analytics-consent-allow { background: var(--red); border-color: var(--red) !important; color: var(--text); }
.analytics-consent-actions button:focus-visible,
[data-analytics-consent]:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100svh - 80px);
    overflow-y: auto;
    background: rgba(10,10,10,0.98);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  }
  .nav-links.is-open li { width: 100%; }
  .nav-links.is-open a {
    display: block;
    padding: 0.85rem clamp(1rem, 4vw, 2rem);
  }
  .nav-links.is-open a::after { display: none; }
  .page-header { padding: 8rem 0 3rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .lead-popup {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100svh - 1rem);
    padding: 1.35rem;
    border-left: none; border-right: none; border-bottom: none;
  }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .analytics-consent { align-items: stretch; flex-direction: column; gap: 0.9rem; }
  .analytics-consent-actions { width: 100%; }
  .analytics-consent-actions button { flex: 1; }
}


/* ============== MOBILE POLISH (<= 768px) ============== */
@media (max-width: 768px) {
  /* Keep tap-to-call visible: compact phone button */
  .nav-cta {
    display: inline-flex !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    margin-left: auto;
    margin-right: 0.5rem;
    white-space: nowrap;
  }
  .nav-inner { gap: 0.5rem; }

  /* Hero typography scale */
  .hero h1, h1 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1.08;
  }
  h1 .ttT { height: 0.95em; width: auto; }
  .hero-sub { font-size: 0.95rem; }
  .eyebrow { font-size: 0.7rem; letter-spacing: 0.15em; }

  /* Stack hero CTAs full width */
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .hero-ctas .btn-primary, .hero-ctas .btn-secondary { justify-content: center; }

  /* Trust stats stack */
  .hero-trust-inner { flex-direction: column; gap: 0.75rem; align-items: flex-start; }

  /* Tagline strip wraps */
  .tagline-strip-inner { flex-wrap: wrap; justify-content: center; gap: 0.4rem; font-size: 0.9rem; }

  /* Search bar stacks */
  .search-grid { grid-template-columns: 1fr !important; display: grid; gap: 0.75rem; }
  .search-submit { width: 100%; justify-content: center; }

  /* Section headings */
  h2 { font-size: clamp(1.5rem, 6.5vw, 2rem) !important; }

  /* Inventory grid single column */
  .inventory-grid { grid-template-columns: 1fr !important; }

  /* Vehicle page: stack gallery and info */
  .vehicle-layout, .vehicle-detail, [class*="vehicle-grid"] { grid-template-columns: 1fr !important; display: grid; }

  /* Generic two-column layouts stack */
  .split, .two-col, [class*="split-"] { grid-template-columns: 1fr !important; }

  /* Tables and long strings don't overflow */
  body { overflow-x: hidden; }
}

@media (max-width: 480px) {
  .nav-inner { padding-inline: 0.8rem; }
  .nav-logo-img { height: 46px; }
  .nav-cta { padding: 0.45rem 0.55rem; font-size: 0.72rem; }
  .hero { padding-top: 6rem; }
  .section { padding: 3rem 0; }
  .btn-primary, .btn-secondary { width: 100%; padding: 0.9rem 1rem; }
  .breadcrumb { line-height: 1.5; }
  .lead-popup-actions { flex-direction: column; }
}
