/*
 * AI24Solutions product carousel — V24
 *
 * Visual contract:
 * - one horizontal product row;
 * - row height is defined by its tallest card;
 * - every product card stretches to that same height;
 * - CTA/actions are aligned at the bottom;
 * - horizontal scrolling and scroll snapping remain intact;
 * - no JavaScript dependency for equal-height calculation.
 */

#products.home-products-section
.portfolio-grid[data-products-track] {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: 370px !important;
  grid-template-columns: none !important;
  grid-template-rows: auto !important;

  align-items: stretch !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;
}

#products.home-products-section
.portfolio-grid[data-products-track]
> .portfolio-tile {
  box-sizing: border-box !important;

  display: flex !important;
  flex-direction: column !important;

  grid-column: auto !important;
  grid-row: 1 !important;

  align-self: stretch !important;

  width: 370px !important;
  max-width: 370px !important;

  height: auto !important;
  max-height: none !important;

  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#products.home-products-section
.portfolio-grid[data-products-track]
> .portfolio-tile
.portfolio-tile__actions {
  margin-top: auto !important;
  padding-top: 18px;
}

@media (max-width: 767px) {
  #products.home-products-section
  .portfolio-grid[data-products-track] {
    grid-auto-columns: calc(100vw - 54px) !important;
  }

  #products.home-products-section
  .portfolio-grid[data-products-track]
  > .portfolio-tile {
    width: 100% !important;
    max-width: 100% !important;
  }
}
