/* Category Page Styles - Mobile First */

/* Breadcrumbs */
.breadcrumbs {
  padding: 15px 0;
  font-size: 14px;
}

.breadcrumbs a {
  color: #666;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #333;
  text-decoration: underline;
}

.breadcrumbs .separator {
  margin: 0 8px;
  color: #999;
}

.breadcrumbs .current {
  color: #333;
}

/* Category Header */
.category-header {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.category-header h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.category-description {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Subcategories */
.subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.subcategory-link {
  display: inline-block;
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

.subcategory-link:hover {
  background: #e0e0e0;
}

.subcategory-link.active {
  color: #fff;
}

/* Category Layout */
.category-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Filter Sidebar - Mobile */
.filter-sidebar {
  width: 100%;
}

.filter-header-mobile {
  display: block;
}

.filter-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.filter-content {
  display: none;
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
}

.filter-content.active {
  display: block;
}

.filter-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

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

.filter-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.price-input {
  width: 80px;
  max-width: 80px;
  min-width: 60px;
  flex: 0 0 auto;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.btn-apply-filter {
  width: 100%;
  padding: 8px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 15px;
}

.btn-clear-filters {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  text-align: center;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.btn-clear-filters:hover {
  background: #f5f5f5;
  color: #333;
}

/* Attribute Filter Inputs */
.attribute-select,
.attribute-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: #333;
}

.attribute-select:focus,
.attribute-input:focus {
  outline: none;
  border-color: var(--accent-color, #6b2d5b);
}

/* Dark mode support for filters */
[data-theme="dark"] .filter-content {
  background: #1a1a1a;
  border-color: #333;
}

[data-theme="dark"] .filter-section {
  border-color: #333;
}

[data-theme="dark"] .filter-section h3 {
  color: #fff;
}

[data-theme="dark"] .price-input,
[data-theme="dark"] .attribute-select,
[data-theme="dark"] .attribute-input {
  background: #0a0a0a;
  border-color: #333;
  color: #fff;
}

[data-theme="dark"] .btn-clear-filters {
  border-color: #333;
  color: #999;
}

[data-theme="dark"] .btn-clear-filters:hover {
  background: #222;
  color: #fff;
}

.filter-list {
  list-style: none;
}

.filter-list li {
  margin-bottom: 5px;
}

.filter-list a {
  display: block;
  padding: 5px 0;
  text-decoration: none;
  color: #666;
  font-size: 14px;
}

.filter-list a:hover,
.filter-list a.active {
  color: #333;
  font-weight: 500;
}

/* Products Main */
.products-main {
  flex: 1;
}

.products-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.results-count {
  font-size: 14px;
  color: #666;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-options label {
  font-size: 14px;
  color: #666;
}

.sort-options select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.product-card {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.product-card .product-image {
  position: relative;
  aspect-ratio: 1;
  background: #f9f9f9;
}

.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .product-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #e53935;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.product-card .product-details {
  padding: 15px;
}

.product-card .product-name {
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.4;
  min-height: 42px;
}

.product-card .product-name a {
  text-decoration: none;
  color: #333;
}

.product-card .product-name a:hover {
  color: #666;
}

.product-pricing {
  margin-bottom: 8px;
}

.current-price {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.original-price {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
  margin-left: 8px;
}

.product-card .stock-status {
  display: block;
  font-size: 12px;
  margin-bottom: 10px;
}

.product-card .btn-add-to-cart {
  width: 100%;
  padding: 10px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.product-card .btn-add-to-cart:hover {
  background: #444;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 30px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.page-link:hover {
  background: #f5f5f5;
}

.page-link.current {
  
  color: white;
  border-color: #333;
}

.page-link.prev,
.page-link.next {
  padding: 0 15px;
}

.page-ellipsis {
  padding: 0 8px;
}

.page-numbers {
  display: flex;
  gap: 5px;
}

/* No Products */
.no-products {
  text-align: center;
  padding: 60px 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.no-products p {
  margin-bottom: 20px;
  color: #666;
}

.no-products .btn {
  display: inline-block;
  padding: 12px 24px;
  background: #333;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* Tablet - 768px and up */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
  
  .products-toolbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .category-header h1 {
    font-size: 28px;
  }
}

/* Desktop - 1024px and up */
@media (min-width: 1024px) {
  .category-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .filter-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-right: 10px;
  }
  
  .filter-header-mobile {
    display: none;
  }
  
  .filter-content {
    display: block;
    padding: 0;
    border: none;
  }
  
  .filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
  }
  
  .filter-list {
    max-height: none;
    overflow-y: visible;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .category-header h1 {
    font-size: 32px;
  }
}

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
