/**
 * Collection & Archive Page Styles
 * Khaas Tech N Games
 */

/* Breadcrumbs */
.breadcrumb-nav {
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
  font-size: 1.3rem;
  color: var(--text-color);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.breadcrumb-separator {
  width: 14px;
  height: 14px;
  color: #a0a0a0;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-current {
  color: var(--heading-color);
  font-weight: var(--font-weight-semibold);
}

/* Collection Header & Subcategory Hub */
.collection-header-section {
  margin-bottom: 3.2rem;
}

.collection-title {
  margin-bottom: 0.8rem;
}

.collection-description {
  font-size: 1.5rem;
  color: var(--text-color);
  max-width: 860px;
  margin-bottom: 2.4rem;
}

/* Subcategory Icon Hub */
.subcategory-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.4rem;
  margin-bottom: 3.2rem;
}

.subcategory-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.4rem 1.0rem;
  background-color: #f7f7f7;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.subcategory-tile:hover {
  background-color: #ffffff;
  border-color: var(--heading-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.subcategory-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.0rem;
  border: 1px solid var(--card-border);
}

.subcategory-icon-wrap img, .subcategory-icon-wrap svg {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.subcategory-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  line-height: 1.3;
}

/* Collection Split Layout */
.collection-split-layout {
  display: flex;
  gap: 3.2rem;
  align-items: flex-start;
}

/* Sticky Desktop Sidebar Filters */
.collection-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  padding-right: 0.8rem;
}

.filter-group {
  border-bottom: 1px solid var(--divider-color);
  padding-top: 1.8rem;
  padding-bottom: 1.8rem;
}

.filter-group:first-child {
  padding-top: 0;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 1.2rem;
}

.filter-group-title {
  font-size: 1.4rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0;
}

.filter-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 1.0rem;
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.35rem;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}

.filter-checkbox-label:hover {
  color: var(--heading-color);
}

.filter-checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #b3b3b3;
  border-radius: 3px;
  margin-right: 1.0rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-checkbox-label input[type="checkbox"]:checked {
  background-color: var(--heading-color);
  border-color: var(--heading-color);
}

.filter-checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.filter-item-count {
  font-size: 1.2rem;
  color: #999999;
}

/* Price Range Slider & Inputs */
.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 1.0rem;
  margin-top: 1.2rem;
}

.price-input-box {
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 1.3rem;
  background-color: #ffffff;
}

.price-currency-symbol {
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
  margin-right: 0.4rem;
}

.price-input-box input {
  width: 100%;
  font-size: 1.3rem;
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

/* In Stock Only Toggle Switch */
.stock-toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #d1d1d1;
  border-radius: 12px;
  transition: background-color var(--transition-fast);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked + .switch-track {
  background-color: var(--in-stock);
}

input[type="checkbox"]:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}

/* Collection Main (Grid & Toolbar) */
.collection-main {
  flex: 1;
  min-width: 0;
}

/* Collection Toolbar */
.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.6rem;
  padding-bottom: 2.0rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--divider-color);
}

.toolbar-left-cluster {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.mobile-filter-trigger {
  display: none;
}

.product-count-display {
  font-size: 1.4rem;
  color: var(--text-color);
  font-weight: var(--font-weight-normal);
}

.product-count-display strong {
  color: var(--heading-color);
}

/* Active Filter Chips Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  width: 100%;
}

.clear-all-filters-btn {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  text-decoration: underline;
  cursor: pointer;
  margin-left: 0.6rem;
}

/* Sort Controls */
.toolbar-sort-wrap {
  display: flex;
  align-items: center;
  gap: 1.0rem;
}

.sort-label {
  font-size: 1.35rem;
  color: var(--text-color);
}

.sort-select {
  border: 1px solid var(--input-border);
  border-radius: var(--btn-radius);
  padding: 0.6rem 3.2rem 0.6rem 1.4rem;
  font-size: 1.35rem;
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232c2c2c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 1.2rem center;
  appearance: none;
  cursor: pointer;
}

/* 5-Column Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--grid-row-gap) var(--grid-column-gap);
}

@media (max-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .collection-sidebar {
    display: none;
  }
  
  .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--btn-radius);
    border: 1px solid var(--heading-color);
    font-size: 1.3rem;
    font-weight: var(--font-weight-bold);
    color: var(--heading-color);
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 680px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .subcategory-hub-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }
}

/* Pagination */
.collection-pagination {
  margin-top: 4.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-numbers .page-link, .page-numbers span.current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: var(--font-weight-bold);
  border: 1px solid var(--card-border);
  transition: all var(--transition-fast);
}

.page-numbers span.current {
  background-color: var(--heading-color);
  color: var(--accent-lime);
  border-color: var(--heading-color);
}

.page-numbers .page-link:hover {
  background-color: #f0f0f0;
}
