/* /assets/css/new-vehicles-side.css */

.vehicle-grid.vehicle-grid--side{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1000px){
  .vehicle-grid.vehicle-grid--side{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .vehicle-grid.vehicle-grid--side{ grid-template-columns: 1fr; }
}

/* Make each tile stretch to same height within the grid row */
.vehicle-tile{
  background:#fff;
  border:1px solid #e7e7e7;
  border-radius:16px;
  overflow:hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
}

.vehicle-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.08);
}

/* KEY: flex column so meta can sit at bottom consistently */
.vehicle-tile__link{
  display:flex;
  flex-direction: column;
  height: 100%;
  text-decoration:none;
  color:inherit;
}

/* ---------------------------------------
   IMAGE AREA: FIXED HEIGHT so cards line up
---------------------------------------- */
.vehicle-tile__image{
  position:relative;
  background:#f4f6f8;
  padding: 12px;
  height: 284px;           /* 260px image area + 12px top + 12px bottom */
  box-sizing: border-box;
  display:flex;
  align-items:center;
  justify-content:center;
}

.vehicle-tile__image img{
  width:100%;
  height: 260px;           /* fixed for alignment */
  object-fit: contain;
  display:block;

  /* Scale the VEHICLE, not the box */
  transform: scale(var(--side-scale, 1));
  transform-origin: center;
}

/* ---------------------------------------
   Broken / Missing Image Fallback
---------------------------------------- */
.vehicle-tile__fallback{
  position: relative;
  height: 260px;           /* fixed for alignment */
  width: 100%;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef1f4, #f7f9fb);
  border: 1px dashed rgba(0,0,0,.12);
  display: none;           /* shown only when missing/broken */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  overflow: hidden;
}

.vehicle-tile__fallback::before{
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 72% auto;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 260'%3E%3Cpath fill='%230b1b2b' d='M118 170c-26 0-48 22-48 48s22 48 48 48 48-22 48-48-22-48-48-48zm404 0c-26 0-48 22-48 48s22 48 48 48 48-22 48-48-22-48-48-48zM78 142l34-72c10-21 32-34 55-34h242c25 0 48 13 60 35l34 64c28 6 60 18 60 48v33c0 15-12 27-27 27h-30c-6-35-36-62-73-62s-67 27-73 62H239c-6-35-36-62-73-62s-67 27-73 62H61c-15 0-27-12-27-27v-45c0-16 10-24 44-29zm125-18h231l-23-44c-6-11-18-18-31-18H224c-13 0-26 7-32 18l-19 44z'/%3E%3C/svg%3E");
}

.vehicle-tile__fallback-inner{
  position: relative;
  z-index: 1;
  max-width: 95%;
}

.vehicle-tile__fallback-icon{
  font-size: 28px;
  line-height: 1;
  opacity: .35;
  margin-bottom: 8px;
}

.vehicle-tile__fallback-title{
  font-size: 13px;
  font-weight: 800;
  color: #0b1b2b;
  line-height: 1.15;
}

.vehicle-tile__fallback-sub{
  margin-top: 6px;
  font-size: 12px;
  color:#6b7280;
}

/* When missing or broken, show fallback and hide img */
.vehicle-tile__image.is-missing img,
.vehicle-tile__image.is-broken img{
  display: none;
}

.vehicle-tile__image.is-missing .vehicle-tile__fallback,
.vehicle-tile__image.is-broken .vehicle-tile__fallback{
  display: flex;
}

/* ---------------------------------------
   Overlay labels (unchanged)
---------------------------------------- */
.vehicle-tile__overlay{
  position:absolute;
  top:10px;
  left:12px;
  right:12px;
  pointer-events:none;
}

.vehicle-tile__year{
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  color:#0b1b2b;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

.vehicle-tile__name{
  margin-top: 3px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  color:#0b1b2b;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* ---------------------------------------
   META AREA: pin to bottom + consistent height
---------------------------------------- */
.vehicle-tile__meta{
  padding: 12px 14px 14px;
  margin-top: auto; /* KEY: pushes meta to bottom of card */
}

.vehicle-tile__type{
  font-size: 13px;
  font-weight: 700;
  color:#374151;
}

/* Clamp tagline so cards match height even if text differs */
.vehicle-tile__tagline{
  margin-top: 4px;
  font-size: 13px;
  color:#6b7280;
  line-height: 1.35;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;   /* 2 lines max */
  overflow: hidden;

  /* Reserve space for 2 lines so short taglines don't shrink the card */
  min-height: calc(13px * 1.35 * 2);
}

/* Utility */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Optional brand/model styling hooks (if you use them) */
.vehicle-tile__brand{
  color:#1e3a8a;
  font-weight:800;
}

.vehicle-tile__model{
  color:#111827;
}