/**
 * Archive Matières Plastiques — Hybster
 * Fichier : css/archive-matiere-plastique.css
 * Style   : inspiré SpecialChem — sidebar familles + liste tabulaire compacte
 */

/* ══════════════════════════════════════════════════
   EN-TÊTE PAGE
══════════════════════════════════════════════════ */
.hx-arc-header {
  background: linear-gradient(135deg, #0055b1 0%, #003d82 100%);
  color: #fff;
  padding: 1.75rem 0 1.5rem;
}
.hx-arc-header__inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hx-arc-header__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  flex: 1;
}
.hx-arc-header__title span {
  font-size: 1rem;
  font-weight: 500;
  opacity: .75;
  margin-left: .75rem;
}
.hx-arc-header__cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #fff;
  color: #0055b1;
  font-size: .82rem;
  font-weight: 700;
  padding: .5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.hx-arc-header__cta:hover { background: #e8f0fb; }

/* ══════════════════════════════════════════════════
   BARRE DE FILTRES STICKY
══════════════════════════════════════════════════ */
.hx-arc-filters-bar {
  background: #fff;
  border-bottom: 1px solid #dde3ee;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hx-arc-filters-bar__inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* Champ recherche — hauteur alignée sur le toggle liste/grille */
.hx-arc-search {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: #f2f5fb;
  border: 1.5px solid #dde3ee;
  border-radius: 6px !important;
  padding: .28rem .7rem;
  min-width: 220px;
  height: 32px;
  box-sizing: border-box;
}
.hx-arc-search svg { color: #8895b0; flex-shrink: 0; }
.hx-arc-search input {
  border: none !important;
  background: transparent !important;
  font-size: .82rem;
  font-family: inherit;
  outline: none !important;
  width: 100%;
  color: #1a2540;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1;
  height: auto;
  -webkit-appearance: none;
  appearance: none;
}
.hx-arc-search input::placeholder { color: #a0adc4; }

/* Toggle vue — même hauteur que la recherche */
.hx-arc-view-toggle {
  display: flex;
  gap: .25rem;
  background: #f2f5fb;
  border: 1.5px solid #dde3ee;
  border-radius: 6px;
  padding: .2rem;
  height: 32px;
  box-sizing: border-box;
  align-items: center;
}
.hx-arc-view-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 4px;
  color: #8895b0;
  font-size: .75rem;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.hx-arc-view-toggle button.active,
.hx-arc-view-toggle button:hover { background: #fff; color: #0055b1; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Badges flags */
.hx-arc-flags {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-left: .25rem;
}
.hx-arc-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .6rem;
  border-radius: 6px;
  border: 1.5px solid #dde3ee;
  background: #fff;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  color: #5a6a8a;
  transition: all .15s;
  white-space: nowrap;
}
.hx-arc-flag-btn:hover { border-color: #0055b1; color: #0055b1; background: #f0f5ff; }
.hx-arc-flag-btn.active { background: #0055b1; color: #fff; border-color: #0055b1; }
.hx-arc-flag-btn input { display: none; }

/* Compteur + reset */
.hx-arc-count-wrap { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.hx-arc-count {
  font-size: .8rem;
  font-weight: 700;
  color: #0055b1;
  white-space: nowrap;
}
.hx-arc-reset {
  background: none;
  border: none;
  font-family: inherit;
  font-size: .78rem;
  color: #c62828;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
}
.hx-arc-reset:hover { background: #fff0f0; }
.hx-arc-reset[hidden] { display: none; }

/* ── Filtre Application ──────────────────────────────── */
.hx-arc-app-filter {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.hx-arc-app-filter__label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: #5a6a8a;
  white-space: nowrap;
}
#hx-arc-app-select {
  border: 1.5px solid #dde3ee !important;
  border-radius: 6px !important;
  background: #f2f5fb !important;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  color: #1a2540;
  padding: .32rem .6rem;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, background .15s;
  max-width: 220px;
  box-shadow: none !important;
  -webkit-appearance: auto;
  appearance: auto;
}
#hx-arc-app-select:hover,
#hx-arc-app-select:focus { border-color: #0055b1 !important; background: #fff !important; }
#hx-arc-app-select.hx-arc-app-select--active {
  border-color: #0055b1 !important;
  background: #0055b1 !important;
  color: #fff;
}

/* ══════════════════════════════════════════════════
   LAYOUT 2 COLONNES : sidebar + contenu
══════════════════════════════════════════════════ */
.hx-arc-layout {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ══════════════════════════════════════════════════
   SIDEBAR FAMILLES
══════════════════════════════════════════════════ */
.hx-arc-sidebar {
  position: sticky;
  top: 60px; /* sous la barre sticky */
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  padding: .75rem 0;
  scrollbar-width: thin;
}
.hx-arc-sidebar::-webkit-scrollbar { width: 4px; }
.hx-arc-sidebar::-webkit-scrollbar-track { background: #f2f5fb; }
.hx-arc-sidebar::-webkit-scrollbar-thumb { background: #c5cfe4; border-radius: 2px; }

.hx-arc-sidebar__title {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8895b0;
  padding: .25rem 1rem .5rem;
  margin: 0;
}
.hx-arc-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hx-arc-sidebar__item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 500;
  color: #2a3550;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .12s;
}
.hx-arc-sidebar__item a:hover {
  background: #f0f5ff;
  color: #0055b1;
  border-left-color: #0055b1;
}
.hx-arc-sidebar__item a.active {
  background: #e8f0fb;
  color: #0055b1;
  font-weight: 700;
  border-left-color: #0055b1;
}
.hx-arc-sidebar__count {
  background: #e8f0fb;
  color: #0055b1;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.hx-arc-sidebar__item a.active .hx-arc-sidebar__count { background: #0055b1; color: #fff; }

/* ══════════════════════════════════════════════════
   ZONE PRINCIPALE : blocs famille + liste
══════════════════════════════════════════════════ */
.hx-arc-main { min-width: 0; }

/* Section famille */
.hx-arc-family {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.hx-arc-family[hidden] { display: none; }

/* En-tête famille */
.hx-arc-family__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: #f8faff;
  border-bottom: 1px solid #dde3ee;
  cursor: pointer;
  user-select: none;
}
.hx-arc-family__head:hover { background: #eef3fc; }
.hx-arc-family__name {
  font-size: .9rem;
  font-weight: 800;
  color: #003d82;
  margin: 0;
  flex: 1;
}
.hx-arc-family__badge {
  background: #0055b1;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}
.hx-arc-family__toggle-ico {
  color: #8895b0;
  font-size: .75rem;
  transition: transform .2s;
  flex-shrink: 0;
}
.hx-arc-family--collapsed .hx-arc-family__toggle-ico { transform: rotate(-90deg); }
.hx-arc-family__desc {
  font-size: .78rem;
  color: #5a6a8a;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hx-arc-family__link {
  font-size: .75rem;
  font-weight: 600;
  color: #0055b1;
  text-decoration: none;
  white-space: nowrap;
  padding: .2rem .5rem;
  border-radius: 4px;
  border: 1px solid #c5d7f5;
  flex-shrink: 0;
}
.hx-arc-family__link:hover { background: #e8f0fb; }

/* Corps famille */
.hx-arc-family__body { }
.hx-arc-family--collapsed .hx-arc-family__body { display: none; }

/* Sous-famille */
.hx-arc-subfamily {
  border-top: 1px solid #eef1f8;
}
.hx-arc-subfamily__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1rem;
  background: #fafbff;
}
.hx-arc-subfamily__name {
  font-size: .78rem;
  font-weight: 700;
  color: #3a4a6a;
  margin: 0;
  flex: 1;
}
.hx-arc-subfamily__count {
  font-size: .65rem;
  font-weight: 600;
  color: #8895b0;
}
.hx-arc-subfamily[hidden] { display: none; }

/* ══════════════════════════════════════════════════
   TABLEAU DE MATIÈRES (vue liste)
══════════════════════════════════════════════════ */
.hx-arc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.hx-arc-table thead th {
  background: #f2f5fb;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8895b0;
  padding: .4rem .75rem;
  text-align: left;
  border-bottom: 1px solid #dde3ee;
  white-space: nowrap;
}
.hx-arc-table thead th:last-child { text-align: right; }

/* Lignes — zébrage une ligne sur deux */
.hx-arc-table tbody tr {
  border-bottom: 1px solid #eef1f8;
  transition: background .1s;
}
.hx-arc-table tbody tr:nth-child(even):not([hidden]) { background: #f7f9fd; }
.hx-arc-table tbody tr:last-child { border-bottom: none; }
.hx-arc-table tbody tr:hover { background: #e8f0fc !important; }
.hx-arc-table tbody tr[hidden] { display: none; }

.hx-arc-table td {
  padding: .45rem .75rem;
  vertical-align: middle;
  color: #1a2540;
}

/* Colonne sigle */
.hx-arc-td-sigle { width: 60px; }
.hx-arc-sigle {
  display: inline-block;
  background: #0055b1;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 3px;
  letter-spacing: .03em;
  white-space: nowrap;
}

/* Colonne nom */
.hx-arc-td-name { min-width: 180px; }
.hx-arc-name {
  font-weight: 600;
  color: #1a2540;
  text-decoration: none;
  font-size: .82rem;
  line-height: 1.3;
}
.hx-arc-name:hover { color: #0055b1; text-decoration: underline; }
.hx-arc-renforce {
  display: block;
  font-size: .7rem;
  color: #8895b0;
  font-weight: 400;
  margin-top: .05rem;
}

/* Colonne process */
.hx-arc-td-process { max-width: 150px; }
.hx-arc-process-txt {
  font-size: .72rem;
  color: #5a6a8a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 150px;
}

/* Colonne flags */
.hx-arc-td-flags { white-space: nowrap; }
.hx-arc-flag-ico { font-size: .85rem; cursor: default; }

/* Colonne scores mini */
.hx-arc-td-scores { width: 80px; }
.hx-arc-score-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hx-arc-score-bar-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.hx-arc-score-bar-lbl {
  font-size: .56rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a0adc4;
  width: 22px;
  flex-shrink: 0;
}
.hx-arc-score-bar-track {
  flex: 1;
  height: 4px;
  background: #e8ecf5;
  border-radius: 2px;
  overflow: hidden;
}
.hx-arc-score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5b8ff9, #0055b1);
  border-radius: 2px;
}

/* Colonne actions */
.hx-arc-td-actions { text-align: right; white-space: nowrap; }
.hx-arc-btn-fiche {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  color: #0055b1;
  border: 1.5px solid #c5d7f5;
  border-radius: 4px;
  text-decoration: none;
  transition: all .12s;
  background: #fff;
}
.hx-arc-btn-fiche:hover { background: #e8f0fb; border-color: #0055b1; }

.hx-arc-btn-compare {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: #0055b1;
  border: 1.5px solid #0055b1;
  border-radius: 4px;
  cursor: pointer;
  transition: all .12s;
  margin-left: .35rem;
  font-family: inherit;
}
.hx-arc-btn-compare:hover { background: #003d82; border-color: #003d82; }
.hx-arc-btn-compare.in-compare {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #81c784;
}
.hx-arc-btn-compare.in-compare:hover { background: #c8e6c9; }

/* ══════════════════════════════════════════════════
   VUE CARTES (alternative)
══════════════════════════════════════════════════ */
.hx-arc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  padding: .75rem;
}
/* Cartes — une carte sur deux légèrement grisée */
.hx-arc-card {
  position: relative;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  padding: .75rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.hx-arc-card:nth-child(even) { background: #f7f9fd; border-color: #e4eaf5; }
.hx-arc-card:hover {
  border-color: #0055b1;
  box-shadow: 0 4px 16px rgba(0,85,177,.1);
  transform: translateY(-1px);
}
.hx-arc-card[hidden] { display: none; }
.hx-arc-card-link {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  z-index: 0;
}
.hx-arc-card-header { position: relative; z-index: 1; }
.hx-arc-card-name {
  font-size: .82rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: #1a2540;
}
.hx-arc-card-name a { color: inherit; text-decoration: none; position: relative; z-index: 1; }
.hx-arc-card-name a:hover { color: #0055b1; }
.hx-arc-card-sub {
  font-size: .7rem;
  color: #8895b0;
  margin: .15rem 0 0;
}
.hx-arc-card-flags { display: flex; gap: .2rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hx-arc-card-footer {
  display: flex;
  gap: .35rem;
  margin-top: auto;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════
   MESSAGE AUCUN RÉSULTAT
══════════════════════════════════════════════════ */
.hx-arc-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #8895b0;
  grid-column: 1 / -1;
}
.hx-arc-empty[hidden] { display: none; }
.hx-arc-empty__icon { font-size: 2.5rem; margin-bottom: .75rem; }
.hx-arc-empty p { font-size: .9rem; margin-bottom: 1rem; }
.hx-arc-empty button {
  background: none;
  border: 1.5px solid #c5d7f5;
  color: #0055b1;
  font-family: inherit;
  font-size: .82rem;
  padding: .4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}
.hx-arc-empty button:hover { background: #e8f0fb; }

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hx-arc-layout {
    grid-template-columns: 1fr;
  }
  .hx-arc-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .5rem;
    background: #f2f5fb;
    border-radius: 8px;
  }
  .hx-arc-sidebar__title { width: 100%; padding: .25rem .5rem .15rem; }
  .hx-arc-sidebar__list { display: flex; flex-wrap: wrap; gap: .25rem; }
  .hx-arc-sidebar__item a {
    padding: .25rem .65rem;
    border-radius: 20px;
    border: 1.5px solid #dde3ee;
    border-left: 1.5px solid #dde3ee;
    background: #fff;
    font-size: .75rem;
  }
  .hx-arc-sidebar__item a.active { border-radius: 20px; border-left-color: #0055b1; }

  /* Masquer colonnes secondaires sur mobile */
  .hx-arc-td-process,
  .hx-arc-td-scores { display: none; }
  .hx-arc-table thead th.hx-th-process,
  .hx-arc-table thead th.hx-th-scores { display: none; }
}

@media (max-width: 600px) {
  .hx-arc-header__title { font-size: 1.1rem; }
  .hx-arc-filters-bar__inner { gap: .4rem; }
  .hx-arc-search { min-width: 0; flex: 1; }
  .hx-arc-flags { display: none; } /* masqué sur très petit écran */
  .hx-arc-layout { padding: .75rem; }
  .hx-arc-table { font-size: .75rem; }
  .hx-arc-table thead { display: none; }
  .hx-arc-table tbody tr { display: flex; flex-wrap: wrap; padding: .5rem .75rem; gap: .25rem; }
  .hx-arc-table tbody tr td { padding: 0; border: none; }
  .hx-arc-td-name { flex: 1 1 100%; }
  .hx-arc-td-sigle { order: -1; }
  .hx-arc-td-flags { flex: 1; }
  .hx-arc-td-actions { flex: 1; text-align: right; }
}

@media print {
  .hx-arc-filters-bar { display: none; }
  .hx-arc-sidebar { display: none; }
  .hx-arc-layout { grid-template-columns: 1fr; }
}
