/* ÔMEGA Veículos 1.6.827 — somente /comprar-carro.
   Mantém a estrutura, o formulário GET e as preferências globais do tema.
   O filtro usa selects nativos para evitar sobreposição/corte de pop-ups
   dentro do painel com rolagem e para manter navegação por teclado. */

/* Barra de listagem: superfície plana e somente uma linha separadora embaixo. */
body.public-body .stock-page-reference > .stock-toolbar-shell,
body.public-body.omega-light-theme .stock-page-reference > .stock-toolbar-shell {
  margin: 0 0 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e5eaf0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  overflow: visible !important;
}
body.public-body .stock-page-reference .stock-toolbar-shell > .container,
body.public-body .stock-page-reference .stock-listbar-reference {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.public-body .stock-page-reference .stock-listbar-reference {
  min-height: 70px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 12px 0 !important;
  gap: 14px 20px !important;
}
body.public-body .stock-page-reference .stock-results-brandtrail {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: #909bac;
  font-size: 14px;
}
body.public-body .stock-page-reference .stock-results-brandtrail a { color: #8d99ac; text-decoration: none; }
body.public-body .stock-page-reference .stock-results-brandtrail a:hover { color: #d61d2c; }
body.public-body .stock-page-reference .stock-results-brandtrail strong { color: #18243a !important; font-size: 15px; font-weight: 650; }
body.public-body .stock-page-reference .stock-listbar-tools { gap: 10px !important; }
body.public-body .stock-page-reference .stock-total-count { font-size: 13px; color: #475569; white-space: nowrap; }
body.public-body .stock-page-reference .stock-total-count i { color: #b91c2d; }
body.public-body .stock-page-reference .stock-sort-form label { gap: 10px; font-size: 13px; color: #64748b; white-space: nowrap; }
body.public-body .stock-page-reference .stock-sort-form .automax-select,
body.public-body .stock-page-reference .stock-sort-form select:not(.automax-native-select) { width: 186px !important; }
body.public-body .stock-page-reference .stock-sort-form .automax-select-toggle,
body.public-body .stock-page-reference .stock-sort-form select:not(.automax-native-select) {
  min-height: 42px !important;
  height: 42px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #243247 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}
body.public-body .stock-page-reference .stock-listbar-reference .view-pill {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid #e5eaf0 !important;
  border-radius: 10px !important;
  background: #f1f4f8 !important;
  color: #637083 !important;
  font-size: 19px !important;
  box-shadow: none !important;
}
body.public-body .stock-page-reference .stock-listbar-reference .view-pill.active {
  background: var(--primary, #ed1025) !important;
  color: #fff !important;
  border-color: var(--primary, #ed1025) !important;
}
body.public-body .stock-page-reference .stock-listbar-reference .view-pill:not(.active):hover {
  background: #e9eef4 !important;
  border-color: #d5dee8 !important;
}
body.public-body .stock-page-reference .stock-listbar-reference .view-pill:focus-visible,
body.public-body .stock-page-reference .stock-sort-form :focus-visible { outline: 2px solid #ed4050 !important; outline-offset: 2px; }

/* Retoma o sticky nativo para evitar o bug do filtro fixo fora da viewport.
   Rolagem do próprio painel permite alcançar todos os campos e botões. */
@media (min-width: 981px) {
  body.public-body .stock-page-reference .stock-results-reference.stock-results-layout {
    display: grid !important;
    grid-template-columns: minmax(260px, 280px) minmax(0, 1fr) !important;
    gap: clamp(18px, 2vw, 28px) !important;
    align-items: start !important;
  }
  body.public-body .stock-page-reference .stock-refine-reference,
  body.public-body .stock-page-reference .stock-refine-reference.automax-filter-is-fixed,
  body.public-body .stock-page-reference .stock-refine-reference.automax-filter-is-bottom {
    position: sticky !important;
    top: var(--automax-stock-filter-top, 112px) !important;
    left: auto !important;
    bottom: auto !important;
    right: auto !important;
    width: 100% !important;
    max-height: max(240px, calc(100vh - var(--automax-stock-filter-top, 112px) - 14px)) !important;
    max-height: max(240px, calc(100dvh - var(--automax-stock-filter-top, 112px) - 14px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin;
    scrollbar-color: #d8dfe8 transparent;
    z-index: 10 !important;
  }
  body.public-body .stock-page-reference .stock-results-reference .stock-results { grid-column: 2 !important; grid-row: 1 !important; }
  body.public-body .stock-page-reference .stock-refine-reference::-webkit-scrollbar { width: 6px; }
  body.public-body .stock-page-reference .stock-refine-reference::-webkit-scrollbar-thumb { background: #d9e0e9; border-radius: 99px; }
}

/* Cartão lateral. As regras são restritas a .stock-page-reference. */
body.public-body .stock-page-reference .stock-refine-reference {
  display: block !important;
  min-width: 0;
  border: 1px solid #e5eaf1 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 3px 18px rgba(20, 31, 52, .035) !important;
}
body.public-body .stock-page-reference .stock-refine-reference form { display: block; min-width: 0; }
body.public-body .stock-page-reference .stock-refine-reference .stock-refine-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 20px 18px 18px !important;
  background: #fafbfc !important;
  border-bottom: 1px solid #edf1f5 !important;
}
body.public-body .stock-page-reference .stock-refine-head .stock-refine-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
body.public-body .stock-page-reference .stock-filter-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: #fff0f1;
  color: #d7182c;
  font-size: 18px;
}
body.public-body .stock-page-reference .stock-refine-head .stock-refine-heading { min-width: 0; }
body.public-body .stock-page-reference .stock-refine-head h2 {
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 750 !important;
  color: #17243b !important;
  white-space: nowrap;
  margin: 0 0 4px !important;
}
body.public-body .stock-page-reference .stock-refine-head .stock-refine-subtitle {
  display: block;
  color: #8a95a6;
  font-size: 11px;
  line-height: 1.35;
}
body.public-body .stock-page-reference .stock-refine-head a {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 6px 0;
  color: #b51b2b !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  text-decoration: none;
  white-space: nowrap;
}
body.public-body .stock-page-reference .stock-refine-head a:hover { text-decoration: underline; }
body.public-body .stock-page-reference .active-filter-note {
  margin: 14px 16px 2px !important;
  padding: 10px 12px !important;
  border: 1px solid #f9d8dc !important;
  border-radius: 10px !important;
  background: #fff4f5 !important;
  color: #b2182b !important;
  font-size: 12px !important;
}
body.public-body .stock-page-reference .stock-refine-reference details {
  margin: 0 !important;
  padding: 0 17px !important;
  border: 0 !important;
  border-bottom: 1px solid #eef1f5 !important;
  background: #fff !important;
}
body.public-body .stock-page-reference .stock-refine-reference details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px !important;
  padding: 0 !important;
  color: #23324a !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25;
  cursor: pointer;
}
body.public-body .stock-page-reference .stock-refine-reference details summary .stock-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.public-body .stock-page-reference .stock-refine-reference details summary .stock-filter-label i {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  color: #b51b2b;
  background: #fff1f2;
  font-size: 13px;
}
body.public-body .stock-page-reference .stock-refine-reference details summary:after {
  content: '\f282' !important;
  font-family: bootstrap-icons !important;
  line-height: 1 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #8390a0 !important;
  transform: none !important;
  transition: transform .18s ease;
}
body.public-body .stock-page-reference .stock-refine-reference details[open] summary:after { transform: rotate(180deg) !important; }
body.public-body .stock-page-reference .stock-refine-reference details > :not(summary) { margin-bottom: 16px; }
body.public-body .stock-page-reference .stock-refine-reference details summary:focus-visible { outline: 2px solid #e03647; outline-offset: 3px; border-radius: 4px; }
body.public-body .stock-page-reference .stock-refine-reference select[data-no-custom-select],
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini input {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 30px 0 11px !important;
  border: 1px solid #dfe6ef !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #26354a !important;
  font-family: inherit !important; font-weight: 500 !important; line-height: 1.2 !important;
  font-size: 12px !important;
  outline: none;
  box-shadow: none !important;
}
body.public-body .stock-page-reference .stock-refine-reference select[data-no-custom-select] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  cursor: pointer;
  text-overflow: ellipsis;
}
body.public-body .stock-page-reference .stock-refine-reference select[data-no-custom-select]:focus,
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini input:focus {
  border-color: #ec4353 !important;
  box-shadow: 0 0 0 3px rgba(237, 16, 37, .07) !important;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini { display: block !important; margin: 0 0 14px !important; }
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini input { padding-left: 36px !important; }
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini i { left: 12px; color: #93a0af; }
body.public-body .stock-page-reference .stock-refine-reference .two-fields { gap: 9px !important; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list { display: grid; gap: 5px !important; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: #455468;
  font-size: 12px !important;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label:hover { background: #f7f9fc; border-color: #eef1f5; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label:has(input:checked) { background: #fff3f4; border-color: #f9d4da; color: #b3162a; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label:focus-within { outline: 2px solid rgba(221,32,51,.3); outline-offset: 1px; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label input[type="radio"] {
  flex: 0 0 16px;
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  accent-color: #d61b2c;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label span { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
body.public-body .stock-page-reference .stock-refine-reference .stock-check-list label small { color: #909bad; font-size: 11px; white-space: nowrap; }
/* A classe label{display:flex} do tema anulava o atributo hidden. */
body.public-body .stock-page-reference .stock-refine-reference .stock-extra-brand[hidden] { display: none !important; }
body.public-body .stock-page-reference .stock-refine-reference .stock-more-link {
  padding: 9px 0 !important;
  margin-top: 5px;
  background: transparent !important;
  color: #be1e30 !important;
  text-align: left;
  font-weight: 700 !important;
  cursor: pointer;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-price-range { margin-top: 1px; gap: 8px; }
body.public-body .stock-page-reference .stock-refine-reference .stock-price-range span { color: #68758a; font-size: 11px; font-weight: 600; }
body.public-body .stock-page-reference .stock-refine-reference .range-slider { margin-top: 2px; }
body.public-body .stock-page-reference .stock-refine-reference .btn[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: calc(100% - 34px) !important;
  min-height: 45px !important;
  height: 45px !important;
  margin: 20px 17px 9px !important;
  border: 1px solid var(--primary, #ed1025) !important;
  border-radius: 10px !important;
  background: var(--primary, #ed1025) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  box-shadow: none !important;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-clear-button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40px !important;
  margin: 0 17px 20px !important;
  padding: 8px;
  border: 1px solid #e6eaf0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #8a2734 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-clear-button:hover { background: #fff6f7 !important; }
/* O painel de filtros não pode desaparecer se uma combinação não trouxer anúncios. */
body.public-body .stock-page-reference .stock-results-layout.stock-results-no-match {
  grid-template-columns: minmax(260px, 280px) minmax(0, 1fr) !important;
}
body.public-body .stock-page-reference .stock-results-layout.stock-results-no-match .stock-refine-reference { display: block !important; }
body.public-body .stock-page-reference .stock-results-layout.stock-results-no-match .stock-results { min-width: 0; }

@media (max-width: 980px) {
  body.public-body .stock-page-reference .stock-results-reference.stock-results-layout,
  body.public-body .stock-page-reference .stock-results-layout.stock-results-no-match {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }
  body.public-body .stock-page-reference .stock-refine-reference,
  body.public-body .stock-page-reference .stock-refine-reference.automax-filter-is-fixed,
  body.public-body .stock-page-reference .stock-refine-reference.automax-filter-is-bottom {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.public-body .stock-page-reference .stock-listbar-reference { padding: 15px 0 !important; }
  body.public-body .stock-page-reference .stock-listbar-tools { flex-wrap: wrap !important; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form { flex: 1 1 220px; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form label { width: 100%; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form .automax-select { flex: 1 1 auto; width: auto !important; min-width: 170px; }
  body.public-body .stock-page-reference .stock-refine-reference { margin: 0 !important; }
}
@media (max-width: 640px) {
  body.public-body .stock-page-reference .stock-listbar-reference { min-height: 0 !important; gap: 12px !important; }
  body.public-body .stock-page-reference .stock-results-brandtrail { width: 100%; font-size: 12px; }
  body.public-body .stock-page-reference .stock-results-brandtrail strong { font-size: 13px !important; }
  body.public-body .stock-page-reference .stock-total-count { width: 100%; }
  body.public-body .stock-page-reference .stock-listbar-tools { gap: 8px !important; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form { flex: 1 1 100%; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form label { gap: 8px; }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form .automax-select { flex: 1 1 auto; min-width: 0 !important; }
  body.public-body .stock-page-reference .stock-listbar-reference .view-pill { width: 40px !important; height: 40px !important; }
  body.public-body .stock-page-reference .stock-refine-reference .stock-refine-head { padding: 16px !important; }
}

/* Especificidade maior do que os ajustes globais do tema (3x .public-body). */
body.public-body.public-body.public-body .stock-page-reference > .stock-toolbar-shell,
body.public-body.public-body.public-body .stock-page-reference .stock-toolbar-shell > .container,
body.public-body.public-body.public-body .stock-page-reference .stock-listbar-reference {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.public-body.public-body.public-body .stock-page-reference > .stock-toolbar-shell {
  border-bottom: 1px solid #e5eaf0 !important;
}
body.public-body.public-body.public-body .stock-page-reference .stock-refine-head .stock-refine-title { flex: 1 1 auto; }
body.public-body.public-body.public-body .stock-page-reference .stock-refine-head h2 { font-size: 14px !important; letter-spacing: -.25px; }
body.public-body.public-body.public-body .stock-page-reference .stock-refine-head a { font-size: 11px !important; }

/* A regra antiga da 1.6.754 usava margem -104px no mobile e escondia
   o cabeçalho do filtro atrás da barra superior. Desfaz apenas aqui. */
@media (max-width:640px) {
  body.public-body .stock-page-reference > .stock-results-reference.stock-results-layout {
    margin-top: 0 !important;
  }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    text-align: left !important;
    font-size: 12px !important;
  }
  body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form .automax-select {
    flex: 1 1 180px;
    width: auto !important;
    max-width: none !important;
  }
}
