/* ==========================================================================
   Greentherm — Boutons flottants WhatsApp + Appel (toutes les pages)
   Markup injecte par js/floating-contact.js (cf. ce fichier pour le detail
   du masquage preloader/ecran scindé) — cette feuille ne fait QUE l'habiller.
   ========================================================================== */

.floating-contact {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-floating-contact);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease-standard), transform 0.4s var(--ease-standard);
}

.floating-contact[hidden] {
  display: none;
}

.floating-contact.is-visible {
  opacity: 1;
  transform: none;
}

/* Evitement de collision (cf. js/floating-contact.js setupCollisionAvoidance) :
   un CTA/le formulaire de devis/le footer est actuellement dans le coin
   bas-droit du viewport -> on s'efface le temps qu'il le traverse, plutot
   que de le recouvrir. pointer-events:none est l'element qui compte
   vraiment ici (jamais de clic vole a l'element en dessous) ; l'opacite
   n'est qu'un confort visuel pour que la disparition ne soit pas un
   "saut" sec. */
.floating-contact.is-visible.is-colliding {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* ---- Bouton (cercle qui devient pilule au survol desktop) ---------------- */
.floating-contact-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 56px;
  min-width: 56px;
  /* 28px (jamais 50%) : un cercle a largeur=hauteur rend un cercle parfait
     (28px = hauteur/2), et la MEME valeur rend une pilule a bords arrondis
     une fois la largeur agrandie par le libellé au survol — aucune
     transition de border-radius necessaire, le rayon ne change jamais. */
  border-radius: 28px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 10px 26px -8px rgba(10, 35, 24, 0.45);
  transition: box-shadow 0.2s var(--ease-standard), transform 0.2s var(--ease-standard);
}

.floating-contact-btn:hover,
.floating-contact-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -8px rgba(10, 35, 24, 0.55);
}

.floating-contact-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.floating-contact-btn--whatsapp {
  background: linear-gradient(135deg, #25D366, #0F9D58);
}

.floating-contact-btn--call {
  /* "Vert Greentherm" (degrade de marque, deja reserve aux CTA/boutons de
     soumission — jamais un fond de section, cf. css/variables.css) : un
     bouton flottant d'appel correspond exactement a cet usage. */
  background: var(--gradient-brand);
}

.floating-contact-icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.floating-contact-icon-wrap svg {
  width: 26px;
  height: 26px;
  color: #fff; /* icone telephone (stroke=currentColor) */
  position: relative;
  z-index: 1;
}

/* ---- Point "en ligne" (WhatsApp uniquement) -------------------------------- */
.floating-contact-online-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ADE80;
  border: 2px solid #fff;
}

/* ---- Onde legere autour de l'icone WhatsApp -------------------------------- */
.floating-contact-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: floating-contact-wave 2.4s ease-out infinite;
}

@keyframes floating-contact-wave {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* ---- Libelle — masque par defaut (largeur nulle), ne sort qu'au survol
   desktop a pointeur fin (jamais sur tactile, pas de hover fiable : seule
   l'icone reste visible en permanence sur mobile, comme demande). --------- */
.floating-contact-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: max-width 0.3s var(--ease-standard), opacity 0.2s var(--ease-standard), padding-right 0.3s var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .floating-contact-btn:hover .floating-contact-label,
  .floating-contact-btn:focus-visible .floating-contact-label {
    max-width: 160px;
    opacity: 1;
    padding-right: 18px;
  }
}

/* ---- Cibles tactiles >=48px (demande explicite) : deja 56px, aucun
   ajustement necessaire — regle presente pour documenter l'intention et
   servir de filet si la taille de base venait a changer un jour. ---------- */
@media (max-width: 767px) {
  .floating-contact-btn {
    height: 56px;
    min-width: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-contact {
    transition: none;
  }

  .floating-contact-btn,
  .floating-contact-label {
    transition: none;
  }

  .floating-contact-ring {
    animation: none;
    display: none;
  }
}
