/* =====================================================================
   POG.VN – THẺ SẢN PHẨM DÙNG CHUNG (.pog-pcard)
   Markup: inc/product-card.php → pog_vn_product_card()
   Phối màu: nền trắng, ảnh trên nền xám nhạt · nhãn % giảm Cam · giá Cam · đánh giá vàng
             nút "Thêm vào giỏ" viền Cam → rê chuột nền Cam · nút "Chọn loại" viền Navy.
   Cập nhật: 2026-11-18 (B7). Chỉ dùng biến --pog-*.
   ===================================================================== */
.pog-pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--pog-border);
  border-radius: var(--pog-radius-lg);
  background: var(--pog-white);
  font-family: var(--pog-font);
  transition: transform var(--pog-transition-base), box-shadow var(--pog-transition-base), border-color var(--pog-transition-base);
}
.pog-pcard:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--pog-shadow-lg);
}
.pog-pcard svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ảnh */
.pog-pcard__media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--pog-bg-soft);
}
.pog-pcard__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pog-pcard:hover .pog-pcard__img {
  transform: scale(1.05);
}
.pog-pcard__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: var(--pog-radius-full);
  background: var(--pog-primary);
  box-shadow: 0 4px 10px rgba(var(--pog-primary-rgb), 0.3);
  color: var(--pog-white);
  font-size: 12px;
  font-weight: var(--pog-fw-black);
  line-height: 1.2;
}

/* Nội dung */
.pog-pcard__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}
.pog-pcard__title {
  margin: 0;
  font-size: 14px;
  font-weight: var(--pog-fw-semibold);
  line-height: 1.45;
}
.pog-pcard__title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
  color: var(--pog-dark);
  text-decoration: none;
}
.pog-pcard__title a:hover {
  color: var(--pog-primary);
}
.pog-pcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--pog-gray);
  font-size: 12px;
  font-weight: var(--pog-fw-medium);
}
.pog-pcard__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--pog-dark);
  font-weight: var(--pog-fw-bold);
}
.pog-pcard__rating svg {
  width: 13px;
  height: 13px;
  fill: var(--pog-warning);
  stroke: var(--pog-warning);
}
.pog-pcard__rating small {
  color: var(--pog-gray);
  font-weight: var(--pog-fw-medium);
}

/* Giá: giá bán trước, giá gốc gạch ngang sau */
.pog-pcard__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-top: auto;
  color: var(--pog-primary);
  font-size: 16px;
  font-weight: var(--pog-fw-black);
  line-height: 1.3;
}
.pog-pcard__price ins {
  order: -1;
  background: none;
  text-decoration: none;
}
.pog-pcard__price del {
  color: var(--pog-gray-light);
  font-size: 12.5px;
  font-weight: var(--pog-fw-medium);
}
.pog-pcard__price .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* Nút */
.pog-pcard__action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.pog-pcard .pog-pcard__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1.5px solid var(--pog-primary);
  border-radius: var(--pog-radius-full);
  background: var(--pog-white);
  color: var(--pog-primary);
  font: var(--pog-fw-bold) 13.5px/1 var(--pog-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--pog-transition-fast), color var(--pog-transition-fast), border-color var(--pog-transition-fast);
}
.pog-pcard .pog-pcard__btn:hover,
.pog-pcard .pog-pcard__btn:focus-visible {
  background: var(--pog-primary);
  color: var(--pog-white);
  outline: none;
}
.pog-pcard .pog-pcard__btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.pog-pcard .pog-pcard__btn--alt {
  border-color: rgba(var(--pog-navy-rgb), 0.25);
  color: var(--pog-navy);
}
.pog-pcard .pog-pcard__btn--alt:hover,
.pog-pcard .pog-pcard__btn--alt:focus-visible {
  border-color: var(--pog-navy);
  background: var(--pog-navy);
  color: var(--pog-white);
}
/* Trạng thái AJAX của WooCommerce */
.pog-pcard .pog-pcard__btn.loading {
  opacity: 0.6;
  pointer-events: none;
}
.pog-pcard .pog-pcard__btn.loading::after,
.pog-pcard .pog-pcard__btn.added::after {
  display: none !important;
}
.pog-pcard .pog-pcard__btn.added {
  border-color: var(--pog-success);
  background: var(--pog-success);
  color: var(--pog-white);
}
.pog-pcard .added_to_cart {
  display: block;
  color: var(--pog-navy);
  font-size: 12.5px;
  font-weight: var(--pog-fw-bold);
  text-align: center;
  text-decoration: none;
}
.pog-pcard .added_to_cart:hover {
  color: var(--pog-primary);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .pog-pcard__body {
    padding: 10px 10px 12px;
    gap: 5px;
  }
  .pog-pcard__title {
    font-size: 13px;
  }
  .pog-pcard__price {
    font-size: 15px;
  }
  .pog-pcard .pog-pcard__btn {
    min-height: 38px;
    font-size: 13px;
  }
  .pog-pcard .pog-pcard__btn svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pog-pcard,
  .pog-pcard__img {
    transition: none;
  }
}
