/* ==========================================================
   Floating CTA "Demander un devis" — Marie Julien Cuisine
   - Apparaît sur toutes les pages sauf /demanderundevis
   - En bas à droite sur mobile (sticky, conversion mobile)
   - En bas à droite sur desktop (plus discret)
   - Cache automatique quand la bannière cookies est ouverte
   - Apparition après 200px de scroll pour ne pas gêner le splash
========================================================== */

/* Réserve un espace en bas de page pour que le CTA flottant
   ne chevauche pas le footer quand l'utilisateur scrolle au bout.
   NB: appliqué UNIQUEMENT au footer final, PAS au .group-band qui
   est une bande de transition entre le contenu et le footer. */
body:has(.float-devis-cta) .site-footer,
body:has(.float-devis-cta) footer {
  padding-bottom: 96px;
}
@media (max-width: 600px) {
  body:has(.float-devis-cta) .site-footer,
  body:has(.float-devis-cta) footer {
    padding-bottom: 84px;
  }
}
/* Fallback pour navigateurs sans :has() */
@supports not selector(:has(*)) {
  .site-footer, footer { padding-bottom: 96px; }
  @media (max-width: 600px) {
    .site-footer, footer { padding-bottom: 84px; }
  }
}

.float-devis-cta {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--navy, #243B69);
  color: var(--bg, #FFFEF8);
  border-radius: 100px;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(36, 59, 105, 0.28);
  cursor: pointer;
  border: 0;
  /* État caché par défaut, apparaît après scroll */
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1),
              opacity .4s,
              background .25s,
              box-shadow .25s;
}

.float-devis-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Inversion couleurs quand le CTA chevauche une section au fond foncé/navy.
   Marquée par data-cta-dark="true" sur la section. Activé via IntersectionObserver
   dans floating-cta.js (ajoute la classe .on-dark au CTA). */
.float-devis-cta.on-dark {
  background: var(--bg, #FFFEF8);
  color: var(--navy, #243B69);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 254, 248, 0.4) inset;
}
.float-devis-cta.on-dark:hover {
  background: #f5efe6;
  color: var(--navy, #243B69);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 254, 248, 0.5) inset;
}

.float-devis-cta:hover {
  background: #1a2c4f;
  box-shadow: 0 12px 32px rgba(36, 59, 105, 0.38);
  transform: translateY(-2px);
}

.float-devis-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Quand la bannière cookies est ouverte (en bas à droite aussi),
   on cache le bouton pour ne pas chevaucher */
body.cookie-banner-open .float-devis-cta,
.float-devis-cta.is-hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* Mobile : bouton plus petit + label raccourci possible */
@media (max-width: 600px) {
  .float-devis-cta {
    bottom: 16px;
    right: 16px;
    padding: 12px 18px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .float-devis-cta svg {
    width: 14px;
    height: 14px;
  }
  /* Si la nav mobile est ouverte, on cache le CTA */
  .site-header.is-nav-open ~ * .float-devis-cta,
  body.is-nav-locked .float-devis-cta {
    opacity: 0;
    pointer-events: none;
  }
}

/* Très petit écran (≤360px) : garder seulement la flèche pour économiser la place */
@media (max-width: 360px) {
  .float-devis-cta .label {
    display: none;
  }
  .float-devis-cta {
    padding: 14px;
  }
  .float-devis-cta svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-devis-cta { transition: opacity .15s; }
  .float-devis-cta:hover { transform: none; }
}
