/* ===== PRODUCT CARD COMPONENT ===== */
.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-img-wrap {
  background: var(--cream-dark);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--cream-dark);
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-placeholder {
  font-size: 48px;
  opacity: 0.4;
}

.product-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 2px;

  /* Truncate to 2 lines for uniform grid */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
}

.product-origin {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-weight: 700;
  font-size: 15px;
  color: var(--green-dark);
}

.product-unit {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 400;
}

.btn-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--white);
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.btn-add:hover {
  background: var(--green-mid);
  transform: scale(1.1);
}

.btn-add:active {
  transform: scale(0.95);
}

/* ===== GRID LAYOUT (when used in a grid container) ===== */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 20px 20px;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}