/* Cart Item Layout Improvements */
.cart-single-item {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 80px 20px 0 !important;
  position: relative !important;
}

.cart-single-item .remove-item-btn {
  position: absolute !important;
  right: 5px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  background: #f8f9fa !important;
  border: 1px solid #dc3545 !important;
  color: #dc3545 !important;
  cursor: pointer !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.cart-single-item .remove-item-btn:hover {
  background: #dc3545 !important;
  color: white !important;
}

.cart-single-item .remove-item-btn i {
  font-size: 11px !important;
}

.cart-single-item .cart-img {
  flex-shrink: 0 !important;
  width: 90px !important;
}

.cart-single-item .cart-img img {
  max-height: 80px !important;
  max-width: 80px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

.cart-single-item .product-name {
  flex: 1 !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

.cart-single-item .product-price {
  flex-shrink: 0 !important;
  width: 80px !important;
  text-align: center !important;
  font-weight: 500 !important;
}

.cart-single-item .quantity-input {
  flex-shrink: 0 !important;
  width: 120px !important;
}

.cart-single-item .product-total-price {
  flex-shrink: 0 !important;
  width: 80px !important;
  text-align: center !important;
  font-weight: 600 !important;
  color: #1a2428 !important;
}

/* Product Grid Consistency Improvements */
.shop-left-sidebar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.shop-left-sidebar-row > div {
  display: flex;
  margin-bottom: 30px;
}

.product-item {
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 320px;
  padding-bottom: 2px !important; /* Aggressive bottom padding reduction */
}

.product-item .content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 15px 0 5px 0 !important; /* Reduce bottom padding of content */
}

.product-item .content h6 {
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 10px !important;
  line-height: 1.3 !important;
}

.product-item .content h6 a {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-wrap: break-word !important;
  text-align: center !important;
  font-size: 16px !important;
}

.product-item .price {
  margin-top: auto !important;
  margin-bottom: 0 !important; /* Remove any bottom margin on price */
}

.product-item .image {
  height: 150px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Reduce spacing for Add to Cart section */
.product-item .add-to-cart-link {
  margin-top: 4px !important;
}

.product-item > div:last-child {
  margin-top: auto !important;
  padding-top: 2px !important;
  margin-bottom: 0 !important; /* Remove any bottom margin */
}

/* Override the mt-1 class specifically in product items */
.product-item .mt-1 {
  margin-top: 2px !important; /* Further reduce gap between price and button */
}

/* Reduce gap between content and Add to Cart button */
.product-item > div:nth-child(2) {
  margin-top: 2px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Ensure AddToCart wrapper has minimal bottom spacing */
.product-item .text-center {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* More aggressive targeting for AddToCart spacing */
.product-item div.mt-1.text-center {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Override Bootstrap p-3 class bottom padding */
.product-item.p-3 {
  padding-bottom: 2px !important;
}

/* Target the specific AddToCart button link */
.product-item .add-to-cart-link.inline-flex {
  margin-bottom: 0 !important;
}

/* Mobile responsive adjustments */
@media only screen and (max-width: 767px) {
  .cart-single-item {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }
  
  .cart-single-item .remove-item-btn {
    right: 5px !important;
    top: 5px !important;
    transform: none !important;
    position: absolute !important;
  }
  
  .cart-single-item {
    padding: 20px 80px 20px 0 !important;
  }
  
  .cart-single-item .product-name,
  .cart-single-item .product-price,
  .cart-single-item .quantity-input,
  .cart-single-item .product-total-price {
    width: auto !important;
  }
  
  .product-item {
    min-height: 280px !important;
  }
  
  .product-item .content h6 {
    min-height: 40px !important;
  }
}