/* ==========================================================================
   DJANS — listado de coleccion
   ========================================================================== */

.collection-head { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.collection-head__title { font-size: var(--step-4); line-height: 0.95; }
.collection-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.collection-head__blurb { max-width: 52ch; color: var(--ink-80); margin-top: 1rem; }

/* --- Pastillas de subcategoria ---------------------------------------- */

.pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.4rem;
  margin-bottom: 1.6rem;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  padding: 0.62em 1.25em;
  border: 1px solid var(--line);
  border-radius: 40px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.pill:hover { border-color: var(--ink); }
.pill.is-active { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* --- Barra de herramientas -------------------------------------------- */

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  background: var(--bone);
  border-block: 1px solid var(--line);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.toolbar__left, .toolbar__right { display: flex; align-items: center; gap: 1rem; }
.toolbar__count { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.select select {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  padding: 0.6em 2.4em 0.6em 1em;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease);
}
.select select:hover { border-color: var(--ink); }
.select svg { position: absolute; right: 0.9em; width: 11px; height: 11px; pointer-events: none; stroke: currentColor; fill: none; stroke-width: 1.8; }

.density { display: flex; gap: 4px; }
.density button {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.density button.is-active { color: var(--ink); border-color: var(--line); }
.density svg { width: 15px; height: 15px; fill: currentColor; }

.filter-toggle { display: none; }

/* --- Estructura ------------------------------------------------------- */

.shop {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(1.6rem, 3vw, 3.4rem);
  align-items: start;
  padding-bottom: var(--section);
}

.facets { position: sticky; top: calc(var(--header-h) + 78px); }
.facets__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.6rem; }
.facets__title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.facets__clear { font-size: 0.74rem; color: var(--muted); text-decoration: underline; }
.facets__clear:hover { color: var(--sale); }

.facet { border-top: 1px solid var(--line); }
.facet:last-child { border-bottom: 1px solid var(--line); }
/* Las facetas son <details>/<summary>: hay que quitar el marcador nativo. */
.facet__btn {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.05rem 0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: left;
}
.facet__btn::-webkit-details-marker { display: none; }
.facet__btn i {
  position: relative;
  width: 11px; height: 11px;
  flex: none;
}
.facet__btn i::before, .facet__btn i::after {
  content: '';
  position: absolute;
  background: currentColor;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.facet__btn i::before { top: 5px; left: 0; width: 11px; height: 1px; }
.facet__btn i::after { top: 0; left: 5px; width: 1px; height: 11px; }
.facet[open] .facet__btn i::after { transform: scaleY(0); opacity: 0; }
.facet__panel { padding-bottom: 1.2rem; display: grid; gap: 0.55rem; max-height: 260px; overflow-y: auto; }
.facet__panel::-webkit-scrollbar { width: 3px; }
.facet__panel::-webkit-scrollbar-thumb { background: var(--line); }

.check { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; font-size: 0.86rem; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  position: relative;
  flex: none;
  width: 15px; height: 15px;
  border: 1px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.check__box::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--bone);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.3s var(--ease);
}
.check:hover .check__box { border-color: var(--ink); }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__n { margin-left: auto; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.check.is-empty { opacity: 0.35; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip-size {
  min-width: 42px;
  padding: 0.5em 0.7em;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.chip-size input { position: absolute; opacity: 0; }
.chip-size:hover { border-color: var(--ink); }
.chip-size.is-on { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.color-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 0.7rem; }
.color-opt { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; font-size: 0.68rem; text-align: center; color: var(--muted); }
.color-opt input { position: absolute; opacity: 0; }
.color-opt .swatch { width: 26px; height: 26px; }
.color-opt.is-on { color: var(--ink); }
.color-opt.is-on .swatch::after { border-color: var(--ink); }

/* --- Rango de precio --------------------------------------------------- */

.range { padding-top: 0.4rem; }
.range__track {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
}
.range__track::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--line);
}
.range__fill {
  position: absolute;
  height: 2px;
  background: var(--ink);
}
.range input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
  height: 26px;
}
.range input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  pointer-events: auto;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bone);
  border: 1px solid var(--ink);
  cursor: grab;
  box-shadow: 0 1px 5px rgba(20, 17, 13, 0.25);
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bone);
  border: 1px solid var(--ink);
  cursor: grab;
}
.range__vals { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Filtros activos --------------------------------------------------- */

.active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.chip-active {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45em 0.5em 0.45em 0.85em;
  background: var(--bone-2);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  border-radius: 40px;
}
.chip-active button { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: var(--bone); font-size: 0.7rem; line-height: 1; }
.chip-active button:hover { background: var(--sale); }

/* --- Resultados -------------------------------------------------------- */

.results__foot { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; margin-top: clamp(2.5rem, 5vw, 4.5rem); }
.results__progress { width: min(280px, 60%); height: 2px; background: var(--line); }
.results__progress span { display: block; height: 100%; background: var(--ink); transition: width 0.6s var(--ease); }
.results__note { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; }

.empty { text-align: center; padding-block: clamp(3rem, 8vw, 6rem); }
.empty__title { font-family: var(--font-display); font-size: var(--step-3); margin-bottom: 0.8rem; }
.empty p { color: var(--muted); max-width: 42ch; margin: 0 auto 1.8rem; }

.skeleton { background: linear-gradient(100deg, var(--bone-2) 30%, var(--line-soft) 50%, var(--bone-2) 70%); background-size: 220% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -120% 0; } }

/* --- Adaptativo --------------------------------------------------------- */

@media (max-width: 1000px) {
  .shop { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .facets {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 92;
    width: min(360px, 90%);
    background: var(--bone);
    padding: 1.4rem var(--gut) 6rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.5s var(--ease);
    box-shadow: 30px 0 60px -40px rgba(20, 17, 13, 0.6);
  }
  .facets.is-open { transform: none; }
  .facets__mobile-foot {
    position: sticky;
    bottom: 0;
    margin: 1.5rem calc(var(--gut) * -1) 0;
    padding: 1rem var(--gut);
    background: var(--bone);
    border-top: 1px solid var(--line);
  }
}
.facets__mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
@media (min-width: 1001px) { .facets__mobile-foot, .facets__mobile-head { display: none; } }

@media (max-width: 720px) {
  .density { display: none; }
  .toolbar { gap: 0.6rem; }
  .toolbar__count { font-size: 0.74rem; }
  .select select { padding: 0.55em 2.1em 0.55em 0.8em; font-size: 0.74rem; }
}
