/* ============================================
   KINAAV - Product Tiles
   Modern product card styling with animations
   ============================================ */

/* -------------------- Product Grid -------------------- */
.product-grid {
  animation: fadeIn 0.4s ease-out;
}

.product-grid > [class*='col'] {
  padding-bottom: 1.5rem;
  animation: fadeInUp 0.5s ease-out backwards;
}

/* Stagger animation for grid items */
.product-grid > [class*='col']:nth-child(1) { animation-delay: 0.05s; }
.product-grid > [class*='col']:nth-child(2) { animation-delay: 0.1s; }
.product-grid > [class*='col']:nth-child(3) { animation-delay: 0.15s; }
.product-grid > [class*='col']:nth-child(4) { animation-delay: 0.2s; }
.product-grid > [class*='col']:nth-child(5) { animation-delay: 0.25s; }
.product-grid > [class*='col']:nth-child(6) { animation-delay: 0.3s; }
.product-grid > [class*='col']:nth-child(7) { animation-delay: 0.35s; }
.product-grid > [class*='col']:nth-child(8) { animation-delay: 0.4s; }

@media (min-width: 768px) {
  .product-grid > [class*='col'] {
    padding-bottom: 2rem;
  }
}

/* -------------------- Product Card -------------------- */
.product-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
  z-index: 10;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.product-card:hover::before {
  transform: scaleX(1);
}

/* Ensure consistent card height */
.product-card.h-100 {
  display: flex;
  flex-direction: column;
}

/* -------------------- Product Image -------------------- */
.product-card .product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.product-card .image-link {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.product-card img.card-img-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.product-card:hover img.card-img-top {
  transform: scale(1.08);
}

/* -------------------- Card Body -------------------- */
.product-card .card-body {
  padding: 1rem;
  background: var(--surface-card);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-card .card-title a {
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.product-card:hover .card-title a {
  color: var(--primary);
}

/* -------------------- Price Display -------------------- */
.product-card .card-text.fw-bold {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
}

/* -------------------- Product Meta -------------------- */
.product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0 0;
  list-style: none;
  padding: 0;
}

.product-meta li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-meta li b {
  font-weight: 600;
}

/* In stock styling */
.product-meta li[style*="color: green"] b,
.product-meta li b[style*="color: green"] {
	color: var(--success) !important;
}

.product-meta li.in-stock b {
	color: var(--success);
}

.product-meta li.out-of-stock {
	color: var(--text-muted);
}

/* -------------------- Card Footer -------------------- */
.product-card .card-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  background: var(--primary-lighter);
  border-top: 1px solid var(--border-light);
}

/* -------------------- Out of Stock Overlay -------------------- */
.product-card.opacity-50 {
  opacity: 0.7;
}

.product-card.opacity-50:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.product-card.opacity-50::before {
  display: none;
}

.product-card .badge.bg-secondary {
  background: var(--text-muted) !important;
  font-size: 0.75rem;
  padding: 0.5em 1em;
}

/* -------------------- Quick View Button (Future) -------------------- */
.product-card .quick-view {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 0.5rem 1.5rem;
  background: var(--surface-card);
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-base);
  z-index: 5;
}

.product-card:hover .quick-view {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.product-card .quick-view:hover {
  background: var(--primary);
  color: #fff;
}