/* =========================================================
   PRODUCT CARDS
   Shared card styling for product grids rendered on product_list.php.
   ========================================================= */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: none;
  margin: 0;
  padding: 0;
}

.product-card {
  --card-red: var(--hkx-red, var(--pw-orange, #b5121b));
  --card-ink: #111318;
  --card-muted: #565b64;
  --card-border: #e4e6ea;

  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(181,18,27,.18);
  box-shadow: 0 16px 30px rgba(0,0,0,.12);
}

.product-card > a {
  display: block;
  text-decoration: none;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 16px;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
}

.product-name-link {
  color: inherit;
  text-decoration: none;
}

.product-name {
  margin: 0 0 16px;
  color: var(--card-ink);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0;
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-height: calc(2 * 1.28em);
}

.product-info p {
  margin: 0 0 12px;
  color: var(--card-ink);
  font-size: .95rem;
  line-height: 1.35;
}

.product-manufacturer {
  color: var(--card-muted);
}

.product-price {
  color: #363b44;
}

.product-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  margin-top: auto;
}

.qty-gift-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.product-qty {
  width: 76px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cfd3d9;
  border-radius: 4px;
  background: #fff;
  color: var(--card-ink);
  font: inherit;
  font-size: .95rem;
  text-align: center;
}

.product-qty:focus {
  outline: 2px solid rgba(181,18,27,.18);
  border-color: rgba(181,18,27,.5);
}

.giftlist-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9197a1;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.giftlist-btn:hover {
  background: #f4f5f7;
  color: var(--card-red);
}

.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 10px 16px;
  border: 1px solid #111318;
  border-radius: 4px;
  background: #111318;
  color: #fff;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.add-to-cart-btn:hover {
  background: var(--card-red);
  border-color: var(--card-red);
  box-shadow: 0 10px 22px rgba(181,18,27,.22);
  transform: translateY(-1px);
}

.add-to-cart-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.add-to-cart-btn.atc-celebrate {
  background: var(--card-red) !important;
  border-color: var(--card-red) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(181,18,27,.28);
  animation: atcPulse .9s ease-in-out infinite;
}

.add-to-cart-btn.atc-celebrate:disabled {
  opacity: 1;
  cursor: default;
}

@keyframes atcPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .product-grid {
    gap: 12px;
  }

  .product-image {
    padding: 12px;
  }

  .product-info {
    padding: 14px;
  }

  .product-name {
    font-size: 1rem;
  }

  .product-info p,
  .product-price {
    font-size: .9rem;
  }

  .product-qty {
    width: 72px;
  }
}
