/* ═══════════════════════════════════════════════════════════════════
   Module prix HT/TTC — toggle du header et bascule d'affichage
   ═══════════════════════════════════════════════════════════════════
   L'état par défaut de .mc-price-ht / .mc-price-ttc (TTC seul visible)
   vit dans global.css du thème : c'est le repli correct quand ce module
   est désactivé. Ce fichier ne porte que l'inversion et l'UI du toggle.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Bascule d'affichage des prix ──────────────────────────────── */

html.mc-prix-ht .mc-price-ht  { display: inline; }
html.mc-prix-ht .mc-price-ttc { display: none; }

/* ── Toggle HT/TTC — slider animé ────────────────────────────── */

.mc-ttc-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: var(--wp--custom--radius--full);
  padding: 3px;
  margin-inline: 4px;
}

/* Slider (pill blanche qui glisse) */
.mc-ttc-toggle__slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background-color: var(--wp--preset--color--blanc);
  border-radius: var(--wp--custom--radius--full);
  transition: transform var(--wp--custom--transition--spring);
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}

/* TTC actif (défaut) : slider à droite */
.mc-ttc-toggle__slider {
  transform: translateX(100%);
}

/* HT actif : slider à gauche */
html.mc-prix-ht .mc-ttc-toggle__slider {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .mc-ttc-toggle__slider {
    transition: none;
  }
}

.mc-ttc-toggle__btn {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--wp--preset--font-family--early-sans);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--wp--custom--radius--full);
  cursor: pointer;
  line-height: 1;
  min-height: 28px;
  transition: color var(--wp--custom--transition--base);
}

/* Texte sombre quand le slider blanc est dessous */
.mc-ttc-toggle__btn[aria-pressed="true"] {
  color: var(--wp--preset--color--teal-sombre);
}

.mc-ttc-toggle__btn:focus-visible {
  outline: 2px solid var(--wp--preset--color--corail-clair);
  outline-offset: 2px;
}

/* ── Responsive — mobile (< 640px) ─────────────────────────────── */

@media (max-width: 639px) {
  .mc-ttc-toggle {
    margin-inline: 0;
  }
}
