/**
 * mac-nuancier-explorer.css — Bloc Builder générique "color_explorer"
 * Mission Nuancier immersif 180 teintes (2026-09-08)
 *
 * ── Refonte visuelle MAC PULSE V02 (2026-10-21, captures propriétaire) ──
 * Le fichier est passé de la charte « Minéral Direct » (--md-*) à l'identité
 * publique MAC PULSE V02 : jetons --mac-* (docs/charte/mac-pulse-v02), Sora /
 * Manrope, boutons pilule, focus cobalt 3 px. TOUS les sélecteurs et les
 * contrats DOM/JS sont conservés (mac-nuancier-explorer.js inchangé) — seul
 * l'habillage change. Priorité renforcée sur les CTA de la bannière
 * (.mac-ce__footer-cta a.mac-ce__btn) : les styles de liens génériques du
 * thème les écrasaient (CTA rendus en liens bleus au lieu de boutons).
 * Scopé sous .mac-ce (Color Explorer) — additif, zéro modification d'un
 * fichier existant.
 */

.mac-ce {
  --ce-gap: var(--mac-space-3, 12px);
  --ce-ink: #0F172A;
  --ce-paper: #FAFAF8;
  --ce-white: #FFFFFF;
  --ce-cobalt: #2563FF;
  --ce-turquoise: #00D1C1;
  --ce-corail: #FF6B6B;
  --ce-stone: #D1D5DB;
  --ce-muted: #475569;
  --ce-font-title: "MAC Sora", "Sora", Arial, sans-serif;
  --ce-font-body: "MAC Manrope", "Manrope", Arial, sans-serif;

  position: relative;
  max-width: var(--md-container-max, 1320px);
  margin: 0 auto;
  padding: var(--md-space-6, 48px) var(--md-gutter, 24px) var(--md-space-6, 48px);
  font-family: var(--ce-font-body);
  color: var(--ce-ink);
}

/* ── Barre outils : recherche + compteur ───────────────────────── */
.mac-ce__toolbar {
  display: flex;
  align-items: center;
  gap: var(--md-space-3, 16px);
  flex-wrap: wrap;
  margin-bottom: var(--md-space-4, 24px);
}
.mac-ce__search-wrap {
  position: relative;
  flex: 1 1 320px;
  max-width: 480px;
}
.mac-ce__search {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border: 1.5px solid var(--ce-stone);
  border-radius: 999px;
  font-family: inherit;
  font-size: .95rem;
  background: var(--ce-white);
  color: var(--ce-ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.mac-ce__search:focus-visible {
  outline: none;
  border-color: var(--ce-cobalt);
  box-shadow: 0 0 0 3px rgba(37, 99, 255, .18);
}
.mac-ce__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(15, 23, 42, .4);
  pointer-events: none;
}
.mac-ce__count {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ce-muted);
  white-space: nowrap;
}
.mac-ce__favorites-toggle {
  display: none; /* révélé en JS dès qu'il y a >=1 favori */
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ce-stone);
  background: var(--ce-white);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--ce-ink);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.mac-ce__favorites-toggle.is-active { background: var(--ce-ink); color: var(--ce-white); border-color: var(--ce-ink); }
.mac-ce__favorites-toggle:hover { border-color: var(--ce-cobalt); color: var(--ce-cobalt); }

/* ── Sélection découverte ──────────────────────────────────────── */
.mac-ce__discovery { margin-bottom: var(--md-space-7, 64px); }
.mac-ce__section-title {
  font-family: var(--ce-font-title);
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 700;
  margin: 0 0 var(--md-space-3, 16px);
  letter-spacing: -.01em;
}
.mac-ce__discovery-reset {
  display: inline-block;
  margin-top: var(--md-space-3, 16px);
  padding: 8px 16px;
  border: 1px solid var(--ce-stone);
  border-radius: 999px;
  background: transparent;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}
.mac-ce__discovery-reset:hover { background: var(--ce-stone); }
.mac-ce__discovery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--ce-gap);
}

/* ── Familles ───────────────────────────────────────────────────── */
.mac-ce__families {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: var(--md-space-4, 24px);
}
.mac-ce__families::-webkit-scrollbar { display: none; }
.mac-ce__family-chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ce-stone);
  background: var(--ce-white);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--ce-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms ease;
}
.mac-ce__family-chip:hover { border-color: var(--ce-ink); color: var(--ce-ink); }
.mac-ce__family-chip.is-active { background: var(--ce-ink); border-color: var(--ce-ink); color: var(--ce-white); }
.mac-ce__family-chip:focus-visible { outline: 3px solid var(--ce-cobalt); outline-offset: 3px; }

/* ── Mur de couleurs ────────────────────────────────────────────── */
.mac-ce__grid {
  display: grid;
  grid-template-columns: repeat(var(--ce-cols, 8), 1fr);
  gap: var(--ce-gap);
}
.mac-ce__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--md-space-7, 64px) var(--md-space-3, 16px);
  color: var(--ce-muted);
  font-size: .9375rem;
}

.mac-ce__card {
  position: relative;
  display: block;
  border: none;
  padding: 8px;
  background: var(--ce-white);
  border: 1px solid var(--ce-stone);
  cursor: pointer;
  text-align: left;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.mac-ce__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}
.mac-ce__card:focus-visible { outline: 3px solid var(--ce-cobalt); outline-offset: 3px; }
.mac-ce__swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  position: relative;
}
.mac-ce__card--discovery .mac-ce__swatch { aspect-ratio: 4 / 5; }
.mac-ce__card-info { padding: 8px 4px 4px; }
.mac-ce__card-name {
  font-family: var(--ce-font-title);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--ce-ink);
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mac-ce__card-ref {
  font-size: .6875rem;
  color: var(--ce-muted);
  font-weight: 600;
  margin: 2px 0 0;
  letter-spacing: .04em;
}
.mac-ce__card-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 180ms ease, background 180ms ease;
}
.mac-ce__card-fav:hover { transform: scale(1.1); background: var(--ce-white); }
.mac-ce__card-fav svg { width: 16px; height: 16px; stroke: var(--ce-ink); fill: none; stroke-width: 2; }
.mac-ce__card-fav.is-fav svg { fill: var(--ce-corail); stroke: var(--ce-corail); }
.mac-ce__card-compare {
  position: absolute;
  bottom: 14px;
  left: 14px;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
  backdrop-filter: blur(4px);
  cursor: pointer;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mac-ce__card-compare svg { width: 13px; height: 13px; stroke: var(--ce-ink); fill: none; stroke-width: 3; opacity: .55; }
.mac-ce__card-compare.is-selected {
  background: var(--ce-cobalt);
  border-color: var(--ce-cobalt);
}
.mac-ce__card-compare.is-selected svg { stroke: #fff; opacity: 1; }

/* ── Barre flottante Comparer ───────────────────────────────────── */
.mac-ce__compare-bar {
  position: sticky;
  bottom: var(--md-space-3, 16px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md-space-3, 16px);
  margin: var(--md-space-4, 24px) 0 0;
  padding: 14px 20px;
  background: var(--ce-ink);
  color: var(--ce-white);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .22);
}
.mac-ce__compare-bar-swatches { display: flex; gap: 6px; }
.mac-ce__compare-bar-swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .3); }
.mac-ce__compare-bar-cta {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--ce-turquoise);
  color: #062A27;
  font-family: inherit;
  font-weight: 700;
  font-size: .8125rem;
  cursor: pointer;
  white-space: nowrap;
}
.mac-ce__compare-bar-cta:hover { background: var(--ce-cobalt); color: #fff; }
.mac-ce__compare-bar-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .65);
  font-size: .75rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Focus teinte : drawer desktop / bottom-sheet mobile ───────── */
.mac-ce__backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .45);
  opacity: 0; transition: opacity 180ms ease;
}
.mac-ce__backdrop.is-open { opacity: 1; }

.mac-ce__focus {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 201;
  width: min(520px, 92vw);
  background: var(--ce-paper);
  box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(.16,1,.3,1);
}
.mac-ce__focus.is-open { transform: translateX(0); }

.mac-ce__focus-close {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: flex-end;
  padding: var(--md-space-3, 16px) var(--md-space-3, 16px) 0;
  background: linear-gradient(var(--ce-paper) 60%, transparent);
}
.mac-ce__focus-close button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--ce-stone);
  background: var(--ce-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mac-ce__focus-close button:focus-visible { outline: 3px solid var(--ce-cobalt); outline-offset: 3px; }
.mac-ce__focus-close svg { width: 16px; height: 16px; stroke: var(--ce-ink); stroke-width: 2; }

.mac-ce__focus-hero {
  height: 220px;
  margin: 0 var(--md-space-4, 24px) var(--md-space-4, 24px);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.mac-ce__focus-body { padding: 0 var(--md-space-4, 24px) var(--md-space-6, 48px); }
.mac-ce__focus-family {
  display: inline-block;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ce-cobalt);
  margin-bottom: 8px;
}
.mac-ce__focus-title {
  font-family: var(--ce-font-title);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.mac-ce__focus-ref { font-size: .8125rem; color: var(--ce-muted); font-weight: 600; margin: 0 0 var(--md-space-4, 24px); }
.mac-ce__focus-desc { font-size: .9375rem; line-height: 1.65; color: #334155; }
.mac-ce__focus-desc p { margin: 0 0 1em; }
.mac-ce__focus-desc p:last-child { margin-bottom: 0; }

.mac-ce__focus-actions { display: flex; flex-direction: column; gap: 10px; margin: var(--md-space-4, 24px) 0; }

/* ── Boutons — charte MAC PULSE V02 (pilule, action encre → survol cobalt,
      focus 3 px cobalt décalé de 3 px). Priorité renforcée sous
      .mac-ce__footer-cta (les styles de liens génériques du thème
      écrasaient ces boutons — CTA rendus en liens bleus). ────────────── */
.mac-ce .mac-ce__btn,
.mac-ce__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--ce-font-body); font-weight: 700; font-size: .875rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.mac-ce .mac-ce__btn:hover,
.mac-ce__btn:hover { transform: translateY(-1px); }
.mac-ce .mac-ce__btn:focus-visible,
.mac-ce__btn:focus-visible { outline: 3px solid var(--ce-cobalt); outline-offset: 3px; }
.mac-ce .mac-ce__btn--primary,
.mac-ce__btn--primary { background: var(--ce-ink); color: #fff; }
.mac-ce .mac-ce__btn--primary:hover,
.mac-ce__btn--primary:hover { background: var(--ce-cobalt); color: #fff; }
.mac-ce .mac-ce__btn--secondary,
.mac-ce__btn--secondary { background: var(--ce-cobalt); color: #fff; }
.mac-ce .mac-ce__btn--secondary:hover,
.mac-ce__btn--secondary:hover { background: var(--ce-ink); color: #fff; }
.mac-ce .mac-ce__btn--ghost,
.mac-ce__btn--ghost {
  background: transparent;
  color: var(--ce-ink);
  border: 1.5px solid var(--ce-stone);
}
.mac-ce .mac-ce__btn--ghost:hover,
.mac-ce__btn--ghost:hover { border-color: var(--ce-cobalt); color: var(--ce-cobalt); background: var(--ce-white); }
.mac-ce .mac-ce__btn--sm,
.mac-ce__btn--sm { padding: 9px 16px; font-size: .75rem; }
.mac-ce .mac-ce__btn[disabled],
.mac-ce__btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.mac-ce__focus-products { margin-top: var(--md-space-4, 24px); }
.mac-ce__focus-products h3, .mac-ce__focus-section-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ce-muted); margin: 0 0 10px;
}
.mac-ce__focus-product-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; background: var(--ce-white);
  border: 1px solid var(--ce-stone);
  margin-bottom: 8px; text-decoration: none; color: var(--ce-ink);
  font-size: .875rem; font-weight: 600;
}
.mac-ce__focus-product-item:hover { border-color: var(--ce-cobalt); color: var(--ce-cobalt); }

/* ── Comparaison ────────────────────────────────────────────────── */
.mac-ce__compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--md-space-3, 16px);
}
.mac-ce__compare-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--ce-white);
  border: 1px solid var(--ce-stone);
}
.mac-ce__compare-swatch { aspect-ratio: 1/1; position: relative; }
.mac-ce__compare-remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .92); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mac-ce__compare-info { padding: 10px 8px; }
.mac-ce__compare-info .mac-ce__card-name { white-space: normal; }
.mac-ce__compare-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ── Fin de page — sortie commerciale (bannière refondue PULSE V02) ──
   Markup figé : 3 × (p + a.mac-ce__btn). La hiérarchie se joue en CSS :
   la bannière devient une bande nuit dégradée avec halo cobalt, chaque
   item une carte translucide, le p un titre clair, le CTA une vraie
   pilule (blanche pleine pour l'action principale, fantômes pour les
   autres). Priorité renforcée pour battre les styles de liens du thème. */
.mac-ce .mac-ce__footer-cta,
.mac-ce__footer-cta {
  position: relative;
  overflow: hidden;
  margin-top: var(--md-space-6, 48px);
  padding: var(--md-space-8, 32px) var(--md-space-5, 24px);
  background: linear-gradient(135deg, #0F172A 0%, #142744 60%, #0F172A 100%);
  color: var(--ce-white);
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--md-space-4, 16px);
  text-align: center;
}
.mac-ce .mac-ce__footer-cta::before,
.mac-ce__footer-cta::before {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 255, .35), transparent 70%);
  pointer-events: none;
}
.mac-ce .mac-ce__footer-cta-item,
.mac-ce__footer-cta-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
}
.mac-ce .mac-ce__footer-cta-item p,
.mac-ce__footer-cta-item p {
  margin: 0;
  font-family: var(--ce-font-title);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ce-white);
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--primary,
.mac-ce__footer-cta a.mac-ce__btn--primary {
  background: var(--ce-white) !important;
  color: var(--ce-ink) !important;
  border-color: var(--ce-white) !important;
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--primary:hover,
.mac-ce__footer-cta a.mac-ce__btn--primary:hover {
  background: var(--ce-turquoise) !important;
  color: #062A27 !important;
  border-color: var(--ce-turquoise) !important;
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--secondary,
.mac-ce__footer-cta a.mac-ce__btn--secondary {
  background: rgba(37, 99, 255, .22) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .32) !important;
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--secondary:hover,
.mac-ce__footer-cta a.mac-ce__btn--secondary:hover {
  background: var(--ce-cobalt) !important;
  border-color: var(--ce-cobalt) !important;
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--ghost,
.mac-ce__footer-cta a.mac-ce__btn--ghost {
  background: transparent !important;
  color: var(--ce-white) !important;
  border: 1px solid rgba(255, 255, 255, .32) !important;
}
.mac-ce .mac-ce__footer-cta a.mac-ce__btn--ghost:hover,
.mac-ce__footer-cta a.mac-ce__btn--ghost:hover {
  border-color: var(--ce-turquoise) !important;
  color: var(--ce-turquoise) !important;
  background: transparent !important;
}

/* ── États d'accessibilité / a11y ──────────────────────────────── */
.mac-ce [hidden] { display: none !important; }
.mac-ce__sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1279px) {
  .mac-ce__grid { --ce-cols: 6; }
  .mac-ce__discovery-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 1023px) {
  .mac-ce { padding: var(--md-space-5, 32px) var(--md-space-3, 16px) var(--md-space-7, 64px); }
  .mac-ce__grid { --ce-cols: 4; }
  .mac-ce__discovery-grid { grid-template-columns: repeat(4, 1fr); }
  .mac-ce .mac-ce__footer-cta,
  .mac-ce__footer-cta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mac-ce__grid { --ce-cols: 2; gap: 10px; }
  .mac-ce__discovery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mac-ce__toolbar { flex-direction: column; align-items: stretch; }
  .mac-ce__count { text-align: right; }

  /* Bottom-sheet mobile — remplace le drawer latéral */
  .mac-ce__focus {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .2);
    transform: translateY(100%);
  }
  .mac-ce__focus.is-open { transform: translateY(0); }
  .mac-ce__focus::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    border-radius: 2px;
    background: rgba(15, 23, 42, .18);
    margin: 10px auto 0;
  }
  .mac-ce__compare-bar { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .mac-ce__grid { --ce-cols: 2; }
  .mac-ce__card-name { font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mac-ce__card, .mac-ce__focus, .mac-ce__backdrop, .mac-ce__btn { transition: none !important; }
}
