/* =========================================================
   Carros Lagarto 10.32.297 — AJUSTE VISUAL FINAL DOS CARDS
   Corrige diferenças observadas na 10.32.296 no mobile.
   ========================================================= */

@media (max-width: 740px) {
  /* Patrocinados: o bloco volta a ocupar toda a largura útil e mostra 2 cards. */
  html body .clc-sponsored-section--vehicle-top {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html body .clc-sponsored-section--vehicle-top .clc-sponsored-top-label {
    display: none !important;
  }

  html body .clc-sponsored-section--vehicle-top .clc-sponsored-track {
    display: flex !important;
    width: 100% !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    align-items: flex-start !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none !important;
  }
  html body .clc-sponsored-section--vehicle-top .clc-sponsored-track::-webkit-scrollbar { display:none !important; }

  /* Dois cards por linha/viewport, sem regras antigas de altura mínima. */
  html body .clc-sponsored-section--vehicle-top .clc-sponsored-track > article.clc-category-vehicle-card,
  html body .clc-sponsored-section--vehicle-top article.clc-home-sponsored-vehicle-card {
    flex: 0 0 calc((100% - 10px) / 2) !important;
    width: calc((100% - 10px) / 2) !important;
    max-width: calc((100% - 10px) / 2) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    scroll-snap-align: start !important;
  }

  html body .clc-free-cascade-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    gap: 10px !important;
  }

  html body .clc-free-cascade-grid > .clc-free-category-carousel,
  html body .clc-free-cascade-grid > section:not(.clc-home-public-vehicle-card) {
    grid-column: 1 / -1 !important;
  }

  /* Card: borda verde discreta, fundo preto e sem sobra vertical. */
  html body article.clc-category-vehicle-card.clc-home-sponsored-vehicle-card,
  html body article.clc-category-vehicle-card.clc-home-public-vehicle-card,
  html body.clc-category-veiculos article.clc-category-vehicle-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(99,230,0,.48) !important;
    border-radius: 17px !important;
    background: #040706 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.22) !important;
    transform: none !important;
  }

  /* Foto realmente dominante: 4:3, sem limitar em 116/150px. */
  html body article.clc-category-vehicle-card .clc-category-vehicle-media {
    position: relative !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #080c09 !important;
  }

  html body article.clc-category-vehicle-card .clc-category-vehicle-media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  /* Bloco inferior curto, centralizado e sem preenchimento vazio. */
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 78px !important;
    height: auto !important;
    max-height: none !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 10px 8px 12px !important;
    box-sizing: border-box !important;
    background: #040706 !important;
    text-align: center !important;
  }

  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines h3,
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines h3 a {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-size: 14.5px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines > strong {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #63E600 !important;
    font-size: 18px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Garante que nenhum elemento legado volte a abrir espaço preto. */
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines p,
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines .clc-category-vehicle-open,
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines .clc-home-vehicle-open {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Favorito e patrocinado sobre a imagem, como no modelo aprovado. */
  html body article.clc-category-vehicle-card .clc-category-vehicle-favorite {
    position: absolute !important;
    z-index: 8 !important;
    top: 8px !important;
    right: 8px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  html body .clc-sponsored-section--vehicle-top .clc-sponsored-badge {
    position: absolute !important;
    z-index: 7 !important;
    top: 8px !important;
    left: 8px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #63E600 !important;
    color: #061000 !important;
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: .025em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
}

@media (max-width: 390px) {
  html body .clc-sponsored-section--vehicle-top .clc-sponsored-track,
  html body .clc-free-cascade-grid { gap: 8px !important; }

  html body .clc-sponsored-section--vehicle-top .clc-sponsored-track > article.clc-category-vehicle-card,
  html body .clc-sponsored-section--vehicle-top article.clc-home-sponsored-vehicle-card {
    flex-basis: calc((100% - 8px) / 2) !important;
    width: calc((100% - 8px) / 2) !important;
    max-width: calc((100% - 8px) / 2) !important;
  }

  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines {
    min-height: 73px !important;
    gap: 4px !important;
    padding: 9px 7px 10px !important;
  }
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines h3,
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines h3 a { font-size: 13.5px !important; }
  html body article.clc-category-vehicle-card .clc-category-vehicle-content.clc-vehicle-card-two-lines > strong { font-size: 17px !important; }
}
