/* AutoCOS · 30/10/2026
   Stock presentation: separate CSS for compact rows and card grid.
   This stylesheet loads after the website's dynamic design rules. It does
   not affect the homepage grid, vehicle detail, or photo processing. */

/* Common type polish for stock listing. Keep the website theme. */
body .stock-page [data-vehicles-results] .vehicle-item {
  overflow: hidden;
  background: #fff;
}
body .stock-page [data-vehicles-results] .vehicle-item__title {
  color: #172332 !important;
  font-weight: 850 !important;
  letter-spacing: -0.032em !important;
  text-decoration: none !important;
  overflow-wrap: break-word;
}
body .stock-page [data-vehicles-results] .vehicle-item__title:hover {
  color: var(--ac-primary,var(--red,#e30613)) !important;
}
body .stock-page [data-vehicles-results] .vehicle-fact i {
  color: var(--ac-primary,var(--red,#e30613)) !important;
  flex-shrink: 0;
}
body .stock-page [data-vehicles-results] .vehicle-fact strong {
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* COMPACT ROW: image, information and actions belong to the same row.
   Give each side a realistic width so finance does not crush the title. */
@media (min-width: 992px) {
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item {
    display:grid !important;
    grid-template-columns: minmax(200px, 30%) minmax(0,1fr) 185px !important;
    min-height:0 !important;
    align-items:stretch !important;
    border-radius:17px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__media {
    position:relative !important;
    display:block !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:auto !important;
    overflow:hidden !important;
    align-self:start !important;
    background:#fff !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__media img {
    display:block !important;
    width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
    object-position:center !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__main {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    align-self:stretch !important;
    justify-content:flex-start !important;
    min-width:0 !important;
    padding:15px 15px 12px !important;
    gap:12px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__headline {
    display:block !important;
    margin:0 !important;
    padding:0 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__title {
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    max-width:none !important;
    min-height:0 !important;
    margin:0 !important;
    font-size:clamp(16px,1.45vw,19px) !important;
    line-height:1.16 !important;
    text-wrap:pretty !important;
    overflow:hidden !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-facts {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,max-content)) !important;
    justify-content:start !important;
    align-content:start !important;
    gap:7px 8px !important;
    width:100% !important;
    margin:0 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-fact {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    min-width:0 !important;
    min-height:27px !important;
    gap:5px !important;
    margin:0 !important;
    padding:5px 8px !important;
    border:1px solid #e8edf2 !important;
    border-radius:7px !important;
    background:#f7f9fb !important;
    box-shadow:none !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-fact strong {
    max-width:110px !important;
    font-size:10.5px !important;
    line-height:1.1 !important;
    font-weight:750 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-fact i {
    font-size:11px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__side {
    align-self:stretch !important;
    justify-content:center !important;
    min-width:0 !important;
    padding:8px 11px !important;
    gap:4px !important;
    border-left:1px solid #edf0f3 !important;
    border-top:0 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__side > span {
    line-height:1 !important;
    font-size:9px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__side > .vehicle-item__price {
    font-size:21px !important;
    line-height:1.05 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-finance-stock-quick {
    margin:3px 0 1px !important;
    padding-top:4px !important;
    gap:1px 5px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-finance-stock-quick .ac-finance-stock-label{font-size:8px !important}
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-finance-stock-quick .ac-finance-stock-value strong{font-size:16px !important}
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-finance-stock-quick .ac-finance-stock-meta{font-size:9px !important}
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-actions {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    width:100% !important;
    margin-top:4px !important;
    gap:5px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-actions .ac-details-action{
    min-height:31px !important;
    padding:6px 8px !important;
    font-size:11px !important;
    border-radius:8px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-card-quick-actions {
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:4px !important;
    width:100% !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-card-quick-actions :is(a,button){
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    min-width:0 !important;
    width:100% !important;
    min-height:29px !important;
    height:29px !important;
    padding:4px !important;
  }
}

/* CARD GRID: a self-contained product card. Do not reuse compact-row styles. */
body.ac-stock-cards .stock-page [data-vehicles-results] > .col-12{min-width:0!important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item {
  display:flex !important;
  flex-direction:column !important;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  border-radius:17px !important;
  overflow:hidden !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item__media {
  display:block !important;
  position:relative !important;
  flex:0 0 auto !important;
  align-self:auto !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  background:#fff !important;
  overflow:hidden !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item__media img {
  width:100% !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  display:block !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__main {
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  padding:14px 13px 12px !important;
  gap:9px !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__headline {
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  gap:8px !important;
  min-width:0 !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__title {
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:3 !important;
  min-height:0 !important;
  max-width:100% !important;
  font-size:16px !important;
  line-height:1.12 !important;
  font-weight:850 !important;
  margin:0 !important;
  text-wrap:pretty !important;
  overflow:hidden !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .mobile-price {
  display:block !important;
  margin:0 !important;
  font-size:22px !important;
  line-height:1.05 !important;
  font-weight:900 !important;
  color:var(--ac-primary,var(--red,#e30613)) !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-facts {
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch !important;
  align-content:start !important;
  gap:6px 7px !important;
  width:100% !important;
  margin:0 !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact {
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  min-width:0 !important;
  min-height:27px !important;
  padding:4px 6px !important;
  gap:5px !important;
  border:0 !important;
  border-radius:7px !important;
  background:#f4f6f8 !important;
  box-shadow:none !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact i{font-size:11px!important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact strong {
  font-size:10.5px !important;
  line-height:1.15 !important;
  font-weight:700 !important;
  max-width:100% !important;
  overflow:hidden !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side {
  display:flex !important;
  flex-direction:column !important;
  flex:0 0 auto !important;
  align-self:auto !important;
  width:100% !important;
  min-width:0 !important;
  margin-top:auto !important;
  padding:10px 13px 11px !important;
  gap:7px !important;
  border:0 !important;
  border-top:1px solid #edf0f3 !important;
  background:#fff !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side > span,
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side > .vehicle-item__price,
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side > small {display:none !important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-finance-stock-quick {
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  min-width:0 !important;
  gap:3px 6px !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-finance-stock-quick .ac-finance-stock-label {font-size:8.5px !important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-finance-stock-quick .ac-finance-stock-value strong{font-size:17px !important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-finance-stock-quick .ac-finance-stock-meta{font-size:9.5px !important}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-actions {
  margin:0 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:7px !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-actions .ac-details-action {
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  width:100% !important;
  min-height:36px !important;
  border-radius:9px !important;
  padding:8px 9px !important;
  font-size:12px !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-card-quick-actions {
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:5px !important;
  width:100% !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-card-quick-actions :is(a,button) {
  width:100% !important;
  min-width:0 !important;
  min-height:34px !important;
  height:34px !important;
  padding:5px !important;
  border-radius:8px !important;
}

/* Grid on larger cards (two columns): avoid wasting horizontal room. */
body.ac-stock-cards.ac-columns-2 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__title {
  -webkit-line-clamp:2 !important;
  min-height:2.3em !important;
  font-size:18px !important;
}
body.ac-stock-cards.ac-columns-2 .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact strong {font-size:11.5px !important}
body.ac-stock-cards.ac-columns-2 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__main {padding:16px !important}
body.ac-stock-cards.ac-columns-2 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side {padding:13px 16px 16px !important}

/* Four columns should still be readable on desktop. */
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__main {padding:12px 10px !important}
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side {padding:10px !important}
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .vehicle-facts {gap:5px !important}
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact {padding:5px!important}
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__title {font-size:14px !important}
body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] .vehicle-item .mobile-price {font-size:20px !important}

/* On tablet and phone the site already stacks/tile cards. Avoid the tiny
   compact three-column row when the display is narrow. */
@media (max-width:991.98px){
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__main{
    justify-content:flex-start !important;
    gap:9px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-facts{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:6px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-fact{
    padding:5px 8px !important;
    min-height:28px !important;
    border-radius:8px !important;
  }
}
@media (max-width:767.98px){
  body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__title{
    -webkit-line-clamp:3 !important;
    min-height:0 !important;
    font-size:18px !important;
  }
  body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__main{padding:15px !important}
  body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side{padding:12px 15px 15px !important}
  body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-fact strong{font-size:11px !important}
}

/* Browser móvil: nunca heredar 2-3 columnas de la configuración desktop. */
@media (max-width:767.98px){
  body.ac-stock-cards.ac-columns-2 .stock-page [data-vehicles-results] > .col-12,
  body.ac-stock-cards.ac-columns-3 .stock-page [data-vehicles-results] > .col-12,
  body.ac-stock-cards.ac-columns-4 .stock-page [data-vehicles-results] > .col-12,
  body.ac-stock-cards .stock-page [data-vehicles-results] > .col-12 {
    width:100% !important;
    flex-basis:100% !important;
    max-width:100% !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item{
    display:flex !important;
    flex-direction:column !important;
    min-height:0 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__media {
    display:block !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    background:#fff !important;
    overflow:hidden !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__media img {
    display:block !important;
    width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__main{
    display:flex !important;
    flex-direction:column !important;
    gap:9px !important;
    padding:15px 14px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item__side{
    display:flex !important;
    flex-direction:column !important;
    width:100% !important;
    padding:13px 14px 15px !important;
    border-left:0 !important;
    border-top:1px solid #edf0f3 !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-actions {
    display:flex !important;
    flex-direction:column !important;
    gap:8px !important;
    width:100% !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-actions .ac-details-action{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:100% !important;
    min-height:38px !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-card-quick-actions {
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:8px !important;
    width:100% !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .ac-card-quick-actions :is(a,button) {
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    min-width:0 !important;
    width:100% !important;
    min-height:37px !important;
    height:37px !important;
  }
}

/* Final density and mobile price visibility. */
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-facts {
  grid-auto-rows:minmax(27px,auto) !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .vehicle-actions .ac-details-action{
  min-height:34px !important;
  padding:7px 9px !important;
}
body.ac-stock-cards .stock-page [data-vehicles-results] .vehicle-item .ac-card-quick-actions :is(a,button){
  height:31px !important;
  min-height:31px !important;
}
@media(max-width:767.98px){
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item .mobile-price{
    display:block !important;
    margin-top:8px !important;
    font-size:24px !important;
    font-weight:900 !important;
    line-height:1.15 !important;
    color:var(--ac-primary,var(--red,#e30613)) !important;
  }
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side > .vehicle-item__price,
  body.ac-stock-compact .stock-page [data-vehicles-results] .vehicle-item .vehicle-item__side > span {display:none !important}
}

/* The arrow is a child of .ac-finance-stock-value (not a grid sibling).
   Keep the amount and arrow on one line: fixes tall, broken finance rows. */
body .stock-page [data-vehicles-results] .vehicle-item a.ac-finance-stock-quick {
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:2px !important;
}
body .stock-page [data-vehicles-results] .vehicle-item a.ac-finance-stock-quick .ac-finance-stock-value {
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  flex-direction:row !important;
  min-height:0 !important;
  height:auto !important;
  width:100% !important;
  gap:8px !important;
}
body .stock-page [data-vehicles-results] .vehicle-item a.ac-finance-stock-quick .ac-finance-stock-value strong {
  display:inline-block !important;
  white-space:nowrap !important;
  line-height:1.18 !important;
}
body .stock-page [data-vehicles-results] .vehicle-item a.ac-finance-stock-quick .ac-finance-stock-arrow {
  display:inline-flex !important;
  flex:0 0 18px !important;
  align-items:center !important;
  justify-content:center !important;
  align-self:center !important;
  margin-left:auto !important;
}
body .stock-page [data-vehicles-results] .vehicle-item a.ac-finance-stock-quick .ac-finance-stock-meta {
  display:flex !important;
  flex-wrap:wrap !important;
  gap:2px 7px !important;
}
