/* ==============================================================
   CATEGORY PAGE – PURE CSS (NO TAILWIND)
   ============================================================== */

.category-section {
  padding: 3rem 0;
  font-family: Arial, sans-serif;
  scroll-behavior: smooth;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Messages */
.messages-container {
  padding: 1rem 0;
  text-align: center;
}
.message {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  margin: 0.25rem;
}
.message-error { background: #fee2e2; color: #991b1b; }
.message-success { background: #d1fae5; color: #065f46; }
.message-info { background: #dbeafe; color: #1e40af; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: #16a34a;
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.separator { margin: 0 0.5rem; }

/* Category Title */
.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #16a34a;
  margin-bottom: 2rem;
}
.dark .category-title { color: #86efac; }

/* Filter Bar */
.filter-form { margin-bottom: 2rem; }
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) {
  .filter-bar { flex-direction: row; justify-content: space-between; align-items: center; }
}

.filter-group,
.sort-group { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.875rem;
}
.dark .filter-select { background: #1e293b; border-color: #334155; color: #f1f5f9; }

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary {
  background: #16a34a;
  color: #fff;
}
.btn-primary:hover { background: #059669; }
.btn-secondary {
  background: #6b7280;
  color: #fff;
}
.btn-secondary:hover { background: #4b5563; }

/* Product Grid */
.product-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* Item Card */
.item-card {
  display: block;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform .3s ease;
  text-decoration: none;
  color: inherit;
}
.dark .item-card { background: #1e293b; }

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1);
}

.image-container {
  background: #e5e7eb;
  overflow: hidden;
}
.dark .image-container { background: #334155; }

.product-img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  display: block;
}
@media (min-width: 640px) {
  .product-img { height: 14rem; }
}

.item-details {
  padding: 0.75rem;
}
.item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dark .item-name { color: #f1f5f9; }

.item-condition {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}
.dark .item-condition { color: #94a3b8; }

.item-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: #16a34a;
}
.dark .item-price { color: #86efac; }

.original-price {
  font-size: 0.75rem;
  text-decoration: line-through;
  color: #9ca3af;
  margin-left: 0.5rem;
}
.dark .original-price { color: #6b7280; }

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
}
.empty-icon {
  width: 4rem;
  height: 4rem;
  color: #9ca3af;
  margin: 0 auto 1rem;
}
.dark .empty-icon { color: #6b7280; }
.empty-text {
  font-size: 1.125rem;
  color: #6b7280;
}
.dark .empty-text { color: #94a3b8; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.pagination-btn {
  background: #16a34a;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background .2s;
}
.pagination-btn:hover:not(.disabled) { background: #059669; }
.pagination-btn.disabled {
  background: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}
.page-info {
  color: #6b7280;
  font-size: 0.875rem;
}
.dark .page-info { color: #94a3b8; }

/* Dark Mode */
html.dark .category-section { background: #0f172a; }