/*
 * Product card extras (woocommerce/content-product.php): pack badge and sale badge over the image,
 * and the scroll-reveal state. Base card: components-product-card.css.
 */

/* Pack badge ("Hũ tròn 500 g") over the top-left corner of the image. */
.product-card__badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  max-width: calc(100% - var(--space-4));
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md, 14px);
  background: rgb(255 253 249 / 0.92);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  backdrop-filter: blur(4px);
}

/* Sale badge from woocommerce_before_shop_loop_item_title, top right (the pack badge owns top left). */
.product-card .onsale {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
}

/* Scroll reveal (assets/js/scroll-reveal.js adds the class only below the fold, never without JS). */
.product-card.is-reveal-pending {
  opacity: 0;
  transform: translateY(1.5rem);
}

.product-card.is-reveal-pending.reveal-from-above {
  transform: translateY(-1.5rem);
}

/* Phones: two cards per row, so tighter padding, smaller title and pack badge. */
@media (max-width: 599px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .product-card {
    gap: var(--space-3);
    padding: var(--space-2);
  }

  .product-card__body {
    padding-inline: var(--space-1);
  }

  .product-card__title {
    font-size: var(--font-size-base);
  }

  .product-card__summary {
    display: none;
  }

  .product-card__price .amount {
    font-size: var(--font-size-base);
  }

  .product-card__badge {
    top: var(--space-1);
    left: var(--space-1);
    padding: 2px var(--space-2);
    font-size: 0.6875rem;
  }

  .product-card__go {
    width: 2rem;
    height: 2rem;
  }
}
