/* Store Page Styles */

/* Products Grid Responsive Layout */
#products-container {
  display: grid;
  gap: 2rem;
  transition: all 0.2s ease;
  will-change: auto;
  transform: translateZ(0);
  /* Enable smooth grid transitions */
  grid-auto-flow: row;
  align-items: stretch;
  /* Prevent layout jump during transitions */
  contain: layout;
  isolation: isolate;
  /* Prevent content jumping */
  min-height: 0;
  /* Ensure consistent row heights */
  grid-auto-rows: 1fr;
}

/* Desktop: 3 columns */
@media screen and (min-width: 992px) {
  #products-container {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(auto, 1fr);
  }
}

/* Tablet: 2 columns */
@media screen and (min-width: 768px) and (max-width: 991px) {
  #products-container {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(auto, 1fr);
  }
}

/* Mobile: 1 column */
@media screen and (max-width: 767px) {
  #products-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    grid-auto-rows: minmax(auto, 1fr);
  }
}

/* Shopping Cart Button - Uses new notification system */
.cart-btn {
  position: relative;
  display: inline-block;
}

.cart-btn .button {
  overflow: hidden;
  padding: 12px;
}

/* Cart button hover effects - handled by general button styles */

/* Cart Count uses the new notification badge system */
.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #FF6D2F, #E55A2B);
  color: #FFFFFF;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 3px 12px rgba(255, 109, 47, 0.4);
  border: 3px solid #1A1A1A;
  z-index: 10;
}

.cart-count.show {
  transform: scale(1);
  animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Enhanced Button Styles for All Icon Buttons */
.button.is-icon,
.button.is-small.is-icon {
  position: relative;
  background: linear-gradient(135deg, rgba(235, 229, 218, 0.1), rgba(235, 229, 218, 0.05));
  border: 2px solid rgba(235, 229, 218, 0.25);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Button Container for Notifications */
.button-with-notification {
  position: relative;
  display: inline-block;
}

.button-with-notification .button {
  overflow: hidden;
}

/* Notification Badge Styles */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #FF6D2F, #E55A2B);
  color: #FFFFFF;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 3px 12px rgba(255, 109, 47, 0.4);
  border: 3px solid #1A1A1A;
  z-index: 10;
}

.notification-badge.show {
  transform: scale(1);
  animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes notificationBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.button.is-icon::before,
.button.is-small.is-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 109, 47, 0.2), transparent);
  transition: left 0.6s;
  z-index: 1;
}

.button.is-icon:hover::before,
.button.is-small.is-icon:hover::before {
  left: 100%;
}

.button.is-icon:hover,
.button.is-small.is-icon:hover {
  border-color: #FF6D2F;
  background: linear-gradient(135deg, rgba(255, 109, 47, 0.2), rgba(255, 109, 47, 0.1));
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 109, 47, 0.3);
}

.button.is-icon svg,
.button.is-small.is-icon svg,
.button.is-icon .icon-embed-small,
.button.is-icon .icon-embed-xxsmall,
.button.is-small.is-icon .icon-embed-small,
.button.is-small.is-icon .icon-embed-xxsmall {
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.button.is-icon:hover svg,
.button.is-small.is-icon:hover svg,
.button.is-icon:hover .icon-embed-small,
.button.is-icon:hover .icon-embed-xxsmall,
.button.is-small.is-icon:hover .icon-embed-small,
.button.is-small.is-icon:hover .icon-embed-xxsmall {
  color: #FF6D2F;
  transform: scale(1.1);
}

/* Enhanced Add to Cart Buttons */
.add-to-cart-btn {
  position: relative;
  background: linear-gradient(135deg, #FF6D2F, #E55A2B);
  border: 2px solid rgba(255, 109, 47, 0.3);
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255, 109, 47, 0.2);
}

.add-to-cart-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
  z-index: 1;
}

.add-to-cart-btn:hover::before {
  left: 100%;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 109, 47, 0.4);
  border-color: #FF6D2F;
}

.add-to-cart-btn div {
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

/* Enhanced Filter Buttons */
.filter-button {
  position: relative;
  background: linear-gradient(135deg, rgba(235, 229, 218, 0.1), rgba(235, 229, 218, 0.05));
  border: 2px solid rgba(235, 229, 218, 0.2);
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.filter-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 109, 47, 0.2), transparent);
  transition: left 0.6s;
  z-index: 1;
}

.filter-button:hover::before,
.filter-button.active::before {
  left: 100%;
}

.filter-button:hover,
.filter-button.active {
  border-color: #FF6D2F;
  background: linear-gradient(135deg, rgba(255, 109, 47, 0.2), rgba(255, 109, 47, 0.1));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 109, 47, 0.3);
}

/* Shopping Cart Modal Styles */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.cart-modal.show {
  display: flex;
}

.cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.cart-content {
  position: relative;
  background: #1A1A1A;
  border: 1px solid rgba(235, 229, 218, 0.2);
  border-radius: 1rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.5);
  animation: cartSlideIn 0.3s ease-out;
}

@keyframes cartSlideIn {
  from {
    opacity: 0;
    transform: translateY(-2rem) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Cart Header */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(235, 229, 218, 0.1);
}

.cart-title {
  color: #EBE5DA;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  color: #EBE5DA;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.cart-close:hover {
  background: rgba(255, 109, 47, 0.1);
  color: #FF6D2F;
}

/* Cart Body */
.cart-body {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.cart-items {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cart Item */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(235, 229, 218, 0.05);
  border: 1px solid rgba(235, 229, 218, 0.1);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: rgba(235, 229, 218, 0.08);
  border-color: rgba(255, 109, 47, 0.3);
}

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: 0.5rem;
  object-fit: cover;
  background: rgba(235, 229, 218, 0.1);
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  color: #EBE5DA;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  color: #FF6D2F;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  background: rgba(235, 229, 218, 0.1);
  border: 1px solid rgba(235, 229, 218, 0.2);
  color: #EBE5DA;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: #FF6D2F;
  border-color: #FF6D2F;
  color: #101010;
}

.quantity-display {
  color: #EBE5DA;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  font-size: 0.9rem;
}

.remove-item {
  background: none;
  border: none;
  color: rgba(235, 229, 218, 0.6);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.remove-item:hover {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.1);
}

/* Empty Cart */
.cart-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(235, 229, 218, 0.6);
}

.empty-cart-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cart-empty h4 {
  color: #EBE5DA;
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.cart-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* Cart Footer */
.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(235, 229, 218, 0.1);
  background: rgba(235, 229, 218, 0.02);
}

.cart-total {
  margin-bottom: 1.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.total-row.final-total {
  border-top: 1px solid rgba(235, 229, 218, 0.2);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.total-label {
  color: rgba(235, 229, 218, 0.8);
  font-size: 0.9rem;
}

.final-total .total-label {
  color: #EBE5DA;
  font-weight: 600;
  font-size: 1rem;
}

.total-value {
  color: #FF6D2F;
  font-weight: 600;
  font-size: 0.9rem;
}

.final-total .total-value {
  font-size: 1.1rem;
}

.cart-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cart-actions .button {
  flex: 1;
  justify-content: center;
}

/* Make secondary button more minimal */
#clear-cart {
  background: transparent !important;
  color: #EBE5DA !important;
  border: 1px solid rgba(235, 229, 218, 0.15) !important;
  font-weight: 400 !important;
  opacity: 0.6 !important;
  transition: all 0.3s ease !important;
}

#clear-cart:hover {
  background: rgba(235, 229, 218, 0.05) !important;
  border-color: rgba(235, 229, 218, 0.25) !important;
  opacity: 0.8 !important;
}

/* Product card styling */
.product-card {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  opacity: 1;
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease;
  contain: layout style;
  transform-origin: center;
  box-sizing: border-box;
  position: relative;
  border: 1px solid rgba(235, 229, 218, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: translateY(0) scale(1);
  background-color: rgba(16, 16, 16, 0.8);
  
  /* Fixed height to ensure consistency */
  min-height: 420px;
  height: auto;
  max-height: none;
}

/* Smooth initial state - cards start invisible and animate in */
.product-card.initial {
  opacity: 0;
  transform: translateY(30px) scale(0.9) translateZ(0);
  visibility: hidden;
}

/* Instant fade-out for smooth hiding */
.product-card.fade-out {
  opacity: 0;
  transform: translateY(-5px) scale(0.98) translateZ(0);
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.6, 1);
  pointer-events: none;
  visibility: hidden;
}

/* Smooth fade-in for appearing */
.product-card.fade-in {
  opacity: 1;
  transform: translateY(0) scale(1) translateZ(0);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: all;
  visibility: visible;
}

/* Smooth layout preservation during filtering */
.product-card.filtering {
  will-change: transform, opacity, filter;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Product image container */
.product-card .layout486_image-wrapper {
  flex: 0 0 auto;
  width: 100%;
  height: 200px; /* Fixed height for image container */
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.product-card .layout486_image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Product content area */
.product-card .layout486_content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

/* Product title */
.product-card .layout486_heading {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: #EBE5DA;
  /* Fixed height for title area */
  min-height: 2.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product description */
.product-card .layout486_text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(235, 229, 218, 0.7);
  margin-bottom: 1rem;
  /* Fixed height for description */
  min-height: 3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product price and button area */
.product-card .layout486_price-wrapper {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(235, 229, 218, 0.1);
}

/* Filter Section Styles */
.filter-section {
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(235, 229, 218, 0.1);
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.filter-buttons-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.filter-button {
  background: rgba(235, 229, 218, 0.1);
  border: 1px solid rgba(235, 229, 218, 0.2);
  color: #EBE5DA;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.filter-button:hover {
  background: rgba(255, 109, 47, 0.2);
  border-color: rgba(255, 109, 47, 0.5);
  color: #FF6D2F;
  transform: translateY(-2px);
}

.filter-button.active {
  background: #FF6D2F;
  border-color: #FF6D2F;
  color: #101010;
  box-shadow: 0 0.5rem 1rem rgba(255, 109, 47, 0.3);
}

.filter-title {
  color: #EBE5DA;
  font-size: 1.125rem;
  font-weight: 600;
  margin-right: 1rem;
  margin-bottom: 0;
}

/* Tablet filter adjustments */
@media screen and (max-width: 991px) and (min-width: 768px) {
  .filter-container {
    gap: 1.5rem;
  }
  
  .filter-buttons-wrapper {
    gap: 1rem;
  }
  
  .filter-button {
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
  }
}

/* Mobile filter adjustments */
@media screen and (max-width: 767px) {
  .filter-section {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
  }
  
  .filter-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .filter-title {
    margin-right: 0;
    margin-bottom: 0;
    white-space: nowrap;
    font-size: 1rem;
  }
  
  .filter-buttons-wrapper {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  .filter-button {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.75rem 1.25rem;
  }
  
  /* Scrollbar styling for mobile filter */
  .filter-buttons-wrapper::-webkit-scrollbar {
    height: 4px;
  }
  
  .filter-buttons-wrapper {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 109, 47, 0.3) transparent;
  }
}

@media screen and (max-width: 480px) {
  .filter-title {
    font-size: 0.95rem;
  }
  
  .filter-button {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }
  
  .product-card {
    padding: 1.25rem;
  }
  
  .product-card .layout486_image-wrapper {
    height: 200px;
  }
}

/* Remove default transitions that cause conflicts */
.product-card:not(.fade-out):not(.fade-in):not(.filtering) {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Enhanced hover that doesn't interfere with filtering */
.product-card:hover:not(.fade-out):not(.filtering) {
  will-change: transform, box-shadow;
  transform: translateY(-8px) scale(1.02) translateZ(0);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Category badge */
.category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  background: rgba(255, 109, 47, 0.9);
  color: #101010;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

/* Ensure proper positioning for image wrapper */
.layout486_image-wrapper {
  position: relative;
} 

/* Mobile Cart Adjustments */
@media screen and (max-width: 767px) {
  .cart-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .cart-header,
  .cart-footer {
    padding: 1rem;
  }
  
  .cart-items {
    padding: 0.75rem;
  }
  
  .cart-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .cart-item-image {
    width: 50px;
    height: 50px;
  }
  
  .cart-item-title {
    font-size: 0.85rem;
  }
  
  .cart-item-price {
    font-size: 0.8rem;
  }
  
  .cart-actions {
    flex-direction: row;
    gap: 0.75rem;
  }
  
  .cart-actions .button {
    width: 100%;
  }
}

/* Cart item loading animation */
.cart-item.adding {
  animation: itemPulse 0.6s ease-in-out;
}

@keyframes itemPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Add to cart button feedback */
.add-to-cart-btn.adding {
  background: #28a745 !important;
  border-color: #28a745 !important;
  pointer-events: none;
}

.add-to-cart-btn.adding div {
  display: none;
}

.add-to-cart-btn.adding::after {
  content: "Added!";
  color: #fff;
}

/* Product Link Styles */
.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-link:hover {
  transform: translateY(-2px);
}

.product-link:hover .layout486_image {
  transform: scale(1.05);
}

.product-link:hover .product-title {
  color: #FF6D2F;
}

/* Product Actions */
.product-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
}

@media screen and (max-width: 767px) {
  .product-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .product-actions .button {
    width: 100%;
    text-align: center;
  }
}

/* Loading State for Products Container */
#products-container.filtering {
  position: relative;
  overflow: hidden;
}

#products-container.filtering::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FF6D2F, transparent);
  animation: loadingSlide 1.2s ease-in-out infinite;
  z-index: 10;
  border-radius: 0 0 2px 2px;
}

@keyframes loadingSlide {
  0% { left: -100%; opacity: 0; }
  50% { left: 0%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Smooth grid layout transitions */
#products-container {
  transition: all 0.3s ease;
  transform-origin: center top;
}

/* Add subtle pulse to filter buttons during active filtering */
.filter-button.filtering {
  animation: filterPulse 1s ease-in-out;
  pointer-events: none;
}

@keyframes filterPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Enhanced fade-in animation with blur effect */
@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    filter: blur(8px);
  }
  30% {
    opacity: 0.3;
    transform: translateY(20px) scale(0.93);
    filter: blur(6px);
  }
  60% {
    opacity: 0.7;
    transform: translateY(10px) scale(0.97);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Improved fade-out animation */
.product-card.fade-out {
  will-change: transform, opacity, filter;
  transform: translateY(20px) scale(0.95) translateZ(0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(5px);
  transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Remove will-change after animations complete */
.product-card:not(.filtering):not(.fade-out):not(.fade-in) {
  will-change: auto;
}

/* Prevent any layout shifts during transitions */
.product-card[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.product-card:not([style*="display: none"]) {
  display: flex !important;
}

/* Mobile and responsive adjustments for consistent heights */
@media screen and (max-width: 767px) {
  .product-card {
    min-height: 380px; /* Slightly smaller on mobile */
    padding: 1.25rem;
  }
  
  .product-card .layout486_image-wrapper {
    height: 180px; /* Smaller image on mobile */
  }
  
  .product-card .layout486_heading {
    font-size: 1.125rem;
    min-height: 2.5rem;
  }
  
  .product-card .layout486_text {
    font-size: 0.8rem;
    min-height: 2.5rem;
  }
  
  #products-container {
    gap: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  .product-card {
    min-height: 360px; /* Even smaller on very small screens */
    padding: 1rem;
  }
  
  .product-card .layout486_image-wrapper {
    height: 160px;
    margin-bottom: 0.75rem;
  }
  
  .product-card .layout486_heading {
    font-size: 1rem;
    min-height: 2.2rem;
    margin-bottom: 0.4rem;
  }
  
  .product-card .layout486_text {
    font-size: 0.75rem;
    min-height: 2.2rem;
    margin-bottom: 0.75rem;
  }
  
  .product-card .layout486_price-wrapper {
    padding-top: 0.75rem;
  }
}

/* Ensure consistency in grid layout across breakpoints */
@media screen and (min-width: 992px) {
  #products-container {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
  }
  
  .product-card {
    min-height: 420px;
  }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
  #products-container {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
  }
  
  .product-card {
    min-height: 400px;
  }
}

/* Force consistent heights even with varying content */
.product-card .layout486_content {
  height: 100%;
  min-height: 0;
} 