/* RevAuto Stock : s'appuie sur la palette du thème (accent-1 rouge, accent-2 anthracite…). */
.rvs-stock, .rvs-vehicle {
	--rvs-red: var(--wp--preset--color--accent-1, #c41119);
	--rvs-dark: var(--wp--preset--color--accent-2, #222b33);
	--rvs-sand: var(--wp--preset--color--accent-3, #f5f2ef);
	--rvs-grey: var(--wp--preset--color--accent-4, #5b6570);
	--rvs-pink: var(--wp--preset--color--accent-5, #fcedee);
	--rvs-line: var(--wp--preset--color--accent-6, #e4dfda);
}

/* Grille */
.rvs-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.rvs-grid > li { margin: 0; }
.rvs-grid > li[hidden] { display: none; }
.rvs-card { position: relative; height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rvs-line); border-radius: 14px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.rvs-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(34, 43, 51, .14); }
.rvs-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--rvs-sand); overflow: hidden; }
.rvs-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rvs-card__nophoto { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px; color: var(--rvs-grey); font-weight: 600; font-size: .9rem; text-align: center; padding: 1rem; }
.rvs-badge { position: absolute; top: .75rem; left: .75rem; background: var(--rvs-red); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .3rem .7rem; border-radius: 99px; }
.rvs-card__body { display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem 1.2rem 1.25rem; flex: 1; }
.rvs-card__title { font-size: 1.15rem !important; line-height: 1.25; margin: 0; }
.rvs-card__title a { color: var(--rvs-dark); text-decoration: none; }
.rvs-card__title a::after { content: ""; position: absolute; inset: 0; } /* carte entièrement cliquable, un seul lien */
.rvs-card__title a:focus-visible { outline: none; }
.rvs-card:has(a:focus-visible) { outline: 3px solid var(--rvs-red); outline-offset: 2px; }
.rvs-card__version { margin: 0; color: var(--rvs-grey); font-size: .88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rvs-facts { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.rvs-facts li { margin: 0; background: var(--rvs-sand); border-radius: 99px; padding: .15rem .65rem; font-size: .78rem; font-weight: 600; color: var(--rvs-dark); }
.rvs-card__foot { margin-top: auto; padding-top: .5rem; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.rvs-price { margin: 0; font-weight: 800; font-size: 1.3rem; color: var(--rvs-red); line-height: 1.1; }
.rvs-price del { color: var(--rvs-grey); font-weight: 600; font-size: .85em; margin-left: .35rem; }
.rvs-price small { font-size: .55em; color: var(--rvs-grey); font-weight: 700; margin-left: .2rem; }
.rvs-card__loc { margin: 0; font-size: .78rem; color: var(--rvs-grey); }

/* Filtres */
.rvs-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 1rem; margin: 0 0 1.25rem; }
.rvs-field { display: flex; flex-direction: column; gap: .25rem; }
.rvs-field label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rvs-grey); }
.rvs-field select { font: inherit; font-size: .95rem; padding: .55rem 2rem .55rem .8rem; border: 1px solid var(--rvs-line); border-radius: 8px; background: #fff; color: var(--rvs-dark); }
.rvs-field select:focus-visible { outline: 3px solid var(--rvs-red); outline-offset: 1px; }
.rvs-count { margin: 0 0 0 auto; font-weight: 700; color: var(--rvs-grey); font-size: .9rem; }
.rvs-empty { padding: 1.5rem; border: 2px dashed var(--rvs-line); border-radius: 14px; text-align: center; color: var(--rvs-grey); }
.rvs-link { font: inherit; background: none; border: 0; color: var(--rvs-red); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }

/* Fiche véhicule */
.rvs-crumbs { font-size: .85rem; color: var(--rvs-grey); margin-bottom: 1.25rem; }
.rvs-crumbs a { color: var(--rvs-dark); }
.rvs-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.rvs-gallery__main { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--rvs-sand); aspect-ratio: 4 / 3; }
.rvs-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rvs-gallery__empty { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--rvs-sand); }
.rvs-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--rvs-dark); font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.rvs-nav--prev { left: .75rem; }
.rvs-nav--next { right: .75rem; }
.rvs-nav:focus-visible, .rvs-thumbs button:focus-visible { outline: 3px solid var(--rvs-red); outline-offset: 2px; }
.rvs-gallery__count { position: absolute; right: .75rem; bottom: .75rem; background: rgba(34, 43, 51, .8); color: #fff; font-size: .8rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; }
.rvs-thumbs { list-style: none; margin: .6rem 0 0; padding: 0 0 .3rem; display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; }
.rvs-thumbs li { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.rvs-thumbs button { display: block; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; opacity: .7; }
.rvs-thumbs button[aria-current="true"] { border-color: var(--rvs-red); opacity: 1; }
.rvs-thumbs img { width: 96px; height: 72px; object-fit: cover; display: block; }
.rvs-summary { position: sticky; top: 110px; background: #fff; border: 1px solid var(--rvs-line); border-radius: 14px; padding: 1.5rem; display: flex; flex-direction: column; gap: .8rem; }
.rvs-title { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem) !important; margin: 0; line-height: 1.15; }
.rvs-title__version { display: block; font-size: .5em; font-weight: 600; color: var(--rvs-grey); margin-top: .35rem; letter-spacing: 0; }
.rvs-price--big { font-size: 2rem; }
.rvs-monthly { margin: -.3rem 0 0; font-weight: 700; }
.rvs-monthly a { color: var(--rvs-dark); }
.rvs-keyfacts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.rvs-keyfacts li { margin: 0; background: var(--rvs-sand); border-radius: 10px; padding: .55rem .75rem; display: flex; flex-direction: column; }
.rvs-keyfacts span { font-size: .75rem; color: var(--rvs-grey); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.rvs-keyfacts strong { color: var(--rvs-dark); }
.rvs-where { margin: 0; font-size: .9rem; color: var(--rvs-grey); }
.rvs-ctas { display: flex; flex-direction: column; gap: .5rem; }
.rvs-btn { display: block; text-align: center; padding: .85rem 1.2rem; border-radius: 8px; font-weight: 700; text-decoration: none; background: var(--rvs-red); color: #fff; border: 2px solid var(--rvs-red); }
.rvs-btn:hover { background: #9e0d14; border-color: #9e0d14; color: #fff; }
.rvs-btn--ghost { background: transparent; color: var(--rvs-dark); border-color: var(--rvs-dark); }
.rvs-btn--ghost:hover { background: var(--rvs-dark); border-color: var(--rvs-dark); }
.rvs-btn:focus-visible { outline: 3px solid var(--rvs-red); outline-offset: 2px; }
.rvs-ref { margin: 0; font-size: .78rem; color: var(--rvs-grey); }
.rvs-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--rvs-line); }
.rvs-section h2 { font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); margin: 0 0 1rem; }
.rvs-specs { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 2rem; }
.rvs-specs div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rvs-line); }
.rvs-specs dt { color: var(--rvs-grey); }
.rvs-specs dd { margin: 0; font-weight: 700; color: var(--rvs-dark); text-align: right; }
.rvs-chips { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.rvs-chips li { margin: 0; background: var(--rvs-pink); color: var(--rvs-red); font-weight: 700; font-size: .85rem; padding: .3rem .8rem; border-radius: 99px; }
.rvs-equip { columns: 2 260px; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }
.rvs-equip li { margin: .25rem 0; break-inside: avoid; }
.rvs-more { margin-top: .8rem; }
.rvs-more summary { cursor: pointer; font-weight: 700; color: var(--rvs-red); }
.rvs-finance { margin: 0 0 .6rem; font-weight: 600; }
.rvs-legal { font-size: .78rem; line-height: 1.5; color: var(--rvs-grey); margin: 0; }
.rvs-dealer p { margin: 0 0 .6rem; }

@media (max-width: 900px) {
	.rvs-top { grid-template-columns: 1fr; }
	.rvs-summary { position: static; }
}
@media (prefers-reduced-motion: reduce) {
	.rvs-card { transition: none; }
}

/* Recherche (filtres côté serveur, pagination) */
.rvs-search__form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); align-items: end; gap: .8rem 1rem; padding: 1.1rem; background: var(--rvs-sand); border-radius: 14px; }
.rvs-field--search { grid-column: 1 / -1; }
.rvs-field input[type="search"] { font: inherit; font-size: 1rem; padding: .65rem .9rem; border: 1px solid var(--rvs-line); border-radius: 8px; background: #fff; color: var(--rvs-dark); width: 100%; box-sizing: border-box; }
.rvs-field input[type="search"]:focus-visible { outline: 3px solid var(--rvs-red); outline-offset: 1px; }
.rvs-search__form .rvs-field select { width: 100%; }
.rvs-search__actions { display: flex; align-items: center; gap: 1rem; min-height: 2.6rem; }
.rvs-search__submit { padding: .6rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; }
/* Avec JavaScript, les résultats suivent chaque changement : le bouton reste accessible au clavier seulement. */
.rvs-search--live .rvs-search__submit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; }
.rvs-search .rvs-count { margin: 1rem 0 .9rem; }
.rvs-results { transition: opacity .15s ease; }
.rvs-results[aria-busy="true"] { opacity: .45; pointer-events: none; }
.rvs-pagination { margin-top: 2rem; }
.rvs-pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.rvs-pagination li { margin: 0; }
.rvs-pagination a, .rvs-pagination span[aria-current] { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: 44px; height: 44px; padding: 0 .8rem; box-sizing: border-box; border: 1px solid var(--rvs-line); border-radius: 8px; font-weight: 700; color: var(--rvs-dark); text-decoration: none; background: #fff; }
.rvs-pagination a:hover { border-color: var(--rvs-dark); }
.rvs-pagination a:focus-visible { outline: 3px solid var(--rvs-red); outline-offset: 2px; }
.rvs-pagination span[aria-current] { background: var(--rvs-red); border-color: var(--rvs-red); color: #fff; }
.rvs-pagination__gap { align-self: center; color: var(--rvs-grey); padding: 0 .2rem; }
@media (max-width: 520px) { .rvs-pagination__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .rvs-search__form { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .rvs-results { transition: none; } }
