/* KGM Trade Links — site styles
   Colours and fonts live in :root below. Change them there and the whole site follows.
   The palette follows mobil.com: Mobil blue (#0c479d, also the blue in KGM's logo),
   near-black text, light grey bands and a charcoal footer. Mobil red is used only for
   thin decorative lines, never for text. */

:root {
  --brand: #0c479d;        /* Mobil blue: intro band, buttons, links */
  --brand-dark: #093a82;   /* hover and gradient shade of the blue */
  --accent: #fe000c;       /* Mobil red: decorative lines and focus rings only */
  --ink: #2b2626;          /* body text (as on mobil.com) */
  --muted: #5a5a5a;        /* secondary text */
  --line: #dedede;         /* borders */
  --input-line: #8c8c8c;   /* form field borders (dark enough to see) */
  --bg: #ffffff;
  --bg-tint: #f2f2f2;      /* light grey bands */
  --footer: #383838;       /* charcoal footer */
  --on-dark: #ffffff;
  --on-dark-muted: #dedede;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --max-width: 1120px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Keep section titles clear of the sticky header when jumping via the nav. */
section[id] { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 8px 14px;
  background: var(--brand);
  color: var(--on-dark);
  font-weight: 600;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(12, 71, 157, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo img { height: 50px; width: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
}
.nav-list a:hover { background: var(--bg-tint); color: var(--brand); }
.nav-list .nav-cta { background: var(--brand); color: var(--on-dark); font-weight: 600; }
.nav-list .nav-cta:hover { background: var(--brand-dark); color: var(--on-dark); }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--brand); color: var(--on-dark); }
.button-primary:hover { background: var(--brand-dark); color: var(--on-dark); }
/* On the blue intro band the main button turns white */
.hero .button-primary { background: #ffffff; color: var(--brand); }
.hero .button-primary:hover { background: #e6edf7; color: var(--brand-dark); }
.button-ghost { border-color: var(--on-dark-muted); color: var(--on-dark); }
.button-ghost:hover { border-color: var(--on-dark); color: var(--on-dark); background: rgba(255, 255, 255, 0.06); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; overflow-x: clip; }  /* clip keeps slide-in animations from causing sideways scroll */
.section-tint { background: var(--bg-tint); }
.section-intro { color: var(--muted); max-width: 60ch; }

.eyebrow {
  margin-bottom: 0.5em;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

/* Banner slideshow (top of the home page) */
.banner { position: relative; background: #f0f0f0; }
.slides {
  position: relative;
  max-width: 1300px;
  margin: 0 auto;
  aspect-ratio: 1300 / 500;
}
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}
.slide.is-active { opacity: 1; }
.slide-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.slide-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: rgba(12, 71, 157, 0.35);
  cursor: pointer;
}
.slide-dots button[aria-pressed="true"] { background: var(--brand); }

/* Intro band */
.hero {
  padding: 64px 0 72px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--on-dark);
}
.hero .eyebrow { color: var(--on-dark-muted); }
.hero h1 { max-width: 20ch; }
.hero .lead { max-width: 62ch; font-size: 1.15rem; color: var(--on-dark-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Mobil flagship */
.flagship {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 48px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--bg-tint);
}

.rounded { border-radius: var(--radius); }

/* Mobil range logos strip (under the intro) */
.logo-strip { padding: 28px 0; background: var(--bg-tint); border-bottom: 1px solid var(--line); }
.logo-strip-title {
  margin-bottom: 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.logo-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.logo-row li {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.logo-row img { max-height: 64px; width: auto; }

/* Popular Mobil products */
.products-title { margin-top: 56px; font-size: 1.35rem; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.product-grid li {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.product-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 12px 12px 14px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
.product-grid img { margin: 0 auto 8px; width: 100%; max-width: 160px; }
.product-grid .product-name { flex: 1; }
.pds-link {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
}
.product-grid a:hover .pds-link { color: var(--brand-dark); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Mobil ranges: small tags */
.range-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.range-list li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Product categories (What we supply) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
.category-grid li {
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
}
.category-grid img { width: 100%; aspect-ratio: 439 / 205; object-fit: cover; }
.category-grid span { display: block; padding: 12px 16px; }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 48px;
}
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.points li {
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.points h3 { margin-bottom: 0.3em; }
.points p { margin: 0; color: var(--muted); }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 48px;
  align-items: start;
}
.contact-list { list-style: none; margin: 24px 0 0; padding: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.contact-label { font-weight: 600; color: var(--muted); }
address { font-style: normal; }

/* Enquiry form */
.enquiry-form {
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--input-line);
  border-radius: 8px;
}
.field textarea { resize: vertical; }
.hidden-field { position: absolute; left: -9999px; }

/* Map */
.map { margin-top: 40px; }
.map iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.map p { margin: 8px 0 0; font-size: 0.95rem; }

/* Quick contact: floating WhatsApp button (larger screens) and bottom bar (phones) */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: #1f8f4e;           /* WhatsApp-style green, dark enough for white text */
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.whatsapp-float:hover { background: #18773f; color: #ffffff; }
.whatsapp-float svg,
.mobile-contact-bar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-contact-bar { display: none; }

/* Simple pages (thanks, 404) */
.simple-page { padding: 96px 0; min-height: 60vh; }
.simple-page p { max-width: 55ch; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 32px 0;
  background: var(--footer);
  color: var(--on-dark-muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0 0 0.5em; }
.site-footer .legal { font-size: 0.8rem; max-width: 80ch; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .flagship,
  .about,
  .contact { grid-template-columns: 1fr; gap: 32px; }
  .flagship-logo img { max-width: min(100%, 360px); }
  .logo-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .whatsapp-float { display: none; }
  .mobile-contact-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-contact-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    font-weight: 700;
    text-decoration: none;
    color: var(--brand);
  }
  .mobile-contact-bar .mobile-contact-whatsapp { background: #1f8f4e; color: #ffffff; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }  /* keep the footer clear of the bar */
  .map iframe { height: 260px; }
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 72px; }
  .logo img { height: 38px; }
  .header-inner { min-height: 60px; }
  .nav-list a { padding: 8px 8px; }
  .slide-dots { bottom: 6px; }
  .slide-dots button { width: 10px; height: 10px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
  .enquiry-form { padding: 20px; }
}

/* ---------- Animation ----------
   Hero text fades up when the page loads. Other blocks fade in as they scroll
   into view: animate.js adds .reveal, then .is-visible when the block appears.
   Nothing moves for visitors whose device asks for reduced motion. */

@keyframes fade-up {
  from { opacity: 0; transform: var(--reveal-from, translateY(28px)); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow,
  .hero h1,
  .hero .lead,
  .hero-actions { animation: fade-up 0.8s ease-out both; }
  .hero h1      { animation-delay: 0.12s; }
  .hero .lead   { animation-delay: 0.24s; }
  .hero-actions { animation-delay: 0.36s; }

  .reveal { opacity: 0; }
  .reveal.is-visible {
    opacity: 1;
    animation: fade-up 0.7s ease-out var(--delay, 0ms) backwards;
  }
  .flagship-logo.reveal { --reveal-from: translateX(-48px); }
  .flagship-text.reveal { --reveal-from: translateX(48px); }

  /* Cards lift slightly on hover */
  .category-grid li,
  .product-grid li,
  .points li,
  .button { transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
  .category-grid li:hover,
  .product-grid li:hover,
  .points li:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(12, 71, 157, 0.12);
  }
  .button:hover { transform: translateY(-1px); }

  /* WhatsApp button pops in after the page loads */
  .whatsapp-float { animation: fade-up 0.6s ease-out 1.2s both; }
}
