/* ==========================================================================
   S.A.V. en discussion — widget (hook Creative Elements / page /sav).
   Couleurs du thème luxalia.fr (doré #d8a777, texte #232323, gris #7a7a7a,
   fond #f6f6f6), police héritée de la page. Préfixe lxchat-.
   ========================================================================== */
.lxchat, .lxchat-page__main {
    --lx-text: #232323;
    --lx-muted: #7a7a7a;
    --lx-line: #e6e6e6;
    --lx-bg: #ffffff;
    --lx-bg-2: #f6f6f6;
    --lx-accent: #d8a777;
    --lx-accent-soft: #fbf5ee;
    --lx-danger: #9b2c2c;
    --lx-danger-bg: #fdecec;
    font-family: inherit;
    color: var(--lx-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.lxchat *, .lxchat *::before, .lxchat *::after { box-sizing: border-box; }
.lxchat { max-width: 720px; margin: 0 auto; }
.lxchat-page__main { max-width: 760px; margin: 0 auto; padding: 8px 0 32px; }
.lxchat__banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #fff7e6; color: #8a5a00; font-size: 13px; font-weight: 600; }
.lxchat__noscript { margin: 12px 0 0; color: var(--lx-muted); font-size: 14px; }

.lxchat__window {
    display: flex;
    flex-direction: column;
    height: min(720px, 78vh);
    min-height: 460px;
    background: var(--lx-bg);
    border: 1px solid var(--lx-line);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(35, 35, 35, .06);
    overflow: hidden;
}
.lxchat__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--lx-line); background: var(--lx-bg); }
.lxchat__avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--lx-accent); color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.lxchat__head-text { display: flex; flex-direction: column; line-height: 1.25; }
.lxchat__head-text strong { font-size: 15px; font-weight: 800; }
.lxchat__head-text span { font-size: 12px; color: var(--lx-muted); }
.lxchat__restart { margin-left: auto; padding: 7px 12px; font: inherit; font-size: 12px; font-weight: 700; color: var(--lx-muted); background: transparent; border: 1.5px solid var(--lx-line); border-radius: 0.3rem; cursor: pointer; }
.lxchat__restart:hover { color: var(--lx-text); border-color: var(--lx-accent); }

.lxchat__thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--lx-bg-2); scroll-behavior: smooth; }
.lxchat__loading { margin: 0; color: var(--lx-muted); font-size: 14px; }
.lxchat__msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-wrap: break-word; animation: lxchat-in .18s ease-out; }
.lxchat__msg--bot { align-self: flex-start; background: var(--lx-bg); border: 1px solid var(--lx-line); border-bottom-left-radius: 4px; }
.lxchat__msg--customer { align-self: flex-end; background: var(--lx-accent); color: #fff; border-bottom-right-radius: 4px; }
.lxchat__msg--error { background: var(--lx-danger-bg); border-color: #f5c2c2; color: var(--lx-danger); font-weight: 600; }
.lxchat__text a { color: inherit; text-decoration: underline; }
.lxchat__msg--customer .lxchat__text a { color: #fff; }
@keyframes lxchat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lxchat__typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.lxchat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--lx-muted); opacity: .5; animation: lxchat-dot 1s infinite; }
.lxchat__typing span:nth-child(2) { animation-delay: .15s; }
.lxchat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes lxchat-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Contenu d'une réponse : vidéo, photos */
.lxchat__video { position: relative; margin: 10px 0 4px; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.lxchat__video iframe, .lxchat__video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lxchat__photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.lxchat__photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--lx-line); }

/* Carte formulaire */
.lxchat__card { width: 100%; max-width: 100%; }
.lxchat__card-hint { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--lx-accent-soft); font-size: 14px; }
.lxchat__card-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.lxchat__card-ta { width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--lx-text); border: 1.5px solid var(--lx-line); border-radius: 10px; resize: vertical; outline: none; }
.lxchat__card-ta:focus { border-color: var(--lx-accent); }
.lxchat__file { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 12px; border: 1.5px dashed var(--lx-line); border-radius: 10px; font-size: 13px; color: var(--lx-muted); cursor: pointer; }
.lxchat__file input { font-size: 12px; }
.lxchat__file--required { border-color: var(--lx-accent); color: var(--lx-text); }
.lxchat__previews { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.lxchat__previews img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--lx-line); }
.lxchat__previews:empty { display: none; }
.lxchat__card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lxchat__card-mail { font-size: 12px; color: var(--lx-muted); }
.lxchat__btn { padding: 11px 18px; font: inherit; font-size: 14px; font-weight: 700; border-radius: 0.3rem; border: 1.5px solid var(--lx-accent); background: var(--lx-accent); color: #fff; cursor: pointer; }
.lxchat__btn:hover { filter: brightness(.94); }
.lxchat__btn[disabled] { opacity: .55; pointer-events: none; }
.lxchat__card.is-sent { opacity: .7; }

/* Barre de saisie */
.lxchat__bar { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--lx-line); background: var(--lx-bg); }
.lxchat__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lxchat__input { flex: 1; min-height: 44px; max-height: 140px; padding: 11px 14px; font: inherit; font-size: 15px; color: var(--lx-text); background: var(--lx-bg-2); border: 1.5px solid var(--lx-line); border-radius: 12px; resize: none; outline: none; line-height: 1.4; }
.lxchat__input:focus { border-color: var(--lx-accent); background: var(--lx-bg); }
.lxchat__input:disabled { opacity: .6; }
.lxchat__send { flex: none; height: 44px; padding: 0 18px; font: inherit; font-size: 14px; font-weight: 700; border-radius: 0.3rem; border: 1.5px solid var(--lx-accent); background: var(--lx-accent); color: #fff; cursor: pointer; }
.lxchat__send:hover { filter: brightness(.94); }
.lxchat__send[disabled] { opacity: .55; pointer-events: none; }

@media (max-width: 560px) {
    .lxchat__window { height: 74vh; border-radius: 12px; }
    .lxchat__msg { max-width: 92%; font-size: 14px; }
    .lxchat__send { padding: 0 14px; }
}

/* ==========================================================================
   Page /sav en plein écran (v1.73.0) : la discussion prend toute la page,
   sans fil d'Ariane ni pied de page ; hauteur ajustée par sav-chat.js
   (variable --lxchat-h = viewport − haut de la fenêtre de discussion).
   Le widget posé par le hook dans une page Creative Elements n'est pas touché.
   ========================================================================== */
body.lxchat-fullpage #wrapper { padding-top: 0 !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
body.lxchat-fullpage #wrapper > .container, body.lxchat-fullpage #wrapper > .container-fluid { max-width: none !important; width: 100% !important; padding-left: 0 !important; padding-right: 0 !important; margin: 0 !important; }
body.lxchat-fullpage #wrapper .breadcrumb, body.lxchat-fullpage .breadcrumb, body.lxchat-fullpage .footer-container, body.lxchat-fullpage #footer, body.lxchat-fullpage footer.footer { display: none !important; }
body.lxchat-fullpage #main, body.lxchat-fullpage #content-wrapper, body.lxchat-fullpage #main > .row, body.lxchat-fullpage .page-content.lxchat-page__main--full { padding: 0 !important; margin: 0 !important; max-width: none !important; width: 100% !important; }
.lxchat-page__main--full { max-width: none; padding: 0; }
.lxchat-page__main--full .lxchat { max-width: none; margin: 0; }
.lxchat-page__main--full .lxchat__banner { margin: 0; border-radius: 0; text-align: center; }
.lxchat-page__main--full .lxchat__window { height: var(--lxchat-h, calc(100vh - 140px)); min-height: 380px; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: none; }
.lxchat-page__main--full .lxchat__head,
.lxchat-page__main--full .lxchat__thread,
.lxchat-page__main--full .lxchat__bar { padding-left: max(16px, calc(50vw - 440px)); padding-right: max(16px, calc(50vw - 440px)); }
.lxchat-page__main--full .lxchat__msg { max-width: 80%; }
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat__window { min-height: 320px; }
    .lxchat-page__main--full .lxchat__head { padding: 10px 12px; }
    .lxchat-page__main--full .lxchat__thread { padding: 12px 12px; }
    .lxchat-page__main--full .lxchat__bar { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .lxchat-page__main--full .lxchat__msg { max-width: 92%; }
    .lxchat-page__main--full .lxchat__input { font-size: 16px; }   /* évite le zoom automatique d'iOS au focus */
}

/* v1.73.2 — les messages se calent en bas du fil (un fil peu rempli n'a plus de vide entre le dernier
   message et le champ : utile sur mobile, clavier ouvert). Sans effet quand le fil déborde (défilement). */
.lxchat__thread::before { content: ''; flex: 1 0 auto; }

/* v1.73.4 — le widget prend toute la largeur de son conteneur et toute la hauteur de l'écran (hauteur posée
   par sav-chat.js) ; les bulles restent lisibles sur un grand écran. */
.lxchat { max-width: none; }
.lxchat__msg { max-width: min(86%, 760px); }
.lxchat__window { height: calc(100vh - 140px); }
@media (max-width: 560px) {
    .lxchat__msg { max-width: 92%; }
}

/* v1.73.5 — page /sav : une petite marge autour de la fenêtre de discussion, qui retrouve son cadre
   (bord, coins arrondis, ombre) au lieu d'être collée à l'en-tête du site. */
.lxchat-page__main--full .lxchat { padding: 14px 14px 0; }
.lxchat-page__main--full .lxchat__window { border: 1px solid var(--lx-line); border-radius: 16px; box-shadow: 0 6px 24px rgba(35, 35, 35, .06); }
.lxchat-page__main--full .lxchat__banner { margin: 0 0 12px; border-radius: 10px; }
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat { padding: 10px 10px 0; }
    .lxchat-page__main--full .lxchat__window { border-radius: 12px; }
}

/* v1.73.6 — page /sav : la rangée Bootstrap du thème (.row, marges −15 px) débordait de l'écran ;
   marge du haut un peu plus nette sous l'en-tête. */
body.lxchat-fullpage #wrapper .row { margin-left: 0 !important; margin-right: 0 !important; }
body.lxchat-fullpage { overflow-x: hidden; }
.lxchat-page__main--full .lxchat { padding: 24px 14px 0; }
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat { padding: 14px 10px 0; }
}

/* v1.73.7 — page /sav : la page tient dans l'écran (en-tête + discussion), plus de défilement de la page
   elle-même (des panneaux du menu du thème ajoutaient ~120 px de hauteur invisible). */
body.lxchat-fullpage { overflow: hidden; }

/* v1.73.8 — mobile : même respiration sous l'en-tête que sur ordinateur (le thème chevauche de 10 px). */
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat { padding: 20px 10px 0; }
}

/* v1.73.9 — page /sav (Jordan) : pas de marge, mais un cadre. La fenêtre part exactement sous l'en-tête
   (le thème le fait chevaucher le contenu de 10 px, d'où ce décalage), touche les bords et le bas de
   l'écran, avec sa ligne de cadre visible. */
.lxchat-page__main--full .lxchat { padding: 10px 0 0; }
.lxchat-page__main--full .lxchat__window { border-radius: 0; box-shadow: none; }
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat { padding: 10px 0 0; }
    .lxchat-page__main--full .lxchat__window { border-radius: 0; }
}

/* v1.73.10 — page /sav : le décalage sous l'en-tête est posé par sav-chat.js (padding-top mesuré), pas en CSS. */
.lxchat-page__main--full .lxchat { padding: 0; }
@media (max-width: 560px) {
    .lxchat-page__main--full .lxchat { padding: 0; }
}

/* v1.75.0 — carte « produits concernés » : la liste des articles de la commande à cocher. */
.lxchat__pick-list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.lxchat__pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid var(--lx-line); border-radius: 10px; background: #fff; }
.lxchat__pick-row.is-on { border-color: var(--lx-accent); background: var(--lx-accent-soft); }
.lxchat__pick-row input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--lx-accent); cursor: pointer; }
.lxchat__pick-row label { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; margin: 0; font-weight: 400; cursor: pointer; min-width: 0; }
.lxchat__pick-row img, .lxchat__pick-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--lx-line); flex: 0 0 auto; background: #fff; }
.lxchat__pick-name { flex: 1 1 auto; font-size: 14px; line-height: 1.25; min-width: 0; }
.lxchat__pick-name small { display: block; color: var(--lx-muted); font-size: 12px; }
.lxchat__pick-qty { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 12px; color: var(--lx-muted); }
.lxchat__pick-qty input { width: 56px; padding: 6px 4px; font: inherit; font-size: 14px; color: var(--lx-text); border: 1.5px solid var(--lx-line); border-radius: 8px; text-align: center; }
.lxchat__link { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 13px; color: var(--lx-muted); text-decoration: underline; cursor: pointer; }
.lxchat__pick.is-sent { opacity: .7; }
.lxchat__pick.is-sent input, .lxchat__pick.is-sent button, .lxchat__pick.is-sent label { pointer-events: none; }
@media (max-width: 760px) {
    .lxchat__pick-row { flex-wrap: wrap; }
    .lxchat__pick-qty { width: 100%; justify-content: flex-end; }
}
