.search-results {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background-color: #f9f9f9;
}

.results-wrapper {
  max-width: 1200px;
  width: 100%;
}

.product-results, .category-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  width: 100%;
  align-items: start; /* Align all grid items at the top */
}

.item-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* center vertically */
  text-align: center;
  min-height: 350px;
  cursor: pointer;
  box-sizing: border-box;
}


.item-card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center text */
  width: 100%;
}
.item-image {
  width: 100%;
  max-width: 400px;
  height: 150px; /* Fixed height for image */
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 15px;
  flex-shrink: 0; /* Prevent image from shrinking */
}

.item-card h4 {
  margin: 0 0 10px;
  height: 100px; /* Fixed height for title */
  font-size: 20px;
  color: #143d6a !important;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* limit to 3 lines */
  -webkit-box-orient: vertical;
}

.item-card p {
  margin: 4px 0;
  height: 100px; /* Fixed height for description */
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* limit to 4 lines */
  -webkit-box-orient: vertical;
}

.item-card:hover,
.item-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .item-card {
    padding: 16px;
    min-height: 320px;
  }

  .item-card h4 {
    font-size: 18px;
    height: 80px;
    -webkit-line-clamp: 2;
  }

  .item-card p {
    font-size: 14px;
    height: 80px;
    -webkit-line-clamp: 3;
  }

  .item-image {
    max-width: 160px;
    height: 120px;
  }
}
