/* Car Listings front end (mobile first). Colors are CSS variables so the theme step can restyle them. */
.cl-wrap, .cl-listing, .cl-search-wrap, .cl-terms-wrap {
	--cl-accent: #c8102e;
	--cl-brand: #1b1f24;
	--cl-ink: #1b1f24;
	--cl-muted: #5f6b76;
	--cl-line: #e2e6ea;
	--cl-bg: #fff;
	--cl-soft: #f5f7f9;
	--cl-radius: 8px;
	color: var(--cl-ink);
}
.cl-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

/* Grid of cards */
.cl-grid-cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 600px) { .cl-grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cl-grid-cards { grid-template-columns: repeat(3, 1fr); } }

.cl-card { background: var(--cl-bg); border: 1px solid var(--cl-line); border-radius: var(--cl-radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s; }
.cl-card:hover, .cl-card:focus-within { box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.cl-card__media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--cl-soft); }
.cl-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-card__noimg { display: block; width: 100%; height: 100%; }
.cl-card--sold .cl-card__media img { filter: grayscale(.8); }
.cl-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cl-card__make { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cl-muted); }
.cl-card__title { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.cl-card__title a { color: inherit; text-decoration: none; }
.cl-card__title a:hover, .cl-card__title a:focus { color: var(--cl-accent); }
.cl-card__facts { margin: 0; font-size: .9rem; color: var(--cl-muted); }
.cl-card__price { margin: auto 0 0; padding-top: 8px; font-size: 1.25rem; font-weight: 700; }
.cl-card__old { font-size: .9rem; font-weight: 400; color: var(--cl-muted); margin-right: 6px; }

/* Badges */
.cl-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; background: var(--cl-muted); }
.cl-card__media .cl-badge { position: absolute; top: 10px; left: 10px; }
.cl-badge--sold { background: #b32d2e; }
.cl-badge--reserved { background: #b7791f; }

/* Pagination */
.cl-pagination { margin-top: 28px; }
.cl-pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; justify-content: center; }
.cl-pagination a, .cl-pagination span { display: block; padding: 8px 14px; border: 1px solid var(--cl-line); border-radius: 6px; text-decoration: none; color: inherit; }
.cl-pagination .current { background: var(--cl-brand); color: #fff; border-color: var(--cl-brand); }
.cl-empty { text-align: center; padding: 40px 0; color: var(--cl-muted); }

/* Archive */
.cl-archive__head { margin-bottom: 24px; }
.cl-archive__head h1 { margin: 0 0 8px; }

/* Single car */
.cl-single__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.cl-single__head h1 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
.cl-single__top { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .cl-single__top { grid-template-columns: 3fr 2fr; align-items: start; } }

.cl-gallery__main { display: block; border-radius: var(--cl-radius); overflow: hidden; background: var(--cl-soft); cursor: zoom-in; }
.cl-gallery__img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.cl-gallery__thumbs { display: flex; gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; overflow-x: auto; }
.cl-gallery__thumbs li { flex: 0 0 90px; margin: 0; }
.cl-gallery__thumbs img { width: 90px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.cl-gallery__thumbs a:focus-visible, .cl-gallery__main:focus-visible { outline: 3px solid var(--cl-accent); outline-offset: 2px; }

.cl-summary { background: var(--cl-soft); border-radius: var(--cl-radius); padding: 20px; }
.cl-summary__price { margin: 0 0 12px; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.cl-summary__facts { list-style: none; margin: 0 0 16px; padding: 0; }
.cl-summary__facts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cl-line); }
.cl-summary__facts span { color: var(--cl-muted); }
.cl-summary__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cl-btn { display: inline-block; padding: 12px 20px; border: 2px solid var(--cl-brand); border-radius: 6px; font-weight: 700; text-decoration: none; color: var(--cl-brand); background: transparent; cursor: pointer; text-align: center; }
.cl-btn:hover, .cl-btn:focus-visible { background: var(--cl-brand); color: #fff; }
.cl-btn--primary { background: var(--cl-accent); border-color: var(--cl-accent); color: #fff; }
.cl-btn--primary:hover, .cl-btn--primary:focus-visible { background: var(--cl-brand); border-color: var(--cl-brand); }

.cl-section { margin-top: 36px; }
.cl-section h2 { font-size: 1.3rem; margin: 0 0 12px; }
.cl-specs { width: 100%; border-collapse: collapse; }
.cl-specs th, .cl-specs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--cl-line); }
.cl-specs th { width: 40%; font-weight: 500; color: var(--cl-muted); background: var(--cl-soft); }
.cl-equipment { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.cl-equipment li { padding-left: 24px; position: relative; margin: 0; }
.cl-equipment li::before { content: "\2713"; position: absolute; left: 0; color: var(--cl-accent); font-weight: 700; }

/* Lightbox */
.cl-no-scroll { overflow: hidden; }
.cl-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.cl-lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.cl-lightbox__btn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.cl-lightbox__btn:hover, .cl-lightbox__btn:focus-visible { background: rgba(255, 255, 255, .35); }
.cl-lightbox__close { top: 16px; right: 16px; }
.cl-lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.cl-lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }

@media (prefers-reduced-motion: reduce) { .cl-card { transition: none; } }

/* Filters */
.cl-filters { background: var(--cl-soft, #f5f7f9); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.cl-filters__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 760px) { .cl-filters__grid { grid-template-columns: repeat(4, 1fr); } }
.cl-filters__field label, .cl-filters__label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.cl-filters__field select, .cl-filters__field input { width: 100%; min-height: 42px; box-sizing: border-box; }
.cl-filters__range > div { display: flex; gap: 6px; }
.cl-filters__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 14px; }
.cl-filters__reset { color: inherit; font-size: .9rem; }
.cl-listing__results.is-loading { opacity: .45; transition: opacity .15s; pointer-events: none; }
.cl-count { margin: 0 0 12px; color: var(--cl-muted, #5f6b76); font-size: .95rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Enquiry form */
.cl-form { max-width: 720px; }
.cl-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.cl-form input[type="text"], .cl-form input[type="email"], .cl-form input[type="tel"], .cl-form textarea { width: 100%; box-sizing: border-box; min-height: 44px; }
.cl-form__grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 700px) { .cl-form__grid { grid-template-columns: repeat(3, 1fr); } }
.cl-form__consent label { font-weight: 400; }
.cl-form__ok { padding: 10px 14px; background: #e6f4ea; color: #14532d; border-radius: 6px; }
.cl-form__err { padding: 10px 14px; background: #fde8e8; color: #7f1d1d; border-radius: 6px; }
.cl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* OpenStreetMap embed */
.cl-map iframe { display: block; width: 100%; border: 0; border-radius: 8px; }
.cl-map__link, .cl-map-link { margin: 8px 0 0; font-size: .9rem; }

/* Homepage blocks: quick search, makes / body types, "all cars" link */
.cl-section-title { margin: 0 0 16px; font-size: 1.6rem; color: var(--cl-brand, #144a8e); }
.cl-search-wrap, .cl-terms-wrap { margin: 0 auto; }
.cl-search { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; background: var(--cl-soft, #f5f7f9); border-radius: 8px; padding: 16px; }
@media (min-width: 900px) { .cl-search { grid-template-columns: repeat(4, 1fr) auto; } }
.cl-search__field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.cl-search__field select { width: 100%; min-height: 42px; box-sizing: border-box; }
.cl-search .cl-btn { grid-column: 1 / -1; }
@media (min-width: 900px) { .cl-search .cl-btn { grid-column: auto; } }
.cl-terms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .cl-terms { grid-template-columns: repeat(4, 1fr); } }
.cl-terms li { margin: 0; }
.cl-terms a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--cl-line, #e2e6ea); border-radius: 8px; text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.cl-terms a:hover, .cl-terms a:focus-visible { border-color: var(--cl-accent, #b45e37); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.cl-terms__name { font-weight: 700; color: var(--cl-brand, #144a8e); }
.cl-terms__count { font-size: .85rem; color: var(--cl-muted, #5f6b76); }
.cl-more { text-align: center; margin: 24px 0 0; }
.cl-listing--nofilters .cl-count { display: none; }
