/* =========================================================================
   solverraholistics.com -- Catalog stylesheet (PLP / brand / full / extended)
   Loads AFTER homepage.css. Reuses its design tokens + .product-grid /
   .product-card / .chip / .btn / header / footer verbatim. This file adds ONLY
   the catalog-specific components: brand hero, faceted filter bar/sidebar, the
   sourced-from toggle, breadcrumb, sort bar, catalog-card extras, pagination.
   Everything consumes var(--*). No hardcoded hex. ASCII-only; straight quotes
   + hyphens only (.com ad-safety + ASCII-clean build rule).
   Source tokens: design-system/solverra-holistics-design-system/project/colors_and_type.css
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. CATALOG LAYOUT SHELL (sidebar + grid)
   ------------------------------------------------------------------------- */
.catalog {
  padding-block: var(--s-7) var(--s-9);
}
.catalog__layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: var(--s-7);
  align-items: start;
}
@media (max-width: 1024px) {
  .catalog__layout { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* Sticky filter sidebar (desktop) */
.catalog__sidebar {
  position: sticky;
  top: 96px;                 /* clears the sticky header */
  align-self: start;
  display: grid;
  gap: var(--s-5);
}
@media (max-width: 1024px) {
  .catalog__sidebar { position: static; top: auto; }
}

/* -------------------------------------------------------------------------
   2. BREADCRUMB
   ------------------------------------------------------------------------- */
.breadcrumb {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: var(--s-5);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; }
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--s-2); }
.breadcrumb li + li::before { content: "/"; color: var(--fg-mute); }
.breadcrumb a { color: var(--sol-forest-mid); text-decoration: none; }
.breadcrumb a:hover { color: var(--sol-lime-deep); }
.breadcrumb [aria-current="page"] { color: var(--fg); font-weight: 700; }

/* -------------------------------------------------------------------------
   3. CATALOG HERO (shared) + BRAND HERO
   ------------------------------------------------------------------------- */
.catalog-hero {
  margin-bottom: var(--s-6);
  max-width: 820px;
}
.catalog-hero .eyebrow { margin-bottom: var(--s-3); }
.catalog-hero h1 { font-size: clamp(32px, 5vw, var(--fs-5xl)); margin: 0 0 var(--s-4); }
.catalog-hero__desc { color: var(--fg-2); max-width: 70ch; }

/* Brand hero -- brand catalog view (logo + blurb + badges) */
.brand-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-6);
  margin-bottom: var(--s-6);
  background: var(--bg-elev);
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
}
.brand-hero__logo {
  width: 96px; height: 96px;
  object-fit: contain;
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  padding: var(--s-3);
}
.brand-hero__body { display: grid; gap: var(--s-2); }
.brand-hero__name { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; font-size: var(--fs-2xl); letter-spacing: var(--ls-display); margin: 0; }
.brand-hero__blurb { color: var(--fg-2); margin: 0; max-width: 64ch; }
.brand-hero__badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
@media (max-width: 560px) {
  .brand-hero { grid-template-columns: 64px 1fr; padding: var(--s-5); }
  .brand-hero__logo { width: 64px; height: 64px; }
}

/* Pill badges used in brand/full/extended heros + cards */
.cat-badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
}
.cat-badge--first-party { background: var(--sol-lime-fog); color: var(--sol-forest); }
.cat-badge--distributor { background: var(--sol-cream); color: var(--sol-bark); }
.cat-badge--coa { background: var(--sol-lime); color: var(--brand-fg); }
.cat-badge--green  { background: var(--sol-lime-fog); color: var(--sol-success); }
.cat-badge--yellow { background: rgba(217, 164, 65, 0.16); color: var(--sol-warning); }
.cat-badge--age    { background: var(--bg-sunken); color: var(--fg-2); }

/* -------------------------------------------------------------------------
   4. SOURCED-FROM TOGGLE (the Extended-view switch)
   ------------------------------------------------------------------------- */
.sourced-toggle {
  display: inline-flex;
  padding: var(--s-1);
  gap: var(--s-1);
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  border: var(--bw-hair) solid var(--border);
}
.sourced-toggle__opt {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  padding: var(--s-2) var(--s-5);
  min-height: 40px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.sourced-toggle__opt[aria-pressed="true"],
.sourced-toggle__opt.is-active {
  background: var(--sol-lime);
  color: var(--brand-fg);
  box-shadow: var(--shadow-1);
}

/* -------------------------------------------------------------------------
   5. FILTER SIDEBAR GROUPS (facets)
   ------------------------------------------------------------------------- */
.facet {
  background: var(--bg-elev);
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.facet + .facet { margin-top: 0; }
.facet__title {
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--fg);
  margin: 0 0 var(--s-4);
  display: flex; align-items: center; justify-content: space-between;
}
.facet__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.facet__opt { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: var(--fg); cursor: pointer; }
.facet__opt input { width: 18px; height: 18px; accent-color: var(--sol-lime-deep); flex: none; }
.facet__count { margin-left: auto; font-size: var(--fs-xs); color: var(--fg-3); }

/* chips inside a facet (brand chips) reuse .chip from homepage; add a checked state */
.facet .chip { cursor: pointer; }
.facet .chip[aria-pressed="true"],
.facet .chip.is-active { background: var(--sol-lime); color: var(--brand-fg); border-color: var(--sol-lime); }

/* range slider (price / strength) */
.facet__range { display: grid; gap: var(--s-3); }
.facet__range input[type="range"] { width: 100%; accent-color: var(--sol-lime-deep); }
.facet__range-out { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--fg-2); }

/* ZIP / ships-to-state control */
.facet__zip { display: flex; gap: var(--s-2); }
.facet__zip .field { min-height: 40px; padding: var(--s-3); }

/* clear-all */
.facet-clear {
  background: none; border: 0; cursor: pointer;
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--sol-lime-deep);
}

/* mobile filter toggle button (sidebar collapses to a drawer trigger) */
.filter-toggle { display: none; }
@media (max-width: 1024px) {
  .filter-toggle {
    display: inline-flex; align-items: center; gap: var(--s-2);
    font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-caps);
    font-size: var(--fs-sm); min-height: 44px; padding: var(--s-3) var(--s-5);
    border: var(--bw-line) solid var(--border-strong); border-radius: var(--r-pill);
    background: var(--bg-elev); color: var(--sol-forest); cursor: pointer;
  }
  /* On mobile the sidebar is hidden until [data-open]; JS toggles it. */
  .catalog__sidebar[hidden] { display: none; }
}

/* -------------------------------------------------------------------------
   6. RESULTS TOOLBAR (count + active chips + sort)
   ------------------------------------------------------------------------- */
.catalog-toolbar {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  align-items: center; justify-content: space-between;
  margin-bottom: var(--s-5);
}
.catalog-toolbar__count { font-size: var(--fs-sm); color: var(--fg-2); }
.catalog-toolbar__count strong { color: var(--fg); }
.catalog-toolbar__right { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.catalog-sort {
  font-family: var(--ff-body); font-size: var(--fs-sm);
  min-height: 44px; padding: var(--s-2) var(--s-4);
  border: var(--bw-line) solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--fg);
}

/* active-facet chip row */
.active-facets { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.active-facets__chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--sol-lime-fog); color: var(--sol-forest);
  font-size: var(--fs-xs); font-weight: 700;
}
.active-facets__remove {
  border: 0; background: rgba(31,44,23,0.10); color: var(--sol-forest);
  width: 18px; height: 18px; border-radius: var(--r-pill); cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------------------
   7. CATALOG PRODUCT CARD EXTRAS
   (reuses .product-grid / .product-card from homepage.css; these add the
    distributor micro-label, legal badge, sunset note, and an add-to-cart row)
   ------------------------------------------------------------------------- */
.product-card__dist {
  position: absolute; top: var(--s-3); left: var(--s-3);
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-caps);
  background: rgba(246, 244, 236, 0.92); color: var(--sol-bark);
  padding: var(--s-1) var(--s-3); border-radius: var(--r-pill);
}
.product-card__legal {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-caps);
}
.product-card__legal--green  { color: var(--sol-success); }
.product-card__legal--yellow { color: var(--sol-warning); }
.product-card__sunset { font-size: var(--fs-2xs); color: var(--sol-warning); }
.product-card__actions { margin-top: var(--s-4); display: flex; gap: var(--s-2); }
.product-card__actions .btn { flex: 1; padding-inline: var(--s-4); }

/* -------------------------------------------------------------------------
   8. EMPTY STATE + PAGINATION
   ------------------------------------------------------------------------- */
.catalog-empty {
  text-align: center; padding: var(--s-9) var(--s-5);
  background: var(--bg-elev); border: var(--bw-hair) dashed var(--border-strong); border-radius: var(--r-lg);
}
.catalog-empty h3 { margin-bottom: var(--s-3); }
.catalog-empty p { color: var(--fg-2); }

.pagination {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  justify-content: center; margin-top: var(--s-8);
}
.pagination a, .pagination span {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 var(--s-3); border-radius: var(--r-sm);
  border: var(--bw-hair) solid var(--border); background: var(--bg-elev);
  color: var(--sol-forest); text-decoration: none; font-weight: 700;
}
.pagination a:hover { border-color: var(--border-strong); }
.pagination [aria-current="page"] { background: var(--sol-lime); color: var(--brand-fg); border-color: var(--sol-lime); }

/* -------------------------------------------------------------------------
   9. BRAND-STRIP (full-catalog house-brand chips) + INFO BANDS
   ------------------------------------------------------------------------- */
.brand-strip {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  margin-bottom: var(--s-6);
}

/* legal / compliance notice band used on YELLOW or cliff messaging */
.catalog-notice {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: rgba(217, 164, 65, 0.12);
  border: var(--bw-hair) solid rgba(217, 164, 65, 0.4);
  color: var(--sol-forest-deep);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-5);
}
.catalog-notice strong { color: var(--sol-warning); }
