/* =========================================================
   70-cards.css — BeautyTrouvailles Product Cards
   Version: 3.0 — UNIVERSAL (works on both product & category pages)
   
   Contents:
   1. Products Grid
   2. Product Card
   3. Card Badge
   4. Card Image
   5. Card Info & Pricing
   6. Card Rating
   7. Quick Add Button
   8. Responsive
   ========================================================= */

/* =========================
   1. PRODUCTS GRID
   ========================= */
.bt-custom-product-page .bt-products-grid,
.bt-category-page .bt-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* =========================
   2. PRODUCT CARD BASE
   ========================= */
.bt-custom-product-page .bt-product-card,
.bt-category-page .bt-product-card {
  position: relative;
  border-radius: var(--bt-radius-lg, 22px);
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: #fff;
  overflow: hidden;
  
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform 220ms cubic-bezier(.2,.9,.2,1),
              box-shadow 220ms cubic-bezier(.2,.9,.2,1),
              border-color 220ms cubic-bezier(.2,.9,.2,1);
  
  display: flex;
  flex-direction: column;
  will-change: transform, box-shadow, border-color;
  /* GPU acceleration */
  transform: translateZ(0);
  contain: layout style paint;
  /* Content visibility for below-fold cards */
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}

.bt-custom-product-page .bt-product-card:hover,
.bt-category-page .bt-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(212,20,90,0.15);
  border-color: rgba(212,20,90,0.25);
}

.bt-custom-product-page .bt-card-link,
.bt-category-page .bt-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* =========================
   3. CARD BADGES
   ========================= */
.bt-custom-product-page .bt-card-badges,
.bt-category-page .bt-card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.bt-custom-product-page .bt-card-badge,
.bt-category-page .bt-card-badge {
  pointer-events: auto;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: linear-gradient(90deg, #D4145A, #FF4FA3);
  box-shadow: 0 12px 24px rgba(212,20,90,0.22);
}

.bt-custom-product-page .bt-sold-badge,
.bt-category-page .bt-sold-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #D4145A;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(212,20,90,0.2);
}

/* =========================
   4. WISHLIST HEART (Category pages only)
   ========================= */
.bt-category-page .bt-wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  transition: all 220ms cubic-bezier(.2,.9,.2,1);
  color: #6b7280;
  cursor: pointer;
}

.bt-category-page .bt-wishlist-btn:hover {
  transform: scale(1.1);
  color: #D4145A;
}

.bt-category-page .bt-wishlist-btn.active {
  color: #D4145A;
  background: rgba(212,20,90,0.1);
}

/* =========================
   5. QUICK VIEW (Category pages only)
   ========================= */
.bt-category-page .bt-quick-view-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  background: rgba(26,26,46,0.95);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 220ms cubic-bezier(.2,.9,.2,1);
  cursor: pointer;
}

.bt-category-page .bt-product-card:hover .bt-quick-view-btn {
  opacity: 1;
  visibility: visible;
}

.bt-category-page .bt-quick-view-btn:hover {
  background: #D4145A;
}

/* =========================
   6. OUT OF STOCK OVERLAY
   ========================= */
.bt-custom-product-page .bt-out-of-stock-overlay,
.bt-category-page .bt-out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.bt-custom-product-page .bt-out-of-stock-badge,
.bt-category-page .bt-out-of-stock-badge {
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: #dc2626;
  background: #fff;
  border: 2px solid #dc2626;
  box-shadow: 0 12px 28px rgba(220,38,38,0.15);
}

/* =========================
   7. CARD IMAGE
   ========================= */
.bt-custom-product-page .bt-card-image,
.bt-category-page .bt-card-image {
  aspect-ratio: 1 / 1;
  padding: 20px;
  background: linear-gradient(135deg, rgba(212,20,90,0.03), rgba(255,79,163,0.03));
  
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.bt-custom-product-page .bt-card-image img,
.bt-category-page .bt-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms cubic-bezier(.2,.9,.2,1);
}

.bt-custom-product-page .bt-product-card:hover .bt-card-image img,
.bt-category-page .bt-product-card:hover .bt-card-image img {
  transform: scale(1.05);
}

/* =========================
   8. CARD INFO
   ========================= */
.bt-custom-product-page .bt-card-info,
.bt-category-page .bt-card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bt-custom-product-page .bt-card-brand,
.bt-category-page .bt-card-brand {
  font-size: 12px;
  font-weight: 800;
  color: #D4145A;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
}

.bt-custom-product-page .bt-card-title,
.bt-category-page .bt-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1.3;
  min-height: 42px;
  
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================
   9. RATING
   ========================= */
.bt-custom-product-page .bt-card-rating,
.bt-category-page .bt-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bt-custom-product-page .bt-rating-stars,
.bt-category-page .bt-rating-stars {
  display: flex;
  gap: 2px;
  color: #f59e0b;
  font-size: 14px;
  line-height: 1;
}

.bt-custom-product-page .bt-rating-text,
.bt-category-page .bt-rating-text {
  font-size: 13px;
  font-weight: 800;
  color: #6b7280;
  line-height: 1;
}

/* =========================
   10. PRICE
   ========================= */
.bt-custom-product-page .bt-card-price,
.bt-category-page .bt-card-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.bt-custom-product-page .bt-price-current,
.bt-custom-product-page .bt-card-price .bt-current,
.bt-category-page .bt-price-current,
.bt-category-page .bt-card-price .bt-current {
  font-size: 24px;
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1;
}

.bt-custom-product-page .bt-price-original,
.bt-custom-product-page .bt-card-price .bt-original,
.bt-category-page .bt-price-original,
.bt-category-page .bt-card-price .bt-original {
  font-size: 15px;
  font-weight: 800;
  color: #6b7280;
  text-decoration: line-through;
  line-height: 1;
}

.bt-custom-product-page .bt-discount-badge,
.bt-category-page .bt-discount-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(212,20,90,0.10);
  color: #D4145A;
  border: 1px solid rgba(212,20,90,0.15);
  line-height: 1;
}

/* =========================
   11. ADD TO CART BUTTON
   ========================= */
.bt-custom-product-page .bt-add-to-cart-btn,
.bt-category-page .bt-add-to-cart-btn {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #D4145A, #FF4FA3);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  box-shadow: 0 12px 24px rgba(212,20,90,0.22);
  transition: all 220ms cubic-bezier(.2,.9,.2,1);
  cursor: pointer;
  line-height: 1;
}

.bt-custom-product-page .bt-add-to-cart-btn:hover,
.bt-category-page .bt-add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(212,20,90,0.3);
}

.bt-custom-product-page .bt-add-to-cart-btn:active,
.bt-category-page .bt-add-to-cart-btn:active {
  transform: translateY(0);
}

.bt-custom-product-page .bt-add-to-cart-btn.loading,
.bt-category-page .bt-add-to-cart-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* =========================
   12. QUICK ADD BUTTON (Product page related products)
   ========================= */
.bt-custom-product-page .bt-quick-add,
.bt-category-page .bt-quick-add {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  
  display: grid;
  place-items: center;
  
  color: #fff;
  background: linear-gradient(90deg, #D4145A, #FF4FA3);
  box-shadow: 0 12px 24px rgba(212,20,90,0.22);
  
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms cubic-bezier(.2,.9,.2,1),
              transform 220ms cubic-bezier(.2,.9,.2,1),
              box-shadow 220ms cubic-bezier(.2,.9,.2,1);
}

.bt-custom-product-page .bt-quick-add i,
.bt-category-page .bt-quick-add i {
  font-size: 16px;
  line-height: 1;
}

.bt-custom-product-page .bt-product-card:hover .bt-quick-add,
.bt-category-page .bt-product-card:hover .bt-quick-add {
  opacity: 1;
  transform: translateY(0);
}

.bt-custom-product-page .bt-quick-add:hover,
.bt-category-page .bt-quick-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(212,20,90,0.3);
}

.bt-custom-product-page .bt-quick-add:active,
.bt-category-page .bt-quick-add:active {
  transform: translateY(0);
}

.bt-custom-product-page .bt-quick-add.loading,
.bt-category-page .bt-quick-add.loading {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}

.bt-custom-product-page .bt-quick-add:focus-visible,
.bt-category-page .bt-quick-add:focus-visible {
  outline: 2px solid #D4145A;
  outline-offset: 2px;
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   13. RESPONSIVE
   ========================= */
@media (max-width: 991px) {
  .bt-custom-product-page .bt-products-grid,
  .bt-category-page .bt-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* Always show quick add on touch devices */
  .bt-custom-product-page .bt-quick-add,
  .bt-category-page .bt-quick-add {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .bt-category-page .bt-quick-view-btn {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .bt-custom-product-page .bt-card-info,
  .bt-category-page .bt-card-info {
    padding: 14px;
  }
  
  .bt-custom-product-page .bt-card-title,
  .bt-category-page .bt-card-title {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .bt-custom-product-page .bt-card-info,
  .bt-category-page .bt-card-info {
    padding: 12px;
  }
  
  .bt-custom-product-page .bt-card-title,
  .bt-category-page .bt-card-title {
    font-size: 14px;
    min-height: 36px;
  }
  
  .bt-custom-product-page .bt-price-current,
  .bt-custom-product-page .bt-card-price .bt-current,
  .bt-category-page .bt-price-current,
  .bt-category-page .bt-card-price .bt-current {
    font-size: 20px;
  }
  
  .bt-custom-product-page .bt-add-to-cart-btn,
  .bt-category-page .bt-add-to-cart-btn {
    padding: 10px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .bt-custom-product-page .bt-products-grid,
  .bt-category-page .bt-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  
  .bt-custom-product-page .bt-card-badge,
  .bt-category-page .bt-card-badge {
    padding: 6px 9px;
    font-size: 11px;
  }
  
  .bt-custom-product-page .bt-quick-add,
  .bt-category-page .bt-quick-add {
    width: 38px;
    height: 38px;
    right: 10px;
    bottom: 10px;
  }
  
  .bt-custom-product-page .bt-quick-add i,
  .bt-category-page .bt-quick-add i {
    font-size: 14px;
  }
}