/*
Theme Name: YKGVL Motors
Theme URI: https://ykgvl.com
Author: YKGVL
Description: A fast, simple used car listing theme. Adds a Cars section to WordPress with search, filters and a clean car detail page. Built to stay light: no page builder, no external fonts, no JavaScript frameworks.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ykgvl-motors
Tags: custom-menu, featured-images, translation-ready
*/

/* ==========================================================
   1. Tokens
   ========================================================== */

:root {
	--ink: #0c1b2a;
	--ink-soft: #16293c;
	--accent: #e0a92e;
	--accent-dark: #8c6411;
	--wa: #1faa54;
	--bg: #f5f6f8;
	--card: #ffffff;
	--line: #e3e7ec;
	--text: #18212b;
	--muted: #5f6e80;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(12, 27, 42, .06), 0 8px 24px rgba(12, 27, 42, .06);
	--shadow-lg: 0 2px 4px rgba(12, 27, 42, .08), 0 18px 40px rgba(12, 27, 42, .12);
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1180px;
}

/* ==========================================================
   2. Base
   ========================================================== */

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

body {
	margin: 0;
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
	margin: 0 0 .5em;
	line-height: 1.2;
	letter-spacing: -.02em;
	color: var(--ink);
}

h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; }

p { margin: 0 0 1em; }

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

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================
   3. Buttons
   ========================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: var(--accent); color: #231704; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); color: #fff; }

.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #178e45; color: #fff; }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 16px; }

/* ==========================================================
   4. Header
   ========================================================== */

.site-header {
	background: var(--ink);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 50;
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { color: #fff; }

.brand-mark {
	display: grid;
	place-items: center;
	width: 34px; height: 34px;
	border-radius: 8px;
	background: var(--accent);
	color: #231704;
	font-weight: 800;
	font-size: 14px;
	letter-spacing: -.02em;
}

.brand-text { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: rgba(255, 255, 255, .82); font-size: 15px; font-weight: 500; }
.main-nav a:hover { color: #fff; }
.main-nav .current-menu-item > a { color: #fff; }

.header-cta { display: flex; gap: 10px; }

.nav-toggle, .nav-toggle-label { display: none; }

/* ==========================================================
   5. Hero and search
   ========================================================== */

.hero {
	background: linear-gradient(160deg, #0c1b2a 0%, #16293c 60%, #1d3144 100%);
	color: #fff;
	padding: 56px 0 44px;
}

.hero h1 { color: #fff; max-width: 15ch; }
.hero .lede { color: rgba(255, 255, 255, .74); font-size: 17px; max-width: 46ch; margin-bottom: 26px; }

.search-card {
	background: var(--card);
	border-radius: var(--radius);
	padding: 18px;
	box-shadow: var(--shadow-lg);
}

.search-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	align-items: end;
}

.field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--muted);
	margin-bottom: 6px;
}

.field select, .field input {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	font-family: inherit;
	font-size: 15px;
	color: var(--text);
	appearance: none;
}

.field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f6e80' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 11px;
	padding-right: 32px;
}

.field select:focus, .field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ==========================================================
   6. Trust strip
   ========================================================== */

.trust {
	background: #fff;
	border-bottom: 1px solid var(--line);
	padding: 22px 0;
}

.trust-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 18px;
}

.trust-item { display: flex; gap: 11px; align-items: flex-start; }
.trust-item svg { width: 21px; height: 21px; color: var(--accent-dark); flex: none; margin-top: 2px; }
.trust-item strong { display: block; font-size: 14px; }
.trust-item span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ==========================================================
   7. Sections
   ========================================================== */

.section { padding: 48px 0; }
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }
.section-head h2 { margin: 0; }
.link-more { font-weight: 600; font-size: 15px; color: var(--accent-dark); }

/* ==========================================================
   8. Car cards
   ========================================================== */

.car-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 22px;
}

.car-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .18s ease, transform .18s ease;
}

.car-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.car-media {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #e9edf1;
	overflow: hidden;
}

.car-media img { width: 100%; height: 100%; object-fit: cover; }

.car-media--empty {
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 8px;
	color: #9bacbd;
	background: linear-gradient(145deg, #eef1f4, #e1e6ec);
}

.car-media--empty svg { width: 86px; height: auto; }
.car-media--empty span { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }

.badge {
	position: absolute;
	top: 10px; left: 10px;
	display: inline-block;
	padding: 5px 10px;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	background: rgba(12, 27, 42, .86);
	color: #fff;
	backdrop-filter: blur(2px);
}

.badge-ulez { background: var(--wa); }
.badge-sold { background: #c0392b; }

.car-body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }

.car-title { font-size: 16px; font-weight: 650; margin: 0 0 4px; line-height: 1.35; }
.car-title a { color: var(--ink); }

.car-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.car-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.car-specs li {
	font-size: 12px;
	color: #44566a;
	background: #f1f4f7;
	border-radius: 6px;
	padding: 4px 9px;
}

.car-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 13px;
	border-top: 1px solid var(--line);
}

.car-price { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.car-link { font-size: 14px; font-weight: 600; color: var(--accent-dark); }

/* ==========================================================
   9. Listing page
   ========================================================== */

.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 30px 0 26px; }
.page-head h1 { margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); }

.filter-bar {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
	margin-bottom: 26px;
}

.filter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
	gap: 12px;
	align-items: end;
}

.filter-actions { display: flex; gap: 8px; }

.results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.results-count { font-size: 14px; color: var(--muted); }

.empty-state {
	background: #fff;
	border: 1px dashed var(--line);
	border-radius: var(--radius);
	padding: 48px 24px;
	text-align: center;
	color: var(--muted);
}

.pagination { margin: 34px 0 0; display: flex; justify-content: center; }
.pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	text-align: center;
	padding: 8px 10px;
	margin: 0 3px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	font-size: 14px;
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ==========================================================
   10. Single car
   ========================================================== */

.car-single { padding: 30px 0 60px; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }

.car-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: 30px;
	align-items: start;
}

.gallery-main {
	border-radius: var(--radius);
	overflow: hidden;
	background: #e9edf1;
	aspect-ratio: 4 / 3;
	position: relative;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
	margin-top: 8px;
}
.gallery-thumbs img { border-radius: var(--radius-sm); aspect-ratio: 4 / 3; object-fit: cover; }

.car-aside {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	box-shadow: var(--shadow);
	position: sticky;
	top: 88px;
}

.car-aside h1 { font-size: 23px; margin-bottom: 6px; }
.aside-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

.price-tag {
	font-size: 34px;
	font-weight: 800;
	color: var(--ink);
	letter-spacing: -.03em;
	line-height: 1.1;
	margin-bottom: 4px;
}
.price-note { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.quick-specs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	overflow: hidden;
	margin-bottom: 18px;
}
.quick-specs div { background: #fff; padding: 11px 13px; }
.quick-specs dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.quick-specs dd { margin: 0; font-size: 15px; font-weight: 600; }

.aside-actions { display: grid; gap: 9px; }

.aside-note {
	margin: 16px 0 0;
	font-size: 12px;
	color: var(--muted);
	line-height: 1.5;
}

.panel {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	margin-top: 26px;
}
.panel h2 { font-size: 20px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th {
	text-align: left;
	font-weight: 500;
	color: var(--muted);
	padding: 10px 12px 10px 0;
	width: 45%;
}
.spec-table td { padding: 10px 0; font-weight: 600; }

/* ==========================================================
   11. CTA band and footer
   ========================================================== */

.cta-band {
	background: var(--ink);
	color: #fff;
	padding: 44px 0;
}
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: rgba(255, 255, 255, .72); margin-bottom: 20px; max-width: 54ch; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.site-footer {
	background: #08131e;
	color: rgba(255, 255, 255, .62);
	padding: 44px 0 26px;
	font-size: 14px;
}
.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 28px;
	margin-bottom: 28px;
}
.site-footer h3 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.site-footer a { color: rgba(255, 255, 255, .62); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .1);
	padding-top: 18px;
	font-size: 12.5px;
	line-height: 1.6;
	color: rgba(255, 255, 255, .62);
}

/* ==========================================================
   12. Plain pages and posts
   ========================================================== */

.content-area { padding: 40px 0 60px; }
.entry {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 34px;
	max-width: 760px;
	margin: 0 auto;
}
.entry img { border-radius: var(--radius-sm); }
.entry ul, .entry ol { padding-left: 1.2em; }
.entry a { text-decoration: underline; text-underline-offset: 2px; }
.entry h2 { margin-top: 1.6em; }
.entry h3 { margin-top: 1.4em; }

/* ==========================================================
   13. Mobile
   ========================================================== */

@media (max-width: 900px) {
	.car-layout { grid-template-columns: 1fr; }
	.car-aside { position: static; }
}

@media (max-width: 760px) {
	.nav-toggle-label {
		display: grid;
		place-items: center;
		margin-left: auto;
		width: 40px; height: 40px;
		border: 1px solid rgba(255, 255, 255, .25);
		border-radius: 8px;
		cursor: pointer;
	}
	.nav-toggle-label span,
	.nav-toggle-label span::before,
	.nav-toggle-label span::after {
		display: block;
		width: 18px; height: 2px;
		background: #fff;
		border-radius: 2px;
		content: "";
		position: relative;
	}
	.nav-toggle-label span::before { position: absolute; top: -6px; }
	.nav-toggle-label span::after { position: absolute; top: 6px; }

	.main-nav {
		display: none;
		order: 3;
		width: 100%;
		margin: 0;
		padding-bottom: 14px;
	}
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav li { border-top: 1px solid rgba(255, 255, 255, .1); }
	.main-nav a { display: block; padding: 12px 0; }

	.nav-toggle:checked ~ .main-nav { display: block; }

	.header-inner { flex-wrap: wrap; }
	.header-cta { order: 4; width: 100%; padding-bottom: 14px; }
	.header-cta .btn { flex: 1; }

	.hero { padding: 36px 0 32px; }
	.quick-specs { grid-template-columns: 1fr 1fr; }
	.entry { padding: 22px; }
}
