/* Wishlist Button Styles */
.wishlist-button-container {
  margin: 15px 0;
}

.wishlist-button {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  background: #f51167;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid #f51167;
}

.wishlist-button:hover {
  background: #d40f5a;
  color: #fff;
  text-decoration: none;
  border-color: #d40f5a;
}

.wishlist-button.in-wishlist {
  background: #28a745;
  border-color: #28a745;
}

.wishlist-button.in-wishlist:hover {
  background: #218838;
  border-color: #218838;
}

.wishlist-button .icon_heart_alt {
  margin-right: 8px;
  font-size: 16px;
}

.wishlist-button .wishlist-text {
  font-size: 14px;
}

/* Wishlist Container */
.wishlist-container {
  min-height: 400px;
}

/* Wishlist Products Grid Layout */
.wishlist-products-grid {
  margin-top: 20px;
}

.wishlist-products-grid .row {
  margin: 0 -15px;
}

.wishlist-products-grid .product__item {
  margin-bottom: 30px;
  position: relative;
}

.wishlist-products-grid .product__item__pic {
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
  background: #f8f9fa
    url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f8f9fa"/><text x="50" y="50" font-family="Arial" font-size="10" fill="%23999" text-anchor="middle" dy=".3em">No Image</text></svg>')
    center/cover;
}

.wishlist-products-grid .product__item__pic img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Show img tag as fallback when set-bg fails */
.wishlist-products-grid .product__item__pic:not(.set-bg-loaded) img {
  display: block !important;
}

.wishlist-products-grid .product__item:hover .product__item__pic img {
  transform: scale(1.05);
}

.wishlist-products-grid .product__item__pic .label {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  z-index: 2;
}

.wishlist-products-grid .product__item__pic .label.sale {
  background: #f51167;
}

.wishlist-products-grid .product__item__pic .label.stockout {
  background: #dc3545;
}

.wishlist-products-grid .product__item__pic .label.new {
  background: #28a745;
}

.wishlist-products-grid .product__hover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  list-style: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.wishlist-products-grid .product__item__pic:hover .product__hover {
  opacity: 1;
}

.wishlist-products-grid .product__hover li {
  display: inline-block;
  margin: 0 5px;
}

.wishlist-products-grid .product__hover a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
}

.wishlist-products-grid .product__hover a:hover {
  background: #f51167;
  color: #fff;
}

.wishlist-products-grid .product__item__text {
  padding: 15px 0;
}

.wishlist-products-grid .product__item__text h6 {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
}

.wishlist-products-grid .product__item__text h6 a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.wishlist-products-grid .product__item__text h6 a:hover {
  color: #f51167;
}

.wishlist-products-grid .rating {
  margin-bottom: 10px;
}

.wishlist-products-grid .rating i {
  font-size: 10px;
  color: #e3c01c;
  margin-right: -4px;
}

.wishlist-products-grid .product__price {
  font-weight: 600;
  color: #f51167;
  font-size: 16px;
}

.wishlist-products-grid .product__price span {
  color: #999;
  text-decoration: line-through;
  margin-left: 10px;
  font-weight: 400;
}

/* Remove from Wishlist Button */
.remove-from-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 35px;
  height: 35px;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 4;
  opacity: 0;
}

.wishlist-products-grid .product__item:hover .remove-from-wishlist-btn {
  opacity: 1;
}

.remove-from-wishlist-btn:hover {
  background: #c82333;
  transform: scale(1.1);
}

/* Empty Wishlist State */
.wishlist-empty {
  text-align: center;
  padding: 80px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.wishlist-empty-icon {
  font-size: 80px;
  color: #e1e1e1;
  margin-bottom: 30px;
}

.wishlist-empty h3 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.wishlist-empty p {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

.primary-btn {
  display: inline-block;
  padding: 15px 35px;
  background: #f51167;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: 2px solid #f51167;
}

.primary-btn:hover {
  background: transparent;
  color: #f51167;
  text-decoration: none;
}

/* YITH Wishlist Table Customization for Compatibility */
.wishlist_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: none; /* Hide table by default, show grid instead */
}

/* Show table on mobile if grid is not suitable */
@media (max-width: 768px) {
  .wishlist_table {
    display: table;
    font-size: 14px;
  }

  .wishlist-products-grid {
    display: none;
  }
}

.wishlist_table th {
  background: #f8f9fa;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  color: #333;
  font-size: 14px;
  text-transform: uppercase;
}

.wishlist_table td {
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.wishlist_table .product-thumbnail img {
  max-width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.wishlist_table .product-name a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.wishlist_table .product-name a:hover {
  color: #f51167;
}

.wishlist_table .product-price {
  font-weight: 600;
  color: #f51167;
  font-size: 16px;
}

.wishlist_table .product-stock-status {
  font-size: 14px;
  font-weight: 500;
}

.wishlist_table .product-stock-status.in-stock {
  color: #28a745;
}

.wishlist_table .product-stock-status.out-of-stock {
  color: #dc3545;
}

.wishlist_table .product-add-to-cart a {
  display: inline-block;
  padding: 8px 20px;
  background: #f51167;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.wishlist_table .product-add-to-cart a:hover {
  background: #d40f5a;
  color: #fff;
}

.wishlist_table .product-remove a {
  color: #dc3545;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s ease;
}

.wishlist_table .product-remove a:hover {
  color: #c82333;
}

/* Wishlist Actions */
.wishlist-actions {
  margin: 30px 0;
  text-align: center;
}

.wishlist-actions .btn {
  margin: 0 10px;
  padding: 12px 25px;
  border: 2px solid #f51167;
  background: transparent;
  color: #f51167;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.wishlist-actions .btn:hover {
  background: #f51167;
  color: #fff;
}

.wishlist-actions .btn.clear-wishlist {
  border-color: #dc3545;
  color: #dc3545;
}

.wishlist-actions .btn.clear-wishlist:hover {
  background: #dc3545;
  color: #fff;
}

/* Responsive Design */
@media (max-width: 992px) {
  .wishlist-products-grid .product__item__pic img {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .wishlist_table th,
  .wishlist_table td {
    padding: 10px 8px;
  }

  .wishlist_table .product-thumbnail img {
    max-width: 60px;
    height: 60px;
  }

  .wishlist-button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .wishlist-button .wishlist-text {
    font-size: 13px;
  }

  .wishlist-empty {
    padding: 40px 20px;
  }

  .wishlist-empty-icon {
    font-size: 60px;
  }

  .wishlist-empty h3 {
    font-size: 20px;
  }

  .wishlist-empty p {
    font-size: 14px;
  }

  .wishlist-actions .btn {
    display: block;
    margin: 10px 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .wishlist_table {
    display: block;
    overflow-x: auto;
  }

  .wishlist-products-grid .col-sm-6 {
    width: 100%;
  }

  .wishlist-button {
    width: 100%;
    justify-content: center;
  }

  .primary-btn {
    width: 100%;
    text-align: center;
  }
}

/* Loading States */
.wishlist-button.loading,
.add-to-wishlist.loading,
.remove-from-wishlist.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.wishlist-button.loading::after,
.add-to-wishlist.loading::after,
.remove-from-wishlist.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Wishlist Count Badge */
.tip[data-count="0"] {
  display: none !important;
}

.tip {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f51167;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
}
