/* Custom dropdown + search suggestions (js/dropdown.js, js/suggest.js). Same surface, radius and gold accents as the cards. */

/* the native <select> stays for forms/tests/assistive tech but is not drawn */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; overflow: hidden; pointer-events: none !important; }

/* the visible control reuses the select's own classes (.select / .qs-control), so it looks exactly like the field it replaces */
button.dd { display: flex; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--carev-color-text); cursor: pointer; }
button.dd .dd__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.dd.is-empty .dd__text { color: #6b6152; }
button.dd.qs-control { height: 3rem; border: 0; background-color: transparent; padding: 0 1.4rem 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2361594e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0 center; font-size: 1rem; }
button.dd.select[aria-expanded="true"] { border-color: var(--carev-color-focus); box-shadow: var(--carev-focus-ring); }
button.dd:focus-visible { outline: 3px solid var(--carev-color-focus); outline-offset: 2px; }
button.dd.select:focus-visible { outline: none; border-color: var(--carev-color-focus); box-shadow: var(--carev-focus-ring); }
.qs-field:has(button.dd:focus-visible) { box-shadow: 0 0 0 3px rgb(242 217 157 / 55%); }
.qs-field button.dd:focus-visible { outline: none; }
button.dd:disabled { cursor: not-allowed; }

/* popup */
.dd-pop, .sg-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; padding: .35rem; background: #fff; border: 1px solid #e6dccb; border-radius: .9rem; box-shadow: 0 16px 40px rgb(32 28 23 / 22%), 0 0 0 1px rgb(212 170 88 / 16%); color: var(--carev-color-text); font-size: 1rem; animation: dd-in .12s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-pop.is-up { animation-name: dd-in-up; }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .dd-pop, .sg-pop { animation: none; } }
.dd-pop__search { padding: .2rem .2rem .4rem; }
.dd-pop__input { width: 100%; box-sizing: border-box; min-height: 2.6rem; padding: .45rem .75rem; font: inherit; color: inherit; background: #fbf8f2; border: 1px solid #d9cdb8; border-radius: .65rem; outline: none; }
.dd-pop__input:focus { border-color: var(--carev-color-focus); box-shadow: var(--carev-focus-ring); }
.dd-pop__list { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; outline: none; scrollbar-width: thin; scrollbar-color: #d4c4a3 transparent; }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .62rem .75rem; border-radius: .6rem; cursor: pointer; line-height: 1.35; }
.dd-opt .ic { flex: none; visibility: hidden; color: var(--carev-color-gold-dark); }
.dd-opt[aria-selected="true"] { font-weight: 700; background: #fbf3e2; }
.dd-opt[aria-selected="true"] .ic { visibility: visible; }
.dd-opt.is-active { background: #f5ead2; }
.dd-opt.is-empty { color: var(--carev-color-text-muted); }
.dd-opt[aria-disabled="true"] { color: #9a8f7e; cursor: not-allowed; }
.dd-opt[hidden] { display: none; }
.dd-pop__empty { margin: 0; padding: .9rem; text-align: center; color: var(--carev-color-text-muted); }

/* search suggestions: models in stock */
.sg-head { margin: 0; padding: .45rem .75rem .35rem; font-size: .8125rem; font-weight: 700; color: var(--carev-color-text-muted); }
.sg-pop { overflow: hidden; }
.sg-list, .dd-pop__list { scrollbar-width: thin; scrollbar-color: #d4c4a3 transparent; }
.sg-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: .15rem; }
.sg-list::-webkit-scrollbar, .dd-pop__list::-webkit-scrollbar { width: 8px; }
.sg-list::-webkit-scrollbar-button, .dd-pop__list::-webkit-scrollbar-button { display: none; }
.sg-list::-webkit-scrollbar-thumb, .dd-pop__list::-webkit-scrollbar-thumb { background: #d4c4a3; border-radius: 8px; border: 2px solid #fff; }
.sg-list::-webkit-scrollbar-thumb:hover, .dd-pop__list::-webkit-scrollbar-thumb:hover { background: #bda46b; }
.sg-list::-webkit-scrollbar-track, .dd-pop__list::-webkit-scrollbar-track { background: transparent; }
.sg-row { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: .6rem; color: var(--carev-color-text); line-height: 1.35; }
.sg-row:hover, .sg-row.is-active { background: #f5ead2; text-decoration: none; }
.sg-row__ic { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: #fbf3e2; color: var(--carev-color-gold-dark); }
.sg-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row__name b { font-weight: 800; }
.sg-row__n { flex: none; font-size: .875rem; font-weight: 700; color: var(--carev-color-gold-text); }
.sg-row--all { margin-top: .2rem; border-top: 1px solid #efe6d5; border-radius: 0 0 .6rem .6rem; font-weight: 700; }

/* flat list, no boxes: no frame around the popup (only a soft shadow to lift it off the page), no pill behind rows */
.dd-pop, .sg-pop { padding: .2rem 0; border: 0; border-radius: .5rem; box-shadow: 0 10px 28px rgb(32 28 23 / 20%), 0 1px 3px rgb(32 28 23 / 10%); }
.dd-opt, .sg-row { border-radius: 0; padding: .72rem 1.1rem; background: none; border-bottom: 1px solid #f2ebdd; }
.dd-opt:last-child, .sg-list .sg-row:last-child { border-bottom: 0; }
.dd-opt.is-active, .sg-row:hover, .sg-row.is-active, .dd-opt[aria-selected="true"], .dd-opt[aria-selected="true"].is-active { background: none; color: var(--carev-color-gold-text); }
.dd-opt[aria-selected="true"] { font-weight: 800; }
.sg-row--all { margin-top: 0; border-top: 0; border-radius: 0; }
.sg-row__ic { width: auto; height: auto; background: none; border-radius: 0; }
.sg-head { padding: .55rem 1.1rem .4rem; }
.dd-pop__search { padding: .25rem 1.1rem .45rem; }
.dd-pop__input { min-height: 2.4rem; padding: .4rem 0; background: transparent; border: 0; border-bottom: 1px solid #d9cdb8; border-radius: 0; }
.dd-pop__input:focus { box-shadow: none; border-bottom-color: var(--carev-color-gold-dark); }
.sg-list::-webkit-scrollbar-thumb, .dd-pop__list::-webkit-scrollbar-thumb { border-color: #fff; }
