/*
Theme Name: AutoPro China
Theme URI: https://autoprochina.com
Author: AutoPro China
Description: The AutoPro China storefront theme — built to work with the AutoPro China plugin (vehicle/part catalog, staff listing uploads, WhatsApp ordering). Colors, logo, and hero text are customizable from Appearance > Customize.
Version: 2.3.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: autopro-theme
Tags: e-commerce, custom-colors, custom-logo, custom-menu, translation-ready

== Design notes ==
Visual identity: a shipping-manifest aesthetic — since every vehicle is
a pre-order shipped from China to Nigeria, the design borrows the
vocabulary of a bill of lading: manifest numbers, a route line
(origin -> destination), and a stamped "pre-order" mark. Colors are
lifted from the AutoPro China logo (signal red, deep green); "steel"
gray and paper background are the theme's own additions to keep the
cargo-document feel without being flat.
*/

/* ---------------------------------------------------------------- */
/* Design tokens — overridden live by Appearance > Customize          */
/* ---------------------------------------------------------------- */
:root {
	--ap-ink: #17181a;
	--ap-paper: #edefea;
	--ap-paper-raised: #f7f8f5;
	--ap-red: #c8000a;
	--ap-green: #00632d;
	--ap-steel: #4b5259;
	--ap-steel-light: #c9cdc7;
	--ap-radius: 6px;
	--ap-max-width: 1180px;
}

/* ---------------------------------------------------------------- */
/* Reset & base                                                       */
/* ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The [hidden] attribute has equal CSS specificity to a class selector,
   so any of our own rules setting "display" on the same element (like
   .ap-lightbox-modal's display:flex) can silently win over the browser's
   default hidden-attribute behavior once specificity ties. This keeps
   [hidden] always authoritative, site-wide, for anything using it now
   or in the future. */
[hidden] { display: none !important; }
body {
	margin: 0;
	background: var(--ap-paper);
	color: var(--ap-ink);
	font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	overflow-x: hidden; /* belt-and-braces: nothing on the page should ever force horizontal scroll of the whole viewport */
	max-width: 100vw;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4 {
	font-family: "Archivo", "IBM Plex Sans", sans-serif;
	font-weight: 800;
	line-height: 1.05;
	margin: 0 0 0.5em;
	letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

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

.ap-mono {
	font-family: "IBM Plex Mono", monospace;
}

.ap-eyebrow {
	font-family: "IBM Plex Mono", monospace;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem;
	color: var(--ap-steel);
}

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	overflow: hidden;
	height: 1px; width: 1px;
	word-wrap: normal !important;
}
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ap-ink);
	color: #fff;
	padding: 10px 16px;
	z-index: 10000;
}
.skip-link:focus { left: 16px; top: 16px; }

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

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---------------------------------------------------------------- */
/* Buttons                                                             */
/* ---------------------------------------------------------------- */
.ap-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: var(--ap-radius);
	font-weight: 600;
	text-decoration: none;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}
.ap-btn:hover { transform: translateY(-1px); }
.ap-btn-primary { background: var(--ap-red); color: #fff; }
.ap-btn-primary:hover { background: #a4000a; color: #fff; }
.ap-btn-outline { background: transparent; border-color: var(--ap-ink); color: var(--ap-ink); }
.ap-btn-outline:hover { background: var(--ap-ink); color: #fff; }

/* ---------------------------------------------------------------- */
/* Header                                                              */
/* ---------------------------------------------------------------- */
.ap-site-header {
	background: var(--ap-paper-raised);
	border-bottom: 2px solid var(--ap-ink);
	position: sticky;
	top: 0;
	z-index: 500;
}
.ap-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	max-width: var(--ap-max-width);
	margin: 0 auto;
	gap: 20px;
}
.ap-site-branding { display: flex; align-items: center; gap: 12px; }
.ap-site-title {
	font-family: "Archivo", sans-serif;
	font-weight: 900;
	font-size: 1.4rem;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--ap-ink);
}
.ap-site-title span { color: var(--ap-red); }
.custom-logo-link img { max-height: 44px; width: auto; }

.ap-primary-nav ul {
	list-style: none;
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
}
.ap-primary-nav a {
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--ap-ink);
	padding: 6px 0;
	border-bottom: 2px solid transparent;
}
.ap-primary-nav a:hover,
.ap-primary-nav .current-menu-item > a { border-bottom-color: var(--ap-red); }

.ap-menu-toggle {
	display: none;
	background: none;
	border: 2px solid var(--ap-ink);
	border-radius: var(--ap-radius);
	padding: 8px 12px;
	font-family: "IBM Plex Mono", monospace;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.75rem;
}

@media (max-width: 860px) {
	.ap-menu-toggle { display: inline-flex; }
	.ap-primary-nav {
		display: none;
		position: absolute;
		left: 0; right: 0; top: 100%;
		background: var(--ap-paper-raised);
		border-bottom: 2px solid var(--ap-ink);
		padding: 16px 24px;
	}
	.ap-primary-nav.is-open { display: block; }
	.ap-primary-nav ul { flex-direction: column; gap: 4px; }
}

/* ---------------------------------------------------------------- */
/* Hero — manifest header                                              */
/* ---------------------------------------------------------------- */
.ap-hero {
	border-bottom: 2px solid var(--ap-ink);
	padding: 56px 0 64px;
	background:
		repeating-linear-gradient(180deg, transparent, transparent 39px, rgba(23,24,26,0.06) 40px);
}
.ap-manifest-line {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.8rem;
	color: var(--ap-steel);
	border-top: 1px solid var(--ap-steel-light);
	border-bottom: 1px solid var(--ap-steel-light);
	padding: 10px 0;
	margin-bottom: 32px;
}
.ap-manifest-line strong { color: var(--ap-ink); }
.ap-route {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.ap-route .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ap-green); display: inline-block; }

.ap-hero-headline { max-width: 720px; }
.ap-hero-sub {
	max-width: 560px;
	color: var(--ap-steel);
	font-size: 1.05rem;
	margin-bottom: 28px;
}
.ap-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.ap-stamp {
	position: absolute;
	transform: rotate(-6deg);
	border: 2.5px solid var(--ap-red);
	color: var(--ap-red);
	font-family: "IBM Plex Mono", monospace;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.7rem;
	padding: 6px 10px;
	border-radius: 4px;
	background: rgba(200,0,10,0.04);
	white-space: nowrap;
}
.ap-hero-stamp-wrap { position: relative; }
.ap-hero-stamp-wrap .ap-stamp { top: 4px; right: 0; }

/* ---------------------------------------------------------------- */
/* Sections                                                            */
/* ---------------------------------------------------------------- */
.ap-section { padding: 56px 0; }
.ap-section-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 28px;
	border-bottom: 1px solid var(--ap-steel-light);
	padding-bottom: 14px;
}
.ap-section-head h2 { margin: 0; }
.ap-section-head a { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; text-decoration: none; color: var(--ap-steel); white-space: nowrap; }
.ap-section-head a:hover { color: var(--ap-red); }

.ap-trust-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	background: var(--ap-paper-raised);
	border: 1px solid var(--ap-steel-light);
	border-radius: var(--ap-radius);
	padding: 24px;
}
.ap-trust-strip div { font-size: 0.9rem; }
.ap-trust-strip strong { display: block; font-family: "Archivo", sans-serif; font-size: 1.6rem; color: var(--ap-ink); }

/* ---------------------------------------------------------------- */
/* Route tracker (order status pipeline)                              */
/* ---------------------------------------------------------------- */
.ap-route-tracker {
	display: flex;
	overflow-x: auto;
	gap: 0;
	margin: 24px 0;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.72rem;
}
.ap-route-tracker .step {
	flex: 1;
	min-width: 110px;
	text-align: center;
	padding: 10px 8px;
	border-top: 3px solid var(--ap-steel-light);
	color: var(--ap-steel);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	position: relative;
}
.ap-route-tracker .step.is-done { border-top-color: var(--ap-green); color: var(--ap-green); }
.ap-route-tracker .step.is-current { border-top-color: var(--ap-red); color: var(--ap-red); font-weight: 700; }

/* ---------------------------------------------------------------- */
/* Vehicle / part cards — theme-level wrapper around plugin markup     */
/* ---------------------------------------------------------------- */
.ap-vehicle-card, .autopro-card {
	background: var(--ap-paper-raised);
	border: 1px solid var(--ap-steel-light);
	border-radius: var(--ap-radius);
	overflow: hidden;
	position: relative;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ap-vehicle-card:hover { box-shadow: 0 6px 18px rgba(23,24,26,0.08); transform: translateY(-2px); }
.ap-vehicle-card a { text-decoration: none; color: inherit; display: block; }
.ap-vehicle-card img { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.ap-vehicle-card .body { padding: 14px 16px; }
.ap-vehicle-code { font-family: "IBM Plex Mono", monospace; font-size: 0.7rem; color: var(--ap-steel); }
.ap-vehicle-card h3 { font-size: 1.05rem; margin: 4px 0; }
.ap-vehicle-price { font-family: "Archivo", sans-serif; font-weight: 800; color: var(--ap-red); font-size: 1.15rem; }
.ap-badge {
	display: inline-block;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 8px;
	border-radius: 3px;
	border: 1px solid currentColor;
}
.ap-badge-preorder { color: var(--ap-steel); }
.ap-badge-auction { color: var(--ap-red); }

.ap-vehicle-grid, .autopro-parts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
}

/* ---------------------------------------------------------------- */
/* Vehicle single page                                                */
/* ---------------------------------------------------------------- */
.ap-vehicle-single { padding: 40px 0 80px; }
.ap-vehicle-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ap-spec-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.92rem; }
.ap-spec-table th, .ap-spec-table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--ap-steel-light); }
.ap-spec-table th { width: 200px; color: var(--ap-steel); font-weight: 600; font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.ap-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 16px 0 28px; }
.ap-gallery img { border-radius: var(--ap-radius); aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--ap-steel-light); }
.ap-gallery-label { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ap-steel); margin: 0 0 8px; }
.ap-video-embed { position: relative; max-width: 640px; margin: 0 0 28px; }
.ap-video-embed iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--ap-radius); border: 1px solid var(--ap-steel-light); }

/* ---------------------------------------------------------------- */
/* Content area (pages, forms, WooCommerce)                            */
/* ---------------------------------------------------------------- */
.ap-content { padding: 48px 0 80px; }
.ap-content .ap-page-title { border-bottom: 2px solid var(--ap-ink); padding-bottom: 16px; margin-bottom: 32px; }

/* Buttons/forms rendered by the AutoPro plugins already carry their own
   brand colors (red/green) — the rules below only add spacing/typography
   consistency so they sit comfortably inside this theme's layout. */
.entry-content .autopro-form label { font-family: "IBM Plex Sans", sans-serif; }
.entry-content table.widefat {
	font-size: 0.92rem;
}

/* ---------------------------------------------------------------- */
/* Footer                                                              */
/* ---------------------------------------------------------------- */
.ap-site-footer {
	background: var(--ap-ink);
	color: #d8dad4;
	margin-top: 64px;
}
.ap-footer-inner {
	max-width: var(--ap-max-width);
	margin: 0 auto;
	padding: 48px 24px 28px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 32px;
}
.ap-footer-inner h4 {
	font-family: "IBM Plex Mono", monospace;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	color: #9aa09a;
	margin-bottom: 14px;
}
.ap-footer-inner ul { list-style: none; margin: 0; padding: 0; }
.ap-footer-inner li { margin-bottom: 8px; }
.ap-footer-inner a { color: #d8dad4; text-decoration: none; }
.ap-footer-inner a:hover { color: #fff; text-decoration: underline; }
.ap-footer-bottom {
	border-top: 1px solid #33352f;
	padding: 18px 24px;
	max-width: var(--ap-max-width);
	margin: 0 auto;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.72rem;
	color: #9aa09a;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}

.ap-header-extra {
	max-width: var(--ap-max-width);
	margin: 0 auto;
	padding: 0 24px 10px;
}
.ap-header-extra:empty { display: none; }
.ap-footer-extra {
	color: #d8dad4;
	padding-bottom: 20px;
}
.ap-footer-extra a { color: #fff; }

/* ---------------------------------------------------------------- */
/* Widgets & sidebar                                                   */
/* ---------------------------------------------------------------- */
.widget { margin-bottom: 32px; }
.widget-title {
	font-family: "IBM Plex Mono", monospace;
	text-transform: uppercase;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	color: var(--ap-steel);
	border-bottom: 1px solid var(--ap-steel-light);
	padding-bottom: 8px;
	margin-bottom: 14px;
}

/* ---------------------------------------------------------------- */
/* Responsive tweaks                                                  */
/* ---------------------------------------------------------------- */
@media (max-width: 700px) {
	.ap-header-inner { flex-wrap: wrap; }
	.ap-hero { padding: 40px 0 48px; }
	.ap-section { padding: 40px 0; }
}

/* ------------------------------------------------------------------ */
/* Product gallery — cars.com-style mosaic (hero + 2x2 grid) that      */
/* opens a lightbox on click, instead of custom swipe/zoom on the      */
/* default view — a static grid needs no gesture handling at all.      */
/* ------------------------------------------------------------------ */
.ap-product-gallery { margin: 16px 0 28px; position: relative; }
.ap-gallery-mosaic {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 8px;
	height: 440px;
	border-radius: var(--ap-radius);
	overflow: hidden;
}
.ap-mosaic-main {
	grid-column: 1;
	grid-row: 1 / span 2;
	padding: 0;
	border: none;
	cursor: pointer;
	overflow: hidden;
	background: var(--ap-paper-raised);
}
.ap-mosaic-thumb {
	padding: 0;
	border: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	background: var(--ap-paper-raised);
}
.ap-mosaic-main img, .ap-mosaic-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ap-mosaic-more-overlay {
	position: absolute;
	inset: 0;
	background: rgba(23,24,26,0.6);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.95rem;
	text-align: center;
	padding: 8px;
}
.ap-mosaic-seeall {
	position: absolute;
	right: 14px;
	bottom: 14px;
	background: #fff;
	border: 1px solid var(--ap-steel-light);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
@media (max-width: 700px) {
	.ap-gallery-mosaic {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto auto;
		height: auto;
	}
	.ap-mosaic-main { grid-column: 1 / span 2; grid-row: 1; aspect-ratio: 4/3; }
	.ap-mosaic-thumb { aspect-ratio: 1/1; }
	.ap-mosaic-seeall { right: 10px; bottom: 10px; padding: 6px 12px; font-size: 0.78rem; }
}

/* Lightbox — opened by clicking any photo in the mosaic or "See gallery" */
.ap-lightbox-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(23,24,26,0.96);
	display: flex;
	align-items: center;
	justify-content: center;
}
.ap-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.15);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.ap-lightbox-counter {
	position: absolute;
	top: 22px;
	left: 20px;
	color: #d8dad4;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.85rem;
}
.ap-lightbox-close-bar {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	color: var(--ap-ink);
	border: none;
	padding: 12px 24px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.ap-lightbox-main {
	position: relative;
	width: 100%;
	max-width: 900px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 60px;
}
.ap-lightbox-main img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform 0.25s ease;
	transform-origin: center center;
	touch-action: pan-y;
	-webkit-user-drag: none;
	-webkit-user-select: none;
	user-select: none;
}
.ap-lightbox-main img.is-zoomed { cursor: grab; }
.ap-main-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.9);
	color: var(--ap-ink);
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.ap-main-arrow:hover { background: #fff; }
.ap-main-arrow-prev { left: 0; }
.ap-main-arrow-next { right: 0; }

/* ------------------------------------------------------------------ */
/* Two-column product layout: gallery left, title/details/CTA right    */
/* ------------------------------------------------------------------ */
.ap-product-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: 40px;
	align-items: start;
}
.ap-product-info { position: sticky; top: 90px; }
@media (max-width: 900px) {
	.ap-product-layout { grid-template-columns: 1fr; gap: 24px; }
	.ap-product-info { position: static; }
	.ap-main-arrow { width: 36px; height: 36px; font-size: 1.2rem; }
}

/* ------------------------------------------------------------------ */
/* Blog listing                                                        */
/* ------------------------------------------------------------------ */
.ap-blog-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 28px;
}
.ap-blog-card {
	border: 1px solid var(--ap-steel-light);
	border-radius: var(--ap-radius);
	overflow: hidden;
	background: var(--ap-paper-raised);
}
.ap-blog-card-thumb { display: block; }
.ap-blog-card-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.ap-blog-card-body { padding: 16px 18px 20px; }
.ap-blog-card-body h2 { font-size: 1.15rem; margin: 6px 0 10px; }
.ap-blog-card-body h2 a { text-decoration: none; color: var(--ap-ink); }
.ap-blog-card-body h2 a:hover { color: var(--ap-red); }
.ap-blog-card-body .entry-summary { font-size: 0.92rem; color: var(--ap-steel); }
.ap-blog-read-more {
	display: inline-block;
	margin-top: 10px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.8rem;
	text-decoration: none;
	color: var(--ap-red);
	font-weight: 600;
}
