/* Reset de base */
.sfcc-promo-wrapper * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Importation de la police Lato */
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap");

.sfcc-promo-wrapper {
  font-family: "Lato", Arial, sans-serif;
}

/* Style de la bannière promotionnelle */
.sfcc-promo-wrapper .sfcc-bandeau-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: #ff9ee5;
  color: #000000 !important;
  font-size: 0.875rem;
  font-weight: 700;
}

/* S'assurer que le texte à l'intérieur de la bannière utilise la couleur sélectionnée */
.sfcc-promo-wrapper .sfcc-bandeau-promo * {
  color: #000000;
}

/* Cacher la checkbox tout en la gardant accessible */
.sfcc-promo-wrapper .promo-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Style de base pour la bannière promotionnelle (version mobile par défaut) */
.sfcc-promo-wrapper .promo-banner {
  width: 100%;
  background-color: #ffcc00; /* Fond jaune pour mobile */
  display: flex;
  align-items: center;
  justify-content: center; /* Centre par défaut */
  position: relative;
  overflow: hidden;
  height: auto; /* Hauteur automatique */
  min-height: 40px; /* Hauteur minimale */
}

.sfcc-promo-wrapper .promo-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 25px;
  position: relative;
  height: 100%;
}

.sfcc-promo-wrapper .promo-text {
  font-size: 13px; /* Taille en mobile */
  font-weight: 700; /* Bold */
  text-align: center;
  line-height: 1.2;
  max-width: 75%;
  transition: all 0.3s ease;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* Style du bouton (transformé en label) */
.sfcc-promo-wrapper .promo-button {
  background-color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Lato", Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  color: #333; /* Couleur par défaut */
  transition: all 0.01s linear;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.sfcc-promo-wrapper .promo-button:hover {
  background-color: #f5f5f5;
  color: #000 !important; /* Force le noir au survol */
}

.sfcc-promo-wrapper .promo-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: #000 !important; /* Force le noir à l'état actif */
}

/* Assurer que le bouton a toujours le texte noir peu importe le contexte */
.sfcc-promo-wrapper .promo-banner .promo-button,
.sfcc-promo-wrapper .sfcc-bandeau-promo .promo-button,
.sfcc-promo-wrapper .sfcc-bandeau-initial .promo-button {
  color: #000 !important; /* Force le noir dans tous les contextes */
}

/* Message de confirmation - complètement caché par défaut */
.sfcc-promo-wrapper .confirmation-message {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 15px;
  height: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, width 0.1s ease;
  color: inherit; /* Hérite de la couleur du texte parent */
  font-weight: 700;
  z-index: 5;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 0 12px;
  font-size: 13px;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

/* Éléments pour afficher le code promo */
.sfcc-promo-wrapper .code-mobile {
  display: inline;
}

.sfcc-promo-wrapper .code-desktop {
  display: none;
}

/* Styles pour l'icône check */
.sfcc-promo-wrapper .check-icon {
  margin-right: 4px;
  stroke: #4caf50;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
}

/* Animation de l'icône check */
@keyframes check-animation {
  from {
    stroke-dashoffset: 20;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.sfcc-promo-wrapper
  .promo-checkbox:checked
  ~ .confirmation-message
  .check-icon {
  animation: check-animation 0.5s forwards;
}

.sfcc-promo-wrapper sup {
  font-size: 10px;
  vertical-align: super;
  line-height: 0;
  top: 0 !important;
}

/* DESKTOP VERSION */
@media screen and (min-width: 960px) {
  .sfcc-promo-wrapper .promo-banner {
    background-color: #ff9ee5; /* Fond rose pour desktop */
    height: 45px;
    min-height: 45px;
  }

  .sfcc-promo-wrapper .promo-text {
    font-size: 22px;
    max-width: none;
    padding: 0;
  }

  .sfcc-promo-wrapper .code-mobile {
    display: none;
  }

  .sfcc-promo-wrapper .code-desktop {
    display: inline;
  }

  .sfcc-promo-wrapper .promo-button {
    position: static;
    padding: 8px 16px;
    margin-left: 15px;
  }

  /* État coché pour desktop */
  .sfcc-promo-wrapper .promo-checkbox:checked ~ .promo-button {
    opacity: 0;
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.01s linear;
  }

  .sfcc-promo-wrapper .promo-checkbox:checked ~ .confirmation-message {
    opacity: 1;
    visibility: visible;
    width: auto;
    overflow: visible;
    pointer-events: auto;
    position: static;
    transform: none;
    top: auto;
    margin-left: 10px;
    height: 30px;
    padding: 0 15px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    animation: bounce-in-desktop 0.5s ease forwards;
  }

  @keyframes bounce-in-desktop {
    0% {
      transform: scale(0.95);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  .sfcc-promo-wrapper
    .promo-checkbox:checked
    ~ .confirmation-message
    .check-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    visibility: visible;
    opacity: 1;
  }
}

/* MOBILE VERSION */
@media screen and (max-width: 959px) {
  /* Force le fond jaune sur mobile dans tous les états */
  .sfcc-promo-wrapper .sfcc-bandeau-promo,
  .sfcc-promo-wrapper .sfcc-bandeau-promo.promo-banner,
  .sfcc-promo-wrapper .sfcc-bandeau-promo.sfcc-success,
  .sfcc-promo-wrapper .sfcc-bandeau-initial,
  .sfcc-promo-wrapper .sfcc-bandeau-success {
    background-color: #ffcc00 !important;
    background-image: none !important;
  }

  /* Force tous les textes en noir sur mobile */
  .sfcc-promo-wrapper .sfcc-bandeau-promo,
  .sfcc-promo-wrapper .sfcc-bandeau-promo .promo-text,
  .sfcc-promo-wrapper .sfcc-bandeau-promo .confirmation-message,
  .sfcc-promo-wrapper .sfcc-bandeau-promo .tw-code-validation,
  .sfcc-promo-wrapper .sfcc-bandeau-success .confirmation-message,
  .sfcc-promo-wrapper .sfcc-success .confirmation-message,
  .sfcc-promo-wrapper .sfcc-bandeau-initial .promo-text,
  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-text,
  .sfcc-promo-wrapper .sfcc-success .promo-text,
  .sfcc-promo-wrapper .sfcc-promo-code,
  .sfcc-promo-wrapper .sfcc-bandeau-promo sup,
  .sfcc-promo-wrapper .promo-text sup {
    color: #000 !important;
  }

  /* Sélecteurs supplémentaires pour le message de confirmation en mobile */
  .sfcc-promo-wrapper .confirmation-message,
  .sfcc-promo-wrapper .promo-checkbox:checked ~ .confirmation-message,
  .sfcc-promo-wrapper .confirmation-message span,
  .sfcc-promo-wrapper .tw-code-validation,
  .sfcc-promo-wrapper .tw-code-validation span {
    color: #000 !important;
  }

  /* Force les icônes SVG en noir en mobile */
  .sfcc-promo-wrapper .check-icon,
  .sfcc-promo-wrapper .check-icon path,
  .sfcc-promo-wrapper .check-icon line,
  .sfcc-promo-wrapper .check-icon polyline,
  .sfcc-promo-wrapper .check-icon circle,
  .sfcc-promo-wrapper .confirmation-message .check-icon,
  .sfcc-promo-wrapper .sfcc-bandeau-success .check-icon,
  .sfcc-promo-wrapper .sfcc-success .check-icon,
  .sfcc-promo-wrapper
    .promo-checkbox:checked
    ~ .confirmation-message
    .check-icon,
  .sfcc-promo-wrapper svg[class*="check"],
  .sfcc-promo-wrapper .confirmation-message svg,
  .sfcc-promo-wrapper .tw-code-validation svg {
    stroke: #000 !important;
    fill: none !important;
    color: #000 !important;
  }

  /* Règle spécifique pour les éléments SVG */
  .sfcc-promo-wrapper svg * {
    stroke-width: 2px;
    stroke: #000 !important;
  }

  /* Remplacer la définition de l'icône check en mobile */
  .sfcc-promo-wrapper .sfcc-bandeau-success .check-icon,
  .sfcc-promo-wrapper .sfcc-success .check-icon {
    stroke: #000 !important;
    animation: check-animation 0.5s forwards;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-promo.promo-banner {
    height: auto !important;
    min-height: 40px;
    padding: 5px 0;
    justify-content: flex-start;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-initial,
  .sfcc-promo-wrapper .sfcc-bandeau-success {
    width: 100%;
    display: flex;
    align-items: center;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-initial .promo-content,
  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

  .sfcc-promo-wrapper .promo-content .promo-text {
    display: block;
    max-width: 65%;
    line-height: 1.3;
    word-spacing: -0.05em;
    text-align: left;
    margin-right: 8px;
    float: left;
  }

  .sfcc-promo-wrapper .promo-content .promo-button {
    float: right;
    margin-left: auto;
    padding: 4px 10px;
    height: 28px;
    flex-shrink: 0;
    min-width: 80px;
  }

  .sfcc-promo-wrapper sup {
    font-size: 8px;
    vertical-align: top;
    line-height: 1;
    position: relative;
    top: -1px;
    display: inline-block;
    margin-left: 1px;
  }

  .sfcc-promo-wrapper .mobile-plus:after {
    content: "\A";
    white-space: pre;
  }

  .sfcc-promo-wrapper .confirmation-message {
    font-size: 13px;
    right: 15px;
    padding: 0 10px;
    height: 28px;
  }

  /* État coché pour mobile */
  .sfcc-promo-wrapper .promo-checkbox:checked ~ .promo-text {
    opacity: 0;
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.01s linear;
  }

  .sfcc-promo-wrapper .promo-checkbox:checked ~ .promo-button {
    opacity: 0;
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.01s linear;
    background-color: transparent;
  }

  .sfcc-promo-wrapper .promo-checkbox:checked ~ .confirmation-message {
    opacity: 1;
    visibility: visible;
    width: auto;
    overflow: visible;
    pointer-events: auto;
    position: static;
    transform: none;
    right: auto;
    top: auto;
    margin: 0 auto;
    height: 28px;
    display: flex;
    align-items: center;
    animation: fade-in 0.3s ease forwards;
  }

  .sfcc-promo-wrapper .promo-content:has(.promo-checkbox:checked) {
    justify-content: center;
    align-items: center;
  }

  @keyframes fade-in {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  .sfcc-promo-wrapper .info-icon-container {
    display: flex; /* Visible uniquement en mobile */
    margin-left: 5px;
  }

  .sfcc-promo-wrapper .promo-content {
    justify-content: flex-start;
  }

  .sfcc-promo-wrapper .promo-text {
    text-align: left;
    margin-left: 0;
  }

  /* Correction de la position du sup qui est trop haut en mobile */
  .sfcc-promo-wrapper .promo-text sup {
    font-size: 9px;
    vertical-align: middle;
    position: relative;
    top: -4px !important;
    line-height: 0;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-initial .promo-content,
  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-content {
    justify-content: center;
    padding-left: 15px;
  }
}

/* Ajustements pour les très petits écrans */
@media screen and (max-width: 480px) {
  .sfcc-promo-wrapper .promo-text {
    font-size: 14px;
    max-width: 72%;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
  }

  .sfcc-promo-wrapper .promo-button {
    padding: 4px 8px;
    font-size: 13px;
    height: 28px;
  }

  .sfcc-promo-wrapper .confirmation-message {
    font-size: 12px;
    padding: 0 8px;
    height: 26px;
  }

  .sfcc-promo-wrapper .check-icon {
    width: 14px;
    height: 14px;
    margin-right: 5px;
  }
}

/* Styles pour les états de la bannière */
.sfcc-promo-wrapper .sfcc-bandeau-initial {
  display: flex;
  width: 100%;
}

.sfcc-promo-wrapper .sfcc-bandeau-success {
  display: none;
}

/* Quand la classe "sfcc-success" est présente */
.sfcc-promo-wrapper .sfcc-bandeau-promo.sfcc-success .sfcc-bandeau-initial {
  display: none;
}

.sfcc-promo-wrapper .sfcc-bandeau-promo.sfcc-success .sfcc-bandeau-success {
  display: flex;
  width: 100%;
}

/* Styles pour l'état success */
.sfcc-promo-wrapper .sfcc-bandeau-success .confirmation-message,
.sfcc-promo-wrapper .sfcc-success .confirmation-message,
.sfcc-promo-wrapper .tw-code-validation {
  display: flex;
  opacity: 1;
  visibility: visible;
  position: static;
  transform: none;
  width: auto;
  margin-left: 15px;
  padding: 0 12px;
  background-color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  border-radius: 16px;
  align-items: center;
  justify-content: flex-start;
  color: inherit; /* Hérite de la couleur du texte parent */
  font-weight: bold;
  height: 32px;
  overflow: visible;
  pointer-events: auto;
}

.sfcc-promo-wrapper .sfcc-bandeau-success .check-icon,
.sfcc-promo-wrapper .sfcc-success .check-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: middle;
  stroke: #007b4f;
  animation: check-animation 0.5s forwards;
}

/* Masquer bouton quand la promo est appliquée */
.sfcc-promo-wrapper .sfcc-bandeau-success .promo-button,
.sfcc-promo-wrapper .sfcc-success .promo-button {
  display: none;
}

/* Styles adaptés pour mobile et desktop */
@media screen and (max-width: 959px) {
  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-text,
  .sfcc-promo-wrapper .sfcc-success .promo-text {
    display: none;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-content,
  .sfcc-promo-wrapper .sfcc-success .promo-content {
    justify-content: center;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .confirmation-message,
  .sfcc-promo-wrapper .sfcc-success .confirmation-message,
  .sfcc-promo-wrapper .tw-code-validation {
    margin: 0 auto;
    font-size: 13px;
    padding: 0 10px;
    color: inherit; /* Hérite de la couleur du texte parent en mobile */
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .code-mobile,
  .sfcc-promo-wrapper .sfcc-success .code-mobile {
    display: inline;
  }
}

@media screen and (min-width: 960px) {
  .sfcc-promo-wrapper .sfcc-bandeau-success .confirmation-message,
  .sfcc-promo-wrapper .sfcc-success .confirmation-message,
  .sfcc-promo-wrapper .tw-code-validation {
    margin-left: 15px;
    font-size: 14px;
    color: inherit; /* Hérite de la couleur du texte parent en desktop */
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .promo-text,
  .sfcc-promo-wrapper .sfcc-success .promo-text {
    font-size: 22px;
    text-align: center;
    margin-right: 15px;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .code-desktop,
  .sfcc-promo-wrapper .sfcc-success .code-desktop {
    display: inline;
  }

  .sfcc-promo-wrapper .sfcc-bandeau-success .code-mobile,
  .sfcc-promo-wrapper .sfcc-success .code-mobile {
    display: none;
  }
}

/* Classe utilitaire essentielle */
.sfcc-promo-wrapper .sfcc-promo-code {
  font-weight: bold;
}

/* Styles de base utilitaires */
.sfcc-promo-wrapper .flex {
  display: flex;
}
.sfcc-promo-wrapper .flex-row {
  flex-direction: row;
}
.sfcc-promo-wrapper .items-center {
  align-items: center;
}
.sfcc-promo-wrapper .gap-8 {
  gap: 2rem;
}
.sfcc-promo-wrapper .pl-8 {
  padding-left: 2rem;
}
.sfcc-promo-wrapper .pr-4 {
  padding-right: 1rem;
}

/* Sans code */

.sfcc-promo-wrapper .sfcc-bandeau-initial .promo-content.sans-code {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.sfcc-promo-wrapper .sfcc-bandeau-initial .promo-content.sans-code .promo-text {
  text-align: center;
}

/* Style pour la deuxième ligne promo (secondary-promo) */
.sfcc-promo-wrapper .secondary-promo {
  height: auto;
  min-height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fond gris uniquement en desktop pour la deuxième ligne promo */
@media screen and (min-width: 960px) {
  .sfcc-promo-wrapper .desktop-gray {
    background-color: #929292 !important;
    height: 45px !important;
    min-height: 45px !important;
  }

  /* Centrage du contenu en desktop */
  .sfcc-promo-wrapper .secondary-promo .promo-content {
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 15px !important;
  }

  .sfcc-promo-wrapper .secondary-promo .promo-text {
    text-align: right !important;
    max-width: none !important;
    font-size: 22px !important;
    margin-right: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
  }

  /* Centrage vertical du message de confirmation */
  .sfcc-promo-wrapper .secondary-promo .confirmation-message.active {
    position: static !important;
    top: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    justify-content: flex-start !important;
  }
}

/* En mobile, masquer le texte principal de la deuxième ligne promo */
@media screen and (max-width: 959px) {
  .sfcc-promo-wrapper .secondary-promo {
    height: auto !important;
    min-height: 40px !important;
    padding: 5px 0 !important;
  }

  .sfcc-promo-wrapper .secondary-promo .promo-text {
    display: none !important;
  }

  .sfcc-promo-wrapper .secondary-promo .promo-content {
    justify-content: center !important;
    padding: 0 25px !important;
  }
}

/* Rendre l'icône check toujours visible dans la deuxième ligne promo */
.sfcc-promo-wrapper .secondary-promo .confirmation-message.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: auto !important;
  background-color: rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  height: 32px !important;
  align-items: center !important;
}

/* Ajustements pour garantir que l'icône check est visible */
.sfcc-promo-wrapper .secondary-promo .check-icon {
  stroke-dashoffset: 0 !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  margin-right: 5px !important;
  vertical-align: middle !important;
  stroke: #007b4f !important;
}

/* Ajustements spécifiques pour mobile */
@media screen and (max-width: 959px) {
  .sfcc-promo-wrapper .secondary-promo .confirmation-message.active {
    font-size: 13px !important;
    padding: 0 10px !important;
    height: 28px !important;
    margin: 0 auto !important;
  }

  .sfcc-promo-wrapper .secondary-promo .check-icon {
    width: 14px !important;
    height: 14px !important;
  }
}

/* Style pour l'icône d'information */
.sfcc-promo-wrapper .info-icon-container {
  display: none !important; /* Toujours caché par défaut */
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

/* Uniquement visible quand en mode app */
body.app-mode .sfcc-promo-wrapper .info-icon-container {
  display: flex !important;
  margin-right: 10px;
}

/* Ajustements spécifiques en mobile quand en mode app */
@media screen and (max-width: 959px) {
  body.app-mode .sfcc-promo-wrapper .info-icon-container {
    margin-left: 5px;
  }

  /* Autres styles mobile inchangés */
}

.sfcc-promo-wrapper .info-icon-container a {
  text-decoration: none;
  display: flex;
}

.sfcc-promo-wrapper .info-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
}

/* Ajustements pour mobile */
@media screen and (max-width: 959px) {
  .sfcc-promo-wrapper .promo-text {
    text-align: left;
    margin-left: 0;
  }
}
