/* Biotech System — catalogue : page Catalogue, listes, cartes, filtres, recherche. */

/* ---------- Parcours de l'échantillon (page Catalogue) ---------- */
.catalog-workflow {
  padding: 48px 0;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.catalog-workflow .section-head {
  margin-bottom: 32px;
}

.catalog-workflow .section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 30px);
}

.catalog-workflow .section-lead {
  max-width: 720px;
  margin: 0;
  color: var(--color-muted);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.workflow-step__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.workflow-step__num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.workflow-step__title {
  margin: 0;
  font-size: 18px;
  color: var(--color-heading);
}

.workflow-step__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
}

.workflow-step__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.workflow-step__link {
  display: inline-block;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-heading);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color .2s, color .2s;
}

a.workflow-step__link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---------- Familles (page Catalogue) ---------- */
.catalog-family {
  padding: 48px 0;
}

.catalog-family:nth-of-type(even) {
  background: var(--color-bg-alt);
}

.catalog-family__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  align-items: center;
  margin-bottom: 24px;
}

.catalog-family__icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 26px;
}

.catalog-family__head h2 {
  margin: 0;
  font-size: 26px;
}

.catalog-family__head h2 a {
  color: var(--color-heading);
}

.catalog-family__head h2 a:hover {
  color: var(--color-accent);
}

.catalog-family__count {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

.catalog-family__intro {
  grid-column: 1 / -1;
  max-width: 760px;
  margin: 12px 0 0;
}

.catalog-family__empty {
  color: var(--color-muted);
  font-style: italic;
}

.term-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 20px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.term-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--color-heading);
  transition: transform .3s, box-shadow .3s;
}

.term-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  color: var(--color-accent);
}

.term-tile img,
.term-tile__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* Photos d'appareils sur fond blanc : affichées en entier, comme dans les cartes produits. */
.term-tile img {
  padding: 10px;
  background: #fff;
  object-fit: contain;
}

.term-tile__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #f1f4f8 0 12px, #e8edf3 12px 24px);
  color: var(--color-accent);
  font-size: 40px;
}

.term-tile__name {
  padding: 14px 16px 2px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.term-tile__count {
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--color-muted);
}

/* ---------- Recherche ---------- */
.search-page {
  padding-top: 32px;
}

.search-page__section {
  margin-top: 36px;
}

.search-page__section h2 {
  font-size: 22px;
}

.search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.search-list a {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.search-list p {
  margin: 4px 0 0;
}

.search-page__empty {
  margin-top: 32px;
}

.search-page__lead {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-heading);
}

.search-page .not-found__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  list-style: none;
}

/* ---------- Mise en page des listes ---------- */
.catalog-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  padding-top: 32px;
}

.catalog-intro__text {
  flex: 1 1 420px;
  max-width: 820px;
}

.catalog-intro__text > :last-child {
  margin-bottom: 0;
}

.catalog-intro__media {
  flex: 0 1 320px;
}

.catalog-intro__media img {
  border-radius: var(--radius);
}

/* Guide de la catégorie, sous les produits (texte après la balise « Lire la suite »). */
.catalog-guide {
  margin-top: 48px;
  padding-top: 8px;
  padding-bottom: 24px;
}

.catalog-guide > * {
  max-width: 820px;
}

.catalog-guide h2 {
  margin-top: 32px;
  font-size: 22px;
}

.catalog-guide h3 {
  margin-top: 20px;
  margin-bottom: 6px;
  font-size: 17px;
}

.catalog-guide li + li {
  margin-top: 6px;
}

.catalog-layout {
  display: grid;
  gap: 30px;
  padding-top: 32px;
}

@media (min-width: 992px) {
  .catalog-layout--filters {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}

/* ---------- Filtres ---------- */
.catalog-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.catalog-filters__title {
  margin: 0;
  font-size: 20px;
}

.catalog-filters__clear {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}

.facet {
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
}

.facet__title {
  margin-bottom: 8px;
  font-size: 15px;
}

.facet__options {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facet__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--color-text);
  font-size: 15px;
}

.facet__option::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid #8a94a3;
  border-radius: 3px;
  background: #fff;
}

.facet__option.is-active {
  font-weight: 500;
  color: var(--color-accent);
}

.facet__option.is-active::before {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

/* Coche dessinée en CSS dans la case active */
.facet__option.is-active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-62%) rotate(45deg);
}

.facet__option:hover {
  color: var(--color-accent);
}

.facet__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-muted);
}

.catalog-filters-open {
  padding: 8px 16px;
}

.catalog-filters-open__count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
}

.catalog-filters-open:hover .catalog-filters-open__count {
  background: #fff;
  color: var(--color-accent);
}

/* Sans JavaScript, les filtres restent affichés au-dessus des résultats. */
html:not(.js) .catalog-filters-open {
  display: none;
}

/* Tiroir des filtres sous 992 px (avec JavaScript) */
@media (max-width: 991.98px) {
  .js .catalog-filters {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 999;
    width: min(86vw, 340px);
    padding: 16px 20px 32px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .3s, visibility .3s;
  }

  .js .catalog-filters.is-open {
    transform: none;
    visibility: visible;
  }
}

@media (min-width: 992px) {
  .catalog-filters .drawer-close,
  .catalog-filters-open {
    display: none;
  }

  /* Colonne collante plus haute que l'écran (anticorps : 6 à 7 facettes) : elle défile elle-même. */
  .catalog-filters {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.catalog-results[aria-busy="true"] {
  opacity: .55;
  transition: opacity .2s;
}

.catalog-results__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-results__count {
  margin: 0;
  font-weight: 500;
  color: var(--color-muted);
}

.catalog-results__count:focus {
  outline: none;
}

.catalog-empty {
  padding: 40px 24px;
  border: 1px dashed #c9d0da;
  border-radius: var(--radius);
  text-align: center;
}

/* ---------- Cartes produits ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .1);
}

.product-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f8fafc;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform .4s;
}

.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-top: 1px solid var(--color-border);
}

.product-card__body p {
  margin: 0;
}

.product-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.product-card__term {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.product-card__title {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.product-card__title a {
  color: var(--color-heading);
}

.product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.product-card__title a:hover {
  color: var(--color-accent);
}

.product-card__title a:focus-visible {
  outline: none;
}

.product-card:has(.product-card__title a:focus-visible) {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.product-card__meta {
  font-size: 13px;
  color: var(--color-muted);
}

.product-card--antibody .product-card__meta.is-mono::before {
  content: "Clone ";
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-muted);
}

.product-card__refs {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
}

.product-card__refs .sku {
  padding: 2px 7px;
  border: 1px solid #d7dde6;
  border-radius: 3px;
  background: #f1f5f9;
  color: var(--color-heading);
  font-size: 12px;
  font-weight: 600;
}

.product-card__specs {
  display: grid;
  gap: 5px;
  margin: 4px 0 2px;
  padding: 8px 0 0;
  border-top: 1px dashed #e2e8f0;
  list-style: none;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text);
}

.product-card__specs li {
  position: relative;
  padding-left: 13px;
}

.product-card__specs li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
}

.product-card__availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto !important;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1d6b3a;
}

.product-card__availability::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.product-card__availability--sur-commande {
  color: #8a4b00;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
}

.product-card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-nav);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-heading);
  transition: color .2s;
}

.product-card:hover .product-card__more {
  color: var(--color-accent);
}

/* ---------- Replis d'image ---------- */
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(45deg, #f1f4f8 0 12px, #e8edf3 12px 24px);
  color: var(--color-accent);
  font-size: 44px;
}

/* Lame colorée H&E : noyaux à l'hématoxyline, cytoplasme à l'éosine (0 Ko d'image). */
.he-stain {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 22% 30%, var(--color-he-hematoxylin) 0 7px, transparent 8px),
    radial-gradient(circle at 60% 22%, var(--color-he-hematoxylin) 0 6px, transparent 7px),
    radial-gradient(circle at 78% 58%, #4b2f8f 0 8px, transparent 9px),
    radial-gradient(circle at 35% 70%, #4b2f8f 0 7px, transparent 8px),
    radial-gradient(circle at 50% 46%, #6a4bb0 0 6px, transparent 7px),
    radial-gradient(circle at 12% 80%, var(--color-he-hematoxylin) 0 6px, transparent 7px),
    radial-gradient(circle at 88% 20%, var(--color-he-hematoxylin) 0 6px, transparent 7px),
    radial-gradient(ellipse at 30% 40%, rgba(224, 69, 123, .6), transparent 45%),
    radial-gradient(ellipse at 70% 65%, rgba(224, 69, 123, .5), transparent 50%),
    radial-gradient(ellipse at 55% 25%, rgba(240, 150, 180, .65), transparent 55%),
    #f6dbe6;
}

.he-stain__label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  color: var(--color-he-hematoxylin);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
