/* Framedis — Roue de la fortune (popup)
   ──────────────────────────────────────────────────────────────────── */

/* ───── Popup containers ───── */
.fr-wheel-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--fr-font-sans, 'DM Sans', sans-serif);
}
.fr-wheel-popup.fr-wheel-open {
  display: flex;
  animation: fr-wheel-fadein 0.25s ease-out;
}
@keyframes fr-wheel-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fr-wheel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 46, 18, 0.72);
  backdrop-filter: blur(3px);
}

.fr-wheel-box {
  position: relative;
  background: #FAF7F0;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: fr-wheel-pop 0.3s cubic-bezier(0.2, 1.3, 0.5, 1);
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes fr-wheel-pop {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.fr-wheel-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #7A6A4A;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}
.fr-wheel-close:hover { color: #2A4A1E; }
.fr-wheel-close:focus { outline: none; }
.fr-wheel-close:focus-visible {
  outline: 2px solid #C07C2A;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ───── Étape intro (titre + roue + form) ───── */
.fr-wheel-title {
  font-size: 24px;
  font-weight: 700;
  color: #1A2E12;
  text-align: center;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.fr-wheel-sub {
  font-size: 14px;
  color: #5A5040;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 22px;
}

.fr-wheel-stage {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 24px;
}

/* Pointeur : petite flèche descendante en haut qui indique la case gagnante */
.fr-wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid #2A4A1E;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.fr-wheel-pointer::after {
  content: '';
  position: absolute;
  top: -28px;
  left: -14px;
  width: 28px;
  height: 28px;
  background: #C07C2A;
  border: 3px solid #2A4A1E;
  border-radius: 50%;
}

/* La roue en SVG — secteurs sans gaps, labels bien positionnés */
.fr-wheel-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: visible;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(42, 74, 30, 0.35));
}
/* Le groupe qui tourne (la rotation se fait en JS via style transform).
   transform-origin défini en pixels car le SVG utilise viewBox 0 0 200 200 */
.fr-wheel-rotator {
  transform-origin: 100px 100px;
  transition: transform 4.5s cubic-bezier(0.16, 0.95, 0.2, 1);
}

/* Hub central (DOM HTML en absolu au-dessus du SVG, pour pouvoir contenir
   du HTML libre admin : SVG, <img>, emoji, texte) */
.fr-wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: #F6F2EA;
  border: 4px solid #2A4A1E;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-size: 28px;
  line-height: 1;
  color: #2A4A1E;
  font-weight: 700;
  padding: 6px;
}
.fr-wheel-hub svg { display: block; max-width: 100%; max-height: 100%; }
.fr-wheel-hub img { display: block; max-width: 100%; max-height: 100%; }

/* Form */
.fr-wheel-form {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.fr-wheel-email {
  flex: 1 1 auto;
  min-width: 0;
  background: #FFFFFF;
  border: 1.5px solid #E5DCC4;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: #1A2E12;
  outline: none;
  transition: border-color 0.2s ease;
}
.fr-wheel-email::placeholder { color: #9E8E70; }
.fr-wheel-email:focus { border-color: #2A4A1E; }

.fr-wheel-spin {
  flex: 0 0 auto;
  background: #C07C2A;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.fr-wheel-spin:hover:not(:disabled) { background: #A0641E; transform: translateY(-1px); }
.fr-wheel-spin:disabled { opacity: 0.6; cursor: not-allowed; }

.fr-wheel-error {
  font-size: 13px;
  color: #C0392B;
  background: #FDEDEC;
  border: 1px solid #F5B7B1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  text-align: center;
}

.fr-wheel-legal {
  font-size: 11px;
  color: #9E8E70;
  text-align: center;
  letter-spacing: 0.02em;
}
.fr-wheel-legal a {
  color: #9E8E70;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.18s ease;
}
.fr-wheel-legal a:hover {
  color: #2A4A1E;
  text-decoration: underline;
}

/* ───── Étape résultat ───── */
.fr-wheel-step-result {
  text-align: center;
  padding: 20px 0 10px;
}
.fr-wheel-result-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}
.fr-wheel-result-title {
  font-size: 22px;
  font-weight: 700;
  color: #1A2E12;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.fr-wheel-result-sub {
  font-size: 14px;
  color: #5A5040;
  margin-bottom: 18px;
  line-height: 1.5;
}
.fr-wheel-result-code {
  background: #EAF2E3;
  border: 1.5px dashed #2A4A1E;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 auto 16px;
  max-width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.fr-wheel-result-code-label {
  font-size: 12px;
  font-weight: 600;
  color: #2A4A1E;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fr-wheel-result-code-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #1A2E12;
  letter-spacing: 1px;
}
.fr-wheel-result-copy {
  background: #2A4A1E;
  color: #F6F2EA;
  border: 0;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.fr-wheel-result-copy:hover { background: #1A2E12; }
.fr-wheel-result-copy.copied { background: #4E7C3A; }

.fr-wheel-result-hint {
  font-size: 12px;
  color: #7A6A4A;
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 0 12px;
}
.fr-wheel-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.fr-wheel-cta-signup {
  background: #C07C2A;
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.fr-wheel-cta-signup:hover {
  background: #A0641E;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.fr-wheel-cta-close {
  background: transparent;
  border: 1.5px solid #E5DCC4;
  color: #7A6A4A;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fr-wheel-cta-close:hover { border-color: #2A4A1E; color: #2A4A1E; }

/* ───── Bouton flottant rappel (logo qui tourne en bas-droite) ─────
   Apparait quand user a vu la popup mais pas encore soumis son email.
   Click → reouvre la popup. */
.fr-wheel-floating {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #2A4A1E;
  cursor: pointer;
  z-index: 9999;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(42, 74, 30, 0.32);
  animation: fr-wheel-floating-spin 6s linear infinite,
             fr-wheel-floating-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: box-shadow 0.2s ease, bottom 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  outline: none;
}
/* Sur fiche produit, quand le bandeau sticky "Ajouter au panier" est visible
   (toggle géré par product.tpl setVisible() → body.fr-sticky-cart-on),
   on remonte le bouton flottant pour qu'il ne chevauche pas le CTA. */
body#product.fr-sticky-cart-on .fr-wheel-floating {
  bottom: 95px;
}
.fr-wheel-floating:hover {
  animation-play-state: paused, paused;
  box-shadow: 0 10px 26px rgba(42, 74, 30, 0.45);
}
.fr-wheel-floating:focus-visible {
  outline: 3px solid #C07C2A;
  outline-offset: 3px;
}
.fr-wheel-floating img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
@keyframes fr-wheel-floating-spin {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}
@keyframes fr-wheel-floating-pop {
  from { opacity: 0; transform: scale(0.4) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mobile : un peu plus petit + decale du coin */
@media (max-width: 520px) {
  .fr-wheel-floating {
    width: 56px;
    height: 56px;
    bottom: 16px;
    right: 16px;
  }
  body#product.fr-sticky-cart-on .fr-wheel-floating {
    bottom: 80px;
  }
}

/* ───── Responsive ───── */
@media (max-width: 520px) {
  .fr-wheel-box { padding: 28px 20px 20px; border-radius: 16px; }
  .fr-wheel-title { font-size: 20px; }
  .fr-wheel-sub { font-size: 13px; }
  .fr-wheel-stage { width: 260px; height: 260px; }
  .fr-wheel-slice-label { font-size: 11px; width: 100px; }
  .fr-wheel-form { flex-direction: column; }
  .fr-wheel-spin { width: 100%; }
}
