/* ÔMEGA 1.6.830 — refinamento visual EXCLUSIVO da listagem Comprar Carro.
   Barra superior mais baixa; filtro lateral sticky com rolagem interna no desktop.
   Preserva o GET de filtros, ordenação, grade/lista, cards e a versão mobile. */

/* Barra plana, compacta e com apenas uma divisória inferior. */
body.public-body.public-body .stock-page-reference > .stock-toolbar-shell{
  margin:0 0 17px!important;
  padding:0!important;
  border:0!important;
  border-bottom:1px solid #e9edf3!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:#fff!important;
}
body.public-body.public-body .stock-page-reference .stock-toolbar-shell > .container{
  border:0!important;border-radius:0!important;box-shadow:none!important;
}
body.public-body.public-body .stock-page-reference .stock-listbar-reference{
  box-sizing:border-box!important;
  min-height:58px!important;
  height:auto!important;
  padding:7px 0!important;
  margin:0!important;
  gap:10px 16px!important;
  border:0!important;
  background:transparent!important;
}
body.public-body .stock-page-reference .stock-results-brandtrail{
  gap:10px!important;
}
body.public-body .stock-page-reference .stock-results-brandtrail strong{
  font-size:14px!important;
}
body.public-body .stock-page-reference .stock-listbar-tools{
  gap:9px!important;
}
body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form .automax-select-toggle,
body.public-body .stock-page-reference .stock-listbar-reference .stock-sort-form select:not(.automax-native-select){
  height:38px!important;
  min-height:38px!important;
  border-radius:10px!important;
}
body.public-body .stock-page-reference .stock-listbar-reference .view-pill{
  width:38px!important;
  height:38px!important;
  border-radius:10px!important;
  font-size:17px!important;
}

/* O overflow-x:hidden global do body criava um contêiner de scroll invisível,
   impedindo o sticky de acompanhar a rolagem real do documento.
   overflow-x:clip não cria esse contêiner e mantém o recorte lateral seguro. */
@media (min-width:981px){
  body.public-body.omega-stock-page-active{
    overflow-x:clip!important;
    overflow-y:visible!important;
  }
}

/* O contêiner da página não deve capturar a rolagem sticky. */
@media (min-width:981px){
  body.public-body .stock-page-reference,
  body.public-body .stock-page-reference > .stock-results-reference,
  body.public-body .stock-page-reference .stock-results-layout{
    overflow:visible!important;
  }
  body.public-body .stock-page-reference > .stock-results-reference.stock-results-layout{
    display:grid!important;
    grid-template-columns:minmax(260px,286px) minmax(0,1fr)!important;
    gap:clamp(20px,2vw,28px)!important;
    align-items:start!important;
    padding-top:0!important;
  }
  body.public-body .stock-page-reference .stock-results-reference > .stock-refine-reference,
  body.public-body .stock-page-reference .stock-results-reference > .stock-refine-reference.automax-filter-is-fixed,
  body.public-body .stock-page-reference .stock-results-reference > .stock-refine-reference.automax-filter-is-bottom{
    /* Sticky no início da seção; folga visual total de 24px do cabeçalho (v1.6.834). */
    position:sticky!important;
    top:calc(var(--automax-stock-filter-top,112px) + 12px)!important;
    bottom:auto!important;
    left:auto!important;
    right:auto!important;
    align-self:start!important;
    box-sizing:border-box!important;
    width:100%!important;
    height:auto!important;
    max-height:calc(100vh - var(--automax-stock-filter-top,112px) - 26px)!important;
    max-height:calc(100dvh - var(--automax-stock-filter-top,112px) - 26px)!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
    scrollbar-width:thin!important;
    scrollbar-color:#d4dce7 transparent!important;
    z-index:12!important;
  }
  body.public-body .stock-page-reference .stock-refine-reference::-webkit-scrollbar{width:5px!important;}
  body.public-body .stock-page-reference .stock-refine-reference::-webkit-scrollbar-thumb{background:#d4dce7!important;border-radius:999px!important;}
  body.public-body .stock-page-reference .stock-refine-reference::-webkit-scrollbar-track{background:transparent!important;}
  body.public-body .stock-page-reference .stock-results-reference .stock-results{
    min-width:0!important;
    grid-column:2!important;
    grid-row:1!important;
  }
  /* Se não houver veículos, o layout e a navegação continuam acessíveis. */
  body.public-body .stock-page-reference .stock-results-reference.stock-results-no-match{
    grid-template-columns:minmax(260px,286px) minmax(0,1fr)!important;
  }
  body.public-body .stock-page-reference .stock-results-reference.stock-results-no-match > .stock-refine-reference{
    display:block!important;
  }
}

/* Aparência de painel profissional; zero interferência nos campos ou no formulário. */
body.public-body .stock-page-reference .stock-refine-reference{
  border:1px solid #e4eaf2!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 8px 26px rgba(25,41,63,.065)!important;
}
body.public-body .stock-page-reference .stock-refine-reference .stock-refine-head{
  background:#fff!important;
  border-bottom:1px solid #e9eef5!important;
}
body.public-body .stock-page-reference .stock-refine-reference details summary{
  transition:color .16s ease!important;
}
body.public-body .stock-page-reference .stock-refine-reference details summary:hover{
  color:#c11d31!important;
}
body.public-body .stock-page-reference .stock-refine-reference details[open] summary .stock-filter-label i{
  background:#fff0f2!important;
  color:#ce1730!important;
}
body.public-body .stock-page-reference .stock-refine-reference select[data-no-custom-select]:focus-visible,
body.public-body .stock-page-reference .stock-refine-reference .stock-search-mini input:focus-visible{
  outline:2px solid rgba(226,36,56,.33)!important;
  outline-offset:1px!important;
}

/* Sem filtro fixo ou rolagem separada no mobile/tablet: mantém fluxo e usabilidade. */
@media (max-width:980px){
  body.public-body .stock-page-reference .stock-listbar-reference{
    min-height:0!important;
    padding:11px 0!important;
    gap:10px!important;
  }
  body.public-body .stock-page-reference .stock-results-reference > .stock-refine-reference{
    position:static!important;
    top:auto!important;
    max-height:none!important;
    overflow:visible!important;
    box-shadow:none!important;
  }
}
@media (max-width:640px){
  body.public-body .stock-page-reference > .stock-toolbar-shell{margin-bottom:14px!important;}
  body.public-body .stock-page-reference .stock-listbar-reference .view-pill{
    width:38px!important;height:38px!important;
  }
}

/* ÔMEGA 1.6.834 — fixa o filtro no viewport até o fim efetivo dos veículos.
   Corrige o recorte sob o cabeçalho quando o sticky alcança o fim da grade.
   Exclusivo da listagem, desktop; o filtro continua com rolagem própria. */
@media (min-width:981px){
  body.public-body.omega-stock-page-active .stock-page-reference .stock-results-reference > .stock-refine-reference.omega-stock-viewport-pin{
    position:fixed!important;
    top:var(--omega-stock-viewport-top, 138px)!important;
    left:var(--omega-stock-viewport-left, 0px)!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--omega-stock-viewport-width, 286px)!important;
    max-height:calc(100vh - var(--omega-stock-viewport-top,138px) - 14px)!important;
    max-height:calc(100dvh - var(--omega-stock-viewport-top,138px) - 14px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    z-index:50!important;
  }
  body.public-body.omega-stock-page-active .stock-page-reference .stock-results-reference > .stock-refine-reference.omega-stock-viewport-ended{
    visibility:hidden!important;
    pointer-events:none!important;
  }
}
