/* =========================================
   WIDGET LIVE CHAT – DEMANDE DE DEVIS
   Reprend les couleurs / rayons / ombres du thème (voir style.css :root)
   ========================================= */

.pv-livechat {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  font-family: var(--font-corps);
}

/* ---------- Bouton flottant ---------- */
.pv-livechat__toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--vert-mousse);
  color: var(--blanc);
  border: none;
  border-radius: var(--arrondi-lg);
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  box-shadow: var(--ombre-forte);
  transition: transform .28s ease, box-shadow .28s ease, background-color .28s ease, opacity .2s ease, visibility 0s linear;
}

.pv-livechat__toggle:hover {
  background: var(--vert-foret);
  transform: translateY(-2px);
}

.pv-livechat.is-open .pv-livechat__toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pv-livechat__toggle-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pv-livechat__toggle-icon .pv-lc-icon-close {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
}

.pv-livechat.is-open .pv-livechat__toggle-icon .pv-lc-icon {
  opacity: 0;
  transform: scale(.6);
}

.pv-livechat.is-open .pv-livechat__toggle-icon .pv-lc-icon-close {
  opacity: 1;
  transform: scale(1);
}

.pv-livechat__toggle-icon > svg:not(.pv-lc-icon-close) {
  transition: opacity .2s ease, transform .2s ease;
}

.pv-livechat__toggle-icon .pv-lc-icon--dots { display: none; }

.pv-livechat__toggle-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.25;
}

.pv-livechat__toggle-text strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.pv-livechat__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--vert-menthe);
}

.pv-livechat__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vert-clair);
  box-shadow: 0 0 0 0 rgba(123,191,104,.6);
  animation: pv-livechat-pulse 2s infinite;
}

.pv-livechat__dot--light { background: var(--vert-menthe); }

@keyframes pv-livechat-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(123,191,104,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(123,191,104,0); }
  100% { box-shadow: 0 0 0 0 rgba(123,191,104,0); }
}

/* ---------- Panneau ---------- */
.pv-livechat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: calc(100vw - 2.5rem);
  max-height: min(92vh, 780px);
  background: var(--blanc);
  border-radius: var(--arrondi-lg);
  box-shadow: var(--ombre-forte);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.pv-livechat.is-open .pv-livechat__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity .3s ease, transform .3s ease, visibility 0s;
}

.pv-livechat__header {
  position: relative;
  background: linear-gradient(135deg, var(--vert-mousse), var(--vert-foret));
  color: var(--blanc);
  padding: 1.25rem 1.4rem 1.1rem;
  flex-shrink: 0;
}

.pv-livechat__header-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--vert-menthe);
  margin-bottom: 0.6rem;
}

.pv-livechat__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--blanc);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .2s ease;
}

.pv-livechat__close:hover { background: rgba(255,255,255,0.28); }

.pv-livechat__header h3 {
  font-family: var(--font-titre);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blanc);
  margin: 0 0 0.35rem;
  padding-right: 2rem;
}

.pv-livechat__header p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.pv-livechat__badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pv-livechat__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--blanc);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
}

.pv-livechat__badge .pv-icon { color: var(--vert-menthe); }

/* ---------- Formulaire ---------- */
.pv-livechat__form {
  padding: 1.1rem 1.4rem 1.3rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pv-livechat__form[hidden] {
  display: none;
}

.pv-livechat__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pv-livechat__field { display: flex; flex-direction: column; gap: 0.4rem; }

.pv-livechat__field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--noir-doux);
}

.pv-livechat__field label .pv-icon { color: var(--vert-mousse); flex-shrink: 0; }

.pv-livechat__field input[type="tel"],
.pv-livechat__field input[type="email"],
.pv-livechat__field input[type="number"],
.pv-livechat__field textarea {
  width: 100%;
  border: 1px solid rgba(61,122,53,0.18);
  border-radius: 16px;
  background: var(--blanc);
  color: var(--noir-doux);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  appearance: none;
}

.pv-livechat__field textarea { resize: vertical; min-height: 72px; }

.pv-livechat__field input:focus,
.pv-livechat__field textarea:focus {
  outline: none;
  border-color: var(--vert-mousse);
  box-shadow: 0 0 0 4px rgba(123,191,104,0.18);
}

.pv-livechat__field input::placeholder,
.pv-livechat__field textarea::placeholder { color: #80907a; }

.pv-livechat__captcha input { max-width: 110px; }

/* ---------- Upload ---------- */
.pv-livechat__upload {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pv-livechat__upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.pv-livechat__upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gris-clair);
  border: 1px solid rgba(61,122,53,0.18);
  color: var(--vert-foret);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: var(--arrondi-xl);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
  margin: 0;
}

.pv-livechat__upload-btn:hover { background: var(--vert-glacial); border-color: var(--vert-mousse); }

.pv-livechat__upload-names {
  font-size: 0.76rem;
  color: var(--gris-moyen);
  word-break: break-word;
}

.pv-livechat__hint {
  font-size: 0.72rem;
  color: var(--gris-moyen);
  margin: 0;
}

/* ---------- Bouton d'envoi ---------- */
.pv-livechat__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--vert-mousse);
  color: var(--blanc);
  font-family: var(--font-corps);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.8rem 1.5rem;
  box-shadow: 0 4px 18px rgba(61,122,53,0.35);
  cursor: pointer;
  transition: transform .28s ease, background-color .28s ease, box-shadow .28s ease, opacity .2s ease;
}

.pv-livechat__submit:hover {
  background: var(--vert-foret);
  box-shadow: 0 8px 28px rgba(61,122,53,0.45);
  transform: translateY(-2px);
}

.pv-livechat__submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.pv-livechat__privacy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--gris-moyen);
  margin: 0;
}

.pv-livechat__privacy .pv-lc-icon { color: var(--vert-mousse); flex-shrink: 0; }

.pv-livechat__message {
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 1em;
}

.pv-livechat__message[data-type="error"] { color: var(--rouge-baie); }
.pv-livechat__message[data-type="success"] { color: var(--vert-foret); }

.pv-livechat__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px solid var(--vert-glacial);
  font-size: 0.78rem;
}

.pv-livechat__hours {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gris-moyen);
}

.pv-livechat__hours .pv-icon { color: var(--vert-mousse); }

.pv-livechat__hours strong { font-size: 16px; font-weight: 700; }

.pv-livechat__call {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--vert-foret);
  font-weight: 700;
  text-decoration: none;
}

.pv-livechat__call .pv-icon { color: var(--vert-mousse); }
.pv-livechat__call:hover { text-decoration: underline; }

/* ---------- État de confirmation ---------- */
.pv-livechat__success {
  padding: 0 1.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pv-livechat__success[hidden] {
  display: none;
}

.pv-livechat__success p {
  margin: 0;
  color: var(--noir-doux);
  line-height: 1.5;
}

.pv-livechat__success .pv-livechat__footer {
  width: 100%;
  margin-top: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .pv-livechat { right: 1rem; bottom: 5.75rem; }

  .pv-livechat__panel {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    max-width: none;
    max-height: 88vh;
  }

  body.pv-livechat-is-open .mobile-bar { display: none; }
}

@media (max-width: 480px) {
  .pv-livechat { bottom: 4.75rem; }

  /* Bouton réduit à une icône de message ronde */
  .pv-livechat__toggle {
    padding: 0.85rem;
    border-radius: 999px;
  }
  .pv-livechat__toggle-text { display: none; }
  .pv-livechat__toggle-icon > .pv-lc-icon:not(.pv-lc-icon--dots) { display: none; }
  .pv-livechat__toggle-icon .pv-lc-icon--dots { display: block; }
  .pv-livechat__toggle-icon .pv-lc-icon,
  .pv-livechat__toggle-icon .pv-lc-icon-close { width: 26px; height: 26px; }

  .pv-livechat__panel {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    max-height: 90vh;
  }
}
