/**
 * Premium Product Grid - Final Match with Live Reference
 * Synchronized with the actual computed styles of product-slider-carousel on the live site.
 */

:root {
  --ppg-primary: #ed1c24;
  --ppg-secondary: #0b5e8c;
  --ppg-text: #333333;
  --ppg-price: #ed1c24;
}

/* Grid Layout */
.ppg-products-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--cols-desktop, 4), 1fr) !important;
  gap: 20px !important;
  margin: 0px 0 !important;
  width: 100% !important;
}

@media (max-width: 1024px) {
  .ppg-products-grid {
    grid-template-columns: repeat(var(--cols-tablet, 3), 1fr) !important;
  }
}

@media (max-width: 600px) {
  .ppg-products-grid {
    grid-template-columns: repeat(var(--cols-mobile, 2), 1fr) !important;
    gap: 15px !important;
  }
}

/*
 * MATCHING LIVE COMPUTED STYLES
 */

.ppg-product-card {
  background: #ffffff !important;
  border-radius: 12px !important;
  border: 1px solid #f0f0f0 !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  overflow: hidden !important;
  box-shadow: none !important; /* No shadow initially like the reference */
  text-decoration: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.09) !important;
}

.ppg-product-card:hover {
  transform: translateY(-5px) !important;
  border-color: #e5e5e5 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  transform: translatey(-4%);
}

.ppg-product-image {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background: #ffffff !important; /* Pure white background */
  padding: 0 !important;
}

.ppg-product-image a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
}

.ppg-product-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important; /* Live site uses cover to fill the top */
  transition: transform 0.5s ease !important;
  display: block !important;
  padding: 0 !important; /* No padding like on the live site */
}

/* Zoom effect on image when hovering card */
.ppg-product-card:hover .ppg-product-image img {
  transform: scale(1.1) !important;
}

.ppg-product-info {
  padding: 15px !important;
  text-align: left !important; /* Verified live alignment */
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  background: #ffffff !important;
}

.ppg-product-cat {
  width: max-content;
  color: var(--fs-color-primary);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: left;
  line-height: 1;
  position: relative;
  /*  */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
}

.ppg-product-cat::after {
  content: "";
  background-color: currentcolor;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  border-radius: 30px;
}

.ppg-product-title {
  font-size: 16px !important;
  margin: 0 0 8px 0 !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  color: var(--primary-color);
}

.ppg-product-excerpt {
  font-size: 13px !important;
  color: #000 !important;
  line-height: 1.5 !important;
  margin-bottom: 15px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  height: 3em !important;
  font-weight: 400 !important;
}

.ppg-product-title a {
  color: var(--primary-color);
  text-decoration: none !important;
  transition: color 0.3s !important;
}

.ppg-product-price {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--ppg-text) !important;
  margin-top: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important; /* Đổi thành flex-start */
  gap: 12px !important; /* Khoảng cách giữa các mức giá */
  width: 100% !important;
}

div.ppg-product-info > div.ppg-product-price > span > bdi {
  color: var(--primary-color);
}

div.ppg-product-info > div.ppg-product-price > ins > span > bdi {
  color: var(--primary-color);
}

.ppg-add-to-cart-btn {
  width: 40px !important;
  height: 40px !important;
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  margin-left: auto !important; /* Đẩy nút sang bên phải tuyệt đối */
  border: none !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
  order: 3 !important;
}

.ppg-add-to-cart-btn:hover {
  transform: scale(1.1) !important;
  background-color: #000 !important;
}

.ppg-add-to-cart-btn i {
  font-size: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  top: 0 !important;
  left: 0 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ppg-add-to-cart-btn i::before {
  margin: 0 !important;
  display: block !important;
}

.ppg-add-to-cart-btn + .added_to_cart {
  display: none !important;
}

.ppg-product-price ins {
  text-decoration: none !important;
  color: var(--ppg-price) !important;
  order: 1 !important;
}

.ppg-product-price del {
  font-size: 0.85em !important;
  color: #999 !important;
  font-weight: 400 !important;
  order: 2 !important;
  margin: 0 !important;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  .ppg-product-title {
    font-size: 14px !important;
  }
  .ppg-product-price {
    font-size: 14px !important;
  }
}
