/* ==========================================================================
   TRENDHUB — collections, pages marques, recherche : bannière, filtres, tri
   ========================================================================== */

/* ---------- Bannière ---------- */
.collection-hero {
  position: relative;
}
.collection-hero__inner {
  display: grid;
  justify-items: start;
  gap: 1rem;
  padding-block: clamp(2rem, 1.5rem + 3vw, 4.5rem) clamp(1.75rem, 1.2rem + 2vw, 3rem);
}
.collection-hero__title {
  font: 400 clamp(3rem, 1.8rem + 6.4vw, 8.5rem) / 0.9 var(--f-serif);
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.collection-hero__text {
  max-width: 60ch;
  color: var(--c-muted);
}
.collection-hero--image {
  display: flex;
  align-items: flex-end;
  min-height: clamp(24rem, 64vh, 46rem);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.collection-hero--image .collection-hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.collection-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collection-hero--image .collection-hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.5) 100%);
}
.collection-hero--image .collection-hero__text {
  color: rgba(255, 255, 255, 0.86);
}
@media (prefers-reduced-motion: no-preference) {
  .collection-hero__title {
    animation: th-rise 1.1s var(--ease-out) 0.05s both;
  }
  .collection-hero__img {
    animation: th-hero-settle 2.4s var(--ease-out) both;
  }
}
@keyframes th-hero-settle {
  from {
    transform: scale(1.05);
  }
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.75;
}
.breadcrumb a {
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Barre de filtres ---------- */
.facets {
  padding-bottom: var(--space-section);
}
.facets__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.facets__open {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0;
  border: 0;
  background: none;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
}
.facets__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
.facets__count {
  display: none;
  font-size: var(--fs-sm);
  color: var(--c-muted);
  white-space: nowrap;
}
.facets__select {
  padding: 0.5rem 1.4rem 0.5rem 0;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='1.3'%3E%3Cpath d='M6.5 9.5l5.5 5.5 5.5-5.5'/%3E%3C/svg%3E")
    right center / 14px no-repeat;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
@media (min-width: 750px) {
  .facets__count {
    display: block;
  }
}

/* ---------- Groupes de filtres (tiroir sur mobile) ---------- */
.facet {
  border-bottom: 1px solid var(--c-line);
}
.facet__summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 0;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.facet__summary::-webkit-details-marker {
  display: none;
}
.facet__summary .icon {
  margin-left: auto;
  transition: transform 0.35s var(--ease-out);
}
.facet[open] > .facet__summary .icon {
  transform: rotate(180deg);
}
.facet__badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-ink);
  color: var(--c-bg);
  font-size: 10px;
  letter-spacing: 0;
}
.facet__panel {
  margin: 0;
  padding: 0 0 1.25rem;
  border: 0;
}
.facet__list {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.facet__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.facet__option input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid rgba(var(--c-ink-rgb), 0.4);
  border-radius: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.facet__option input:checked {
  background: var(--c-ink);
  border-color: var(--c-ink);
  box-shadow: inset 0 0 0 3px var(--c-bg);
}
.facet__option input:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 2px;
}
.facet__option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.facet__swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.facet__count {
  margin-left: auto;
  font-size: var(--fs-micro);
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}
.facet__price {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.facets__foot .facets__clear {
  justify-self: center;
}

/* ---------- Ordinateur : filtres en ligne, menus déroulants ---------- */
@media (min-width: 990px) {
  .facets__bar {
    z-index: 5;
  }
  .facets__open {
    display: none;
  }
  .facets-drawer {
    position: static;
    flex: 1;
    min-width: 0;
    visibility: visible;
    pointer-events: auto;
    transition: none;
  }
  .facets-drawer .panel__overlay,
  .facets-drawer .panel__head,
  .facets-drawer .panel__foot {
    display: none;
  }
  .facets-drawer .panel__box {
    position: static;
    display: block;
    width: auto;
    background: none;
    transform: none;
    transition: none;
  }
  .facets-drawer .panel__body {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2rem;
    padding: 0;
    overflow: visible;
  }
  .facet {
    position: relative;
    border: 0;
  }
  .facet__summary {
    padding: 0.9rem 0;
  }
  .facet__summary .icon {
    margin-left: 0.1rem;
  }
  .facet[open] > .facet__panel {
    position: absolute;
    top: 100%;
    left: -1.25rem;
    z-index: 20;
    min-width: 260px;
    max-height: 360px;
    overflow: auto;
    padding: 1rem 1.25rem;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    box-shadow: 0 24px 48px -28px rgba(17, 17, 17, 0.4);
    animation: th-pop 0.35s var(--ease-out);
  }
  .facet[open] > .facet__price {
    min-width: 320px;
  }
}

/* ---------- Filtres actifs ---------- */
.facets__active:empty {
  display: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  font-size: var(--fs-sm);
  text-decoration: none;
  border: 1px solid rgba(var(--c-ink-rgb), 0.25);
  transition: border-color 0.3s var(--ease);
}
.chip:hover {
  border-color: var(--c-ink);
}
th-facets {
  display: block;
}
th-facets.is-loading [data-region='results'] {
  opacity: 0.45;
  transition: opacity 0.2s var(--ease);
}

/* ---------- Recherche ---------- */
.search-head__form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 44rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--c-ink);
}
.search-head__input {
  flex: 1;
  min-width: 0;
  height: 3.5rem;
  padding: 0;
  font: 400 clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem) / 1 var(--f-serif);
  border: 0;
  background: none;
  outline: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.search-results-pages {
  display: grid;
  gap: 0.75rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}
.search-results-pages a {
  font: 400 1.35rem / 1.2 var(--f-serif);
  text-decoration: none;
}
