/* ====================================================================
   TheShopCart — Subcategory Landing Page styles
   Path: public/assets/css/subcategory.css
   Pairs with: views/pages/subcategory.php
   Loaded by: views/layout/header.php (add a <link> after category.css)

   Visual language inherits from category.css / home.css:
     - Sharp corners (no border-radius)
     - #e4e6eb borders
     - #7a0f0f burgundy accent on hover/active states
     - White cards on a light surface
     - Filter-card pattern borrowed from subcategory-collectibles.css
       but recolored to our brand language (burgundy accent instead
       of pure black active state).

   Class names use the .tsc-filter-* prefix so they do not collide
   with the legacy .collectibles-subcategory rules if that file is
   still loaded somewhere.
   ==================================================================== */

/* --------------------------------------------------
   PAGE WRAPPER + HEADER BAND
-------------------------------------------------- */

.tsc-sub-page {
  /* placeholder hook in case we want page-level adjustments later */
}

.tsc-sub-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e4e6eb;
}

.tsc-sub-header__crumb {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.tsc-sub-header__crumb a {
  color: #6b7280;
  text-decoration: none;
}
.tsc-sub-header__crumb a:hover { color: #7a0f0f; text-decoration: underline; }

.tsc-sub-header__title {
  display: inline-block;
  position: relative;
  margin: 0 0 0.55rem;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111827;
}

.tsc-sub-header__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 0.55rem;
  background: #7a0f0f;
}

.tsc-sub-header__intro {
  max-width: 72ch;
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --------------------------------------------------
   LAYOUT — two columns, sidebar collapses on mobile
-------------------------------------------------- */

.tsc-sub-body { /* a Bootstrap .row replacement marker if needed */ }

/* Mobile filter toggle button — only visible below lg */
.tsc-filter-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid #e4e6eb;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111827;
  border-radius: 0;
}

.tsc-filter-toggle i {
  font-size: 1rem;
  color: #7a0f0f;
}

.tsc-filter-toggle:hover {
  background: #f9fafb;
}

/* --------------------------------------------------
   FILTER SIDEBAR
-------------------------------------------------- */

.tsc-sub-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Individual filter card (boxed group) */
.tsc-filter-card {
  border: 1px solid #e4e6eb;
  background: #f4f5f7;
}

.tsc-filter-card__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e4e6eb;
  background: #ffffff;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tsc-filter-card__b {
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  color: #1f2937;
}

/* List of options (chips stack vertically inside a filter card) */
.tsc-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tsc-filter-scroll {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.tsc-filter-scroll::-webkit-scrollbar { width: 6px; }
.tsc-filter-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.tsc-filter-scroll::-webkit-scrollbar-track { background: transparent; }

/* Individual chip option (a button or anchor) */
.tsc-filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #e4e6eb;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  border-radius: 0;
}

.tsc-filter-chip:hover {
  background: #ffffff;
  border-color: #7a0f0f;
  color: #7a0f0f;
}

.tsc-filter-chip--active {
  border-color: #7a0f0f;
  background: #fbf6f6;
  color: #7a0f0f;
  font-weight: 600;
}

.tsc-filter-chip__count {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.78rem;
}

.tsc-filter-chip--active .tsc-filter-chip__count {
  color: #7a0f0f;
}

/* Tabs — horizontal row, used for Type (Sports/Non-Sports) etc. */
.tsc-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tsc-filter-tab {
  flex: 1 1 auto;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e4e6eb;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  border-radius: 0;
}

.tsc-filter-tab:hover {
  border-color: #7a0f0f;
  color: #7a0f0f;
}

.tsc-filter-tab--active {
  background: #1a1715;
  border-color: #1a1715;
  color: #ffffff;
}

.tsc-filter-tab--active:hover {
  background: #2a2522;
  border-color: #2a2522;
  color: #ffffff;
}

/* Price range — two inputs side by side */
.tsc-filter-range {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.tsc-filter-input {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid #e4e6eb;
  background: #ffffff;
  font-size: 0.85rem;
  color: #1f2937;
  border-radius: 0;
}

.tsc-filter-input:focus {
  outline: none;
  border-color: #7a0f0f;
  box-shadow: 0 0 0 2px rgba(122, 15, 15, 0.12);
}

.tsc-filter-range__sep {
  color: #9ca3af;
  font-size: 0.85rem;
}

.tsc-filter-apply {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #7a0f0f;
  background: #7a0f0f;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s ease;
}

.tsc-filter-apply:hover {
  background: #961616;
  border-color: #961616;
}

/* Search input inside brand/etc. filter cards */
.tsc-filter-search {
  margin-bottom: 0.5rem;
}

/* Empty placeholder block when a filter has no options yet */
.tsc-filter-empty {
  padding: 0.65rem 0.55rem;
  color: #9ca3af;
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
}

/* --------------------------------------------------
   RESULTS BAR — sits above the product grid
-------------------------------------------------- */

.tsc-filter-results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: #f4f5f7;
  border: 1px solid #e4e6eb;
  font-size: 0.85rem;
}

.tsc-filter-results__count {
  color: #1f2937;
  font-weight: 500;
}

.tsc-filter-results__count strong {
  color: #111827;
  font-weight: 700;
}

.tsc-filter-results__sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tsc-filter-results__sort label {
  color: #6b7280;
}

.tsc-filter-results__select {
  padding: 0.35rem 0.55rem;
  border: 1px solid #e4e6eb;
  background: #ffffff;
  font-size: 0.85rem;
  color: #1f2937;
  border-radius: 0;
}

.tsc-filter-results__select:focus {
  outline: none;
  border-color: #7a0f0f;
}

/* --------------------------------------------------
   BACK TO PARENT CATEGORY (bottom of page)
-------------------------------------------------- */

.tsc-sub-back {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e4e6eb;
  text-align: center;
}

.tsc-sub-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #7a0f0f;
  text-decoration: none;
}

.tsc-sub-back a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------
   EMPTY STATE — when no products match
-------------------------------------------------- */

.tsc-sub-empty {
  background: #ffffff;
  border: 1px dashed #d1d5db;
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: #6b7280;
}

.tsc-sub-empty i {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.85rem;
  color: #9ca3af;
}

/* --------------------------------------------------
   MOBILE — sidebar becomes collapse panel
-------------------------------------------------- */

@media (max-width: 991.98px) {
  .tsc-sub-filters {
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 992px) {
  .tsc-filter-toggle {
    display: none;
  }
  /* Ensure sidebar is always visible on lg+ (override Bootstrap .collapse) */
  .tsc-sub-filters.collapse:not(.show) {
    display: flex !important;
  }
}