/**
 * Olanzu — Global Product Cards
 * Reference: product.html related products section
 * Used everywhere: shop, related products, category pages
 */

/* ── Grid container ──────────────────────────────────────────────────────────── */
.olz-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px; /* gap-4 */
}

@media (min-width: 640px) {
  .olz-cards-grid { gap: 24px; } /* sm:gap-6 */
}

@media (min-width: 1024px) {
  .olz-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px; /* lg:gap-7 */
  }
}


/* ── Card ────────────────────────────────────────────────────────────────────── */
/* group block bg-white rounded-md overflow-hidden border border-transparent hover:shadow-md transition-all duration-200 */
.olz-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--olz-gray-200); /* always-visible border so card separates from page bg */
  border-radius: 6px; /* rounded-md */
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.olz-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  border-color: var(--olz-gray-300);
}


/* ── Card image wrapper ───────────────────────────────────────────────────────── */
/* relative aspect-square bg-white flex items-center justify-center p-6 border border-gray-100 */
.olz-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-bottom: 1px solid #F3F4F6;
  overflow: hidden;
}

.olz-card__img-wrap img,
.olz-card__img-wrap .olz-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  will-change: transform;
  transition: transform 0.35s ease;
}

/* On hover: scale image instead of changing padding — avoids layout triggers */
.olz-card:hover .olz-card__img-wrap img,
.olz-card:hover .olz-card__img-wrap .olz-card__img {
  transform: scale(1.07);
}


/* ── Sale badge ──────────────────────────────────────────────────────────────── */
.olz-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--olz-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  z-index: 1;
  pointer-events: none;
}


/* ── Card body ────────────────────────────────────────────────────────────────── */
/* p-5 — 20px padding all sides */
.olz-card__body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* text-sm font-medium text-black leading-snug — min-height 40px for 2 lines */
.olz-card__title {
  font-size: 14px;
  font-weight: 500;
  color: #000;
  line-height: 1.45;
  margin: 0;
  min-height: 25px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.olz-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  margin-bottom: 5px;
}

.olz-card__rating svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  fill: var(--olz-red);
  color: var(--olz-red);
}

/* text-xs text-gray-500 ml-1 tabular-nums */
.olz-card__review-count {
  font-size: 12px;
  color: #6B7280;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* Variant info line */
.olz-card__meta {
  font-size: 12px;
  color: #6B7280;
  margin-top: 5px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.olz-card__price {
  margin-top: 0;
  display: flex;
  align-items: baseline;
  gap: 8px; /* gap-2 */
}

/* text-base font-semibold text-black tabular-nums */
.olz-card__price .woocommerce-Price-amount,
.olz-card__price .price,
.olz-card__price > span:first-child {
  font-size: 16px; /* text-base */
  font-weight: 600;
  color: #000;
  font-variant-numeric: tabular-nums;
}

/* del / was price */
.olz-card__price del,
.olz-card__price del .woocommerce-Price-amount {
  font-size: 13px;
  font-weight: 400;
  color: #9CA3AF; /* text-gray-400 */
  text-decoration: line-through;
}

.olz-card__price ins {
  text-decoration: none;
}

/* WooCommerce outputs .price directly — override */
.olz-card__price .price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

/* "From" prefix on variable products */
.olz-card__from {
  font-size: 12px;
  font-weight: 400;
  color: #6B7280;
  margin-right: 2px;
}

