/* ============================================================
   Cape Wearparts & Supplies — main stylesheet
   ============================================================ */

:root {
  --ink: #17191c;
  --body: #3d4248;
  --muted: #6b7178;
  --line: #e4e6e8;
  --bg: #ffffff;
  --bg-alt: #f6f7f8;
  --red: #d6001c;
  --red-dark: #a80016;
  --max: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Archivo", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

p + p { margin-top: 1em; }

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

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

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

/* ---------- top utility bar ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 38px;
  flex-wrap: wrap;
  padding-top: 4px;
  padding-bottom: 4px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .note { color: #c9cdd2; }
.topbar .contacts { display: flex; gap: 22px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .topbar .note { display: none; }
  .topbar .contacts a:last-child { display: none; }
  .topbar .container { justify-content: center; }
  .topbar .contacts { gap: 26px; }
  .topbar .contacts a { padding: 6px 0; }
}

/* ---------- header / nav ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
.logo {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--red);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--ink); font-weight: 600; }
.logo:hover { color: var(--red-dark); }

.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav > ul { display: flex; align-items: center; gap: 26px; list-style: none; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 0;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--red); }

/* dropdown */
.has-dropdown { position: relative; }
.has-dropdown > a::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.dropdown {
  position: absolute;
  top: 100%;
  left: -14px;
  min-width: 260px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(23, 25, 28, 0.1);
  list-style: none;
  padding: 8px 0;
  display: none;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 18px; font-weight: 500; }
.dropdown a:hover { background: var(--bg-alt); }

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 4px;
  border: 1px solid var(--red);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle svg { display: block; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    box-shadow: 0 14px 28px rgba(23, 25, 28, 0.08);
  }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li { border-bottom: 1px solid var(--line); }
  .main-nav a { display: block; padding: 12px 0; }
  .has-dropdown > a::after { display: none; }
  .dropdown {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0 0 8px 14px;
    min-width: 0;
  }
  .main-nav .btn { display: block; margin-top: 16px; text-align: center; }
}

@media (max-width: 420px) {
  .logo { font-size: 0.98rem; }
  .site-header .container { min-height: 62px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--ink);
}
.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.hero .container {
  position: relative;
  padding-top: 96px;
  padding-bottom: 96px;
  max-width: 900px;
  text-align: center;
}
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero p.lead { font-size: 1.2rem; color: #e8eaec; max-width: 640px; margin: 0 auto 12px; }
.hero .hero-cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--ink); }

/* subpage header */
.page-head {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 42px;
}
.page-head h1 { margin: 6px 0 12px; }
.page-head .intro { max-width: 760px; }
.breadcrumbs { font-size: 0.875rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 12px; }

/* trust strip */
.trust-strip { border-top: 1px solid var(--line); }
.trust-strip .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 34px;
  padding-bottom: 34px;
}
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item svg { flex: none; margin-top: 3px; }
.trust-item strong { display: block; color: var(--ink); font-family: "Archivo", sans-serif; font-size: 1rem; }
.trust-item span { font-size: 0.92rem; color: var(--muted); }
@media (max-width: 800px) { .trust-strip .container { grid-template-columns: 1fr; gap: 18px; } }

/* cards */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 950px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: 0 12px 30px rgba(23, 25, 28, 0.09); border-color: #d4d7da; }
.card .card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); }
.card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.98rem; flex: 1; }
.card .card-link {
  margin-top: 16px;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.card a.cover-link { color: inherit; text-decoration: none; }

/* checklist */
.checklist { list-style: none; columns: 2; column-gap: 40px; }
.checklist li {
  break-inside: avoid;
  padding: 7px 0 7px 30px;
  position: relative;
  color: var(--body);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 16px;
  height: 16px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23d6001c" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') no-repeat center / contain;
}
@media (max-width: 640px) { .checklist { columns: 1; } }

/* split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split .split-img { border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.split .split-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 850px) { .split { grid-template-columns: 1fr; } }

/* brand list */
.brand-list { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; }
.brand-list li {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 20px;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
}

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table.parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: var(--bg);
}
table.parts th, table.parts td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--line); }
table.parts th {
  font-family: "Archivo", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-alt);
}
table.parts tr:last-child td { border-bottom: 0; }

/* before / after */
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.ba-grid figure { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.ba-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ba-grid figcaption {
  padding: 14px 18px;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
@media (max-width: 640px) { .ba-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 52px 18px 22px;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  color: var(--ink);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--red);
  font-weight: 400;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 22px 18px; }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; }
.cta-band .container {
  padding-top: 64px;
  padding-bottom: 64px;
  text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: 12px; }
.cta-band p { color: #c9cdd2; max-width: 560px; margin: 0 auto 28px; }
.cta-band .btn-outline { color: #fff; border-color: #fff; }
.cta-band .btn-outline:hover { background: #fff; color: var(--ink); }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }
@media (max-width: 850px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-details p { margin: 0 0 6px; }
.contact-details .label {
  font-family: "Archivo", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 6px;
}
.contact-details .label:first-child { margin-top: 0; }

form.quote-form { display: grid; gap: 16px; }
.quote-form label {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}
.quote-form input, .quote-form textarea {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  color: var(--ink);
  border: 1px solid #cfd3d7;
  border-radius: 4px;
  background: var(--bg);
}
.quote-form input:focus, .quote-form textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.map-wrap { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: 56px; }
.map-wrap iframe { display: block; width: 100%; height: 420px; border: 0; }

/* footer */
.site-footer { background: var(--ink); color: #b9bec4; font-size: 0.95rem; }
.site-footer .container { padding-top: 60px; padding-bottom: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #b9bec4; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-logo {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  display: inline-block;
  margin-bottom: 12px;
}
.footer-bottom {
  border-top: 1px solid #2c2f33;
  margin-top: 44px;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #8d939a;
}
.footer-bottom a { color: #8d939a; }
.footer-bottom a:hover { color: #fff; }

/* ---------- part number index ---------- */
.parts-search-wrap { max-width: 560px; margin-bottom: 28px; }
.parts-search-wrap label {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 8px;
}
#parts-search {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  border: 1px solid #cfd3d7;
  border-radius: 4px;
  background: var(--bg);
}
#parts-search:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}
.parts-count { font-size: 0.9rem; color: var(--muted); margin-top: 8px; min-height: 1.3em; }
table.parts td.pn {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
table.parts .ask { color: var(--muted); font-style: italic; }

/* ---------- steps (how it works) ---------- */
.step .card-body { align-items: flex-start; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 16px;
}

/* ---------- motion & premium finishes ---------- */

/* scroll reveal (elements get .reveal from js/main.js) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* hero entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroZoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}
.hero h1 { animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s backwards; }
.hero p.lead { animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s backwards; }
.hero p.lead + p.lead { animation-delay: 0.32s; }
.hero .hero-cta { animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.45s backwards; }
.hero-media img { animation: heroZoom 8s ease-out forwards; }

/* page-head entrance on subpages */
.page-head .breadcrumbs { animation: rise 0.55s ease 0.02s backwards; }
.page-head h1 { animation: rise 0.55s ease 0.1s backwards; }
.page-head .intro { animation: rise 0.55s ease 0.2s backwards; }

/* card lift + image zoom */
.card { transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease; }
.card:hover { transform: translateY(-4px); }
.card .card-img img { transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }
.card:hover .card-img img { transform: scale(1.045); }

/* button lift */
.btn { transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(214, 0, 28, 0.22); }
.btn-outline:hover { box-shadow: 0 8px 20px rgba(23, 25, 28, 0.16); }
.btn:active { transform: none; box-shadow: none; }

/* header shadow once scrolled (class added by js/main.js) */
.site-header { transition: box-shadow 0.25s ease; }
.site-header.scrolled { box-shadow: 0 4px 20px rgba(23, 25, 28, 0.08); }

/* desktop nav underline sweep */
@media (min-width: 901px) {
  .main-nav > ul > li > a { position: relative; }
  .main-nav > ul > li > a::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }
  .main-nav > ul > li > a:hover::before,
  .main-nav > ul > li > a[aria-current="page"]::before { transform: scaleX(1); }
}

/* dropdown ease-in */
.dropdown { transform-origin: top; }
@media (min-width: 901px) {
  @keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
  }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown { animation: dropIn 0.2s ease; }
}

/* brand pill hover */
.brand-list li { transition: border-color 0.2s ease, transform 0.2s ease; }
.brand-list li:hover { border-color: var(--red); transform: translateY(-2px); }

/* FAQ open affordance */
.faq summary::after { transition: transform 0.25s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq details { transition: border-color 0.2s ease; }
.faq details[open] { border-color: #d4d7da; }

/* form feedback */
.form-status {
  padding: 14px 18px;
  border-radius: 4px;
  font-weight: 600;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: #eef7ef; color: #1e6b2d; border: 1px solid #bfe0c5; }
.form-status.err { background: #fdeeee; color: #a12020; border: 1px solid #f0c4c4; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* utilities */
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.lead { font-size: 1.15rem; }
.center { text-align: center; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }
