/* Premium Product Cards - Better than Jumia */
.premium-product-card {
  background: white;
  border-radius: 8px; /* Jumia style: smaller radius */
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e7eb;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.premium-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
  border-color: transparent;
}

.premium-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%; /* Square aspect ratio */
  background: #f9fafb;
  overflow: hidden;
}

.premium-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.premium-product-card:hover .premium-image {
  transform: scale(1.08);
}

/* Badge Styles */
.premium-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.premium-badge.sale {
  /* Hide the default sale badge because we use the discount tag in the top-right */
  display: none;
}

.premium-badge.new {
  background: #10b981;
  color: white;
}

.premium-badge.hot {
  background: #f59e0b;
  color: white;
}

.premium-badge.free-shipping {
  background: #10b981;
  color: white;
  font-size: 9px;
  padding: 3px 6px;
}


/* Actions (Wishlist, Quick View) */
.premium-actions {
  position: absolute;
  top: 8px;
  right: 8px; /* Default position */
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
  z-index: 3; /* Above badges */
}

/* Always show actions on touch devices or small screens */
/* Always show actions on touch devices or small screens */
@media (hover: none), (max-width: 768px) {
  .premium-actions {
    display: flex; /* Show actions on mobile */
    opacity: 1;    /* Make them fully visible */
    transform: translateX(0); /* Reset position */
    background: rgba(255, 255, 255, 0.9); /* Add subtle background for better visibility */
    border-radius: 20px;
    padding: 4px;
  }

  .action-btn {
    width: 28px; /* Slightly smaller on mobile */
    height: 28px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

.premium-product-card:hover .premium-actions {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 14px;
}

.action-btn:hover {
  background: #dc2626;
  color: white;
  transform: scale(1.1);
}

.action-btn.active {
  color: #dc2626;
  background: #fee2e2;
}

/* Content Area */
.premium-content {
  padding: 8px; /* Compact padding globally */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.premium-category {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.premium-title {
  font-size: 13px; /* Slightly larger than mobile 12px for readability on desktop */
  font-weight: 500;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px; /* Fixed height for 2 lines */
}

.premium-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}

.premium-stars {
  color: #f59e0b;
  font-size: 10px;
}

.premium-review-count {
  font-size: 10px;
  color: #9ca3af;
}

.premium-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 8px;
}

.premium-price {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.premium-old-price {
  font-size: 12px;
  color: #9ca3af;
  text-decoration: line-through;
}

/* Discount Tag - Jumia Style (Top Right of Card) */
.premium-discount-tag {
  font-size: 10px;
  color: #dc2626;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  z-index: 2;
}

.premium-add-btn {
  width: 100%;
  padding: 8px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
}

.premium-add-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.premium-add-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Horizontal Scroll Support */
.horizontal-scroll-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 12px;
  padding: 4px 4px 16px 4px; /* Add padding to prevent shadow clipping */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.horizontal-scroll-container::-webkit-scrollbar {
  display: none;
}

.horizontal-scroll-container .premium-product-card {
  flex: 0 0 220px; /* Default width for desktop */
  min-width: 220px;
  max-width: 220px;
  margin-right: 0;
  scroll-snap-align: start;
}

@media (max-width: 768px) {
  .horizontal-scroll-container .premium-product-card {
    flex: 0 0 45%; /* 2 cards per row */
    min-width: 45%;
    max-width: 45%;
  }
}

/* Scroll Buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
  color: #374151;
}

.scroll-btn:hover {
  background: #f9fafb;
  color: #dc2626;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.scroll-btn-prev {
  left: -20px;
}

.scroll-btn-next {
  right: -20px;
}

@media (max-width: 768px) {
  .scroll-btn {
    display: none !important; /* Hide on mobile as touch scroll is better */
  }
}


/* Smaller cards for horizontal scroll sections on products page */
#flash-grid .premium-product-card,
#trending-grid .premium-product-card,
#featured-grid .premium-product-card {
  flex: 0 0 180px !important;
  min-width: 180px !important;
  width: 180px !important;
}

#flash-grid .premium-image-container,
#trending-grid .premium-image-container,
#featured-grid .premium-image-container {
  height: 180px;
}

#flash-grid .premium-title,
#trending-grid .premium-title,
#featured-grid .premium-title {
  font-size: 0.85rem;
  line-height: 1.25rem;
  height: 2.5rem; /* Limit to 2 lines */
  overflow: hidden;
}

#flash-grid .premium-price,
#trending-grid .premium-price,
#featured-grid .premium-price {
  font-size: 1rem;
}

#flash-grid .premium-content,
#trending-grid .premium-content,
#featured-grid .premium-content {
  padding: 10px;
}

#flash-grid .premium-add-btn,
#trending-grid .premium-add-btn,
#featured-grid .premium-add-btn {
  padding: 6px;
  font-size: 0.85rem;
}

/* Filter Modal (Global) */
#filter-sidebar.active {
  display: block !important;
}

/* Modal Animation */
#filter-sidebar .relative.transform {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease-out;
}

#filter-sidebar.active .relative.transform {
  opacity: 1;
  transform: scale(1);
}

/* Backdrop Animation */
#filter-sidebar #filter-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#filter-sidebar.active #filter-backdrop {
  opacity: 1;
}
