/* ==========================================================
   Scale-Details – main stylesheet
   ========================================================== */

/* ---------- Fonts (self-hosted, no Google requests) ---------- */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

/* ---------- Colors & basics ---------- */
:root {
  --bg:        #111316;   /* asphalt */
  --bg-2:      #1a1d21;   /* panels */
  --bg-3:      #24282d;   /* placeholders, borders */
  --line:      #2e3338;
  --text:      #f2f2f0;
  --muted:     #a9afb6;
  --accent:    #d1141f;   /* signal red */
  --accent-hi: #ea2a35;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--text); }
a:hover { color: var(--accent-hi); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1;
  margin: 0;
}

/* thin red/white "kerb" stripe used as a divider */
.kerb {
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 28px, #f2f2f0 28px 56px);
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(17, 19, 22, .72);   /* lets the hatching / page shine through */
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 24px; min-height: 84px;
}

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 48px; height: 48px; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 22px; height: 2px; background: currentColor;
  margin: 0 auto; position: relative; content: "";
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after  { position: absolute; top: 7px; }

.main-nav { flex: 1; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 6px;
}
.main-nav li:first-child { margin-right: auto; }   /* START sits left, the rest right */
.main-nav a {
  display: block;
  padding: 10px 16px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--text);
}
.main-nav a:hover { color: var(--accent-hi); }
/* current page = red block */
.main-nav a[aria-current="page"],
.main-nav a[aria-current="page"]:hover { background: var(--accent); color: #fff; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 8px 24px 20px; gap: 0; }
  .main-nav li:first-child { margin-right: 0; }
  .main-nav a { padding: 14px 12px; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
/* flat headline band with the hatched surface */
.hero {
  padding: 72px 0 64px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px),
    var(--bg-2);
}
.hero .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.hero-logo { width: 240px; height: 240px; flex-shrink: 0; margin-left: auto; }
@media (max-width: 700px) { .hero-logo { width: 150px; height: 150px; } }
.hero h1 { font-size: clamp(48px, 8vw, 104px); }
.hero h1 em { display: block; font-style: normal; color: var(--accent-hi); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--head); font-weight: 700; font-size: 20px;
  text-transform: uppercase; letter-spacing: 1.5px; text-decoration: none;
  padding: 14px 28px; min-height: 48px;
  background: var(--accent); color: #fff; border: 2px solid var(--accent);
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--text); color: var(--text); }
.btn.ghost:hover { background: var(--text); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(40px, 5vw, 64px); }
.section-head p { color: var(--muted); max-width: 48ch; margin: 0; }

/* category tiles */
.cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1000px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .cats { grid-template-columns: 1fr; } }

.cat {
  display: flex; flex-direction: column;
  background: var(--bg-2);
  text-decoration: none; color: var(--text);
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease;
}
.cat:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--text); }
.cat .img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-3); }
.cat .img img { width: 100%; height: 100%; object-fit: cover; }
.cat .body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.cat .more { margin-top: auto; }   /* red link always on the bottom line */
.cat h3 { font-size: 34px; }
.cat p { color: var(--muted); font-size: 15px; margin: 8px 0 14px; }
.cat .more {
  font-family: var(--head); font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; font-size: 17px; color: var(--accent-hi);
}

/* placeholder for missing photos – remove once real images are in */
.ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px;
  color: var(--muted); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 12px, transparent 12px 24px),
    var(--bg-3);
}
/* gallery: one 16:9 stage, images cross-fade, not clickable */
.gallery-intro { color: var(--muted); max-width: 62ch; margin: -16px 0 32px; }
.gallery-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px),
    var(--bg-2);
}
.gallery-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
  pointer-events: none;
}
.gallery-stage img.on { opacity: 1; }
.gallery-stage .ph { position: absolute; inset: 0; background: none; }
.gallery-stage.has-images .ph { display: none; }
.gallery-ctrl {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: rgba(17, 19, 22, .72);
  border: 1px solid rgba(255, 255, 255, .12);
}
.gallery-ctrl[hidden] { display: none; }
.gallery-ctrl button {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.gallery-ctrl button:hover { background: var(--accent); color: #fff; }
.gallery-ctrl svg { width: 20px; height: 20px; }
.gallery-ctrl .i-play { display: block; }
.gallery-ctrl .i-pause { display: none; }
.gallery-ctrl .playing .i-play { display: none; }
.gallery-ctrl .playing .i-pause { display: block; }
.gallery-ctrl .count {
  font-family: var(--head); font-weight: 700; font-size: 16px; letter-spacing: 1px;
  color: var(--muted); padding: 0 12px 0 8px; min-width: 64px; text-align: center;
}

/* intro / USP strip */
.usp {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
}
@media (max-width: 800px) { .usp { grid-template-columns: 1fr; } }
.usp div { border-top: 3px solid var(--accent); padding-top: 18px; }
.usp h3 { font-size: 28px; margin-bottom: 8px; }
.usp p { color: var(--muted); margin: 0; }

/* buy band */
.buy {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px),
    var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.buy .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; }
.buy h2 { font-size: clamp(36px, 4.5vw, 56px); }
.buy h2 em { font-style: normal; color: var(--accent-hi); }
.buy p { color: var(--muted); margin: 10px 0 0; max-width: 52ch; }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 40px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.social { display: flex; gap: 12px; }
.social a {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.social a:hover { border-color: var(--accent); }
.social svg { width: 20px; height: 20px; }

/* accessibility helpers */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--accent); color: #fff; padding: 10px 16px; }
:focus-visible { outline: 3px solid var(--accent-hi); outline-offset: 3px; }

/* ==========================================================
   Product pages (Liveries, Wheels, Bodykits, Spare Parts)
   ========================================================== */
.page-hero { padding: 56px 0 48px; }
.products { padding: 72px 0 96px; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 16fr);   /* text 6 : image 16 */
  margin-bottom: 56px;
  border: 1px solid var(--line);
}
.product:last-child { margin-bottom: 0; }

/* black text field */
.product-info {
  background: #000;
  padding: 28px 24px 24px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.product-info h2 {
  font-size: 32px; font-weight: 800;
  color: var(--accent-hi);
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.product-text p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.product-buy {
  margin-top: auto; padding-top: 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.product-buy .price {
  font-family: var(--head); font-weight: 500; font-size: 30px; line-height: 1;
  white-space: nowrap;
}
.product-buy .btn { font-size: 17px; padding: 12px 16px; white-space: nowrap; }
.product-text ul { margin: 0 0 12px; padding: 0; list-style: none; }
.product-text li {
  position: relative; padding-left: 18px;
  color: var(--muted); font-size: 15px; line-height: 1.6;
}
.product-text li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 7px; height: 7px; background: var(--accent);
}

/* 16:9 image slider */
.product-slider {
  position: relative;
  overflow: hidden;          /* at least 16:9 (see ::before), grows if the text is longer */
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px),
    var(--bg-2);
}
.product-slider img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .5s ease;
}
.product-slider img.on { opacity: 1; }
.product-slider::before { content: ""; display: block; padding-top: 56.25%; }
.product-slider .ph { position: absolute; inset: 0; background: none; }

/* big, clearly visible arrows */
.product-slider .arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 56px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .6); color: #fff;
  border: 0; cursor: pointer;
}
.product-slider .arrow:hover { background: var(--accent); }
.product-slider .arrow svg { width: 28px; height: 28px; }
.product-slider .prev { left: 0; }
.product-slider .next { right: 0; }
.product-slider .slide-count {
  position: absolute; right: 12px; bottom: 10px; z-index: 2;
  font-family: var(--head); font-weight: 700; font-size: 15px; letter-spacing: 1px;
  background: rgba(0, 0, 0, .6); padding: 4px 10px;
}

@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; }
  .product-slider { order: -1; }     /* image on top, text below on phones */
}
.empty-note { color: var(--muted); }
