:root {
  --ebay-primary: #059669;
  --ebay-hover: #047857;
  --ebay-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --ebay-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* Container - desktop default respects user column selection */
#ebay-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Tablet: Scale down to 2 columns */
@media (max-width: 1024px) {
  #ebay-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small tablet/large mobile: Keep 2 columns */
@media (max-width: 768px) {
  #ebay-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.75rem;
  }
}

/* Mobile: Single column */
@media (max-width: 640px) {
  #ebay-items {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.75rem;
  }
}

.ebay-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  background: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--ebay-shadow);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s forwards;
}

.ebay-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--ebay-shadow-hover);
  border-color: var(--ebay-primary);
}

.ebay-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.ebay-item:hover img {
  transform: scale(1.05);
}

.ebay-item-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #111827;
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-decoration: none;
}

.ebay-item-price {
  font-size: clamp(1.125rem, 3vw, 1.25rem);
  color: var(--ebay-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ebay-item-cta {
  color: var(--ebay-primary);
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.ebay-item-cta:hover {
  color: var(--ebay-hover);
}

.ebay-item:focus {
  outline: 2px solid var(--ebay-primary);
  outline-offset: 2px;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ebay-item:nth-child(n) {
  animation-delay: calc(0.1s * var(--i));
}

#ebay-load-more:hover {
  background: var(--ebay-hover);
}

#ebay-load-more:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Pagination styling */
#ebay-pagination {
  text-align: center;
  margin-top: 1rem;
  padding: 0 1rem;
}