/* Khodro Ads: search UI (category field, suggestions, sort, range inputs). Class names are unique (cpc-*) so this
   file is safe outside the .cpc-scope wrapper (the suggestion list is appended to <body>). */

.cpc-catpick { position: relative; }
.cpc-catpick .cpc-cat-input { width: 100%; margin: 0; padding-inline-end: 30px; }
.cpc-cat-clear { position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.12); color: #444; font-size: 16px; line-height: 20px; text-align: center; cursor: pointer; }
.cpc-cat-clear:hover { background: rgba(0,0,0,.22); }
.cpc-cat-clear[hidden] { display: none; }

.cpc-suggest { position: absolute; z-index: 99999; margin: 0; padding: 0; list-style: none; background: #fff; color: #222; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); max-height: 300px; overflow: auto; direction: rtl; text-align: right; font-family: "Vazirmatn", "Vazir", Tahoma, sans-serif; }
.cpc-suggest[hidden] { display: none; }
.cpc-suggest li { margin: 0; padding: 7px 12px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.cpc-suggest li small { display: block; color: #888; font-size: 12px; }
.cpc-suggest li:hover, .cpc-suggest li.active { background: #eef3ff; }
.cpc-suggest li.cpc-suggest-empty { cursor: default; color: #888; }

.cpc-sort { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font-size: .9rem; }
.cpc-sort label { margin: 0; white-space: nowrap; }
.cpc-sort select { width: auto; min-width: 150px; margin: 0; }
.cpc-scope .page-header.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.cpc-scope .page-header.row .page-count { margin-inline-start: 0; }

.cpc-results { transition: opacity .15s ease; }
.cpc-results.cpc-loading { opacity: .45; pointer-events: none; }

.cpc-range .row.collapsed { gap: 6px; flex-wrap: nowrap; }
.cpc-range .row.collapsed > .column { padding: 0; }
.cpc-range-input { text-align: center; direction: ltr; }

body.ps-dark-mode .cpc-suggest { background: #2a2d33; color: #e6e8eb; border-color: #444; }
body.ps-dark-mode .cpc-suggest li:hover, body.ps-dark-mode .cpc-suggest li.active { background: #343841; }
body.ps-dark-mode .cpc-suggest li small { color: #9aa1ab; }
body.ps-dark-mode .cpc-cat-clear { background: rgba(255,255,255,.18); color: #ddd; }

/* ---- category manager (create-listing, category step) ------------------- */
.cpc-catman { margin: 1.5rem 0; padding: 0; border: 1px solid #dcdfe4; border-radius: 10px; background: #fafbfc; }
.cpc-catman > summary { padding: 12px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.cpc-catman > summary::-webkit-details-marker { display: none; }
.cpc-catman > summary::before { content: "+"; display: inline-block; width: 1.4em; font-weight: 700; }
.cpc-catman[open] > summary::before { content: "−"; }
.cpc-catman-body { padding: 4px 16px 14px; }
.cpc-catman-modes label { display: inline-block; margin: 0 0 0 16px; }
.cpc-catman-field { margin: 0 0 10px; }
.cpc-catman-field label { display: block; margin-bottom: 4px; font-size: .9rem; }
.cpc-catman-field select, .cpc-catman-field input[type="text"] { width: 100%; max-width: 420px; margin: 0; }
.cpc-catman-msg { margin-inline-start: 10px; font-size: .9rem; }
.cpc-catman-help { margin: 0; font-size: .8rem; color: #7a808a; }
.cpc-year-help { display: block; margin-top: 4px; font-size: .8rem; color: #7a808a; }
body.ps-dark-mode .cpc-catman { background: #25282d; border-color: #3a3e45; }
body.ps-dark-mode .cpc-catman-help, body.ps-dark-mode .cpc-year-help { color: #9aa1ab; }
