/* ============================================================
   Category & Products Grid Styles
   ============================================================ */

/* ── Products Area ───────────────────────────────────────── */
.products-area {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.category-filter-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
  gap: 12px;
}
.filter-left h2  { font-size: 24px; color: var(--text-dark); }
.product-count   { color: var(--text-light); font-size: 13px; margin-top: 2px; }

.filter-right select {
  padding: 9px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
  min-width: 190px;
  color: var(--text-dark);
  transition: border-color 0.2s;
}
.filter-right select:hover,
.filter-right select:focus {
  border-color: var(--brand-start);
  outline: none;
}

/* ── Products Grid ───────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 28px;
  min-height: 300px;
}

/* ── Product Card ────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.product-card-image {
  position: relative;
  height: 270px;
  overflow: hidden;
  background: var(--bg);
}
.product-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.product-card:hover .product-card-image img { transform: scale(1.08); }

.product-card-info { padding: 20px; }
.product-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card-description { display: none; }
.product-card-price {
  font-size: 21px;
  font-weight: 700;
  color: var(--brand-start);
  margin-bottom: 14px;
}
.product-card-price.sale-price { color: var(--red); }
.product-card-price .original-price {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}
.sale-percent-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: 6px;
}

.product-card-button {
  display: block;
  width: 100%;
  padding: 11px;
  background: var(--brand-gradient);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.product-card-button:hover { opacity: 0.88; }

/* Out of stock overlay */
.product-card.out-of-stock .product-card-image::after {
  content: 'Out of Stock';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── Empty / Error States ────────────────────────────────── */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.no-products svg { margin: 0 auto 16px; }
.no-products p { font-size: 17px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
@media (max-width: 768px) {
  .category-filter-bar { justify-content: space-between; padding: 4px 0; margin-bottom: 12px; }
  .filter-right select { min-width: unset; padding: 4px 10px; font-size: 13px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .product-card-image { height: 200px; }
}
@media (max-width: 480px) {
  .products-grid { gap: 12px; }
  .product-card-image { height: 160px; }
  .product-card-info { padding: 12px; }
  .product-card-title { font-size: 14px; }
  .product-card-price { font-size: 17px; }
  .product-card-button { padding: 9px; font-size: 13px; }
}
