/* Promotions — bouton WhatsApp flottant + choix magasin (même source que /magasins)
   Ciblage : .promotions-wa-float-wrap:not(.--bottom) (et non plus seulement --grid) pour
   rester compatible avec d’anciens déploiements où le wrap n’avait que promotions-wa-float-wrap. */
.promotions-wa-layout--has-wa {
  width: 100%;
}

@media (max-width: 767px) {
  /* Grille pleine largeur ; bouton fixe coin bas-droit (hors flux grille) */
  .promotions-wa-layout--has-wa {
    display: block;
  }

  .promotions-wa-layout--has-wa .promotions-wa-aside {
    position: static;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 10050;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) {
    position: static;
    pointer-events: none;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) .promotions-wa-float-btn {
    position: fixed;
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: none;
    margin: 0;
    pointer-events: auto;
    z-index: 10050;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) .promotions-wa-modal {
    pointer-events: auto;
  }
}

@media (min-width: 768px) {
  /*
   * Desktop : wrap fixe en colonne (bouton puis panneau). Pas de transform sur le wrap
   * → le panneau peut rester en flux (dropdown) sans overlay plein écran.
   */
  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) {
    position: fixed !important;
    left: auto !important;
    right: max(1.25rem, env(safe-area-inset-right)) !important;
    top: calc(50% - 1.75rem) !important;
    bottom: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    width: auto !important;
    height: auto !important;
    z-index: 10050 !important;
    pointer-events: none !important;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) .promotions-wa-float-btn {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) .promotions-wa-modal {
    pointer-events: auto;
  }

  .promotions-wa-float-wrap.promotions-wa-float-wrap--bottom {
    position: fixed !important;
    left: auto !important;
    right: max(1.25rem, env(safe-area-inset-right)) !important;
    top: calc(50% - 1.75rem) !important;
    bottom: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    width: auto !important;
    height: auto !important;
    z-index: 10050 !important;
    pointer-events: none !important;
  }

  .promotions-wa-float-wrap.promotions-wa-float-wrap--bottom .promotions-wa-float-btn {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .promotions-wa-float-wrap.promotions-wa-float-wrap--bottom .promotions-wa-modal {
    pointer-events: auto;
  }
}

/* Grands écrans : aligné sur le bord droit du container (--container-width), ~60px vers l’intérieur depuis la marge */
@media (min-width: 1200px) {
  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) {
    position: fixed !important;
    left: auto !important;
    right: max(
      1.25rem,
      calc(
        env(safe-area-inset-right) + (100vw - var(--container-width, 1200px)) / 2 - 60px
      )
    ) !important;
    top: calc(60% - 1.75rem) !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    z-index: 10050 !important;
    pointer-events: none !important;
  }

  .promotions-wa-float-wrap:not(.promotions-wa-float-wrap--bottom) .promotions-wa-float-btn {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .promotions-wa-float-wrap.promotions-wa-float-wrap--bottom {
    right: max(
      1.25rem,
      calc(
        env(safe-area-inset-right) + (100vw - var(--container-width, 1200px)) / 2 - 60px
      )
    ) !important;
    top: calc(60% - 1.75rem) !important;
  }
}

.promotions-wa-float-wrap {
  position: relative;
}

/* Mobile : variant sans visuels — même coin bas-droit que la grille */
@media (max-width: 767px) {
  .promotions-wa-float-wrap--bottom .promotions-wa-float-btn {
    position: fixed;
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: none;
    z-index: 10050;
  }
}

.promotions-wa-float-btn {
  position: fixed;
  left: auto;
  right: auto;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10050;
  width: 3.5rem;
  height: 3.5rem;
  min-width: 48px;
  min-height: 48px;
  border: none;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  animation: promotions-wa-float-breathe 2.2s ease-in-out infinite;
}

.promotions-wa-float-btn svg {
  position: relative;
  z-index: 1;
  transform-origin: center center;
  animation: promotions-wa-icon-pulse 2.4s ease-in-out infinite;
}

.promotions-wa-float-btn::before,
.promotions-wa-float-btn::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.5);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.promotions-wa-float-btn::before {
  animation: promotions-wa-float-ring 2.2s ease-out infinite;
}

.promotions-wa-float-btn::after {
  border-color: rgba(255, 255, 255, 0.35);
  animation: promotions-wa-float-ring 2.2s ease-out infinite;
  animation-delay: 1.1s;
}

@keyframes promotions-wa-float-breathe {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }
  33% {
    transform: scale(1.06) rotate(-1.5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
  66% {
    transform: scale(1.08) rotate(1.5deg);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  }
}

@keyframes promotions-wa-icon-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes promotions-wa-float-ring {
  0% {
    transform: scale(0.88);
    opacity: 0.65;
  }
  55% {
    opacity: 0.18;
  }
  100% {
    transform: scale(1.48);
    opacity: 0;
  }
}

.promotions-wa-float-btn:hover {
  animation-play-state: paused;
  transform: scale(1.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  background: #20bd5a;
  color: #fff;
}

.promotions-wa-float-btn:hover::before,
.promotions-wa-float-btn:hover::after {
  animation-play-state: paused;
  opacity: 0;
}

.promotions-wa-float-btn:hover svg {
  animation-play-state: paused;
}

.promotions-wa-float-btn:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 3px;
  animation-play-state: paused;
}

.promotions-wa-float-btn:focus-visible::before,
.promotions-wa-float-btn:focus-visible::after {
  animation-play-state: paused;
  opacity: 0;
}

.promotions-wa-float-btn:focus-visible svg {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .promotions-wa-float-btn,
  .promotions-wa-float-btn::before,
  .promotions-wa-float-btn::after,
  .promotions-wa-float-btn svg {
    animation: none;
  }

  .promotions-wa-float-btn::before,
  .promotions-wa-float-btn::after {
    display: none;
  }
}

/* Mobile seulement : overlay plein écran → éviter le scroll de fond */
@media (max-width: 767px) {
  html.promotions-wa-modal-open {
    overflow: hidden;
  }
}

.promotions-wa-modal[hidden] {
  display: none !important;
}

.promotions-wa-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@media (min-width: 480px) {
  .promotions-wa-modal:not([hidden]) {
    align-items: center;
  }
}

/* Desktop : panneau sous le FAB (dropdown), page toujours visible, pas de voile */
@media (min-width: 768px) {
  .promotions-wa-modal:not([hidden]) {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: min(26rem, calc(100vw - 2rem));
    max-width: min(26rem, calc(100vw - 2rem));
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
    pointer-events: auto !important;
    z-index: 10060;
  }

  .promotions-wa-modal:not([hidden]) .promotions-wa-modal__backdrop {
    display: none !important;
  }

  .promotions-wa-modal:not([hidden]) .promotions-wa-modal__list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }

  .promotions-wa-modal:not([hidden]) .promotions-wa-store-btn {
    min-width: 0;
  }
}

@keyframes promotions-wa-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.promotions-wa-modal__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(199, 1, 3, 0.5) 0%,
    rgba(120, 2, 8, 0.58) 45%,
    rgba(74, 0, 6, 0.62) 100%
  );
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.promotions-wa-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  max-height: min(85vh, 32rem);
  overflow: auto;
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
  padding: 1.25rem 1.25rem 1.5rem;
  animation: promotions-wa-slide-up 0.22s ease-out;
}

@media (min-width: 480px) {
  .promotions-wa-modal__panel {
    border-radius: 1rem;
    animation: promotions-wa-fade-in 0.2s ease-out;
  }
}

@media (min-width: 768px) {
  .promotions-wa-modal:not([hidden]) .promotions-wa-modal__panel {
    width: 100%;
    max-width: none;
    max-height: min(70vh, 28rem);
    border-radius: 1rem;
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.2);
    animation: promotions-wa-dropdown-in 0.22s ease-out;
  }

  @media (prefers-reduced-motion: reduce) {
    .promotions-wa-modal:not([hidden]) .promotions-wa-modal__panel {
      animation: none;
    }
  }
}

@keyframes promotions-wa-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0.85;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes promotions-wa-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.promotions-wa-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.promotions-wa-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text, #0f172a);
}

.promotions-wa-modal__close {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text, #334155);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promotions-wa-modal__close:hover {
  background: rgba(148, 163, 184, 0.28);
}

.promotions-wa-modal__sub {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted, #64748b);
}

/* Une colonne seulement sur mobile ; le ≥768px définit la grille 2 colonnes plus haut. */
@media (max-width: 767px) {
  .promotions-wa-modal__list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
}

.promotions-wa-store-btn {
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.promotions-wa-store-btn:hover {
  background: #25d366;
  color: #fff;
  border-color: #1da851;
}

.promotions-wa-store-btn:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.35);
  outline-offset: 2px;
}

/* Accueil : FAB masqué jusqu’en bas de page (classe ajoutée par JS quand proche du bas ou modal ouvert) */
.promotions-wa-float-wrap--scroll-reveal-bottom:not(.promotions-wa-float-wrap--scroll-reveal-bottom-visible) .promotions-wa-float-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

.promotions-wa-float-wrap--scroll-reveal-bottom .promotions-wa-float-btn {
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .promotions-wa-float-wrap--scroll-reveal-bottom .promotions-wa-float-btn {
    transition: none;
  }
}

/* Accueil : FAB WhatsApp en bas de page ; liste magasins au-dessus du bouton */
.promotions-wa-float-wrap.promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.55rem;
}

@media (max-width: 767px) {
  .promotions-wa-float-wrap.promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom {
    position: static;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 10050;
  }

  .promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom .promotions-wa-float-btn {
    position: fixed;
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: none;
    margin: 0;
    pointer-events: auto;
    z-index: 10050;
  }

  .promotions-wa-float-wrap--home .promotions-wa-modal {
    pointer-events: auto;
  }
}

@media (min-width: 768px) {
  .promotions-wa-float-wrap.promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom {
    position: fixed !important;
    right: max(1.25rem, env(safe-area-inset-right)) !important;
    bottom: max(1.25rem, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    z-index: 10050 !important;
    pointer-events: none !important;
  }

  .promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom .promotions-wa-float-btn {
    position: static !important;
    pointer-events: auto !important;
  }

  .promotions-wa-float-wrap--home .promotions-wa-modal {
    pointer-events: auto;
  }
}

@media (min-width: 1200px) {
  .promotions-wa-float-wrap.promotions-wa-float-wrap--home.promotions-wa-float-wrap--bottom {
    right: max(
      1.25rem,
      calc(
        env(safe-area-inset-right) + (100vw - var(--container-width, 1200px)) / 2 - 60px
      )
    ) !important;
    top: auto !important;
    bottom: max(1.25rem, env(safe-area-inset-bottom)) !important;
  }
}

/* Sélecteur de magasin sans bouton flottant (ex. page Contact) */
.promotions-wa-float-wrap--no-float,
.promotions-wa-float-wrap.promotions-wa-float-wrap--bottom.promotions-wa-float-wrap--no-float {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  display: block !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.promotions-wa-float-wrap--no-float .promotions-wa-float-btn {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 0 !important;
  bottom: auto !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  box-shadow: none !important;
  animation: none !important;
}

.promotions-wa-float-wrap--no-float .promotions-wa-float-btn::before,
.promotions-wa-float-wrap--no-float .promotions-wa-float-btn::after,
.promotions-wa-float-wrap--no-float .promotions-wa-float-btn svg {
  display: none !important;
  animation: none !important;
}

.promotions-wa-float-wrap--no-float .promotions-wa-modal {
  pointer-events: auto !important;
}

html.promotions-wa-modal-open:has(.promotions-wa-float-wrap--no-float) {
  overflow: hidden;
}

@media (min-width: 768px) {
  .promotions-wa-float-wrap--no-float .promotions-wa-modal:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    max-width: none !important;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) !important;
    margin: 0 !important;
  }

  .promotions-wa-float-wrap--no-float .promotions-wa-modal:not([hidden]) .promotions-wa-modal__backdrop {
    display: block !important;
  }

  .promotions-wa-float-wrap--no-float .promotions-wa-modal:not([hidden]) .promotions-wa-modal__panel {
    width: min(26rem, calc(100vw - 2rem));
    max-width: min(26rem, calc(100vw - 2rem));
  }
}
