/* ========================================
   MODERN PRODUCT GRID DESIGN
   High Specificity to Override main.css
   ======================================== */

/* Product Grid Container - Override main.css */
.category-product .row {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 24px !important;
  padding: 20px 0 !important;
  margin: 0 !important;
}

/* Remove any clearfix or pseudo-elements that might create blank space */
.category-product .row:before,
.category-product .row:after {
  display: none !important;
  content: none !important;
}

/* Reset column classes for grid */
.category-product .row > div[class*="col-"] {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  grid-column: auto !important;
}

/* Ensure first item starts at the beginning */
.category-product .row > div[class*="col-"]:first-child {
  grid-column-start: 1 !important;
}

/* Product Card Container */
.category-product .item,
.category-product .item .products,
.category-product .item .products .product {
  height: 100% !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Product Card - Override main.css */
.category-product .products,
.category-product .item .products {
  background: #ffffff !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  border: 1px solid #f0f0f0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.category-product .products:hover,
.category-product .item .products:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
  border-color: #e0e0e0 !important;
}

/* Product Inner - Override main.css */
.category-product .product,
.category-product .products .product,
.category-product .item .products .product {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Product Image Container - Amazon Style (No padding, full image) */
.category-product .product-image,
.category-product .product .product-image,
.category-product .products .product .product-image {
  position: relative !important;
  overflow: hidden !important;
  background: #ffffff !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 0 !important;
  min-height: 280px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.category-product .product-image .image,
.category-product .product .product-image .image {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.category-product .product-image .image a,
.category-product .product .product-image .image a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Product Images - Amazon Style (Fill container, better visibility) */
.category-product .product-image img,
.category-product .product .product-image img,
.category-product .products .product .product-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Default Image - Always visible - Override main.css */
.category-product .product-image .default-image,
.category-product .product .product-image .default-image,
.category-product .product-image .image .default-image,
.category-product .product-image .image a .default-image {
  position: relative !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  z-index: 1 !important;
  background: transparent !important;
  display: block !important;
}

/* Hover Image - Hidden by default - Override main.css */
.category-product .product-image .hover-image,
.category-product .product .product-image .hover-image,
.category-product .product-image .image .hover-image,
.category-product .product-image .image a .hover-image {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  opacity: 0 !important;
  transform: scale(1.05) !important;
  z-index: 2 !important;
  background: transparent !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* On Hover - ONLY trigger on image area, not entire card */
.category-product .product-image:hover .default-image,
.category-product .product .product-image:hover .default-image,
.category-product .product-image:hover .image .default-image,
.category-product .product-image:hover .image a .default-image {
  opacity: 0 !important;
  transform: scale(1.05) !important;
}

.category-product .product-image:hover .hover-image,
.category-product .product .product-image:hover .hover-image,
.category-product .product-image:hover .image .hover-image,
.category-product .product-image:hover .image a .hover-image {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Image placeholder/fallback */
.category-product .product-image img[src=""],
.category-product .product-image img:not([src]) {
  background: #f8f9fa;
  position: relative;
}

.category-product .product-image img[src=""]:before,
.category-product .product-image img:not([src]):before {
  content: "No Image";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9ca3af;
  font-size: 14px;
}

/* Product Info Section - Override main.css */
.category-product .product-info,
.category-product .product .product-info,
.category-product .products .product .product-info {
  padding: 16px !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  margin: 0 !important;
}

/* Product Name - Override main.css */
.category-product .product-info .name,
.category-product .product .product-info .name {
  margin: 0 0 4px 0 !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  min-height: 42px !important;
  padding: 0 !important;
}

.category-product .product-info .name a,
.category-product .product .product-info .name a {
  color: #1a1a1a !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: color 0.3s ease !important;
}

.category-product .product-info .name a:hover,
.category-product .product .product-info .name a:hover {
  color: #2563eb !important;
}

/* Rating - Override main.css */
.category-product .rating,
.category-product .product-info .rating {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  color: #fbbf24 !important;
  margin: 0 0 4px 0 !important;
}

/* Product Price - Override main.css */
.category-product .product-price,
.category-product .product-info .product-price {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin: 4px 0 !important;
}

.category-product .product-price .price,
.category-product .product-info .product-price .price {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  letter-spacing: -0.5px !important;
}

.category-product .product-price .price-before-discount,
.category-product .product-info .product-price .price-before-discount {
  font-size: 16px !important;
  color: #9ca3af !important;
  text-decoration: line-through !important;
  font-weight: 500 !important;
}

/* Delivery & Availability Info - Override main.css */
.category-product .product-info > div[style*="margin: 10px"],
.category-product .product .product-info > div[style*="margin: 10px"] {
  margin: 4px 0 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.category-product .product-info > div[style*="margin: 10px"] span {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.category-product .product-info > div[style*="margin: 10px"] i {
  font-size: 14px !important;
}

/* Cart Actions - Override main.css */
.category-product .cart,
.category-product .product .cart {
  padding: 0 16px 16px !important;
  margin-top: auto !important;
}

.category-product .cart .action ul,
.category-product .product .cart .action ul {
  display: flex !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.category-product .cart .action ul li,
.category-product .product .cart .action ul li {
  margin: 0 !important;
  padding: 0 !important;
}

.category-product .cart .action ul li.add-cart-button,
.category-product .product .cart .action ul li.add-cart-button {
  flex: 1 !important;
}

/* Add to Cart Button */
.category-product .add-cart-button .btn-group {
  display: flex;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.category-product .add-cart-button .btn {
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  border-radius: 0;
}

.category-product .add-cart-button .btn.icon {
  padding: 12px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.category-product .add-cart-button .btn.cart-btn {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-product .add-cart-button .btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Wishlist & Compare Icons */
.category-product .cart .action ul li.lnk {
  width: 44px;
  height: 44px;
}

.category-product .cart .action ul li.lnk a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f3f4f6;
  border-radius: 12px;
  color: #6b7280;
  transition: all 0.3s ease;
  text-decoration: none;
}

.category-product .cart .action ul li.lnk a:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.05);
}

.category-product .cart .action ul li.lnk a i {
  font-size: 18px;
}

/* Badge Styles */
.category-product .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.category-product .tag.sale {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.category-product .tag.hot {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Discount Badge */
.category-product .discount-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Responsive Grid */
@media (max-width: 1400px) {
  .category-product .row {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 1200px) {
  .category-product .row {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 992px) {
  .category-product .row {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  
  .category-product .product-info {
    padding: 16px;
  }
  
  .category-product .cart {
    padding: 0 16px 16px;
  }
}

@media (max-width: 768px) {
  .category-product .row {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .category-product .product-info .name {
    font-size: 14px;
    min-height: 38px;
  }
  
  .category-product .product-price .price {
    font-size: 20px;
  }
  
  .category-product .product-price .price-before-discount {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .category-product .row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .category-product .products {
    border-radius: 12px;
  }
  
  .category-product .product-image {
    border-radius: 12px 12px 0 0;
  }
  
  .category-product .product-info {
    padding: 12px;
    gap: 6px;
  }
  
  .category-product .product-info .name {
    font-size: 13px;
    min-height: 36px;
  }
  
  .category-product .product-price .price {
    font-size: 18px;
  }
  
  .category-product .product-price .price-before-discount {
    font-size: 13px;
  }
  
  .category-product .cart {
    padding: 0 12px 12px;
  }
  
  .category-product .add-cart-button .btn {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .category-product .cart .action ul li.lnk {
    width: 40px;
    height: 40px;
  }
  
  .category-product .cart .action ul li.lnk a i {
    font-size: 16px;
  }
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.category-product .loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
  background-size: 1000px 100%;
}

/* Hover Effects Enhancement */
.category-product .products::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(29, 78, 216, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 16px;
}

.category-product .products:hover::before {
  opacity: 1;
}

/* Quick View Button (Optional Enhancement) */
.category-product .quick-view {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  z-index: 15;
  background: white;
  color: #1a1a1a;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
}

.category-product .products:hover .quick-view {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.category-product .quick-view:hover {
  background: #2563eb;
  color: white;
}

/* Stock Status */
.category-product .stock-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
}

.category-product .stock-status.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}

.category-product .stock-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
