/* ============================================================
   Product Card Component  (.product-card)
   Shared styles used on:
   - Home page (Swiper slider)
   - Product detail page (Related products grid)
   ============================================================ */

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--cdt-surface);
  border: 1px solid var(--cdt-border);
  box-shadow: var(--cdt-shadow);
  text-decoration: none;
  color: inherit;
}

.product-card:hover,
.product-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(16, 35, 60, 0.18);
}

/* ── Media (image area) ── */
.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cdt-bg);
}

.product-card__media img {
  padding: 1rem;
  mix-blend-mode: multiply;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card__media img {
  transform: scale(1.05);
}

.product-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(44, 156, 59, 0.12), rgba(15, 23, 40, 0.08));
  color: var(--cdt-primary);
  font-size: 3rem;
  font-weight: 800;
}

/* ── Hover overlay buttons ── */
.product-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(16, 35, 60, 0);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.product-card:hover .product-card__overlay {
  background: rgba(16, 35, 60, 0.1);
  opacity: 1;
}

.product-card__overlay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 35, 60, 0.15);
  color: var(--cdt-text);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.product-card__overlay-btn:hover {
  background: var(--cdt-primary);
  color: #fff;
}

/* ── Badge (Hot / Mới) ── */
.product-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-card__badge.is-hot {
  background: #ef4444;
}

.product-card__badge.is-new {
  background: #3b82f6;
}

/* ── Body (name + price) ── */
.product-card__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.product-card__category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cdt-primary);
  margin-bottom: 0.25rem;
}

.product-card__body h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cdt-text);
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(1.4em * 2);
  line-height: 1.4;
}

.product-card:hover .product-card__body h3 {
  color: var(--cdt-primary);
}

.product-card__body strong {
  color: var(--cdt-primary);
  font-size: 0.875rem;
  font-weight: 700;
}
