/* =============================================
   HILGOD — PRODUCTS PAGE CSS
   ============================================= */

.products-page { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-6); margin-top: var(--space-4); }

/* ---- FILTERS SIDEBAR ---- */
.filters-sidebar {
  background: var(--white); border-radius: var(--radius-md);
  padding: var(--space-6); box-shadow: var(--shadow-sm);
  align-self: start; position: sticky; top: 144px;
}
.filter-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4); padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--primary);
}
.filter-header h3 { font-size: 1rem; font-weight: 700; }
.filter-clear { font-size: .8rem; color: var(--primary); cursor: pointer; font-weight: 600; }
.filter-clear:hover { text-decoration: underline; }

.filter-group { margin-bottom: var(--space-5); }
.filter-group-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .88rem; font-weight: 700; cursor: pointer; margin-bottom: var(--space-3); color: var(--dark);
}
.filter-group-title i { font-size: .75rem; transition: transform var(--transition); color: var(--gray-2); }
.filter-group.collapsed .filter-group-title i { transform: rotate(-90deg); }
.filter-group-body { display: flex; flex-direction: column; gap: 8px; }
.filter-group.collapsed .filter-group-body { display: none; }

/* Checkbox filters */
.filter-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 4px 0; transition: color var(--transition);
}
.filter-check input { display: none; }
.checkmark {
  width: 18px; height: 18px; border: 2px solid var(--gray-3);
  border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.filter-check input:checked + .checkmark { background: var(--primary); border-color: var(--primary); }
.filter-check input:checked + .checkmark::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .65rem; color: var(--white); }
.filter-label { font-size: .86rem; color: var(--dark); }
.filter-count { margin-left: auto; font-size: .75rem; color: var(--gray-2); }
.filter-check:hover .filter-label { color: var(--primary); }

/* Price Range */
.price-range-wrap { padding: var(--space-2) 0; }
.price-slider-track { position: relative; height: 5px; background: var(--gray-3); border-radius: 3px; margin: var(--space-4) 0; }
.price-slider-fill { position: absolute; height: 100%; background: var(--primary); border-radius: 3px; }
.price-slider {
  position: absolute; top: 50%; transform: translateY(-50%);
  -webkit-appearance: none; width: 100%; height: 5px; background: transparent;
  pointer-events: none; z-index: 2;
}
.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--white); border: 3px solid var(--primary); border-radius: 50%;
  cursor: pointer; pointer-events: all; box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.price-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.price-range-display { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; font-weight: 600; }
.price-display { color: var(--primary); }

/* Star Rating Filter */
.rating-filter { display: flex; flex-direction: column; gap: 8px; }
.rating-option {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0;
}
.rating-option:hover .filter-label { color: var(--primary); }

/* ---- PRODUCTS MAIN CONTENT ---- */
.products-main { min-width: 0; }

.products-topbar {
  background: var(--white); border-radius: var(--radius-md);
  padding: 14px var(--space-4); margin-bottom: var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.products-count { font-size: .88rem; color: var(--gray-1); }
.products-count strong { color: var(--dark); }
.sort-controls { display: flex; align-items: center; gap: var(--space-3); }
.sort-label { font-size: .85rem; color: var(--gray-1); white-space: nowrap; }
.sort-select {
  padding: 8px 14px; border: 1.5px solid var(--gray-3); border-radius: var(--radius);
  font-size: .87rem; cursor: pointer; background: var(--white);
}
.sort-select:focus { border-color: var(--primary); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gray-3); color: var(--gray-2);
  cursor: pointer; transition: all var(--transition);
}
.view-btn.active, .view-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }

/* Product grid layouts */
.product-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.product-catalog-grid.list-view { grid-template-columns: 1fr; }
.product-catalog-grid.list-view .product-card { flex-direction: row; }
.product-catalog-grid.list-view .product-card__img-wrapper { width: 200px; flex-shrink: 0; height: auto; }
.product-catalog-grid.list-view .product-card__body { padding: var(--space-4); }

/* Active filters */
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-3); }
.active-filter-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--primary-xlight);
  border: 1px solid var(--primary); border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 600; color: var(--primary); cursor: pointer;
}
.active-filter-tag i { font-size: .7rem; }
.active-filter-tag:hover { background: var(--primary); color: var(--white); }
.active-filters-label { font-size: .82rem; color: var(--gray-1); }

/* ---- RESPONSIVE PRODUCTS ---- */
@media (max-width: 1100px) { .product-catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .products-page { grid-template-columns: 1fr; }
  .filters-sidebar { position: relative; top: 0; display: none; }
  .filters-sidebar.mobile-open { display: block; }
  .product-catalog-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) { .product-catalog-grid { grid-template-columns: repeat(2, 1fr); } }
