/* ---------- Tokens ---------- */
:root {
	--ink: #0C2238;
	--azul: #155E9E;
	--celeste: #74ACDF;
	--celeste-50: #EAF3FB;
	--paper: #F4F7FA;
	--white: #fff;
	--line: #D9E2EC;
	--muted: #52667A;
	--sol: #F6B40E;
	--wa: #128C4A;
	--font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
	--font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wrap: 1200px;
	--gutter: clamp(1rem, 4vw, 2rem);
	--header-h: 64px;
	--r-card: 12px;
	--r-btn: 8px;
	--r-pill: 999px;
	--r-panel: 20px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; font: 400 1rem/1.55 var(--font-body); color: var(--ink); background: var(--paper); }
body.nav-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--azul); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }
.hero :focus-visible, .site-footer :focus-visible, .cta--ink :focus-visible { outline-color: var(--sol); }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sr, .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sol); color: var(--ink); padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.muted { color: var(--muted); }
.icon { flex: none; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: 0 1.25rem; border: 2px solid transparent; border-radius: var(--r-btn); font: 700 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; }
.btn--sol { background: var(--sol); color: var(--ink); }
.btn--azul { background: var(--azul); color: var(--white); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--wa { background: var(--wa); color: var(--white); }
.btn--line { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--block { width: 100%; }
.btn:hover { filter: brightness(1.06); }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); }
.brand { font: 800 1.15rem/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); text-decoration: none; background: var(--white); border: 2px solid var(--ink); border-top: 7px solid var(--azul); border-radius: 6px; padding: .35rem .7rem .3rem; }
.brand-logo img { max-height: 40px; width: auto; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.nav-list { display: flex; gap: .25rem; }
.nav-list a, .bar-link { display: block; padding: .6rem .9rem; color: var(--ink); font-weight: 600; text-decoration: none; border-radius: var(--r-btn); }
.nav-list a:hover, .bar-link:hover { background: var(--celeste-50); }
.nav-panel { display: flex; align-items: center; gap: 1.5rem; }
.bar-actions { display: flex; align-items: center; gap: .5rem; }

@media (max-width: 899px) {
	.js .nav-panel { display: none; position: fixed; inset: var(--header-h) 0 0 0; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1.5rem; padding: 1.25rem var(--gutter); background: var(--white); overflow-y: auto; }
	.js .nav-panel.is-open { display: flex; }
	.nav-list { flex-direction: column; }
	.nav-list a { font: 700 1.5rem/1.2 var(--font-display); padding: .9rem 0; border-bottom: 1px solid var(--line); border-radius: 0; }
	.bar-actions { flex-direction: column; align-items: stretch; }
	.bar-actions .btn, .bar-link { text-align: center; }
	.nav-toggle { display: inline-flex; }
	.nav-panel { flex-wrap: wrap; }
}
@media (min-width: 900px) { .nav-toggle { display: none; } .nav-panel { flex: 1; justify-content: space-between; margin-left: 1.5rem; } }

/* ---------- Inicio: hero ---------- */
.hero { position: relative; margin-bottom: 4.25rem; padding: clamp(2rem, 6vw, 4rem) 0 2.5rem; background: var(--azul); color: var(--white); }
.hero__title { max-width: 14ch; }
.hero__lead { max-width: 46ch; margin: 1rem 0 1.75rem; font-size: 1.125rem; color: #E2EEF9; }
.hero__search { position: relative; z-index: 1; margin-bottom: -5rem; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--sol) 0 30px, transparent 30px 56px); }
@media (prefers-reduced-motion: no-preference) {
	.hero::after { animation: road 1.4s ease-out both; }
	@keyframes road { from { background-position: -280px 0; } to { background-position: 0 0; } }
}

/* Buscador del plugin dentro del hero */
.am-buscador { background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1rem; box-shadow: 0 12px 0 -6px var(--ink); }
.am-buscador .am-tabs { display: flex; gap: .25rem; margin: 0 0 1rem; padding: .25rem; background: var(--celeste-50); border-radius: 12px; }
.am-buscador .am-tabs button { flex: 1; min-height: 42px; padding: 0 .5rem; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font: 600 .95rem var(--font-body); cursor: pointer; }
.am-buscador .am-tabs button.is-active { background: var(--white); color: var(--ink); border-color: var(--line); }
.am-buscador .am-form { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.am-buscador .am-more { grid-column: 1 / -1; }
.am-buscador .am-more summary { cursor: pointer; font-weight: 600; color: var(--azul); padding: .25rem 0; }
.am-buscador .am-submit { grid-column: 1 / -1; min-height: 48px; border: 0; border-radius: var(--r-btn); background: var(--azul); color: var(--white); font: 700 1rem var(--font-body); cursor: pointer; }
@media (min-width: 700px) { .am-buscador .am-form { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .am-buscador { padding: 1.5rem; } .am-buscador .am-form { grid-template-columns: repeat(4, 1fr); } .am-buscador .am-submit { grid-column: auto; align-self: end; } }

/* ---------- Formularios ---------- */
.field, .am-field { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .am-field input, .am-field select, .am-select { width: 100%; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); color: var(--ink); font: 400 1rem var(--font-body); }
.field input:focus, .field select:focus, .am-field input:focus, .am-field select:focus { border-color: var(--azul); outline: 2px solid var(--azul); outline-offset: 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.notice { padding: 1rem; background: var(--celeste-50); border-radius: var(--r-btn); color: var(--ink); }

/* ---------- Secciones ---------- */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head a { font-weight: 600; white-space: nowrap; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--azul); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chips--page { margin-top: 1rem; }
.empty-line { color: var(--muted); }
.empty { max-width: 520px; padding: 2rem 0; }
.empty h2, .h-md { font-size: 1.5rem; margin-bottom: .5rem; }
.empty p { color: var(--muted); }

.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.tile { display: block; padding: 1.1rem 1.25rem; border-left: 6px solid var(--sol); border-radius: var(--r-card); background: var(--celeste-50); color: var(--ink); text-decoration: none; }
.tile:hover { background: #DCEBF8; }
.tile__name { display: block; font: 700 1.15rem/1.2 var(--font-display); }
.tile__count { display: block; margin-top: .25rem; font-size: .875rem; color: var(--muted); }

.cta-grid { display: grid; gap: 1rem; }
.cta { padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: var(--r-panel); }
.cta h2 { margin-bottom: .5rem; }
.cta p { max-width: 38ch; margin-bottom: 1.25rem; }
.cta--ink { background: var(--ink); color: var(--white); }
.cta--sol { background: var(--sol); color: var(--ink); }
@media (min-width: 760px) { .cta-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Tarjetas ---------- */
.grid-v { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid-p { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card-v, .card-p { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.card-v { display: flex; flex-direction: column; }
.card-v:hover, .card-p:hover { border-color: var(--azul); }
.card-v__media { position: relative; aspect-ratio: 4 / 3; background: var(--celeste-50); display: flex; align-items: center; justify-content: center; }
.card-v__media img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 64px; height: 64px; color: var(--celeste); stroke-width: 1.2; }
.badge { position: absolute; top: .6rem; left: .6rem; padding: .25rem .6rem; border-radius: var(--r-pill); background: var(--white); color: var(--ink); font-size: .8rem; font-weight: 700; }
.card-v__body { padding: .9rem 1rem 1rem; }
.price { margin: 0; font: 800 1.45rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.price--lg { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.card-v__title { margin-top: .4rem; font-size: 1rem; font-weight: 600; }
.card-v__title a, .card-p__title a { color: var(--ink); text-decoration: none; }
.card-v__title a::after, .card-p__title a::after { content: ""; position: absolute; inset: 0; }
.specs { display: flex; flex-wrap: wrap; gap: .15rem .85rem; margin-top: .5rem; color: var(--muted); font-size: .875rem; }
.card-v__dealer { margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .875rem; font-weight: 600; }

.card-p { display: flex; gap: 1rem; align-items: center; padding: 1rem; }
.card-p__logo { flex: none; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: var(--celeste-50); border-radius: 10px; overflow: hidden; font: 800 1.75rem var(--font-display); color: var(--azul); }
.card-p__logo img { width: 100%; height: 100%; object-fit: contain; }
.card-p__title { font-size: 1.1rem; }
.card-p__extra { margin: .25rem 0 0; font-size: .875rem; color: var(--muted); }
.meta-line { display: flex; align-items: center; gap: .35rem; margin: .25rem 0 0; font-size: .9rem; color: var(--muted); }
.meta-line .icon { width: 16px; height: 16px; }
.meta-line--plain { display: block; }
.meta-line a { color: inherit; }

/* ---------- Cabeceras de página ---------- */
.page-head { padding: clamp(1.5rem, 4vw, 2.25rem) 0; background: var(--white); border-bottom: 1px solid var(--line); }
.page-head__count { margin: .5rem 0 0; color: var(--muted); }
.dir-search { display: grid; gap: .75rem; margin-top: 1.25rem; align-items: end; }
@media (min-width: 700px) { .dir-search { grid-template-columns: 1fr 1fr auto; max-width: 720px; } }

/* ---------- Listados con filtros ---------- */
.archive-layout { display: grid; gap: 1.25rem; padding-top: 1.5rem; padding-bottom: 3rem; }
.filters-form { display: grid; gap: .85rem; padding: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.filters-reset { text-align: center; font-weight: 600; }
.js .filters { display: none; margin-top: .75rem; }
.js .filters.is-open { display: block; }
.filters-toggle { width: 100%; }
@media (min-width: 960px) {
	.archive-layout { grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
	.archive-side { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; }
	.filters-toggle { display: none; }
	.js .filters { display: block; margin-top: 0; }
}
.navigation.pagination { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none; }
.page-numbers.current { background: var(--azul); border-color: var(--azul); color: var(--white); }

/* ---------- Ficha del vehículo ---------- */
.single-v { padding-top: 1rem; padding-bottom: 3rem; }
.back { margin-bottom: 1rem; font-weight: 600; }
.vehicle { display: grid; gap: 1.5rem; }
.gallery__main, .gallery__empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-card); background: var(--celeste-50); }
.gallery__empty { display: flex; align-items: center; justify-content: center; }
.gallery__thumbs { display: flex; gap: .5rem; margin-top: .5rem; overflow-x: auto; }
.gallery__thumb { flex: none; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; }
.gallery__thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--azul); }
.vehicle__head { margin: 1.25rem 0; }
.vehicle__head h1 { margin: .5rem 0; font-size: clamp(1.6rem, 4vw, 2.25rem); }
.tag { display: inline-block; margin: 0 .35rem .35rem 0; padding: .2rem .7rem; border-radius: var(--r-pill); background: var(--celeste-50); color: var(--ink); font-size: .85rem; font-weight: 600; }
.h-sm { margin: 2rem 0 .85rem; font-size: 1.25rem; }
.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 1.5rem; margin: 0; padding: 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.spec-list dt { font-size: .8rem; color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 600; }
.prose { max-width: 70ch; }
.prose--lead { margin-bottom: 2rem; }
.prose-wrap .prose { max-width: 72ch; }
.contact-card { padding: 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.contact-card__label { margin: 0; font-size: .85rem; color: var(--muted); }
.contact-card__name { margin: .15rem 0 .25rem; font-size: 1.25rem; }
.contact-card__name a { color: var(--ink); }
.contact-card__actions { display: grid; gap: .5rem; margin-top: 1rem; }
.contact-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: .5rem; padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); }
.contact-bar .btn { flex: 1; }
body.single-vehiculo main { padding-bottom: 5rem; }
@media (min-width: 960px) {
	.vehicle { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
	.vehicle__side { position: sticky; top: calc(var(--header-h) + 1rem); }
	.contact-bar { display: none; }
	body.single-vehiculo main { padding-bottom: 0; }
}

/* ---------- Perfiles ---------- */
.profile__grid { display: grid; gap: 1.25rem; align-items: center; }
.profile__logo { width: 96px; height: 96px; border: 1px solid var(--line); }
.profile__tags { margin: .5rem 0 0; }
.profile__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 800px) { .profile__grid { grid-template-columns: auto 1fr auto; gap: 1.75rem; } }

/* ---------- Publicidad ---------- */
.ad-slot { margin: 1.5rem 0; }
.am-ad { text-align: center; }
.am-ad img { margin: 0 auto; border-radius: var(--r-card); }
.am-ad__label { display: block; margin-bottom: .25rem; font-size: .75rem; color: var(--muted); }

/* ---------- Entradas ---------- */
.post-row { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.post-row h2 a { color: var(--ink); text-decoration: none; }

/* ---------- Pie ---------- */
.site-footer { position: relative; margin-top: 2rem; padding: 3.5rem 0 1.5rem; background: var(--ink); color: #C7D8E8; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--sol) 0 30px, transparent 30px 56px); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand { margin: 0 0 .5rem; font: 800 1.4rem var(--font-display); color: var(--white); }
.footer-text { max-width: 36ch; }
.footer-title { margin-bottom: .75rem; font: 700 1rem var(--font-body); color: var(--white); }
.site-footer li { margin-bottom: .5rem; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #23405C; font-size: .875rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
