/* ── Disclaimer d'accueil ────────────────────────────────────────────────── */
#demoDisclaimer {
  position: fixed; bottom: 88px; right: 24px; z-index: 149;
  font-family: 'DM Sans', sans-serif;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
#demoDisclaimer.visible  { opacity: 1; transform: translateY(0); pointer-events: all; }
#demoDisclaimer.hiding   { opacity: 0; transform: translateY(8px); pointer-events: none; }

.demo-disclaimer-content {
  background: #1a1a1a; color: #fff;
  border-radius: 14px; padding: 14px 18px;
  max-width: 300px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.demo-disclaimer-text {
  font-size: 13px; line-height: 1.55; flex: 1;
}
.demo-disclaimer-text strong { display: block; margin-bottom: 3px; font-size: 13px; }
.demo-disclaimer-text em { font-style: normal; font-weight: 600; color: #c5f135; }

.demo-disclaimer-close {
  background: rgba(255,255,255,.12); color: #fff; border: none;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  transition: background .15s; flex-shrink: 0;
}
.demo-disclaimer-close:hover { background: rgba(255,255,255,.22); }

.demo-disclaimer-arrow {
  color: rgba(255,255,255,.5); margin-right: 14px;
  animation: arrowBounce 1.2s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(4px, 4px); }
}

@media (max-width: 900px) {
  /* Widget fixé en bas à droite, panel s'ouvre vers le haut sur toute la largeur */
  .demo-widget { bottom: 16px; right: 16px; z-index: 200; }
  .demo-widget-panel {
    width: calc(100vw - 32px);
    right: 0;
    max-height: 80vh;
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  #demoDisclaimer { right: 12px; bottom: 80px; }
  .demo-disclaimer-content { max-width: calc(100vw - 48px); }
}

/* ── Widget de personnalisation ─────────────────────────────────────────── */
.demo-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 150;
  font-family: 'DM Sans', sans-serif;
}

.demo-widget-btn {
  display: flex; align-items: center; gap: 8px;
  background: #fff; color: #1a1a1a;
  border: 1.5px solid rgba(0,0,0,.12); border-radius: 100px;
  padding: 10px 18px 10px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  transition: box-shadow .2s, transform .15s;
  white-space: nowrap;
}
.demo-widget-btn:hover { box-shadow: 0 6px 28px rgba(0,0,0,.2); transform: translateY(-1px); }
.demo-widget-btn-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(var(--p2) 0 50%, var(--p3) 50% 75%, var(--p4) 75%);
  flex-shrink: 0;
}

.demo-widget-panel {
  position: absolute; bottom: calc(100% + 12px); right: 0;
  background: #fff; border: 1px solid rgba(0,0,0,.1); border-radius: 16px;
  padding: 20px; width: 260px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transform: translateY(10px) scale(.97);
  transition: opacity .2s, transform .2s;
}
.demo-widget-panel.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.widget-panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #999; margin-bottom: 12px;
}
.widget-group { margin-bottom: 16px; }
.widget-group-label {
  font-size: 12px; font-weight: 600; color: #444; margin-bottom: 8px; display: block;
}

/* Palette swatches */
.widget-palettes { display: flex; gap: 8px; flex-wrap: wrap; }
.widget-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent; transition: border-color .15s, transform .15s;
  position: relative;
}
.widget-swatch:hover { transform: scale(1.1); }
.widget-swatch.active { border-color: #1a1a1a; }
.widget-swatch-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; font-size: 11px; white-space: nowrap;
  padding: 4px 8px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.widget-swatch:hover .widget-swatch-tooltip { opacity: 1; }

/* Ton chips */
.widget-tons { display: flex; flex-wrap: wrap; gap: 6px; }
.widget-ton {
  font-size: 12px; font-weight: 500; color: #444;
  background: #f4f4f4; border: 1.5px solid transparent; border-radius: 100px;
  padding: 5px 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
.widget-ton:hover { background: #ebebeb; }
.widget-ton.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* Menu options */
.widget-brand-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.widget-brand-opt {
  font-size: 11px; font-weight: 600; color: #444;
  background: #f4f4f4; border: 1.5px solid transparent; border-radius: 8px;
  padding: 8px 6px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: background .15s, border-color .15s; line-height: 1.3;
}
.widget-brand-opt:hover { background: #ebebeb; }
.widget-brand-opt.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

.widget-menu-opts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.widget-menu-opt {
  font-size: 11px; font-weight: 600; color: #444;
  background: #f4f4f4; border: 1.5px solid transparent; border-radius: 8px;
  padding: 8px 6px; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  line-height: 1.3;
}
.widget-menu-opt:hover { background: #ebebeb; }
.widget-menu-opt.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.widget-menu-icon { font-size: 13px; letter-spacing: 1px; opacity: .7; }

/* Divider + CTA */
.widget-divider { height: 1px; background: #f0f0f0; margin: 14px 0; }
.widget-demo-note {
  font-size: 11px; color: #999; text-align: center; line-height: 1.5;
}
.widget-demo-note a { color: #1a1a1a; font-weight: 600; text-decoration: underline; }

/* ── Battement périodique ────────────────────────────────────────────────── */
@keyframes widgetBeat {
  0%   { transform: scale(1);    box-shadow: 0 4px 20px rgba(0,0,0,.15); }
  20%  { transform: scale(1.08); box-shadow: 0 8px 32px rgba(0,0,0,.25); }
  40%  { transform: scale(1.04); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
  60%  { transform: scale(1.08); box-shadow: 0 8px 32px rgba(0,0,0,.25); }
  100% { transform: scale(1);    box-shadow: 0 4px 20px rgba(0,0,0,.15); }
}

.demo-widget-btn.beating {
  animation: widgetBeat .9s ease-in-out;
}
.widget-demo-note a { color: #1a1a1a; font-weight: 600; text-decoration: underline; }
