/* ═══════════════════════════════════════════════════════════════════
   Sélection — flyout bottom + bouton produit + badge header
   ═══════════════════════════════════════════════════════════════════ */

/* ── Flyout container ─────────────────────────────────────────────── */

.mc-selection-flyout {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 800;
  width: min(520px, calc(100vw - 2rem));
  border-radius: var(--wp--custom--radius--lg) var(--wp--custom--radius--lg) 0 0;
  overflow: hidden;
  box-shadow: 0 -4px 32px rgba(10, 14, 26, 0.16);
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mc-selection-flyout.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* Replié : seule la barre de titre reste visible */
.mc-selection-flyout.is-visible.is-collapsed {
  transform: translateX(-50%) translateY(calc(100% - 52px));
  cursor: pointer;
}

/* ── Panel ────────────────────────────────────────────────────────── */

.mc-selection-flyout__panel {
  background: var(--wp--preset--color--blanc);
  padding: 0.875rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mc-selection-flyout__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mc-selection-flyout__panel-title {
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 700;
  color: var(--wp--preset--color--encre);
}

.mc-selection-flyout__panel-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.mc-selection-flyout__remaining {
  font-size: var(--wp--preset--font-size--xs);
  color: var(--wp--preset--color--gris-texte);
  white-space: nowrap;
}

/* Bouton Comparer (inline dans le head) */
.mc-selection-flyout__compare-btn {
  background: var(--wp--preset--color--violet);
  color: var(--wp--preset--color--blanc);
  border-radius: var(--wp--custom--radius--full);
  padding: 4px 12px;
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 200ms;
  flex-shrink: 0;
}

.mc-selection-flyout__compare-btn:hover {
  background: var(--wp--preset--color--violet-sombre);
  color: var(--wp--preset--color--blanc);
}

/* ── Vignettes ────────────────────────────────────────────────────── */

.mc-selection-flyout__items {
  display: flex;
  gap: 0.625rem;
}

.mc-selection-flyout__item {
  position: relative;
  flex: 1;
  max-width: calc((100% - 1.25rem) / 3);
  aspect-ratio: 1;
  border-radius: var(--wp--custom--radius--md);
  overflow: hidden;
  border: 2px solid var(--wp--preset--color--gris-moyen);
  background: var(--wp--preset--color--gris-clair);
}

.mc-selection-flyout__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mc-selection-flyout__item--empty {
  border-style: dashed;
  background: transparent;
}

.mc-selection-flyout__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: var(--wp--custom--radius--full);
  background: rgba(10, 14, 26, 0.55);
  color: var(--wp--preset--color--blanc);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 180ms;
}

.mc-selection-flyout__remove:hover {
  background: rgba(10, 14, 26, 0.8);
}

/* ── Badge icône header ───────────────────────────────────────────── */

.mc-header__action--selection {
  position: relative;
}

.mc-selection-header-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--wp--preset--color--violet);
  color: var(--wp--preset--color--blanc);
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--wp--custom--radius--full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── Tooltip header (< 2 produits) ───────────────────────────────── */

.mc-selection-header-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--wp--preset--color--encre);
  color: var(--wp--preset--color--blanc);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 500;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: var(--wp--custom--radius--md);
  pointer-events: none;
  z-index: 600;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mc-selection-header-tip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 14px;
  border: 5px solid transparent;
  border-bottom-color: var(--wp--preset--color--encre);
  border-top-width: 0;
}

.mc-selection-header-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Bouton sélection sur les cartes produit ─────────────────────── */

/* Position de référence pour le bouton absolu */
.products .product,
article.mc-product-grid__card {
  position: relative;
}

.mc-selection-btn-loop {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: var(--wp--custom--radius--full);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp--preset--color--teal);
  padding: 0;
  transition: background 180ms, transform 180ms, color 180ms;
  z-index: 10;
}

.mc-selection-btn-loop:hover {
  background: var(--wp--preset--color--blanc);
  transform: scale(1.08);
}

.mc-selection-btn-loop.is-selected {
  background: var(--wp--preset--color--teal);
  color: var(--wp--preset--color--blanc);
}

/* ── Bouton "Ajouter à ma sélection" (fiche produit) ─────────────── */

.mc-selection-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  background: transparent;
  border: 1.5px solid var(--wp--preset--color--teal);
  border-radius: var(--wp--custom--radius--full);
  color: var(--wp--preset--color--teal);
  font-family: var(--wp--preset--font-family--early-sans);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms, color 200ms;
}

.mc-selection-btn:hover,
.mc-selection-btn.is-selected {
  background: var(--wp--preset--color--teal);
  color: var(--wp--preset--color--blanc);
}

/* ── Responsive / accessibilité ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .mc-selection-flyout,
  .mc-selection-header-tip {
    transition: none;
  }
}
