/* Wishlist grid container */
.wishlist-page ul.products.wishlist-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Individual card */
.wishlist-page ul.products.wishlist-products li.product {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Typography & layout for product info */
.wishlist-page ul.products.wishlist-products li.product .product-info {
  text-align: left;
  position: relative;
  font-family: 'Arial', sans-serif !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

}

/* Product brand */
.wishlist-page ul.products.wishlist-products li.product .product-brand {
  font-size: 14px;
  font-weight: 550;
  color: #333;
  margin: 10px 0 0;
  text-transform: uppercase;
  line-height: 1.2;
  display: block;
}

/* Product title */
.wishlist-page ul.products.wishlist-products li.product .woocommerce-loop-product__title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 5px 0 0;
  text-transform: uppercase;
  line-height: 1.2;
  display: block;
  flex-grow: 0;
  max-height: 2.4em; /* Limit to 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Product price */
.wishlist-page ul.products.wishlist-products li.product .price {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 10px 0 10px; /* Adjusted to reduce gap when title is 2 lines */
  display: block;
}

/* Available sizes */
.wishlist-page ul.products.wishlist-products li.product .available-sizes {
  position: absolute;
  color: #333;
  top: 10px;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-bottom: 8px; /* Space between size dropdown and add-to-bag button */
}

.wishlist-page ul.products.wishlist-products li.product .product-info:hover .available-sizes {
  opacity: 1;
}

/* Label/value inside available-sizes */
.wishlist-page ul.products.wishlist-products li.product .available-sizes .available-label {
  font-size: 14px;
  font-weight: 550;
  text-transform: uppercase;
  margin: 10px 0 0;
  line-height: 1.2;
}

.wishlist-page ul.products.wishlist-products li.product .available-sizes .size-values {
  font-size: 14px;
  font-weight: 500;
  margin-top: 5px;
}

/* Image wrapper */
.wishlist-page ul.products.wishlist-products .product-image-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-bottom: 125%; /* 4:5 aspect ratio */
  background: #fff;
  border-radius: 8px;
}

.wishlist-page ul.products.wishlist-products .product-image-wrapper a {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 8px;
}

.wishlist-page ul.products.wishlist-products .wishlist-img-primary,
.wishlist-page ul.products.wishlist-products .wishlist-img-secondary {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1);
  border-radius: 3px;
}

.wishlist-page ul.products.wishlist-products .wishlist-img-secondary {
  opacity: 0;
  pointer-events: none;
}

.wishlist-page ul.products.wishlist-products .product-image-wrapper:hover .wishlist-img-primary {
  opacity: 0;
}

.wishlist-page ul.products.wishlist-products .product-image-wrapper:hover .wishlist-img-secondary {
  opacity: 1;
}

/* Remove button styling */
.wishlist-page ul.products.wishlist-products .product-image-wrapper .remove-wishlist-item {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: rgb(37,37,37);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.wishlist-page ul.products.wishlist-products .product-image-wrapper .remove-wishlist-item:hover {
  background: rgb(115,67,74);
  color: #fff;
  border-color: rgb(115,67,74);
  transform: translateY(-1px);
}

/* Add-to-bag button */
.wishlist-page ul.products.wishlist-products .add-to-bag {
  display: inline-block;
  background: #000;
  color: #fff;
  text-transform: uppercase;
  font-size: 0.9rem;
  padding: 10px 0;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 8px; /* Space between size dropdown and add-to-bag button */
}

.wishlist-page ul.products.wishlist-products .add-to-bag:hover {
  background: #333;
}

/* Disable fade effects on hover */
.wishlist-page ul.products.wishlist-products li.product:hover .product-info *,
.wishlist-page ul.products.wishlist-products li.product:hover .size-select,
.wishlist-page ul.products.wishlist-products li.product:hover .add-to-bag,
.wishlist-page ul.products.wishlist-products li.product:hover .remove-wishlist-item {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
}

/* Subtle removal effect */
.wishlist-page ul.products.wishlist-products .product.removing {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wishlist-page ul.products.wishlist-products {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 15px;
  }
  .wishlist-page .product-info {
      padding: 12px;
  }
  .wishlist-page .remove-wishlist-item {
      top: 6px;
      right: 6px;
      width: 20px;
      height: 20px;
      font-size: 14px;
  }
}