/* =====================================================================
 * ABIMEDIA - Offre & Négociation — v1.0
 * Fenêtre discrète en bas à droite, style chic et animé.
 * ===================================================================== */

:root {
  --abineg-accent: #0b69f6;
  --abineg-accent-dark: #084ec2;
  --abineg-ink: #101828;
  --abineg-muted: #667085;
  --abineg-line: #eef0f3;
  --abineg-ok: #0e8a49;
}

.abineg {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99998;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--abineg-line);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .22), 0 2px 8px rgba(16, 24, 40, .06);
  color: var(--abineg-ink);
  font-size: 14px;
  line-height: 1.45;
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  transition: opacity .26s cubic-bezier(.16, 1, .3, 1), transform .26s cubic-bezier(.16, 1, .3, 1);
  overflow: hidden;
}
.abineg--open { opacity: 1; transform: translateY(0) scale(1); }

/* En-tête */
.abineg__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--abineg-accent), var(--abineg-accent-dark));
}
.abineg__spark { font-size: 16px; opacity: .9; }
.abineg__close {
  margin-left: auto;
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 13px; cursor: pointer;
  transition: background .16s ease;
}
.abineg__close:hover { background: rgba(255, 255, 255, .32); }

.abineg__body { padding: 16px; }
.abineg__body--center { text-align: center; }

.abineg__intro { margin: 0 0 12px; color: var(--abineg-muted); }
.abineg__note { margin: 10px 0 0; font-size: 12px; color: var(--abineg-muted); font-style: italic; }
.abineg__ref { font-size: 13px; color: var(--abineg-muted); margin-bottom: 12px; }

/* Prix */
.abineg__prices {
  display: flex; align-items: baseline; justify-content: center;
  gap: 10px; flex-wrap: wrap; margin: 6px 0 8px;
}
.abineg__old { color: var(--abineg-muted); text-decoration: line-through; font-size: 15px; }
.abineg__new { font-size: 26px; font-weight: 800; color: var(--abineg-ink); letter-spacing: -.5px; }
.abineg__badge {
  background: #fdecec; color: #d92d20;
  font-size: 12px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px;
}
.abineg__save {
  text-align: center; font-size: 13px; color: var(--abineg-ok);
  background: #e7f6ee; border-radius: 10px; padding: 7px 10px; margin-bottom: 14px;
}

/* Boutons */
.abineg__btn {
  display: block; width: 100%;
  padding: 12px 16px; margin-bottom: 8px;
  border: 0; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: filter .16s ease, transform .16s ease, background .16s ease;
}
.abineg__btn--primary {
  background: linear-gradient(135deg, var(--abineg-accent), var(--abineg-accent-dark));
  color: #fff;
}
.abineg__btn--primary:hover { filter: brightness(1.07); transform: translateY(-1px); color: #fff; text-decoration: none; }
.abineg__btn--primary:disabled { opacity: .6; cursor: wait; transform: none; }
.abineg__btn--ghost {
  background: #f7f9fc; color: var(--abineg-accent-dark);
  border: 1px solid var(--abineg-line);
}
.abineg__btn--ghost:hover { background: #fff; border-color: var(--abineg-accent); }
.abineg__later {
  display: block; width: 100%;
  background: none; border: 0; padding: 6px;
  color: var(--abineg-muted); font-size: 13px; cursor: pointer;
  text-decoration: underline;
}
.abineg__later:hover { color: var(--abineg-ink); }

/* Saisie du prix */
.abineg__label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.abineg__inputwrap { position: relative; margin-bottom: 14px; }
.abineg__input {
  width: 100%; height: 50px;
  border: 2px solid var(--abineg-line); border-radius: 12px;
  padding: 0 38px 0 14px;
  font-size: 20px; font-weight: 700; color: var(--abineg-ink);
  outline: none; transition: border-color .16s ease, box-shadow .16s ease;
}
.abineg__input:focus { border-color: var(--abineg-accent); box-shadow: 0 0 0 4px rgba(11, 105, 246, .12); }
.abineg__input--err { border-color: #d92d20; }
.abineg__cur {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; font-weight: 700; color: var(--abineg-muted); pointer-events: none;
}

/* Bulles de discussion */
.abineg__bubble {
  padding: 10px 13px; border-radius: 12px;
  margin-bottom: 10px; font-size: 13px;
  animation: abineg-in .26s ease both;
}
.abineg__bubble--me { background: #f2f7ff; color: var(--abineg-accent-dark); border-bottom-right-radius: 4px; }
.abineg__bubble--shop { background: #f7f9fc; color: var(--abineg-ink); border-bottom-left-radius: 4px; }
@keyframes abineg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Attente */
.abineg__dots { display: flex; gap: 6px; justify-content: center; margin: 18px 0 12px; }
.abineg__dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--abineg-accent); opacity: .35;
  animation: abineg-bounce 1.1s infinite ease-in-out;
}
.abineg__dots span:nth-child(2) { animation-delay: .16s; }
.abineg__dots span:nth-child(3) { animation-delay: .32s; }
@keyframes abineg-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-7px); opacity: 1; }
}

/* Succès + coupon */
.abineg__ok {
  width: 52px; height: 52px; line-height: 52px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: #e7f6ee; color: var(--abineg-ok);
  font-size: 26px; font-weight: 800;
  animation: abineg-pop .34s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes abineg-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.abineg__couponlabel { font-size: 12px; color: var(--abineg-muted); margin-bottom: 6px; }
.abineg__coupon {
  display: inline-block;
  border: 2px dashed var(--abineg-accent);
  background: #f2f7ff; color: var(--abineg-accent-dark);
  border-radius: 12px; padding: 10px 18px;
  font-size: 19px; font-weight: 800; letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.abineg__expire { font-size: 12px; color: var(--abineg-muted); margin-bottom: 10px; }
.abineg__hint { font-size: 12px; color: var(--abineg-muted); margin: 0 0 14px; }

/* Écran « en attente de validation » */
.abineg__clock {
  font-size: 40px;
  margin: 6px 0 12px;
  animation: abineg-sway 2.4s ease-in-out infinite;
}
@keyframes abineg-sway {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

/* ---------------------------------------------------------------------
 * Bouton permanent « Négocier le prix » sur la fiche produit
 * ------------------------------------------------------------------- */
.abineg-hookbtn { margin: 12px 0; }

.abineg-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 13px 22px;
  border: 2px solid var(--abineg-accent);
  border-radius: 12px;
  background: #fff;
  color: var(--abineg-accent-dark);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.abineg-trigger:hover {
  background: linear-gradient(135deg, var(--abineg-accent), var(--abineg-accent-dark));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 105, 246, .22);
}
.abineg-trigger__icon { font-size: 17px; }

/* Mobile : la fenêtre s'ancre en bas, pleine largeur */
@media (max-width: 600px) {
  .abineg {
    right: 10px; left: 10px; bottom: 10px;
    width: auto; border-radius: 16px;
  }
  .abineg__new { font-size: 23px; }
}
