/* eBay-style Product Card Styles */

/* Product Card Grid */
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

/* Product Card */
.product-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card-actions,
.btn-product-action {
  position: relative;
  z-index: 2;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Product Image */
.product-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

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

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

/* Image overlay for multiple images indicator */
.image-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Product Badges */
.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-featured {
  background: #0064d2;
  color: white;
}

.badge-best-seller {
  background: #28a745;
  color: white;
}

.badge-trending {
  background: #ff6b35;
  color: white;
}

.badge-verified {
  background: #17a2b8;
  color: white;
}

.badge-new {
  background: #28a745;
  color: white;
}

.badge-condition {
  background: #6c757d;
  color: white;
}

/* Product Info */
.product-card-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Price Section */
.product-card-price {
  margin-bottom: 12px;
}

.price-current {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.price-original {
  font-size: 14px;
  color: #6c757d;
  text-decoration: line-through;
  margin-right: 8px;
}

.price-savings {
  font-size: 14px;
  color: #28a745;
  font-weight: 600;
}

/* Seller Info */
.product-card-seller {
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.seller-name {
  font-size: 12px;
  color: #0064d2;
  font-weight: 500;
}

.seller-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-stars {
  color: #ffc107;
  font-size: 12px;
}

.rating-text {
  font-size: 12px;
  color: #6c757d;
}

.seller-location {
  font-size: 12px;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 4px;
}

.seller-response {
  font-size: 12px;
  color: #28a745;
  font-weight: 500;
}

/* Product Actions */
.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-product-action {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #333;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-product-action:hover {
  background: #f8f9fa;
  border-color: #0064d2;
  color: #0064d2;
}

.btn-product-action.primary {
  background: #0064d2;
  color: white;
  border-color: #0064d2;
}

.btn-product-action.primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .product-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .product-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .product-card-image {
    height: 160px;
  }
  
  .product-card-info {
    padding: 12px;
  }
  
  .product-card-title {
    font-size: 13px;
  }
  
  .price-current {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .product-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .product-card-image {
    height: 140px;
  }
  
  .product-card-seller {
    padding-top: 8px;
    margin-bottom: 8px;
  }

  .seller-location,
  .seller-response,
  .rating-text {
    display: none;
  }

  .product-card-actions {
    flex-direction: row;
  }

  .btn-product-action {
    padding: 10px 10px;
    min-height: 40px;
  }

  .btn-product-action span {
    display: none;
  }

  .product-card-actions {
    gap: 6px;
  }
}

/* Filter Sidebar */
.filter-sidebar {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-option input[type="checkbox"] {
  margin: 0;
}

.filter-option label {
  font-size: 14px;
  color: #333;
  margin: 0;
  cursor: pointer;
}

.filter-count {
  font-size: 12px;
  color: #6c757d;
  margin-left: auto;
}

/* Price Range Slider */
.price-range {
  margin-bottom: 16px;
}

.price-inputs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.price-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
}

/* Sort Dropdown */
.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sort-label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #333;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 40px;
  text-align: center;
}

.pagination-btn:hover {
  background: #f8f9fa;
  border-color: #0064d2;
  color: #0064d2;
}

.pagination-btn.active {
  background: #0064d2;
  color: white;
  border-color: #0064d2;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: #6c757d;
  margin-left: 16px;
}

/* Loading State */
.product-card.loading {
  background: #f8f9fa;
  border: 1px dashed #e0e0e0;
}

.product-card.loading .product-card-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mobile Filters */
.mobile-filter-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
  background: #0064d2;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 92px;
  }
  
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    margin: 0;
    border-radius: 0;
  }
  
  .filter-sidebar.show {
    transform: translateX(0);
  }
  
  .filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin: -20px -20px 20px -20px;
  }
  
  .filter-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
  }
  
  .filter-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
  }
}
