/* ======================================================
   JAISWAL FASHION — Products Page Styles
   ====================================================== */

/* ==================== LAYOUT ==================== */
.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-8);
  align-items: start;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

/* ==================== FILTERS SIDEBAR ==================== */
.filters-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}

.filters-header h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-white);
  font-size: var(--fs-sm);
  transition: all var(--ease-fast);
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Filter Groups */
.filter-group {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: var(--sp-3);
}

/* Checkbox Filters */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--ease-fast);
}

.filter-checkbox:hover {
  color: var(--text-white);
}

.filter-checkbox input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-fast);
  flex-shrink: 0;
}

.filter-checkbox input:checked + .checkbox-custom {
  background: var(--gold);
  border-color: var(--gold);
}

.filter-checkbox input:checked + .checkbox-custom::after {
  content: '✓';
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 700;
}

.filter-checkbox input:checked ~ span:last-child {
  color: var(--text-white);
}

/* Price Range */
.price-range {
  margin-top: var(--sp-4);
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.price-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--gold), var(--gold-dark));
  border-radius: 3px;
  outline: none;
  margin-bottom: var(--sp-3);
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 3px solid var(--bg-primary);
}

.price-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 3px solid var(--bg-primary);
}

.price-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

#priceValue {
  color: var(--gold-light);
  font-weight: 600;
}

/* Color Filter */
.color-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: all var(--ease-fast);
}

.color-option.active {
  border-color: var(--text-white);
  transform: scale(1.2);
}

.color-option:hover {
  transform: scale(1.1);
}

/* Size Filter */
.size-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.size-filter-btn {
  min-width: 44px;
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.size-filter-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-white);
}

.size-filter-btn.active {
  background: var(--gold-subtle);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ==================== PRODUCTS CONTENT ==================== */
.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.results-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sort-select {
  width: auto;
  min-width: 180px;
  padding: var(--sp-2) var(--sp-8) var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  border-radius: var(--radius-md);
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--ease-fast);
}

.view-btn:hover {
  color: var(--text-white);
}

.view-btn.active {
  background: var(--gold-subtle);
  color: var(--gold);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--gold-light);
  transition: all 0.3s ease;
  transform-style: preserve-3d;
}

.active-filter-tag:hover {
  transform: translateZ(5px) translateY(-2px);
  box-shadow: 0 4px 10px rgba(212, 97, 26, 0.2);
}

.active-filter-tag button {
  background: none;
  border: none;
  color: var(--gold-light);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--ease-fast);
}

.active-filter-tag button:hover {
  opacity: 1;
}

/* Mobile Filter Button */
.mobile-filter-btn {
  display: none !important;
}

/* Mobile Overlay */
.mobile-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-navbar) - 1);
}

.mobile-filter-overlay.active {
  display: block;
}

/* ==================== LIST VIEW ==================== */
.products-grid.list-view {
  grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.products-grid.list-view .product-card-image {
  aspect-ratio: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: var(--z-navbar);
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform var(--ease-base);
    max-height: 100vh;
  }

  .filters-sidebar.open {
    transform: translateX(0);
  }

  .mobile-filter-btn {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .products-grid.list-view {
    grid-template-columns: 1fr;
  }

  .products-grid.list-view .product-card {
    grid-template-columns: 120px 1fr;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .sort-select {
    flex: 1;
    min-width: auto;
  }
}
