/* VeganGo — category listing page.
   Built on the tokens and components in main.css: .wrap, .section, .pcard, .btn, .crumbs, .field.
   Nothing here overrides shared components; every rule is scoped to the listing page. */

/* ---------------------------------------------------------------- category band */
.cat-band {
  position: relative;
  isolation: isolate;
  background: var(--navy);
  overflow: hidden;
}
.cat-band-wash { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.cat-band-wash img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; opacity: .55; }
.cat-band::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(8, 29, 61, .97) 0%, rgba(8, 29, 61, .93) 38%, rgba(8, 29, 61, .66) 66%, rgba(8, 29, 61, .5) 100%),
    radial-gradient(120% 90% at 8% 110%, rgba(62, 156, 57, .38), transparent 62%);
}
.cat-band-glow {
  position: absolute;
  right: -6%;
  top: -34%;
  width: 46vw;
  height: 46vw;
  max-width: 720px;
  max-height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(142, 209, 79, .3), transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.cat-band-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: clamp(28px, 3.6vw, 64px);
  align-items: stretch;
  padding-block: clamp(30px, 4.4vw, 76px) clamp(36px, 4.8vw, 82px);
}
.cat-band-copy { display: grid; gap: 20px; align-content: center; }
.cat-band .crumbs { margin-bottom: 0; }
.cat-band h1 { font-size: clamp(2.6rem, 5vw, 5.2rem); }
.cat-band .lead { color: rgba(255, 255, 255, .88); }

.cat-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-stats li {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .95rem;
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
}
.cat-stats strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--lime); }

.chips ul { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  color: var(--navy);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.1;
  transition: background-color .25s, color .25s, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.chip:hover { background: var(--lime); color: var(--navy); transform: translateY(-2px); }

.band-figure { position: relative; margin: 0; width: 100%; display: grid; }
.band-figure .frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  min-height: 320px;
  max-height: var(--media-cap);
  box-shadow: var(--shadow);
}
.band-figure .frame img { width: 100%; height: 100%; object-fit: cover; }
.band-figure::before {
  content: '';
  position: absolute;
  inset: 20px -20px -20px 20px;
  border: 2px solid rgba(142, 209, 79, .7);
  border-radius: var(--radius);
  z-index: -1;
}
.band-stamp {
  position: absolute;
  left: -14px;
  bottom: 22px;
  max-width: 220px;
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--peach);
  color: var(--navy);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: var(--shadow-sm);
}
.band-stamp strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 60;
  background: rgba(255, 247, 236, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-block: 14px;
}
.toolbar-count { font-weight: 600; color: var(--muted); }
.toolbar-count strong { color: var(--navy); font-weight: 800; }
.applied {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 15px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-deep);
  font-weight: 700;
  font-size: .9rem;
}
.applied[hidden] { display: none; }
.applied button {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  transition: background-color .2s;
}
.applied button:hover { background: var(--green-deep); }
.toolbar-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.toolbar-filters { display: none; }
.toolbar-sort { display: flex; align-items: center; gap: 10px; }
.toolbar-sort label { color: var(--muted); font-weight: 600; white-space: nowrap; }
.toolbar-sort select { width: auto; padding: 10px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; }

/* ---------------------------------------------------------------- listing shell */
.listing {
  position: relative;
  background: var(--oat);
  padding-block: clamp(28px, 3vw, 52px) clamp(56px, 6vw, 104px);
  overflow: clip;
}
.listing-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 86% 4%, rgba(62, 156, 57, .12), transparent 60%),
    radial-gradient(60% 40% at 2% 62%, rgba(29, 91, 180, .1), transparent 62%),
    repeating-linear-gradient(135deg, rgba(14, 43, 87, .028) 0 2px, transparent 2px 13px);
}
.cat-layout {
  position: relative;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(24px, 2.4vw, 44px);
  align-items: start;
}
.cat-main { min-width: 0; }

/* ---------------------------------------------------------------- filters */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 68px);
  max-height: calc(100svh - var(--header-h) - 86px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.filters-scrollwrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.filters-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding-right: 10px;
}
/* A visible track, so it is obvious the list carries on below the fold of the panel. */
.filters-scroll::-webkit-scrollbar { width: 7px; }
.filters-scroll::-webkit-scrollbar-track { background: rgba(14, 43, 87, .07); border-radius: 7px; }
.filters-scroll::-webkit-scrollbar-thumb { background: rgba(14, 43, 87, .3); border-radius: 7px; }
.filters-scroll::-webkit-scrollbar-thumb:hover { background: rgba(14, 43, 87, .5); }
/* The panel holds more than one screen of options, so it scrolls inside itself.
   This fade sits at the foot of the visible area and says so. */
.filters-fade {
  position: absolute;
  left: 0;
  right: 17px;
  bottom: 0;
  height: 56px;
  background: linear-gradient(to top, #fff 22%, rgba(255, 255, 255, 0));
  pointer-events: none;
  transition: opacity .25s;
}
.filters-head { display: none; }
.filters-form {
  display: grid;
  gap: 4px;
  background: #fff;
  border-radius: var(--radius);
  padding: 6px 20px 20px;
  box-shadow: var(--shadow-sm);
}
.fgroup { border: 0; margin: 0; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.fgroup > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.01em;
  color: var(--navy);
}
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-right: 2.5px solid var(--navy);
  border-bottom: 2.5px solid var(--navy);
  transform: rotate(45deg);
  transition: transform .3s;
}
.fgroup[open] > summary::after { transform: rotate(-135deg); }
.fgroup-note { font-size: .86rem; color: var(--muted); margin-bottom: 10px; }
.fchecks { display: grid; gap: 2px; }
.fcheck {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  margin-inline: -8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .96rem;
  transition: background-color .2s;
}
.fcheck:hover { background: var(--oat); }
.fcheck input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.fcheck .box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid rgba(14, 43, 87, .28);
  background: #fff;
  position: relative;
  transition: background-color .2s, border-color .2s;
}
.fcheck .box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(42deg) scale(0);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.fcheck input:checked ~ .box { background: var(--green); border-color: var(--green); }
.fcheck input:checked ~ .box::after { transform: rotate(42deg) scale(1); }
.fcheck input:focus-visible ~ .box { outline: 3px solid var(--blue); outline-offset: 3px; }
.fcheck input:checked ~ .fcheck-name { font-weight: 700; }
.fcheck-count { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* price range */
.frange-out { font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.frange { position: relative; height: 34px; }
.frange-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 5px;
  border-radius: 5px;
  background: rgba(14, 43, 87, .14);
  display: block;
}
.frange-track i { position: absolute; top: 0; bottom: 0; background: var(--green); border-radius: 5px; left: 0; right: 0; }
.frange input[type="range"] {
  position: absolute;
  left: 0;
  top: 6px;
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}
.frange input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--green);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  pointer-events: auto;
}
.frange input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--green);
  cursor: grab;
  pointer-events: auto;
}
.frange input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--blue); outline-offset: 2px; }

.filters-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 6px; }
.filters-actions .btn { flex: 1 1 auto; }
#filtersApply { display: none; }

.filters-promo {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: stretch;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.filters-promo:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.filters-promo > img { width: 100%; height: 100%; min-height: 112px; object-fit: cover; }
.filters-promo-body { display: grid; align-content: center; gap: 5px; padding: 14px 16px; }
.filters-promo-title { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; line-height: 1.1; }
.filters-promo-note { font-size: .86rem; color: rgba(255, 255, 255, .82); line-height: 1.35; }
.filters-promo::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 8px;
  height: 8px;
  border-right: 2.4px solid var(--lime);
  border-top: 2.4px solid var(--lime);
  transform: rotate(45deg);
}

/* ---------------------------------------------------------------- product grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 22px);
  align-items: stretch;
}
.cat-grid > .pcard { min-width: 0; }
.no-results {
  margin-top: 28px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  color: var(--muted);
}
.no-results[hidden] { display: none; }
.promo.is-hidden { display: none; }

/* editorial promo tile inside the grid */
.promo {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
  isolation: isolate;
}
.promo-media { position: relative; overflow: hidden; background: var(--navy-deep); min-height: 200px; }
.promo-media img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.promo-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 29, 61, 0) 55%, rgba(8, 29, 61, .55) 100%);
}
.promo-body { display: grid; align-content: center; gap: 12px; justify-items: start; padding: clamp(20px, 2vw, 34px); }
.promo-meta { display: flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 700; color: var(--lime); }
.promo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); flex: none; }
.promo h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 1.7vw, 2rem); font-weight: 800; line-height: 1.06; letter-spacing: -.015em; }
.promo-body p:not(.promo-meta) { color: rgba(255, 255, 255, .84); font-size: .98rem; }
.promo .btn { margin-top: 6px; }
.promo:hover .promo-media img { transform: scale(1.05); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }

/* ---------------------------------------------------------------- pagination */
.pager { margin-top: clamp(32px, 3.4vw, 54px); display: grid; gap: 14px; justify-items: center; }
.pager ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 48px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  justify-content: center;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 1px 0 var(--line);
  transition: background-color .2s, color .2s, transform .2s;
}
.pager-link:hover { background: var(--mint); transform: translateY(-2px); }
.pager-link.is-current { background: var(--navy); color: #fff; }
.pager-next { background: var(--blue); color: #fff; }
.pager-next:hover { background: var(--blue-deep); color: #fff; }
.pager-gap { display: inline-grid; place-items: center; width: 34px; height: 48px; color: var(--muted); font-weight: 700; }
.pager-note { font-size: .9rem; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- popular row */
.popular {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--mint) 0%, #fff 62%);
  isolation: isolate;
}
.popular-texture { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.popular-texture img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; opacity: .34; }
.popular-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(228, 243, 220, .9) 0%, rgba(240, 249, 236, .72) 38%, rgba(255, 255, 255, .86) 100%),
    radial-gradient(60% 50% at 88% 10%, rgba(62, 156, 57, .16), transparent 62%);
}
.pop-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: clamp(12px, 1.4vw, 22px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}
.pop-row > * { scroll-snap-align: start; }
.pop-more {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: clamp(20px, 2vw, 32px);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--blue) 0%, var(--green) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
.pop-more:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.pop-more-ring { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.pop-more-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.05; }
.pop-more-note { font-size: .92rem; color: rgba(255, 255, 255, .85); font-weight: 600; }

/* scrim only exists for the mobile drawer */
.filters-scrim { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 1500px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .promo { grid-column: span 2; grid-row: span 2; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .promo-media::after { background: linear-gradient(180deg, rgba(8, 29, 61, 0) 55%, rgba(8, 29, 61, .5) 100%); }
}
@media (max-width: 1280px) {
  .cat-layout { grid-template-columns: 272px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
  .toolbar-filters { display: inline-flex; }
  .filters { position: static; max-height: none; display: block; }
  .filters-scrollwrap { display: block; }
  .filters-scroll { overflow: visible; padding: 0; }
  .filters-fade { display: none; }
  .filters-promo { margin-top: 14px; grid-template-columns: 200px minmax(0, 1fr); }
  .filters-promo > img { min-height: 130px; }

  /* With JS the sidebar becomes an off-canvas drawer. Without JS it stays in the flow. */
  html.js .filters {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(390px, 90vw);
    z-index: 130;
    background: var(--oat);
    padding: 0 18px 24px;
    max-height: none;
    display: flex;
    flex-direction: column;
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: 30px 0 60px -30px rgba(14, 43, 87, .6);
  }
  html.js .filters-scrollwrap { display: flex; flex: 1 1 auto; min-height: 0; }
  html.js .filters-scroll { overflow-y: auto; padding: 0 4px 0 0; }
  html.js .filters-promo { margin-top: 0; grid-template-columns: 104px minmax(0, 1fr); }
  html.js .filters-promo > img { min-height: 112px; }
  html.js .filters-fade { display: block; right: 4px; }
  html.js .filters.is-open { transform: none; visibility: visible; }
  html.js .filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding-block: 16px 12px;
    background: var(--oat);
    border-bottom: 1px solid var(--line);
  }
  html.js .filters-title { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }
  html.js .filters-close { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); }
  html.js .filters-scrim { display: block; position: fixed; inset: 0; z-index: 125; background: rgba(8, 29, 61, .5); backdrop-filter: blur(3px); opacity: 0; }
  html.js .filters-scrim[hidden] { display: none; }
  html.js #filtersApply { display: inline-flex; }
}
@media (max-width: 900px) {
  .cat-band-inner { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .band-figure { order: -1; }
  .band-figure .frame { width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 10; max-height: min(42vh, 360px); }
  .band-figure::before { inset: 14px -12px -12px 14px; }
  .band-stamp { left: 12px; bottom: 12px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promo { grid-column: span 2; grid-template-columns: minmax(0, 1fr); }
  .promo-media { min-height: 220px; height: clamp(200px, 30vh, 300px); }
  .promo-media::after { background: linear-gradient(180deg, rgba(8, 29, 61, 0) 55%, rgba(8, 29, 61, .5) 100%); }
  .toolbar-inner { padding-block: 11px; }
  .toolbar-sort label { display: none; }
}
@media (max-width: 640px) {
  .cat-band-inner { padding-block: 22px 30px; }
  .cat-band h1 { font-size: clamp(2.4rem, 11vw, 3.3rem); }
  .cat-stats li { font-size: .88rem; padding: 7px 13px; }
  .cat-stats strong { font-size: 1.05rem; }
  .chip { font-size: .88rem; padding: 9px 14px; }
  .cat-grid { gap: 10px; }
  .toolbar-count { font-size: .92rem; }
  .toolbar-tools { margin-left: 0; width: 100%; }
  .toolbar-sort { flex: 1 1 auto; }
  .toolbar-sort select { width: 100%; }
  .pager-link { min-width: 44px; height: 44px; padding: 0 13px; }
  .pop-row { grid-auto-columns: minmax(200px, 74vw); }
}
