/*
 * UX du comparateur (limite de 4 produits).
 * Complète .taxo-commands #comparer2 défini dans style.css (bandeau vert fixe).
 * À intégrer dans les sources SCSS du thème lors d'une prochaine recompilation.
 */

/* Bandeau : texte centré, qui peut passer sur deux lignes sur petit écran.
 * Vert assombri (#498310, même teinte que la charte #5EAA15) : contraste 4,63:1
 * avec le texte blanc (WCAG AA), contre 2,9:1 auparavant. */
.taxo-commands #comparer2 {
  background-color: #498310;
  align-items: center;
  padding: 0 16px;
  transition: background-color .2s ease;
}

.taxo-commands #comparer2 .compare-status {
  line-height: 1.2;
}

/* 1 seul produit : bandeau informatif, pas encore actionnable. */
.taxo-commands #comparer2.is-inactive {
  background-color: #5f6b58;
  cursor: default;
}

/* Message d'avertissement temporaire (5e produit, ou clic avec 1 seul produit). */
.taxo-commands #comparer2.is-warning {
  background-color: #b34700;
  cursor: default;
  animation: compare-shake .35s ease-in-out 1;
}

@keyframes compare-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .taxo-commands #comparer2.is-warning {
    animation: none;
  }
}

/* 4 produits cochés : les autres cases sont grisées (elles restent cliquables pour afficher le message). */
.compare-full .views-field-nid .comparer:not(:checked),
.compare-full .views-field-nid .comparer:not(:checked) + label {
  opacity: .45;
  cursor: not-allowed !important; /* products.css force cursor:pointer !important sur .views-field-nid * */
}

/* Jusqu'à 768px, la barre de navigation mobile (#block-footermobileproiconenav,
 * 67px, fixée en bas — cf. responsive.css) est affichée : le bandeau se place au-dessus
 * au lieu de la recouvrir. */
@media screen and (max-width: 768px) {
  .taxo-commands #comparer2 {
    bottom: 67px;
    /* Place réservée au bouton #back-to-top (50px, à droite) pour ne pas masquer le texte. */
    padding-right: 70px !important;
  }
}

@media (max-width: 767px) {
  .taxo-commands #comparer2 {
    font-size: 16px;
    height: auto;
    min-height: 50px;
    padding: 6px 12px;
  }
}
