/*
Theme Name: Aftermarket Parts Australia
Theme URI: https://aftermarketpartsaustralia.com
Description: Parts catalogue theme built around the build plate. Vehicle first, fitment stated on every listing.
Author: Aftermarket Parts Australia
Version: 1.0
Text Domain: apx
*/

/* ---------------------------------------------------------------------------
   1. Tokens
   Ground is a cool paper white, structure is eucalypt green, panels are zinc.
   The one hot colour is callout red, used for diagram callouts and sale marks only.
--------------------------------------------------------------------------- */
:root {
	--ink:        #101F1B;
	--ink-2:      #33443F;
	--ink-3:      #5D6B67;
	--eucalypt:   #1E4D43;
	--eucalypt-d: #14352E;
	--eucalypt-l: #2C6B5D;
	--zinc-1:     #E7EBEA;
	--zinc-2:     #D2D9D7;
	--zinc-3:     #AFBAB7;
	--ground:     #F4F6F4;
	--paper:      #FFFFFF;
	--callout:    #B23A22;
	--line:       #D6DDDA;
	--line-dark:  rgba(255,255,255,.16);

	--font-display: "Anybody", "Arial Narrow", system-ui, sans-serif;
	--font-body:    "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono:    "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

	--wrap: 1260px;
	--r: 3px;                     /* corners stay square, never pill */
	--pad: clamp(18px, 4vw, 40px);
	--gap: clamp(16px, 2.2vw, 28px);
	--shadow: 0 1px 2px rgba(16,31,27,.06), 0 8px 24px rgba(16,31,27,.06);
}

/* ---------------------------------------------------------------------------
   2. Reset and base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.62;
	font-variant-numeric: tabular-nums lining-nums;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--eucalypt); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--callout); }
:focus-visible { outline: 2px solid var(--callout); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: min(var(--wrap), 100% - (var(--pad) * 2)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------------------------------------------------------------------------
   3. Typography
--------------------------------------------------------------------------- */
h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	font-stretch: 125%;             /* Anybody is variable width: wide headings are the house voice */
	line-height: 1.04;
	letter-spacing: -.01em;
	margin: 0 0 .5em;
	text-wrap: balance;
}
h1 { font-size: clamp(30px, 4.1vw, 54px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: clamp(18px, 1.7vw, 22px); font-stretch: 112%; }
h4 { font-size: 16px; font-stretch: 100%; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 62ch; }
.eyebrow {
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 12px;
}
.stamp { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.15em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }

/* ---------------------------------------------------------------------------
   4. Buttons. Square-shouldered, never pill.
--------------------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 13px 22px;
	background: var(--eucalypt); color: #fff;
	font-family: var(--font-display); font-stretch: 112%; font-weight: 700;
	font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
	border: 1px solid var(--eucalypt); border-radius: var(--r);
	text-decoration: none; cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--eucalypt-d); border-color: var(--eucalypt-d); color: #fff; }
.btn--ghost { background: transparent; color: var(--eucalypt); }
.btn--ghost:hover { background: var(--eucalypt); color: #fff; }
.btn--light { background: #fff; color: var(--eucalypt); border-color: var(--zinc-2); }
.btn--light:hover { background: var(--zinc-1); color: var(--eucalypt-d); border-color: var(--zinc-3); }
.btn--sm { padding: 9px 14px; font-size: 12px; }
.btn--block { width: 100%; }

/* ---------------------------------------------------------------------------
   5. The plate. Signature element: a stamped build plate, used for the vehicle
   finder on the home page and for the fitment block on a product page.
--------------------------------------------------------------------------- */
.plate {
	position: relative;
	background:
		linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 38%),
		repeating-linear-gradient(102deg, #DBE1E0 0 2px, #D3DAD8 2px 4px),
		var(--zinc-2);
	border: 1px solid var(--zinc-3);
	border-radius: var(--r);
	box-shadow: inset 0 1px 0 rgba(255,255,255,.7), var(--shadow);
	padding: clamp(18px, 2.4vw, 28px);
}
.plate::before, .plate::after {
	content: ""; position: absolute; top: 10px; width: 9px; height: 9px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff, var(--zinc-3) 60%, #8C9895);
	box-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.plate::before { left: 10px; }
.plate::after { right: 10px; }
.plate__head {
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
	border-bottom: 1px solid rgba(16,31,27,.22); padding-bottom: 10px; margin-bottom: 16px;
}
.plate__head b { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.plate__head span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.plate__row { display: grid; gap: 10px; margin-bottom: 12px; }
.plate__field { display: grid; gap: 5px; }
.plate__field > label {
	font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .13em;
	text-transform: uppercase; color: var(--ink-3);
}
.plate__field select, .plate__field input {
	appearance: none; -webkit-appearance: none;
	width: 100%; padding: 12px 34px 12px 12px;
	background: #F7F9F8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2333443F' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1px solid var(--zinc-3); border-radius: 2px;
	font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em;
	color: var(--ink);
	box-shadow: inset 0 1px 2px rgba(16,31,27,.12);
}
.plate__field input { background-image: none; padding-right: 12px; }
.plate__field select:disabled { color: var(--ink-3); background-color: #EDF0EF; }
.plate__note { font-family: var(--font-body); font-size: 13px; color: var(--ink-2); margin: 12px 0 0; }
.plate__note a { color: var(--eucalypt-d); }

/* Compact plate, used on product pages for the fitment facts. */
.plate--spec .plate__row { gap: 0; }
.plate--spec dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.plate--spec dt {
	font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
	color: var(--ink-3); padding: 9px 16px 9px 0; border-bottom: 1px solid rgba(16,31,27,.12);
}
.plate--spec dd {
	margin: 0; padding: 9px 0; text-align: right; font-family: var(--font-mono); font-size: 13px;
	border-bottom: 1px solid rgba(16,31,27,.12); color: var(--ink);
}
.plate--spec dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* ---------------------------------------------------------------------------
   6. Header
--------------------------------------------------------------------------- */
.topbar {
	background: var(--eucalypt-d); color: rgba(255,255,255,.86);
	font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
}
.topbar .wrap { display: flex; gap: 20px; align-items: center; justify-content: space-between; min-height: 34px; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.masthead .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--gap); min-height: 78px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 17px; line-height: 1; letter-spacing: -.01em; text-transform: uppercase; }
.brand__name span { display: block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .18em; color: var(--ink-3); margin-top: 4px; text-transform: uppercase; }

.hsearch { display: flex; border: 1px solid var(--zinc-3); border-radius: var(--r); background: #fff; overflow: hidden; }
.hsearch input {
	flex: 1; min-width: 0; padding: 12px 14px; border: 0; background: transparent;
	font-size: 14.5px;
}
.hsearch input::placeholder { color: var(--ink-3); }
.hsearch button {
	border: 0; background: var(--eucalypt); color: #fff; padding: 0 18px; cursor: pointer;
	font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
}
.hsearch button:hover { background: var(--eucalypt-d); }

.hactions { display: flex; align-items: center; gap: 6px; }
.hactions a { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-size: 13px; }
.hactions a:hover { background: var(--zinc-1); color: var(--eucalypt-d); }
.hactions .count { font-family: var(--font-mono); font-size: 11px; background: var(--eucalypt); color: #fff; border-radius: 2px; padding: 1px 5px; }

.systems { background: var(--eucalypt); }
.systems .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.systems .wrap::-webkit-scrollbar { display: none; }
.systems a {
	display: flex; align-items: center; gap: 8px; white-space: nowrap;
	padding: 13px 16px; color: rgba(255,255,255,.88); text-decoration: none;
	font-family: var(--font-display); font-stretch: 108%; font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
	border-bottom: 3px solid transparent;
}
.systems a:hover, .systems a[aria-current="page"] { color: #fff; background: var(--eucalypt-d); border-bottom-color: var(--callout); }
.systems svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.5; opacity: .85; }

.navtoggle { display: none; }

/* ---------------------------------------------------------------------------
   7. Sections and the home hero
--------------------------------------------------------------------------- */
.section { padding: clamp(44px, 6vw, 82px) 0; }
.section--paper { background: var(--paper); }
.section--dark { background: var(--eucalypt-d); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .eyebrow { color: rgba(255,255,255,.6); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gap); margin-bottom: clamp(22px, 3vw, 38px); }
.section__head p { margin: 0; }

.hero { position: relative; background: var(--eucalypt-d); color: #fff; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(92deg, var(--eucalypt-d) 8%, rgba(20,53,46,.72) 52%, rgba(20,53,46,.35)); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 56px); align-items: center; padding-block: clamp(46px, 6vw, 88px); }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: #fff; border-bottom: 4px solid var(--callout); padding-bottom: 2px; }
.hero p { color: rgba(255,255,255,.84); }
.hero__facts { display: flex; gap: 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-dark); }
.hero__facts div b { display: block; font-family: var(--font-mono); font-size: 19px; color: #fff; }
.hero__facts div span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* ---------------------------------------------------------------------------
   8. Product cards, styled as parts box labels
--------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

ul.products { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.card {
	position: relative; display: flex; flex-direction: column; height: 100%;
	background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--zinc-3); box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; mix-blend-mode: multiply; }
.card__tags { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.tag {
	font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
	padding: 4px 8px; background: var(--ink); color: #fff;
}
.tag--oem { background: var(--eucalypt); }
.tag--sale { background: var(--callout); }
.tag--side { background: var(--zinc-1); color: var(--ink-2); }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.card__sku { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); }
.card__name { font-size: 14.5px; line-height: 1.35; margin: 0; font-weight: 600; }
.card__name a { color: var(--ink); text-decoration: none; }
.card__name a:hover { color: var(--eucalypt); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.price { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--ink); }
.price del { color: var(--ink-3); font-size: 12px; margin-right: 6px; font-weight: 400; }
.price ins { text-decoration: none; color: var(--callout); }

/* ---------------------------------------------------------------------------
   9. Footer
--------------------------------------------------------------------------- */
.footer { background: var(--ink); color: rgba(255,255,255,.72); padding: clamp(40px, 5vw, 64px) 0 0; }
.footer a { color: rgba(255,255,255,.72); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer h4 { color: #fff; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--gap); padding-bottom: 40px; }
.footer__bar { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-family: var(--font-mono); font-size: 11px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------
   10. Responsive
--------------------------------------------------------------------------- */
@media (max-width: 1000px) {
	.hero .wrap { grid-template-columns: 1fr; }
	.footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
	.masthead .wrap { grid-template-columns: auto 1fr; gap: 12px; min-height: 64px; }
	.hsearch { grid-column: 1 / -1; margin-bottom: 12px; }
	.section__head { flex-direction: column; align-items: flex-start; }
	.footer__grid { grid-template-columns: 1fr; }
	.hero__facts { flex-wrap: wrap; gap: 18px; }

	/* The tagline wraps to five lines on a phone and crowds the links, so it stands down. */
	.topbar .wrap > p { display: none; }
	.topbar .wrap { justify-content: flex-start; }
	.topbar ul { gap: 4px; flex-wrap: wrap; }
	.topbar a { display: inline-block; padding: 11px 8px; }   /* a thumb-sized hit area */

	/* Touch targets: 44px of height for anything used to navigate. */
	.hactions a { padding: 12px 10px; }
	.dept__list a { padding: 12px 8px; }
	.typecard { padding: 16px; }
	.linkset a, .catguide__kids a, .make { padding: 14px; }
	.crumbs { gap: 6px 10px; }
	.crumbs a { padding: 4px 0; }
	.plate__note a, .prose a { padding: 2px 0; display: inline-block; }
	.footer ul { gap: 4px; }
	.footer ul a { display: inline-block; padding: 9px 0; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
