/* CarTotalos Marketplace – RTL, mobile-first. Builds on assets/ctp.css tokens. */
.ctp-mp [hidden] { display: none !important; }
.ctp-mp { max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
.ctp-mp a:focus-visible, .ctp-mp summary:focus-visible, .ctp-mp-fav:focus-visible, .ctp-mp .ctp-mp-cmp input:focus-visible, .ctp-mp .ctp-choice input:focus-visible { outline: 3px solid var(--ctp-focus, #0a4585); outline-offset: 2px; }
.ctp-mp-intro { color: var(--ctp-muted); max-width: 70ch; margin: 0 0 16px; }

/* toolbar */
.ctp-mp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.ctp-mp-sort { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.ctp-mp-sort select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--ctp-control-border); border-radius: 10px; background: #fff; font: 16px var(--ctp-font); }

/* layout */
.ctp-mp-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
	.ctp-mp-layout { grid-template-columns: 290px 1fr; }
	.ctp-mp-filters { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
	.ctp-mp-filter-toggle, .ctp-mp-close, .ctp-mp-overlay { display: none !important; }
	.ctp-mp-filters__head { display: none; }
}

/* filters */
.ctp-mp-filters { background: var(--ctp-bg); border: 1px solid var(--ctp-line); border-radius: var(--ctp-radius); padding: 16px; }
.ctp-mp-filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ctp-mp-filters__head h2 { margin: 0; font-size: 1.2rem; }
.ctp-mp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctp-mp-fs { border: 0; padding: 0; margin: 0 0 14px; min-inline-size: 0; }
.ctp-mp-fs legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.ctp-mp-more { margin: 4px 0 14px; }
.ctp-mp-more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.ctp-mp-pricenote { margin: -6px 0 12px; }
.ctp-mp-filters__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ctp-mp-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ctp-ink); }
.ctp-mp-overlay { position: fixed; inset: 0; background: rgba(20, 32, 46, .5); z-index: 9998; }

/* drawer (only when JS is active; without JS the form is simply shown inline) */
@media (max-width: 899px) {
	.ctp-mp.has-js .ctp-mp-filters { position: fixed; z-index: 9999; inset-block: 0; inset-inline-start: 0; width: min(92vw, 400px); border-radius: 0; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
	.ctp-mp.has-js .ctp-mp-filters.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
	html.ctp-mp-lock { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .ctp-mp.has-js .ctp-mp-filters { transition: none; } }

/* results */
.ctp-mp-results.is-loading { opacity: .55; transition: opacity .15s; }
.ctp-mp-results:focus { outline: none; }
/* the result count is the heading of the results block (keeps h1 > h2 > h3 card titles); it looks like the plain text line it was */
.ctp .ctp-mp-count { margin: 0 0 12px; font-size: 1.05rem; font-weight: 400; line-height: 1.55; }
.ctp-mp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ctp-mp-empty { text-align: start; }
.ctp-mp-empty h3 { font-size: 1.25rem; }

/* card */
.ctp-mp-card { display: flex; flex-direction: column; background: var(--ctp-bg); border: 1px solid var(--ctp-line); border-radius: var(--ctp-radius); overflow: hidden; box-shadow: var(--ctp-shadow); min-width: 0; }
.ctp-mp-card.is-sponsored { border-color: var(--ctp-accent); }
.ctp-mp-card.is-under-offer { opacity: .92; }
.ctp-mp-card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ctp-surface); }
.ctp-mp-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctp-mp-card__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ctp-muted); font-size: .95rem; }
.ctp-mp-ribbon { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; background: var(--ctp-accent); color: #1b1b1b; font-weight: 700; font-size: .8rem; padding: 3px 10px; border-radius: 999px; }
.ctp-mp-card__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.ctp-mp-card__title { margin: 0; font-size: 1.08rem; }
.ctp-mp-card__title a { color: var(--ctp-ink); text-decoration: none; }
.ctp-mp-card__title a:hover { text-decoration: underline; }
.ctp-mp-card__meta { margin: 0; color: var(--ctp-muted); font-size: .92rem; }
.ctp-mp-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ctp-mp-card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ctp-mp-card__price { margin: 0; font-weight: 800; font-size: 1.2rem; }
.ctp-mp-card__price.is-offers, .ctp-mp-side__price.is-offers { color: var(--ctp-brand); font-size: 1.05rem; }
.ctp-mp-card__seller { margin: 0; }
.ctp-mp-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--ctp-line); padding-top: 8px; }
.ctp-mp-fav { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--ctp-line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--ctp-muted); }
.ctp-mp-fav svg { fill: none; stroke: currentColor; stroke-width: 2; }
.ctp-mp-fav[aria-pressed=true] { color: var(--ctp-bad); border-color: var(--ctp-bad); }
.ctp-mp-fav[aria-pressed=true] svg { fill: currentColor; }
.ctp-mp-cmp { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 8px; cursor: pointer; font-size: .95rem; }
.ctp-mp-cmp input { width: 20px; height: 20px; accent-color: var(--ctp-brand); }

/* pager */
.ctp-mp-pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 22px 0 6px; }
.ctp-mp-pager a, .ctp-mp-pager__cur { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; }
.ctp-mp-pager__num { border: 1px solid var(--ctp-line); }
.ctp-mp-pager__cur { background: var(--ctp-brand); color: var(--ctp-brand-ink); font-weight: 700; }

/* saved search + legal */
.ctp-mp-alert { margin-top: 22px; }
.ctp-mp-alert summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ctp-mp-alert__msg { min-height: 1.4em; margin: 8px 0 0; }
.ctp-mp-legal { margin-top: 18px; }

/* compare bar + dialog */
.ctp-mp-cmpbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 9990; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ctp-bg); border-top: 1px solid var(--ctp-line); box-shadow: 0 -4px 16px rgba(20, 32, 46, .12); }
.ctp-mp-cmpbar__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.ctp-mp-chip__t { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctp-mp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--ctp-surface); border: 1px solid var(--ctp-line); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: .9rem; }
.ctp-mp-chip button { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--ctp-ink); }
.ctp-mp-dialog { width: min(1100px, 96vw); max-height: 92vh; padding: 0; border: 1px solid var(--ctp-line); border-radius: var(--ctp-radius); direction: rtl; font-family: var(--ctp-font); color: var(--ctp-ink); }
.ctp-mp-dialog::backdrop { background: rgba(20, 32, 46, .55); }
.ctp-mp-dialog__head { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--ctp-line); position: sticky; top: 0; background: var(--ctp-bg); }
.ctp-mp-dialog__head h2 { margin: 0; }
.ctp-mp-dialog__body { padding: 12px 16px 20px; }
.ctp-mp-cmp-wrap { overflow-x: auto; }
.ctp-mp-cmp-table th[scope=col] { min-width: 170px; vertical-align: top; }
.ctp-mp-cmp-table th[scope=row] { white-space: nowrap; color: var(--ctp-muted); font-weight: 600; }
.ctp-mp-cmp-img { display: block; width: 100%; height: auto; max-height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.ctp-mp-cmp-remove { min-height: 44px; margin-top: 6px; padding: 6px 12px; font-size: .9rem; }

/* listing page */
.ctp-mp-crumbs { margin: 8px 0 14px; color: var(--ctp-muted); font-size: .92rem; }
.ctp-mp-l-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 18px; }
@media (min-width: 900px) { .ctp-mp-l-grid { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.ctp-mp-gallery__main { background: var(--ctp-surface); border-radius: var(--ctp-radius); overflow: hidden; }
.ctp-mp-gallery__main img { width: 100%; height: auto; display: block; max-height: 70vh; object-fit: contain; }
.ctp-mp-gallery__thumbs { list-style: none; display: flex; gap: 8px; margin: 8px 0 0; padding: 0; overflow-x: auto; }
.ctp-mp-gallery__thumbs a { display: block; width: 88px; min-height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid var(--ctp-line); }
.ctp-mp-gallery__thumbs img { width: 100%; height: 66px; object-fit: cover; display: block; }
.ctp-mp-gallery__none { padding: 40px 16px; text-align: center; background: var(--ctp-surface); border-radius: var(--ctp-radius); color: var(--ctp-muted); }
.ctp-mp-side h1 { margin: 0 0 4px; font-size: 1.5rem; line-height: 1.25; }
.ctp-mp-side__price { font-size: 1.7rem; font-weight: 800; margin: 10px 0 2px; }
.ctp-mp-side__actions { display: grid; gap: 10px; margin: 14px 0; }
.ctp-mp-notice { margin-bottom: 18px; }
.ctp-mp-sec { margin: 22px 0; }
.ctp-mp-facts th { width: 40%; color: var(--ctp-muted); font-weight: 600; }
.ctp-mp .ctp-table-wrap { overflow-x: auto; max-width: 100%; } /* tables never widen the page on mobile */
.ctp-mp-history { margin: 0; padding-inline-start: 20px; }
.ctp-mp-gone h1 { margin-top: 0; }
body.ctp-listing-page .ctp-mp { padding-bottom: 80px; }
/* a11y: the car title link inside a card was 21px high (WCAG 2.5.8 asks for at least 24px) */
.ctp-mp-card__title a { display: inline-block; padding-block: 2px; }

/* partner portal: business listings (ctp/portal/sections) */
.ctp-mpl { max-width: 860px; margin: 18px auto 0; padding-inline: 16px; }
.ctp-mpl fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.ctp-mpl legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.ctp-mpl__new { margin: 10px 0 18px; }
.ctp-mpl__new > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--ctp-brand); }
.ctp-mpl__form { margin-top: 12px; }
.ctp-mpl__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ctp-mpl__top { justify-content: space-between; margin-bottom: 6px; }
.ctp-mpl__top h4 { margin: 0; font-size: 1.05em; }
.ctp-mpl__top h4 a { display: inline-block; padding-block: 4px; }
.ctp-mpl__actions { margin-top: 10px; gap: 8px; }
.ctp-mpl__actions form { margin: 0; }
.ctp-mpl [aria-invalid="true"] { border-color: var(--ctp-bad) !important; }
.ctp-mpl [hidden] { display: none !important; }
.ctp-mpl [data-ctp-mpl-notice]:focus { outline: 3px solid var(--ctp-brand); outline-offset: 2px; }
/* board: small text link to the verified partner directory */
.ctp-mp-dirlink { margin: -4px 0 12px; font-size: .92rem; }
.ctp-mp-dirlink a { display: inline-block; padding-block: 10px; }
