/* skeleton animation fallback if not using Tailwind animate-pulse */
@keyframes mobile-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
.animate-pulse {
  animation: mobile-pulse 1.2s infinite;
}

/* modal basic */
.mobile-quickview {
  display: none;
}
.mobile-quickview .modal {
  z-index: 60;
  background: transparent;
}
.mobile-toast {
  z-index: 9999;
}

/* small accessibility focus */
.wishlist-btn:focus,
.quickview-btn:focus,
.ajax-add-to-cart:focus {
  box-shadow: 0 0 0 3px rgba(31, 112, 54, 0.15);
}

/* ensure product image fade */
.product-image.opacity-0 {
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  transform: scale(1);
}
.product-image[data-loaded="true"] {
  opacity: 1;
}

/* Product card title clamp */
.product-card .product-title {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3rem; /* approx two lines */
}

.discount-badge {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  z-index: 2;
}

.product-media-spacer {
  padding-top: 82%;
}

@media (min-width: 768px) {
  .product-media-spacer {
    padding-top: 112%;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-card > div:last-child {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-card .price-wrap,
.product-card .price {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Action buttons transition (desktop) */
.product-card .quickview-btn,
.product-card .wishlist-btn {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.product-card-cta {
  background-color: #1f7036;
}

.product-card-cta:hover {
  background-color: #195e2e;
}

/* Ensure overlay add-to-cart is hidden on mobile */
.product-card .ajax-add-to-cart {
  display: inline-block;
}

.product-card-cta-inline {
  background-color: #1f7036;
  border: 1px solid rgba(31, 112, 54, 0.9);
  padding: 0.38rem 0.52rem;
  font-size: 0.68rem;
  line-height: 1;
  min-width: 62px;
}

.product-card-cta-inline:hover {
  background-color: #195e2e;
}

@media (max-width: 767px) {
  .product-card {
    border-radius: 8px;
  }

  .product-card-content {
    padding: 0.52rem;
  }

  .product-card .product-category {
    display: none;
  }

  .product-card .product-title {
    font-size: 0.78rem;
    line-height: 1.1rem;
    height: 2.2rem;
    margin-bottom: 0.2rem;
  }

  .product-card .wishlist-btn,
  .product-card .quickview-btn {
    padding: 0.32rem;
  }

  .product-card .wishlist-btn i,
  .product-card .quickview-btn i {
    font-size: 0.72rem;
  }

  .product-card-cta-inline {
    padding: 0.34rem 0.44rem;
    font-size: 0.64rem;
    min-width: 54px;
    border-radius: 0.42rem;
  }

  .product-card-cta-inline i {
    font-size: 0.62rem;
  }

  .product-card .price-section {
    line-height: 1.1;
  }

  .product-card .price-section .text-red-500 {
    margin-top: 0.12rem;
    font-size: 0.62rem;
  }
}

/* Style for mobile inline add-to-cart */
.ajax-add-to-cart-mobile {
  background-color: #1f7036;
  border: none;
}

@media (min-width: 768px) {
  .ajax-add-to-cart-mobile {
    display: none;
  }
}
/*  */

/* Ensure card background and image area match across pages */
.product-card {
  background: #ffffff;
}
.product-card > div.relative {
  background: #fafafa; /* subtle image background to mask white-padded images */
}
