/*
 * Toddy's Toys V5.2
 * Shop page shared-card layout repair
 */

.storefront-shop-page .shop-page {
  width: min(1320px, calc(100% - 40px));
  max-width: 1320px;
  margin-inline: auto;
}

.storefront-shop-page .shop-product-grid {
  width: 100% !important;
  margin: 36px auto 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 22px !important;
}

.storefront-shop-page .shop-product-card {
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 20px !important;
}

.storefront-shop-page
.shop-product-card
.product-image {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}

.storefront-shop-page
.shop-product-card
.product-card-image-link {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

.storefront-shop-page
.shop-product-card
.product-image img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
}

.storefront-shop-page
.shop-product-card
.product-badge {
  top: 13px !important;
  left: 13px !important;
  z-index: 5 !important;
  padding: 8px 11px !important;
  border-radius: 999px !important;
}

.storefront-shop-page
.shop-product-card
.product-card-view-icon {
  top: 13px !important;
  right: 13px !important;
  z-index: 5 !important;
}

.storefront-shop-page
.shop-product-card
.product-info {
  min-width: 0 !important;
  min-height: 300px !important;
  padding: 19px !important;
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
}

.storefront-shop-page
.shop-product-card
.product-info h3 {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  margin: 9px 0 !important;
  overflow: hidden !important;
  font-size: 18px !important;
  line-height: 24px !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
}

.storefront-shop-page
.shop-product-card
.product-description {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 0 12px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
}

.storefront-shop-page
.shop-product-card
.product-card-footer {
  margin-top: auto !important;
}

.storefront-shop-page
.shop-product-card
.product-card-button {
  width: 100% !important;
  min-height: 48px !important;
  margin-top: 14px !important;
}

@media (max-width: 1120px) {
  .storefront-shop-page .shop-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 850px) {
  .storefront-shop-page .shop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 580px) {
  .storefront-shop-page .shop-page {
    width: min(100% - 28px, 1320px);
  }

  .storefront-shop-page .shop-product-grid {
    grid-template-columns: 1fr !important;
    gap: 17px !important;
  }

  .storefront-shop-page
  .shop-product-card
  .product-image {
    aspect-ratio: 16 / 11 !important;
  }

  .storefront-shop-page
  .shop-product-card
  .product-info {
    min-height: 0 !important;
  }
}
