/* /wp-content/themes/ton-theme-enfant/assets/css/sticky-cta.css */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--cta-bg, #111);
  color: var(--cta-fg, #fff);
  padding: 0.75rem env(safe-area-inset-right, 0)
    calc(0.75rem + env(safe-area-inset-bottom, 0)) env(safe-area-inset-left, 0);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
}

.sticky-cta__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sticky-cta__text {
  margin: 0;
  line-height: 1.4;
}

.sticky-cta__btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--cta-accent, #10b981);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  transition: transform 0.08s ease;
}
.sticky-cta__btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.sticky-cta__btn:active {
  transform: translateY(1px);
}

.sticky-cta__close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.sticky-cta[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .sticky-cta {
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0))
      0.75rem;
  }
  .sticky-cta__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.6rem;
  }
  .sticky-cta__text {
    flex: 0 0 auto;
    font-size: 0.95rem;
  }
  .sticky-cta__btn {
    width: 100%;
    text-align: center;
    border-radius: 0.6rem;
  }
  /* Close en haut à droite du bandeau */
  .sticky-cta {
    position: fixed;
  }
  .sticky-cta__close {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
  }
}

/* Le body s’ajuste sur la hauteur mesurée (posée par JS) */
body.has-sticky-cta {
  padding-bottom: calc(
    var(--sticky-cta-h, 72px) + env(safe-area-inset-bottom, 0)
  );
}

/* évite que le CTA masque le bas de page (inclut safe area iOS) */
body.has-sticky-cta {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
}
