/* ===================================================
   Assistant projet — IDEE&CO (base saine)
   Fond image : /assets/img/assistant-ui-ideeandco.webp
   But :
   - Textes + boutons directement SUR l'image (sans "feuille")
   - Barre haute : "1 minute → on vous oriente" + X (transparent)
   - Barre basse : Showroom dynamique (transparent)
   - Scroll OK (mobile + desktop)
   =================================================== */

:root {
  --ic-black: #0a0a0b;
  --ic-ink: #151515;
  --ic-cuivre: #da532c;

  --ic-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  --ic-radius: 20px;

  /* Zone safe sur l'image */
  --ic-inset-top: 19%;
  --ic-inset-x: 16%;
  --ic-inset-bottom: 18%;

  /* Tailles */
  --ic-text: .88rem;
  --ic-q: .92rem;
  --ic-opt: .82rem;
  --ic-cta: .79rem;
}

.ic-assist,
.ic-assist * {
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* =============================
   WIDGET (bulle)
   ============================= */
.ic-assist {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 99999;

  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity .25s ease, transform .25s ease;
}

.ic-assist:not(.is-visible) {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

@media (max-width:768px) {
  .ic-assist {
    right: 12px;
    bottom: 64px;
  }

  .ic-assist:not(.is-visible) {
    transform: translate(-26px, -24px);
  }
}

/* bouton flottant */
.ic-assist-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  background: var(--ic-black);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;

  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  font-weight: 600;
  font-size: .95rem;
  opacity: .92;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.ic-assist-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

.ic-assist-btn:focus {
  outline: 3px solid rgba(212, 175, 55, .45);
  outline-offset: 3px;
}

.ic-assist-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Mobile : mini bulle + tooltip */
@media (max-width:768px) {
  .ic-assist-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    font-size: 0;
    overflow: visible;
  }

  .ic-assist-btn::before {
    content: "💬";
    font-size: 20px;
    line-height: 1;
  }

  .ic-assist-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);

    background: #111;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;

    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
    transition: opacity .2s ease;
  }

  .ic-assist-btn.tip-on::after,
  .ic-assist-btn:focus::after {
    opacity: 1;
  }
}

/* =============================
   PANNEAU (image UI 4:5)
   ============================= */
.ic-assist-panel {
  width: min(420px, 92vw);
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  border-radius: var(--ic-radius);

  background: url("../img/assistant-ui-ideeandco.webp") center / cover no-repeat;
  box-shadow: var(--ic-shadow);

  transform-origin: 92% 100%;
  animation: icBookOpen .28s cubic-bezier(.2, .9, .2, 1) both;
}

@keyframes icBookOpen {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ic-assist-panel[hidden] {
  display: none;
}

@media (max-width:768px) {
  .ic-assist-panel {
    width: min(420px, 94vw);
  }
}

/* =============================
   BARRE HAUTE (transparent)
   ============================= */
.ic-assist-topbar {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 5;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 8px 44px 0;
  background: transparent !important;
  border: 0;
  box-shadow: none;

  color: #222;
  font-size: .92rem;
  font-weight: 750;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.ic-assist-topbar-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.ic-assist-topbar-title span {
  font-weight: 650;
  color: #444;
}

/* bouton fermer */
.ic-assist-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent !important;
  cursor: pointer;

  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: #222;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* =============================
   BARRE BASSE (transparent)
   ============================= */
.ic-assist-bottombar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;

  padding: 0 12px 10px;
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

.ic-assist-proximity {
  text-align: center;
  font-size: .86rem;
  line-height: 1.2;
  color: rgba(30, 30, 30, .82);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* =============================
   CONTENU SUR L'IMAGE (sans feuille)
   ============================= */
.ic-assist-content {
  position: absolute;
  left: var(--ic-inset-x);
  right: var(--ic-inset-x);
  top: var(--ic-inset-top);
  bottom: var(--ic-inset-bottom);
  z-index: 3;

  display: flex;
  flex-direction: column;
  gap: 10px;

  background: transparent;
  max-width: 285px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 6px;
  /* marge interne anti micro-débordement */
}

/* IMPORTANT pour le scroll dans un flex : */
.ic-assist-body {
  flex: 1 1 auto;
  min-height: 0;
  /* ✅ clé du scroll fiable */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  color: var(--ic-ink);
  font-size: var(--ic-text);
  line-height: 1.28;

  /* wrap agressif pour les lignes longues (Infos : ... | ...) */
  overflow-wrap: anywhere;
  word-break: break-word;

  /* scrollbar discrète */
  scrollbar-width: thin;
}

.ic-q {
  font-weight: 800;
  font-size: var(--ic-q);
  margin: 6px 0 8px;
  letter-spacing: .1px;
}

.ic-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.ic-opt {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  padding: 6px 9px;
  cursor: pointer;

  font-size: var(--ic-opt);
  font-weight: 650;
  color: #222;

  max-width: 100%;
  white-space: normal;
  /* mobile safe */
}

.ic-opt.is-active {
  background: rgba(255, 240, 234, .90);
  border-color: rgba(218, 83, 44, .70);
}

/* astuce */
.ic-assist-body .hint,
.ic-assist-body .muted {
  color: rgba(30, 30, 30, .78);
  font-size: .74rem;
  line-height: 1.25;
  opacity: .9;
}

/* =============================
   FOOT sur l'image (CTA)
   ============================= */
.ic-assist-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  align-items: center;
  /* CTA moins larges */
}

.ic-assist-cta {
  display: inline-block;
  text-align: center;
  text-decoration: none;

  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 850;
  font-size: var(--ic-cta);
  line-height: 1.15;

  border: 1px solid rgba(0, 0, 0, .10);
  max-width: 92%;
  white-space: nowrap;
}

/* CTA principal */
.ic-assist-cta:not(.ghost) {
  background: linear-gradient(180deg, #e4a976, var(--ic-cuivre));
  color: #111;
  min-width: 240px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .08);
}

/* CTA secondaire */
.ic-assist-cta.ghost {
  background: rgba(255, 255, 255, .82);
  color: #222;
  border: 1px solid rgba(0, 0, 0, .14);
  min-width: 220px;
}

.ic-assist-or {
  text-align: center;
  font-size: .86rem;
  color: rgba(40, 40, 40, .70);
  margin: -2px 0;
}

/* =============================
   Résumé premium + bouton copier + toast
   (pas de scroll interne : c'est la zone .ic-assist-body qui scrolle)
   ============================= */

.ic-summary {
  display: flex;
  flex-direction: column;
  text-align: center;
  margin-top: 6px;
}

.ic-summary-title {
  margin-bottom: 6px;
}

.ic-summary-line {
  font-size: .80rem;
  line-height: 1.25;
  opacity: .92;
  margin: 6px 0 10px;
}

/* Boîte du texte résumé : PAS de scroll interne, elle reste "dans" le flux */
.ic-summary-box {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(0, 0, 0, .10);
  text-align: left;

  white-space: pre-line;
  font-size: .80rem;
  line-height: 1.28;

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Bouton : reste visible pendant le scroll du body */
.ic-summary-copy {
  position: sticky;
  bottom: 0;

  margin: 6px auto 0;
  display: inline-block;

  padding: 6px 12px;
  font-size: .78rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .16);

  background: rgba(255, 255, 255, .92);
  /* plus opaque quand il "colle" */
  cursor: pointer;

  /* petit confort visuel quand il est sticky */
  box-shadow: 0 -10px 18px rgba(0, 0, 0, .06);
  backdrop-filter: blur(2px);
}

/* Toast "Copié ✓" */
#ic-toast {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 999999;

  background: rgba(20, 20, 20, .92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .82rem;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

#ic-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================= 
   Mobile ajustements
   ============================= */
@media (max-width:768px) {
  :root {
    --ic-inset-top: 20%;
    --ic-inset-x: 17%;
    --ic-inset-bottom: 18%;

    --ic-text: .90rem;
    --ic-q: .96rem;
    --ic-opt: .86rem;
    --ic-cta: .78rem;
  }

  .ic-assist-topbar {
    left: 8px;
    right: 8px;
    top: 8px;
  }

  .ic-assist-bottombar {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .ic-assist-cta:not(.ghost) {
    min-width: 210px;
  }

  .ic-assist-cta.ghost {
    min-width: 200px;
  }

  .ic-summary-box {
    font-size: .84rem;
    line-height: 1.28;
  }
}

@media (max-width:380px) {
  .ic-assist-cta:not(.ghost) {
    font-size: .76rem;
    padding: 6px 10px;
  }
}

/* =====================================================
   AJUSTEMENT TYPOGRAPHIE — rendu premium & discret
   ===================================================== */

/* Base texte : plus léger, plus élégant */
.ic-assist {
  font-weight: 450;
  /* au lieu de 600+ */
  letter-spacing: .15px;
}

/* Titres / questions */
.ic-q {
  font-weight: 600;
  /* avant 800 */
  letter-spacing: .2px;
}

/* Texte normal */
.ic-assist-body,
.ic-summary-box {
  font-weight: 420;
}

/* Astuce (encore plus discrète) */
.ic-assist-body .hint,
.ic-assist-body .muted {
  font-weight: 400;
  opacity: .78;
}

/* Options (chips) : moins “bouton”, plus “choix” */
.ic-opt {
  font-weight: 500;
  /* avant 650 */
  letter-spacing: .15px;
}

/* Option active : signal visuel sans gras excessif */
.ic-opt.is-active {
  font-weight: 550;
}

/* CTA : premium = pas ultra-gras */
.ic-assist-cta {
  font-weight: 650;
  /* avant 850 */
  letter-spacing: .25px;
}

/* Résumé */
.ic-summary-title strong {
  font-weight: 600;
}

.ic-summary-line {
  font-weight: 420;
}

.ic-summary-box {
  font-weight: 420;
}

/* Bouton copier : discret */
.ic-summary-copy {
  font-weight: 500;
  letter-spacing: .2px;
}

/* Barre haute "1 minute → on vous oriente" */
.ic-assist-topbar,
.ic-assist-topbar * {
  font-weight: 550;
  letter-spacing: .3px;
}

/* Barre basse showroom */
.ic-assist-proximity {
  font-weight: 420;
  letter-spacing: .2px;
}

/* Mobile : encore plus doux */
@media (max-width:768px) {
  .ic-assist {
    letter-spacing: .1px;
  }

  .ic-q {
    font-weight: 580;
  }

  .ic-assist-cta {
    font-weight: 620;
  }
}