/* product-card.css - Compact, uniform height premium e-commerce specs */

/* Grid container */
.premium-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 768px) {
  .premium-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1200px) {
  .premium-product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Card Base */
.product-card {
  height: 100%;
  min-height: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
}

/* Image section */
.product-image-box {
  position: relative;
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: block;
  text-decoration: none;
}

.product-image-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.product-image-box img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  object-position: center;
}

.product-image-box .image-placeholder {
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .product-image-box {
    height: 145px;
    min-height: 145px;
    max-height: 145px;
  }
}

@media (max-width: 480px) {
  .product-image-box {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
  }
}

/* Top Left Badge */
.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  max-width: calc(100% - 58px);
  padding: 4px 8px;
  border-radius: 999px;
  background: #07803d;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top Right Favorite Button */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  color: #ef4444;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

@media (max-width: 480px) {
  .product-badge {
    top: 6px;
    left: 6px;
    font-size: 9.5px;
    padding: 3px 7px;
  }

  .favorite-btn {
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

@media (min-width: 992px) {
  .favorite-btn:hover {
    transform: scale(1.05);
    background: #fef2f2;
  }
}
.favorite-btn:active {
  transform: scale(0.95);
}

/* Bottom Right Rating Overlay Badge */
.rating-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.rating-badge .rating-star {
  color: #fbbf24;
  font-size: 13px;
  line-height: 1;
}

@media (max-width: 480px) {
  .rating-badge {
    right: 6px;
    bottom: 6px;
    font-size: 11px;
    padding: 4px 7px;
  }
}

/* Info Section */
.product-info {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (max-width: 480px) {
  .product-info {
    padding: 9px 9px 10px;
  }
}

/* Title */
.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  margin: 0 0 7px;
}

.product-title:hover {
  color: #2563eb;
}

@media (max-width: 480px) {
  .product-title {
    font-size: 13px;
    min-height: 34px;
    max-height: 34px;
    margin-bottom: 6px;
  }
}

/* Author Row */
.product-author {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.2;
  margin: 0 0 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-author span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-author .author-icon {
  width: 14px;
  height: 14px;
  font-size: 13px;
  flex-shrink: 0;
  opacity: .75;
}

@media (max-width: 480px) {
  .product-author {
    font-size: 11.5px;
    margin-bottom: 8px;
  }
}

/* Price & Stock Row */
.product-meta-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.product-price {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .product-price {
    font-size: 14px;
  }

  .stock-badge {
    padding: 5px 7px;
    font-size: 10.5px;
  }
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
  transition: background 0.2s ease, transform 0.1s ease;
}

@media (min-width: 992px) {
  .add-to-cart-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
  }
}

.add-to-cart-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.add-to-cart-btn i {
  font-size: 17px;
}

@media (max-width: 480px) {
  .add-to-cart-btn {
    min-height: 38px;
    border-radius: 10px;
    font-size: 12.5px;
  }
}
