/* ============================================================
   CATALOG PAGE (v4)
   ============================================================ */
.catalog { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.catalog__wrap { padding: clamp(18px, 2.4vw, 30px) 0 clamp(60px, 8vw, 100px); }

/* breadcrumb + heading */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.crumb a:hover { color: var(--text); }
.crumb i { font-style: normal; opacity: .5; }
.crumb span { color: var(--text); }
.cathead { margin: 14px 0 clamp(18px, 2.4vw, 28px); }
.cathead__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.02; letter-spacing: -.01em; }
.cathead__sub { color: var(--muted); margin-top: 8px; font-size: .95rem; }

/* category chips + search on one row */
.catbar { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(16px, 2vw, 24px); }
.catbar .catchips { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.catbar .catsearch { flex: 0 0 clamp(240px, 26vw, 330px); }

/* category quick chips */
.catchips {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 4px; margin-bottom: clamp(16px, 2vw, 24px);
}
.catchips::-webkit-scrollbar { display: none; }
.catchip {
  flex: 0 0 auto; display: inline-flex; align-items: center; height: 38px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: 40px; font-size: 13px; font-weight: 500;
  color: var(--text-2); background: var(--surface);
  transition: background .25s, color .25s, border-color .25s;
}
.catchip:hover { border-color: var(--accent); color: var(--text); }
.catchip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* chips slider (mobile): shift one chip per scroll + dots below */
.catchips.is-paged { flex-direction: column; gap: 12px; overflow: visible; padding-bottom: 0; }
.catchips__row {
  position: relative; display: flex; gap: 10px; width: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.catchips__row::-webkit-scrollbar { display: none; }
.catchips.is-paged .catchip { scroll-snap-align: start; }
.catchips__dots { display: flex; justify-content: center; gap: 8px; }
.catchips__dots button { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background .3s, transform .3s; }
.catchips__dots button.is-active { background: var(--accent); transform: scale(1.35); }

/* toolbar */
.cattoolbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.filterbtn {
  display: none; align-items: center; gap: 9px; height: 44px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-weight: 600;
  letter-spacing: .04em; color: var(--text);
}
.filterbtn svg { width: 18px; height: 18px; }
.filterbtn em { font-style: normal; min-width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.catsearch {
  flex: 1; max-width: 440px; display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: border-color .25s;
}
.catsearch:focus-within { border-color: var(--accent); }
.catsearch > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.catsearch input { flex: 1; min-width: 0; border: none; background: none; font-family: var(--sans); font-size: 14px; color: var(--text); }
.catsearch input:focus { outline: none; }
.catsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.catsearch__clear { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); flex: none; }
.catsearch__clear:hover { background: var(--card); color: var(--text); }
.catsearch__clear svg { width: 13px; height: 13px; }
.cattoolbar__count { font-size: .9rem; color: var(--muted); margin-right: auto; white-space: nowrap; }
.cattoolbar__count b { color: var(--text); font-weight: 600; }
.sortsel { display: inline-flex; align-items: center; gap: 10px; }
.sortsel > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sortsel select {
  font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); height: 42px; padding: 0 34px 0 14px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2377736C' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.sortsel select:focus { outline: none; border-color: var(--accent); }

/* custom sort dropdown (site-styled) */
.cselect { position: relative; }
.cselect__btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  min-width: 176px; height: 42px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--text);
  transition: border-color .25s;
}
.cselect__btn .chev { opacity: .6; margin-bottom: 3px; transition: transform .3s var(--ease); }
.cselect.is-open .cselect__btn { border-color: var(--accent); }
.cselect.is-open .cselect__btn .chev { transform: rotate(-135deg); margin-bottom: -2px; }
.cselect__list {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 100%; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 22px 44px -22px rgba(20,18,15,.28); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.cselect.is-open .cselect__list { opacity: 1; visibility: visible; transform: none; }
.cselect__opt {
  padding: 10px 12px; border-radius: 4px; font-size: 13px; color: var(--text-2);
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.cselect__opt:hover { background: var(--card); color: var(--text); }
.cselect__opt.is-active { color: var(--accent); font-weight: 600; }

/* layout: sidebar + results */
.catlayout { display: grid; grid-template-columns: 264px 1fr; gap: clamp(24px, 3vw, 48px); align-items: start; margin-top: clamp(20px, 2.6vw, 32px); }

/* ---------- Filters ---------- */
.filters {
  position: sticky; top: 78px;
  max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;              /* Firefox: hide scrollbar */
}
.filters::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* WebKit: hide scrollbar */
.filters__head { display: none; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.filters__head span { font-size: 15px; font-weight: 700; }
.filters__x svg { width: 22px; height: 22px; }
.filters__body { display: flex; flex-direction: column; }
.filters__foot { display: none; }

.filters__active { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.filters__active:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px 0 12px;
  background: var(--card); border-radius: 40px; font-size: 12px; font-weight: 500; color: var(--text);
}
.chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); }
.chip button:hover { background: rgba(0,0,0,.08); color: var(--text); }
.chip svg { width: 12px; height: 12px; }

.fgroup { border-bottom: 1px solid var(--border-2); padding: 4px 0; }
.fgroup__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 2px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--text);
}
.fgroup__head .chev { transition: transform .3s var(--ease); }
.fgroup.is-collapsed .fgroup__head .chev { transform: rotate(-45deg); }
.fgroup__body { display: flex; flex-direction: column; gap: 2px; overflow: hidden; max-height: 420px; transition: max-height .35s var(--ease); padding-bottom: 12px; }
.fgroup.is-collapsed .fgroup__body { max-height: 0; padding-bottom: 0; }

/* checkbox option */
.fopt { display: flex; align-items: center; gap: 11px; padding: 8px 2px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.fopt:hover { color: var(--text); }
.fopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.fopt__box {
  flex: 0 0 auto; width: 18px; height: 18px; border: 1.5px solid var(--border); border-radius: 4px;
  display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.fopt__box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity .2s; }
.fopt input:checked + .fopt__box { background: var(--text); border-color: var(--text); }
.fopt input:checked + .fopt__box svg { opacity: 1; }
.fopt input:focus-visible + .fopt__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.fopt__name { flex: 1; }
.fopt__count { color: var(--muted); font-size: 12px; }

/* swatch options (color) */
.fswatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 2px 4px; }
.fswatch { position: relative; cursor: pointer; }
.fswatch input { position: absolute; opacity: 0; }
.fswatch__dot { display: block; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); transition: box-shadow .2s; }
.fswatch input:checked + .fswatch__dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* price */
.fprice { padding: 6px 2px 4px; }
.fprice__inputs { display: flex; align-items: center; gap: 10px; }
.fprice__field { flex: 1; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 10px; height: 42px; }
.fprice__field span { color: var(--muted); font-size: 13px; }
.fprice__field input { width: 100%; border: none; background: none; font-family: var(--sans); font-size: 14px; color: var(--text); }
.fprice__field input:focus { outline: none; }
.fprice__sep { color: var(--muted); }
.fprice__presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fpreset { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 40px; font-size: 12px; color: var(--text-2); transition: .2s; }
.fpreset:hover { border-color: var(--accent); }
.fpreset.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Results ---------- */
.results { min-height: 60vh; }
.results__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 2vw, 32px) clamp(12px, 1.2vw, 18px); }
.results__empty { text-align: center; padding: clamp(50px, 8vw, 90px) 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.results__more { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: clamp(34px, 4vw, 52px); }
.results__shown { font-size: .88rem; color: var(--muted); }
.results__more.is-done .btn { display: none; }

/* card price extras already styled in styles.css (.pcard) */
.pcard { animation: cardIn .5s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .results__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  /* filters become a slide-in drawer */
  .catlayout { grid-template-columns: 1fr; }
  .catbar { flex-wrap: wrap; }
  .catbar .catsearch { flex: 1 1 100%; }
  .filterbtn { display: inline-flex; }
  .cattoolbar__count { display: none; }
  .filters {
    position: fixed; inset: 0; z-index: 210; width: 100%; height: 100%; max-height: none;
    background: var(--surface); overflow: hidden;
    transform: translateX(-100%); transition: transform .4s var(--ease);
    display: flex; flex-direction: column;
  }
  .filters.is-open { transform: translateX(0); }
  .filters__head { display: flex; }
  .filters__body { flex: 1; overflow-y: auto; padding: 8px 20px; }
  .filters__foot { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
  .filters__foot .btn { flex: 1; justify-content: center; white-space: nowrap; padding: 0 16px; letter-spacing: .1em; }
  .filters__scrim {
    position: fixed; inset: 0; z-index: 205; background: rgba(20,18,15,.4);
    opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
  }
  .filters__scrim.is-open { opacity: 1; visibility: visible; }
}

@media (max-width: 640px) {
  .results__grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .cattoolbar { gap: 10px; }
  .sortsel > span { display: none; }
}

/* ============================================================
   Variant 2/3: controls without white fill — transparent + contour
   ============================================================ */
.catsearch,
.cselect__btn,
.filterbtn,
.catchip,
.fprice__field,
.sortsel select { background: transparent; }
