/* =========================================================
   Home Product Card Alignment Fix
   Scope: homepage product/fittings cards only.
   Purpose: keep titles and buttons aligned when some titles are 1 line and others are 2 lines.
   Does not change product structure, page order, images, or card layout.
========================================================= */

.home-product-grid .product-card,
.home-product-grid .enhanced-product-card,
.home-product-grid .badge-product-card{
  display:flex !important;
  flex-direction:column !important;
  height:100% !important;
}

.home-product-grid .product-card .card-body,
.home-product-grid .enhanced-product-card .card-body,
.home-product-grid .badge-product-card .card-body{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
}

/* Lock title area so short titles do not pull buttons upward */
.home-product-grid .product-card h3,
.home-product-grid .enhanced-product-card h3,
.home-product-grid .badge-product-card h3{
  min-height:56px !important;
  max-height:56px !important;
  margin:0 0 16px !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  line-height:1.22 !important;
}

/* Keep buttons pinned to the bottom of the white area */
.home-product-grid .card-actions-stack{
  margin-top:auto !important;
  width:100% !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:10px !important;
}

.home-product-grid .card-actions-stack .card-action,
.home-product-grid .card-actions-stack .more{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* Desktop: match current visual rhythm without changing framework */
@media(min-width:961px){
  .home-product-grid .product-card .card-body,
  .home-product-grid .enhanced-product-card .card-body,
  .home-product-grid .badge-product-card .card-body{
    padding-bottom:20px !important;
  }

  .home-product-grid .card-actions-stack .card-action,
  .home-product-grid .card-actions-stack .more{
    min-height:52px !important;
  }
}

/* Mobile: two-column cards, titles still aligned but more compact */
@media(max-width:960px){
  .home-product-grid .product-card h3,
  .home-product-grid .enhanced-product-card h3,
  .home-product-grid .badge-product-card h3{
    min-height:48px !important;
    max-height:48px !important;
    margin-bottom:12px !important;
    font-size:17px !important;
    line-height:1.22 !important;
  }

  .home-product-grid .card-actions-stack{
    gap:8px !important;
  }

  .home-product-grid .card-actions-stack .card-action,
  .home-product-grid .card-actions-stack .more{
    min-height:44px !important;
  }
}

@media(max-width:420px){
  .home-product-grid .product-card h3,
  .home-product-grid .enhanced-product-card h3,
  .home-product-grid .badge-product-card h3{
    min-height:46px !important;
    max-height:46px !important;
    font-size:16px !important;
  }

  .home-product-grid .card-actions-stack .card-action,
  .home-product-grid .card-actions-stack .more{
    min-height:42px !important;
    font-size:14px !important;
  }
}
