/* ============================================================
 * Comparateur de panneaux des kits — lbs_kit_compare
 * Design « option 2 » : tableau compact, colonne du kit surlignée
 * en jaune, meilleures valeurs en vert avec couronne.
 * Couleurs alignées sur Advanced Pack (jaune #ffd221, gris #414141).
 * ============================================================ */

.lbs-cmp-open-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;   /* phrase puis bouton, calés à droite */
  gap: 16px;
  margin: 2px 16px 14px;
}

.lbs-cmp-open {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1.5px solid #1f1f1f;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lbs-cmp-open:hover,
.lbs-cmp-open:focus-visible {
  background: #ffd221;
  border-color: #ffd221;
}

.lbs-cmp-open__icon {
  font-size: 22px;
  line-height: 1;
}

/* Phrase d'accroche à gauche du bouton, suivie d'un trait vertical */
.lbs-cmp-open-hint {
  max-width: 280px;
  padding-right: 16px;
  border-right: 1px solid #d9d9d9;
  font-size: 12px;
  line-height: 1.4;
  color: #8a8a8a;
  text-align: right;
}

/* Bouton placé dans le contenu de l'option (déjà espacé par AP5) */
.lbs-cmp-open-wrap.lbs-cmp-open-wrap--in-panel {
  margin: 0 0 12px;
}

/* Téléphone : bouton compact et discret, à la taille des textes voisins,
   sans la phrase d'accroche */
@media (max-width: 575px) {
  .lbs-cmp-open-wrap {
    margin: 2px 12px 10px;
  }
  .lbs-cmp-open-wrap.lbs-cmp-open-wrap--in-panel {
    margin: 0 0 10px;
  }
  .lbs-cmp-open {
    gap: 6px;
    padding: 6px 12px;
    border-width: 1px;
    border-color: #cfcfcf;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
  }
  .lbs-cmp-open__icon {
    font-size: 18px;
  }
  .lbs-cmp-open-hint {
    display: none;
  }
}

/* Mise en évidence de l'option après un choix dans le comparatif */
.lbs-cmp-flash {
  animation: lbs-cmp-flash 1.6s ease-out;
}
@keyframes lbs-cmp-flash {
  0%, 30% { box-shadow: 0 0 0 3px #ffd221; }
  100% { box-shadow: 0 0 0 3px rgba(255, 210, 33, 0); }
}

/* ── Fenêtre ─────────────────────────────────────────────────── */

html.lbs-cmp-is-open,
html.lbs-cmp-is-open body {
  overflow: hidden;
}

.lbs-cmp {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 20, 0.5);
}
.lbs-cmp[hidden] {
  display: none;
}

.lbs-cmp__dialog {
  display: flex;
  flex-direction: column;
  width: max-content;
  max-width: min(1100px, 100%);
  max-height: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  color: #414141;
  outline: none;
  overflow: hidden;
}

.lbs-cmp__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 14px 32px;
}
.lbs-cmp__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #1f1f1f;
  text-transform: none;
}
.lbs-cmp__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: #6b6b6b;
}
.lbs-cmp__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1f1f1f;
  cursor: pointer;
}
.lbs-cmp__close:hover,
.lbs-cmp__close:focus-visible {
  background: #f2f2f2;
}

.lbs-cmp__scroll {
  flex: 1 1 auto;
  min-height: 0; /* permet le défilement interne dans la fenêtre (flex) */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 32px 22px;
}

/* ── Tableau ─────────────────────────────────────────────────── */

.lbs-cmp__table {
  /* Toute la largeur de la fenêtre : avec 2 panneaux, la fenêtre est réglée
     sur la longueur du sous-titre et le tableau s'étire au lieu de laisser
     un vide à droite. */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: #1f1f1f;
}
.lbs-cmp__table th,
.lbs-cmp__table td {
  padding: 15px 20px;
  border-bottom: 1px solid #ededed;
  text-align: center;
  vertical-align: middle;
  width: 210px;
  min-width: 190px;
}

/* 1re colonne figée : icône + libellé */
.lbs-cmp__table tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 220px;
  min-width: 200px;
  padding-left: 8px;
  background: #fff;
  text-align: left;
}
.lbs-cmp__crit {
  font-weight: 400;
  white-space: nowrap;
}
.lbs-cmp__crit > span {
  white-space: nowrap;
}
.lbs-cmp__icon {
  flex: none;
  margin-right: 12px;
  color: #7a7a7a;
  vertical-align: -3px;
}
.lbs-cmp__crit[title] {
  cursor: help;
}

/* En-tête : badge, photo, nom, technologie */
.lbs-cmp__table thead th,
.lbs-cmp__table thead td {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 12px;
}
.lbs-cmp__table thead td {
  z-index: 4;
}
.lbs-cmp__panel {
  font-weight: 400;
}
.lbs-cmp__badge-slot {
  height: 22px;
  margin-bottom: 6px;
}
.lbs-cmp__badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  background: #ffd221;
  color: #1f1f1f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lbs-cmp__img {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.lbs-cmp__img img {
  height: 100%;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}
.lbs-cmp__name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  color: #1f1f1f;
}
/* Colonne du panneau actuellement dans le kit : fond jaune pâle + liseré */
.lbs-cmp__table .is-current {
  background: #fffbea;
  box-shadow: inset 2px 0 0 #ffd221, inset -2px 0 0 #ffd221;
}
.lbs-cmp__table thead th.is-current {
  background: #fffbea;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 2px 0 0 #ffd221, inset -2px 0 0 #ffd221, inset 0 2px 0 #ffd221;
}
.lbs-cmp__table tfoot td.is-current {
  border-radius: 0 0 8px 8px;
  box-shadow: inset 2px 0 0 #ffd221, inset -2px 0 0 #ffd221, inset 0 -2px 0 #ffd221;
}

/* Infobulle « Technologie » : bouton en haut à droite de la case, comme la
   couronne des meilleures valeurs. */
.lbs-cmp td.has-tip {
  position: relative;
  padding-left: 26px;
  padding-right: 26px;   /* place réservée à l'icône : pas de chevauchement */
}
.lbs-cmp__tip-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1d6fd8;
  vertical-align: middle;
  cursor: pointer;
  touch-action: manipulation;
}
.lbs-cmp__tip-btn .material-icons {
  font-size: 17px;
  line-height: 1;
}
.lbs-cmp__tip-btn:hover,
.lbs-cmp__tip-btn:focus-visible,
.lbs-cmp__tip-btn[aria-expanded="true"] {
  background: #eef3fb;
}
.lbs-cmp__tooltip {
  position: fixed;
  box-sizing: border-box;
  z-index: 10060;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1f2937;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
}
.lbs-cmp__tooltip {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* Le thème impose sa propre taille de paragraphe : on la neutralise. */
.lbs-cmp__tooltip p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: inherit;
}
.lbs-cmp__tooltip p + p {
  margin-top: 6px;
}
.lbs-cmp__tooltip strong {
  color: #ffd221;
}

/* Valeurs */
.lbs-cmp__val {
  font-weight: 600;
}
.lbs-cmp__multi + .lbs-cmp__multi {
  margin-top: 3px;
}
.lbs-cmp__multi-label {
  margin-right: 6px;
  font-size: 12px;
  color: #7a7a7a;
}
.lbs-cmp__empty {
  color: #c2c2c2;
}

/* Meilleure valeur : fond vert, flèche, couronne + texte */
.lbs-cmp__table td.is-best,
.lbs-cmp__table td.is-best.is-current {
  background: #e6f6ea;
}
.lbs-cmp__table td.is-best .lbs-cmp__val {
  font-weight: 800;
}
.lbs-cmp__table td.is-best .lbs-cmp__val::before {
  content: "▲ ";
  font-size: 9px;
  color: #2e8b4e;
  vertical-align: 1px;
}
.lbs-cmp__table td.is-best {
  position: relative;
}
.lbs-cmp__best {
  position: absolute;
  top: 5px;
  right: 7px;
  line-height: 0;
}
/* Texte lu par les lecteurs d'écran uniquement */
.lbs-cmp__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Pied : boutons de choix */
.lbs-cmp__table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-bottom: 0;
  background: #fff;
  padding-top: 14px;
  padding-bottom: 12px;
}
.lbs-cmp__table tfoot td:first-child {
  z-index: 2;
}
.lbs-cmp__table tfoot td.is-current {
  background: #fffbea;
}
.lbs-cmp__btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 6px;
  background: #ffd221;
  color: #1f1f1f;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.lbs-cmp__btn:hover,
.lbs-cmp__btn:focus-visible {
  background: #f5c400;
}
.lbs-cmp__btn--done,
.lbs-cmp__btn--done:hover {
  background: #e3f3e6;
  color: #2e7d32;
  cursor: default;
}
.lbs-cmp__btn--done:focus {
  outline: none;
}

/* ── Vue tablette / téléphone (cartes + comparatif) ─────────── */
/* Sur ordinateur : uniquement le tableau. */

.lbs-cmp__pane--quick,
.lbs-cmp__qfoot {
  display: none;
}

@media (max-width: 1100px) {
  .lbs-cmp__pane--quick {
    display: block;
    padding-top: 2px;
  }
  .lbs-cmp__pane--detail {
    display: none;
  }
  .lbs-cmp__qfoot {
    display: flex;
    gap: 12px;
    padding: 12px 24px 16px;
    border-top: 1px solid #ededed;
    background: #fff;
  }

  /* Pas de zoom au double-toucher : des appuis rapides restent des clics */
  .lbs-cmp-q__arrow,
  .lbs-cmp-q__dot,
  .lbs-cmp-q__card,
  .lbs-cmp__qfoot .lbs-cmp__btn {
    touch-action: manipulation;
  }
  .lbs-cmp-q__tip[hidden] {
    display: none;
  }

  /* Cartes */
  .lbs-cmp-q__nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .lbs-cmp-q__arrow,
  .lbs-cmp-q__dots {
    display: none;
  }
  .lbs-cmp-q__cards {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(var(--lbs-cols, 3), minmax(0, 1fr));
    gap: 12px;
  }
  .lbs-cmp-q__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: #fff;
    color: #1f1f1f;
    font: inherit;
    text-align: center;
    cursor: pointer;
  }
  .lbs-cmp-q__card.is-focus:not(.is-current) {
    border-color: #1d6fd8;
    box-shadow: inset 0 0 0 1px #1d6fd8;
  }
  .lbs-cmp-q__card.is-current {
    border: 2px solid #ffd221;
    background: #fffbea;
  }
  .lbs-cmp-q__badge-slot {
    display: block;
    height: 22px;
    margin-bottom: 4px;
  }
  .lbs-cmp-q__img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    margin-bottom: 8px;
  }
  .lbs-cmp-q__img img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }
  .lbs-cmp-q__name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
  }
  .lbs-cmp-q__price {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
  }
  .lbs-cmp-q__price.is-best {
    color: #2e8b4e;
  }
  .lbs-cmp-q__price.is-best::before {
    content: "▲ ";
    font-size: 10px;
    vertical-align: 1px;
  }

  /* Mini-comparatif */
  .lbs-cmp-q__table {
    width: 100%;
    margin-top: 14px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: #1f1f1f;
  }
  .lbs-cmp-q__table th,
  .lbs-cmp-q__table td {
    padding: 10px 8px;
    border-bottom: 1px solid #ededed;
    vertical-align: middle;
  }
  .lbs-cmp-q__table th {
    width: 150px;
    font-weight: 400;
    text-align: left;
  }
  .lbs-cmp-q__table td {
    text-align: center;
  }
  .lbs-cmp-q__table td.is-current {
    background: #fffbea;
  }
  .lbs-cmp-q__table td.is-best {
    background: #e6f6ea;
  }
  .lbs-cmp-q__table td.is-best .lbs-cmp__val {
    font-weight: 800;
  }
  .lbs-cmp-q__table td.is-best .lbs-cmp__val::before {
    content: "▲ ";
    font-size: 9px;
    color: #2e8b4e;
    vertical-align: 1px;
  }

  .lbs-cmp-q__table .lbs-cmp__multi + .lbs-cmp__multi {
    margin-top: 3px;
  }

  /* Conseil */
  .lbs-cmp-q__tip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
    padding: 12px 14px;
    border: 1px solid #d6e6fb;
    border-radius: 8px;
    background: #eef5ff;
    color: #1f3b63;
    font-size: 13px;
    line-height: 1.4;
  }
  .lbs-cmp-q__tip-icon {
    flex: none;
    font-size: 22px;
    color: #1d6fd8;
  }

  /* Pied de la vue rapide */
  .lbs-cmp__qfoot .lbs-cmp__btn {
    flex: 1 1 0;
  }
  .lbs-cmp-q__state:not(.lbs-cmp__btn--done) {
    background: #f2f2f2;
    color: #414141;
  }
  .lbs-cmp-q__choose:disabled {
    opacity: 0.45;
    cursor: default;
  }
}

/* ── Tablette : cartes alignées sur les colonnes du comparatif ── */
/* La 1re colonne du tableau (libellés) fait 150 px : les cartes commencent
   après elle et chaque carte occupe exactement la largeur de sa colonne. */

@media (min-width: 768px) and (max-width: 1100px) {
  .lbs-cmp-q__table th {
    box-sizing: border-box;
    width: 150px;
  }
  .lbs-cmp-q__cards {
    gap: 0;
    margin-left: 150px;
  }
  .lbs-cmp-q__card {
    margin: 0 6px;
    min-width: 0;
  }
}

/* ── Tablette (768 – 1100 px) : fenêtre presque pleine largeur ── */

@media (min-width: 768px) and (max-width: 1100px) {
  .lbs-cmp {
    padding: 16px;
  }
  .lbs-cmp__dialog {
    width: 100%;
    max-width: none;
  }
  .lbs-cmp__header {
    padding: 18px 18px 12px 24px;
  }
  .lbs-cmp__scroll {
    padding: 0 20px 18px;
  }
  .lbs-cmp__icon {
    margin-right: 8px;
  }
  .lbs-cmp__btn {
    padding: 11px 8px;
    white-space: normal;
  }
}

/* ── Téléphone (≤ 767 px) ───────────────────────────────────── */
/* Plein écran, carrousel d'une carte (voisines visibles) et comparatif sur
   2 colonnes (libellé / valeur du panneau affiché). */

@media (max-width: 767px) {
  .lbs-cmp {
    padding: 0;
    align-items: stretch;
  }
  .lbs-cmp__dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .lbs-cmp__header {
    gap: 8px;
    padding: 14px 10px 10px 16px;
    border-bottom: 1px solid #ededed;
  }
  .lbs-cmp__title {
    font-size: 17px;
  }
  .lbs-cmp__subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
  }
  .lbs-cmp__scroll {
    padding: 0 8px;
    overflow-x: hidden;
  }

  .lbs-cmp__icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
  }
  .lbs-cmp__badge {
    padding: 2px 6px;
    font-size: 9px;
  }

  /* Carrousel : carte du panneau au centre, un bout des cartes voisines
     visible de chaque côté (derrière les flèches) pour montrer qu'on peut
     faire défiler. La bande glisse (translateX calculé en JS). */
  .lbs-cmp__pane--quick {
    padding: 12px 0 4px;
  }
  .lbs-cmp-q__nav {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0 -8px;          /* les cartes voisines vont jusqu'au bord */
    padding: 2px 0;
  }
  .lbs-cmp-q__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e3e3e3;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #1d6fd8;
    cursor: pointer;
    transform: translateY(-50%);
  }
  .lbs-cmp-q__arrow[hidden] {
    display: none;
  }
  .lbs-cmp-q__arrow--prev {
    left: 10px;
  }
  .lbs-cmp-q__arrow--next {
    right: 10px;
  }
  .lbs-cmp-q__cards {
    position: relative;
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease;
    will-change: transform;
  }
  .lbs-cmp-q__card {
    flex: 0 0 58%;
    max-width: none;
    margin: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .lbs-cmp-q__card:not(.is-focus) {
    opacity: 0.45;
    transform: scale(0.92);
  }
  .lbs-cmp-q__img {
    height: 80px;
  }
  .lbs-cmp-q__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
  }
  .lbs-cmp-q__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
  }
  .lbs-cmp-q__dot.is-active {
    background: #1d6fd8;
  }
  .lbs-cmp-q__table {
    table-layout: auto;
    margin-top: 10px;
  }
  .lbs-cmp-q__table th {
    width: auto;
    padding: 10px 4px;
  }
  .lbs-cmp-q__table td {
    padding: 10px 8px;
    text-align: right;
  }
  .lbs-cmp-q__table td:not(.is-focus) {
    display: none;
  }
  .lbs-cmp-q__table td.has-tip {
    padding-left: 8px;
    padding-right: 36px;
  }
  /* Icône ⓘ plus grande au doigt */
  .lbs-cmp__tip-btn {
    top: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
  }
  .lbs-cmp__tip-btn .material-icons {
    font-size: 21px;
  }
  /* Le balayage horizontal est géré par le script, le vertical par le navigateur */
  .lbs-cmp-q {
    touch-action: pan-y;
  }
  .lbs-cmp-q__table .lbs-cmp__multi-label {
    display: inline;
    margin-right: 6px;
    font-size: 11px;
  }
  .lbs-cmp-q__table .lbs-cmp__multi + .lbs-cmp__multi {
    margin-top: 3px;
  }
  .lbs-cmp-q__table td.is-current:not(.is-best) {
    background: transparent;
  }
  .lbs-cmp-q__tip {
    font-size: 12px;
    padding: 10px 12px;
  }
  .lbs-cmp__qfoot {
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .lbs-cmp__qfoot .lbs-cmp__btn {
    font-size: 13px;
    line-height: 1.2;
    padding: 11px 6px;
    white-space: normal;
  }
}
