.ab-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.ab-product-card {
  background-color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-sizing: border-box;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ab-product-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

.ab-card-header-icons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.ab-card-header-icons i {
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.ab-card-header-icons .update-wishlist {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ab-card-header-icons .update-wishlist:hover {
  transform: scale(1.15);
  color: #ef4444 !important;
}

.ab-card-header-icons .update-wishlist.ab-wishlist-active {
  color: #ef4444 !important;
  animation: heartPulse 0.6s ease;
}

.ab-card-header-icons .update-wishlist.ab-wishlist-clicked {
  animation: heartBeat 0.5s ease;
}

@keyframes heartPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(0.9);
  }
  75% {
    transform: scale(1.1);
  }
}

/* Share Icon Wrapper */
.ab-share-wrapper {
  position: relative;
  display: inline-block;
}

.ab-share-icon {
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  color: #9ca3af;
  position: relative;
}

.ab-share-icon:hover {
  color: #3b82f6 !important;
  transform: scale(1.15);
}

.ab-share-icon.ab-share-active {
  color: #3b82f6 !important;
  animation: sharePulse 0.4s ease;
}

@keyframes sharePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1);
  }
}

/* Share Dropdown */
.ab-share-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 180px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ab-share-wrapper.active .ab-share-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ab-share-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ffffff;
  filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

.ab-share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.ab-share-option:hover {
  background-color: #f3f4f6;
  transform: translateX(4px);
}

.ab-share-option i {
  font-size: 20px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-share-option[data-share="whatsapp"] i {
  color: #25D366;
}

.ab-share-option[data-share="facebook"] i {
  color: #1877F2;
}

.ab-share-option[data-share="twitter"] i {
  color: #1DA1F2;
}

.ab-share-option[data-share="copy"] i {
  color: #6B7280;
}

.ab-share-option span {
  flex: 1;
  white-space: nowrap;
}

/* Responsive adjustments for share dropdown */
@media (max-width: 992px) {
  .ab-product-card {
    overflow: visible !important;
  }
  
  .ab-card-header-icons {
    overflow: visible !important;
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper {
    position: relative;
    overflow: visible !important;
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper .ab-share-dropdown {
    right: 0 !important;
    left: auto !important;
    transform: translateY(-10px) scale(0.95) !important;
    min-width: 160px;
    max-width: calc(100vw - 30px);
    transform-origin: top right;
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper.active .ab-share-dropdown {
    transform: translateY(0) scale(1) !important;
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper .ab-share-dropdown::before {
    right: 20px !important;
    left: auto !important;
  }
  
  .ab-share-option {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .ab-share-option i {
    font-size: 18px;
    width: 20px;
  }
}

@media (max-width: 768px) {
  .ab-product-card .ab-card-header-icons .ab-share-wrapper .ab-share-dropdown {
    right: 0 !important;
    transform: translateY(-10px) scale(0.95) !important;
    min-width: 150px;
    max-width: calc(100vw - 30px);
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper.active .ab-share-dropdown {
    transform: translateY(0) scale(1) !important;
  }
}

@media (max-width: 480px) {
  .ab-product-card .ab-card-header-icons .ab-share-wrapper .ab-share-dropdown {
    right: 0 !important;
    transform: translateY(-10px) scale(0.95) !important;
    min-width: 140px;
    max-width: calc(100vw - 20px);
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper.active .ab-share-dropdown {
    transform: translateY(0) scale(1) !important;
  }
  
  .ab-product-card .ab-card-header-icons .ab-share-wrapper .ab-share-dropdown::before {
    right: 15px !important;
  }
}

.ab-product-image {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #ffffff;
  position: relative;
}

.ab-product-image a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
  padding: 8px;
  box-sizing: border-box;
  image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.ab-product-image img:hover {
  transform: scale(1.05);
}

.ab-product-details h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  transition: color 0.3s ease;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-product-details h2:hover {
  color: #007bff;
}

.ab-rating-reviews {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.ab-rating-stars {
  display: flex;
  align-items: center;
  color: #f59e0b;
  font-size: 18px;
}

.ab-rating-stars i {
  transition: transform 0.2s ease;
}

.ab-rating-stars i:hover {
  transform: scale(1.1);
  cursor: pointer;
}

.ab-reviews-text {
  color: #4b5563;
  font-size: 14px;
  transition: color 0.3s ease;
}

.ab-reviews-text i {
  margin-right: 4px;
}

.ab-reviews-text:hover {
  color: #000;
  cursor: pointer;
}

.ab-price-cart-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ab-price-details {
  display: flex;
  flex-direction: column;
}

.ab-old-price-container {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.ab-old-price {
  color: #6b7280;
  text-decoration: line-through;
  font-size: 14px;
  margin-right: 8px;
}

.ab-discount-badge {
  background-color: #fef08a;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 9999px;
}

.ab-new-price {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.ab-add-to-cart-button {
  background-color: #e9bb4f;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1),
    0 1px 2px -1px rgba(0, 0, 0, 0.06);
  transition: background-color 0.2s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-add-to-cart-button:hover {
  background-color: #eab308;
  transform: translateY(-2px);
}

.ab-add-to-cart-button i {
  font-size: 18px;
}

@media (max-width: 1200px) {
  .ab-products {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 10px;
  }
  .ab-product-image {
    height: 220px;
  }
}

@media (max-width: 992px) {
  .ab-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 10px;
  }
  .ab-product-image {
    height: 210px;
  }
}

@media (max-width: 768px) {
  .ab-products {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 10px;
  }
  .ab-product-card {
    padding: 14px;
  }
  .ab-product-image {
    height: 260px;
  }
}

@media (max-width: 480px) {
  .ab-product-image {
    height: 240px;
  }
  .ab-product-image img {
    padding: 6px;
  }
}
