/* ═══════════════════════════════════════════════════════════════════════════
   Odiens CRO Widgets — Front-end CSS (v1.2.0)
   Bouton, carte d'accroche, bandeau, interstitiel pleine page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset scope ─────────────────────────────────────────────────────────── */
.cro-widget,
.cro-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Visibilité contrôlée par classe JS ─────────────────────────────────── */
.cro-cta {
  display: none !important;
  pointer-events: auto;
  line-height: 1;
}
.cro-cta.cro-cta--visible {
  display: block !important;
  pointer-events: auto;
}

/* ══ FORMAT 1 : BOUTON FLOTTANT (floating_button) ═════════════════════════ */
.cro-cta--floating_button {
  position: fixed;
}
.cro-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  -webkit-font-smoothing: antialiased;
}
.cro-cta__btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}
.cro-cta__btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.cro-cta__btn:focus-visible {
  outline: 3px solid #4a90e2;
  outline-offset: 3px;
}

.cro-cta__icon svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}
.cro-cta__icon i {
  font-size: 1.15em;
  line-height: 1;
}
.cro-cta__icon--top {
  display: block;
  margin: 0 auto 4px;
}
.cro-cta__text--below {
  display: block;
}

/* ══ FORMAT 2 : BANDEAU STICKY (sticky_bar) ═══════════════════════════════ */
.cro-cta--sticky_bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  box-shadow: 0 2px 14px rgba(0,0,0,0.15);
}
.cro-cta--sticky-top {
  top: 0 !important;
  bottom: auto !important;
}
.cro-cta--sticky-bottom {
  bottom: 0 !important;
  top: auto !important;
}

.cro-sticky-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
/* Bandeau sans message : bouton centré */
.cro-sticky-bar__inner > .cro-sticky-bar__actions:first-child {
  margin: 0 auto;
}
.cro-sticky-bar__content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.cro-sticky-bar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cro-sticky-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cro-sticky-bar__btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.cro-sticky-bar__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 6px;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}
.cro-sticky-bar__close:hover {
  opacity: 1;
  background: rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .cro-sticky-bar__inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .cro-sticky-bar__content {
    font-size: 13px;
  }
  .cro-sticky-bar__btn {
    font-size: 13px !important;
    padding: 8px 14px !important;
  }
}

/* ══ BOUTON — option « icône seule » (rond) ═════════════════════════════════ */
.cro-cta--icon-only .cro-cta__btn {
  width: 58px;
  height: 58px;
  border-radius: 50% !important;
  padding: 0 !important;
  gap: 0 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), filter 0.15s ease;
}
.cro-cta--icon-only .cro-cta__btn:hover { transform: scale(1.08) translateY(-2px); }
.cro-cta--icon-only .cro-cta__text {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important;
}
.cro-cta--icon-only .cro-cta__icon { margin: 0 !important; }
.cro-cta--icon-only .cro-cta__icon svg { width: 26px; height: 26px; }
.cro-cta--icon-only .cro-cta__icon i   { font-size: 24px; }

/* ══ BOUTON — option « barre pleine largeur en bas sur mobile » ════════════ */
@media (max-width: 768px) {
  .cro-cta.cro-cta--mobile-bar {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    translate: none !important;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.18);
  }
  .cro-cta--mobile-bar .cro-cta__btn {
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 16px 20px !important;
    gap: 8px !important;
    justify-content: center;
    font-weight: 700;
    box-shadow: none !important;
  }
  .cro-cta--mobile-bar .cro-cta__btn:hover { transform: none; }
  /* En barre, le texte redevient visible même si le bouton est « icône seule » sur desktop */
  .cro-cta--mobile-bar.cro-cta--icon-only .cro-cta__text {
    position: static !important; width: auto !important; height: auto !important; clip: auto !important;
  }
  .cro-cta--mobile-bar .cro-cta-dismiss { top: -10px; right: 8px; }
}

/* ══ INTERSTITIEL PLEINE PAGE ══════════════════════════════════════════════ */
.cro-cta.cro-cta--interstitial {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cro-cta.cro-cta--interstitial.cro-cta--visible { display: flex !important; }
.cro-interstitial__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.cro-interstitial__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  text-align: center;
  animation: cro-int-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes cro-int-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.cro-interstitial__img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}
.cro-interstitial__body { padding: 32px 32px 24px; }
.cro-interstitial__title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px !important;
  color: inherit;
}
.cro-interstitial__text {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 24px !important;
  opacity: .85;
  color: inherit;
}
.cro-interstitial__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 60%;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  border: none;
  transition: filter .15s, transform .15s;
}
.cro-interstitial__btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cro-interstitial__btn:focus-visible { outline: 3px solid #4a90e2; outline-offset: 3px; }
.cro-interstitial__no {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: inherit;
  opacity: .6;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}
.cro-interstitial__no:hover { opacity: 1; }
.cro-interstitial__x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #1d2327;
  font-size: 24px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cro-interstitial__x:hover { background: #fff; }
.cro-interstitial__x:focus-visible { outline: 2px solid #4a90e2; }
html.cro-no-scroll, html.cro-no-scroll body { overflow: hidden !important; }
.cro-cta--interstitial.cro-cta--visible .cro-interstitial__overlay { animation: cro-ov-in .3s ease; }
@keyframes cro-ov-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Fenêtre en panneau latéral (glisse depuis la droite ou la gauche) ───── */
.cro-cta.cro-cta--interstitial.cro-int--right,
.cro-cta.cro-cta--interstitial.cro-int--left { padding: 0; align-items: stretch; }
.cro-cta.cro-cta--interstitial.cro-int--right { justify-content: flex-end; }
.cro-cta.cro-cta--interstitial.cro-int--left  { justify-content: flex-start; }
.cro-int--right .cro-interstitial__panel,
.cro-int--left  .cro-interstitial__panel {
  max-width: 440px;
  height: 100%;
  max-height: none;
  border-radius: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.cro-int--right .cro-interstitial__panel { animation: cro-panel-in-right .45s cubic-bezier(.22,.9,.24,1); box-shadow: -16px 0 48px rgba(0,0,0,0.3); }
.cro-int--left  .cro-interstitial__panel { animation: cro-panel-in-left  .45s cubic-bezier(.22,.9,.24,1); box-shadow: 16px 0 48px rgba(0,0,0,0.3); }
@keyframes cro-panel-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes cro-panel-in-left  { from { transform: translateX(-100%); } to { transform: none; } }
.cro-int--right .cro-interstitial__img,
.cro-int--left  .cro-interstitial__img { max-height: 240px; }
.cro-int--right .cro-interstitial__body,
.cro-int--left  .cro-interstitial__body { padding: 72px 40px 32px; }
.cro-int--right .cro-interstitial__img + .cro-interstitial__body,
.cro-int--left  .cro-interstitial__img + .cro-interstitial__body { padding-top: 32px; }
.cro-int--right .cro-interstitial__title,
.cro-int--left  .cro-interstitial__title { font-size: 28px; }
.cro-int--right .cro-interstitial__btn,
.cro-int--left  .cro-interstitial__btn { min-width: 0; }
.cro-int--right .cro-interstitial__no,
.cro-int--left  .cro-interstitial__no { margin: 14px 0 0; }
.cro-int--right .cro-interstitial__x,
.cro-int--left  .cro-interstitial__x { top: 16px; right: 16px; }

/* Fermeture animée */
.cro-cta--closing .cro-interstitial__overlay { animation: cro-ov-out .25s ease forwards; }
.cro-int--center.cro-cta--closing .cro-interstitial__panel { animation: cro-int-out .2s ease forwards; }
.cro-int--right.cro-cta--closing .cro-interstitial__panel { animation: cro-panel-out-right .28s ease-in forwards; }
.cro-int--left.cro-cta--closing  .cro-interstitial__panel { animation: cro-panel-out-left .28s ease-in forwards; }
@keyframes cro-ov-out { to { opacity: 0; } }
@keyframes cro-int-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes cro-panel-out-right { to { transform: translateX(100%); } }
@keyframes cro-panel-out-left  { to { transform: translateX(-100%); } }

@media (max-width: 600px) {
  .cro-cta.cro-cta--interstitial.cro-int--right,
  .cro-cta.cro-cta--interstitial.cro-int--left { padding: 0; align-items: stretch; }
  .cro-int--right .cro-interstitial__panel,
  .cro-int--left  .cro-interstitial__panel { border-radius: 0 !important; max-height: none !important; }
  .cro-int--right .cro-interstitial__panel,
  .cro-int--left  .cro-interstitial__panel { max-width: none; width: 100%; }
  .cro-int--right .cro-interstitial__body,
  .cro-int--left  .cro-interstitial__body { padding: 64px 22px 24px; }
  .cro-int--right .cro-interstitial__title,
  .cro-int--left  .cro-interstitial__title { font-size: 23px; }
  .cro-int--right .cro-interstitial__btn,
  .cro-int--left  .cro-interstitial__btn { width: 100%; }
}
@media (max-width: 600px) {
  .cro-cta.cro-cta--interstitial { padding: 12px; align-items: flex-end; }
  .cro-interstitial__panel { border-radius: 14px; max-height: calc(100vh - 24px); }
  .cro-interstitial__body { padding: 24px 20px 18px; }
  .cro-interstitial__title { font-size: 21px; }
  .cro-interstitial__text { font-size: 15px; margin-bottom: 18px !important; }
  .cro-interstitial__btn { width: 100%; min-width: 0; }
  .cro-interstitial__img { max-height: 180px; }
}

/* ══ FORMAT 5 : CARTE D'ACCROCHE (teaser) ═════════════════════════════════ */
.cro-cta--teaser {
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 18px 18px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
  line-height: 1.4;
  text-align: left;
}
.cro-teaser__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 22px 6px 0 !important;
  color: inherit;
}
.cro-teaser__text {
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 14px !important;
  opacity: .85;
  color: inherit;
}
.cro-teaser__title[style*="none"] + .cro-teaser__text { margin-right: 22px !important; }
.cro-teaser__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  border: none;
  transition: filter .15s, transform .15s;
}
.cro-teaser__btn:hover { filter: brightness(1.08); }
.cro-teaser__btn:focus-visible { outline: 2px solid #4a90e2; outline-offset: 2px; }
.cro-teaser__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .55;
  font-size: 20px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.cro-teaser__close:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.cro-teaser__close:focus-visible { outline: 2px solid #4a90e2; opacity: 1; }
@media (max-width: 600px) {
  .cro-cta--teaser {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    width: auto;
    max-width: none;
    translate: none !important;
  }
}

/* ══ ANIMATIONS ═════════════════════════════════════════════════════════════ */
@keyframes cro-anim-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cro-anim-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cro-anim-bounce {
  0%   { opacity: 0; transform: scale(.6); }
  60%  { opacity: 1; transform: scale(1.1); }
  80%  { transform: scale(.96); }
  100% { transform: scale(1); }
}
@keyframes cro-anim-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
}

.cro-anim--fade_in  { animation: cro-anim-fade-in  0.4s ease forwards; }
.cro-anim--slide_up { animation: cro-anim-slide-up 0.4s ease forwards; }
.cro-anim--bounce   { animation: cro-anim-bounce   0.5s ease forwards; }
.cro-anim--pulse    { animation: cro-anim-pulse    1.5s ease 0.5s 3; }

/* Accessibilité : respect du choix de l'utilisateur */
@media (prefers-reduced-motion: reduce) {
  .cro-anim--fade_in,
  .cro-anim--slide_up,
  .cro-anim--bounce,
  .cro-anim--pulse,
  .cro-cta__btn,
  .cro-sticky-bar__btn,
  .cro-teaser__btn,
  .cro-interstitial__btn,
  .cro-interstitial__panel,
  .cro-interstitial__overlay {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Bouton rejet sur CTA ────────────────────────────────────────────────── */
.cro-cta-dismiss {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  padding: 0;
  z-index: 2;
  transition: background .15s;
}
.cro-cta-dismiss:hover {
  background: rgba(0,0,0,0.85);
}
.cro-cta {
  position: fixed;
}
.cro-cta .cro-cta__btn,
.cro-cta .cro-teaser__btn {
  position: relative;
}
.cro-cta-dismiss:focus-visible {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}
