/* =========================================================
   ZANDYA — Jumia-style product card hover
   Desktop (PC): Add to Cart appears only on hover, then hides
   Mobile: Add to Cart always visible under the card
   ========================================================= */

/* ---------- Base card ---------- */
.customer-product-card,
.products-grid .product-card,
#shopItems .product-card,
#vendorItems .product-card,
#searchProductsGrid .product-card,
#favoritesGrid .customer-product-card,
.search-products-grid .product-card {
  position: relative;
  transition: box-shadow 0.2s ease;
}

.customer-product-card:hover,
.products-grid .product-card:hover,
#shopItems .product-card:hover,
#vendorItems .product-card:hover,
#searchProductsGrid .product-card:hover,
#favoritesGrid .customer-product-card:hover,
.search-products-grid .product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Image never scales */
.customer-product-card .cat-img img,
.customer-product-card img,
.product-card .product-image img,
.products-grid .product-image img,
#shopItems .product-image img,
#searchProductsGrid .product-image img {
  transform: none !important;
  transition: none !important;
}

/* ---------- DESKTOP (min-width: 769px): Jumia hover ---------- */
@media (min-width: 769px) {

  .customer-product-card .cat-img,
  .product-card .product-image,
  .products-grid .product-image,
  #shopItems .product-image {
    position: relative;
    overflow: hidden;
  }

  .customer-product-card .customer-add-cart-btn,
  .product-card .add-cart-btn,
  .product-card .add-cart-button,
  #shopItems .add-cart-btn,
  #searchProductsGrid .add-cart-btn,
  #searchProductsGrid .add-cart-button,
  .products-grid .add-cart-btn {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 6 !important;

    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(8px) !important;
    pointer-events: none !important;

    transition:
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0.18s ease,
      background 0.15s ease !important;
  }

  .customer-product-card:hover .customer-add-cart-btn,
  .product-card:hover .add-cart-btn,
  .product-card:hover .add-cart-button,
  #shopItems .product-card:hover .add-cart-btn,
  #searchProductsGrid .product-card:hover .add-cart-btn,
  #searchProductsGrid .product-card:hover .add-cart-button,
  .products-grid .product-card:hover .add-cart-btn {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .customer-product-card .customer-add-cart-btn:hover,
  .product-card .add-cart-btn:hover,
  .product-card .add-cart-button:hover {
    background: #c80510 !important;
  }
}

/* ---------- MOBILE: always show button under card ---------- */
@media (max-width: 768px) {
  .customer-product-card .customer-add-cart-btn,
  .product-card .add-cart-btn,
  .product-card .add-cart-button,
  #shopItems .add-cart-btn,
  #searchProductsGrid .add-cart-btn,
  #searchProductsGrid .add-cart-button {
    position: static !important;
    display: block !important;
    width: calc(100% - 24px) !important;
    margin: 8px 12px 12px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

/* Price / rating stay readable */
.customer-product-price,
.customer-product-rating,
.price-row,
.product-info {
  position: relative;
  z-index: 5;
  background: #fff;
}
.product-card .product-name,
.customer-product-card strong {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.product-card .product-image,
.customer-product-card .cat-img {
  overflow: hidden;
}
