/*
 * Final Home + Products product-card alignment overrides.
 * The three source product artworks share the same native height (181px),
 * so desktop alignment is safest when they share a rendered height too.
 * Width stays automatic to preserve each artwork's aspect ratio and prevent
 * the iota-e Video / Sensors / Communications labels from being cropped.
 */

/* Products page: keep logo/title blocks identical so artwork starts on one line. */
.ecrio-product-portfolio .ecrio-product-brand-picture {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecrio-product-portfolio .ecrio-product-brand-logo--portfolio {
  width: 150px;
  max-height: 46px;
  margin: 0 auto !important;
}

.ecrio-product-portfolio .ecrio-portfolio-card h3 {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 8px;
  text-align: center;
}

/*
 * Products page media stage: keep all three artworks aligned while using
 * more of the available card width. Home-page image sizing is untouched.
 */
.ecrio-product-portfolio .ecrio-portfolio-image-wrap {
  height: 164px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 8px;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible;
}

.ecrio-product-portfolio .ecrio-portfolio-image-wrap img,
.ecrio-product-portfolio .ecrio-portfolio-image {
  display: block;
  width: auto !important;
  max-width: 100%;
  height: clamp(118px, 12.5vw, 148px) !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center top;
  margin: 0 auto !important;
}

/* Home: reserve one common logo/title block before the three artworks. */
@media (min-width: 992px) {
  .ecrio-home-product-heading {
    min-height: 78px !important;
    margin-bottom: 6px;
    gap: 4px;
  }

  .ecrio-home-product-heading .ecrio-product-brand-picture {
    flex: 0 0 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ecrio-home-product-heading .ecrio-product-brand-logo--home {
    width: 150px;
    max-height: 42px;
    margin: 0 auto !important;
  }

  .ecrio-home-product-heading p {
    min-height: 24px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
  }

  /* Same rendered height + auto width keeps every source image proportional. */
  .ecrio-home-product-image {
    display: block;
    width: auto !important;
    max-width: 100%;
    height: clamp(100px, 10.2vw, 120px) !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center top;
    margin: 4px auto 14px !important;
  }
}

/* Stacked cards do not need cross-card equal-height media; use natural ratio. */
@media (max-width: 991px) {
  .ecrio-product-portfolio .ecrio-product-brand-picture {
    height: 50px;
  }

  .ecrio-product-portfolio .ecrio-portfolio-card h3 {
    min-height: 0;
    margin-bottom: 12px;
  }

  .ecrio-product-portfolio .ecrio-portfolio-image-wrap {
    height: auto;
  }

  .ecrio-product-portfolio .ecrio-portfolio-image-wrap img,
  .ecrio-product-portfolio .ecrio-portfolio-image,
  .ecrio-home-product-image {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}


