/* Guide d'achat — 2f2c Agence */
.sg-guide, .sg-banner, .sg-cta, .sg-float, .sg-drawer {
  --sg-accent: #1f6feb;
  --sg-ink: #fff;
  --sg-accent-text: var(--sg-accent);
  --sg-soft: color-mix(in srgb, var(--sg-accent) 7%, #fff);
  --sg-soft-2: color-mix(in srgb, var(--sg-accent) 14%, #fff);
  --sg-border: #e3e6ea;
  --sg-text: #1d2330;
  --sg-muted: #6b7280;
}
@supports not (color: color-mix(in srgb, red 50%, white)) {
  .sg-guide, .sg-banner, .sg-cta, .sg-float, .sg-drawer { --sg-soft: #f6f7fb; --sg-soft-2: #eceff7; }
}
.sg-guide [hidden], .sg-drawer[hidden], .sg-banner [hidden] { display: none !important; }

/* ---------- Bandeau d'entrée (tête de catégorie, accueil, shortcode) ---------- */
.sg-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  background: var(--sg-accent);
  color: var(--sg-ink);
}
.sg-banner-visual { flex: 0 0 auto; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; color: var(--sg-ink); }
.sg-banner-visual img { width: 100%; height: 100%; object-fit: contain; }
.sg-banner-visual svg { width: 56px; height: 56px; }
.sg-banner-text { flex: 1 1 auto; min-width: 0; }
.sg-banner-title { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.3; color: var(--sg-ink); }
.sg-banner-sub { margin: .2rem 0 0; font-size: .92rem; opacity: .85; color: var(--sg-ink); }
.sg-banner-btn {
  flex: 0 0 auto;
  padding: .8rem 1.4rem;
  border: 0;
  border-radius: 6px;
  background: #fff !important;
  color: var(--sg-accent-text) !important;
  opacity: 1 !important;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sg-banner-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }

/* ---------- Bouton (fiche produit, shortcode) ---------- */
.sg-cta { margin: 1rem 0; }
.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .8rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--sg-accent) 80%, #000) !important;
  border-radius: 6px;
  background: var(--sg-accent) !important;
  color: var(--sg-ink) !important;
  opacity: 1 !important;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: .01em;
  text-shadow: none !important;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sg-btn:hover, .sg-btn:focus { color: var(--sg-ink) !important; filter: brightness(.93); text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--sg-accent) 35%, transparent); }
.sg-btn-sm { padding: .55rem 1.1rem; font-size: .9rem; }

/* ---------- Bouton flottant ---------- */
.sg-float {
  position: fixed;
  bottom: 20px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--sg-accent) !important;
  color: var(--sg-ink) !important;
  font-weight: 600;
  font-size: .95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: transform .15s ease;
}
.sg-float:hover { transform: translateY(-2px); }
.sg-float--right { right: 20px; }
.sg-float--left { left: 20px; }
.sg-float-icon { font-size: 1.1rem; line-height: 1; }

/* ---------- Panneau latéral ---------- */
.sg-drawer { position: fixed; inset: 0; z-index: 10050; }
.sg-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 28, .5);
  opacity: 0;
  transition: opacity .25s ease;
}
.sg-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  outline: none;
}
.sg-drawer.is-open .sg-drawer-backdrop { opacity: 1; }
.sg-drawer.is-open .sg-drawer-panel { transform: none; }
html.sg-lock, html.sg-lock body { overflow: hidden; }

/* ---------- Questionnaire ---------- */
.sg-guide {
  position: relative;
  margin: 0 0 2rem;
  padding: 1.75rem;
  border: 1px solid var(--sg-border);
  border-radius: 10px;
  background: #fff;
  color: var(--sg-text);
}
.sg-guide.sg-in-drawer { margin: 0; padding: 1.5rem 1.75rem 2rem; border: 0; border-radius: 0; min-height: 100%; }

.sg-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
}
.sg-in-drawer .sg-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -1.5rem -1.75rem .75rem;
  padding: 1.1rem 1.75rem .6rem;
  background: #fff;
}
.sg-tb {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem 0;
  border: 0;
  background: none;
  color: var(--sg-text);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}
.sg-tb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sg-tb:hover { color: var(--sg-accent-text); }
.sg-tb[hidden] { display: inline-flex !important; visibility: hidden; }
.sg-back { justify-self: start; }
.sg-restart { justify-self: center; }
.sg-close, .sg-tb-spacer { justify-self: end; }

.sg-progress { height: 4px; margin: 0 0 1.75rem; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.sg-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sg-accent); transition: width .35s ease; }

.sg-welcome { padding: 1.5rem 0 .5rem; animation: sg-in .25s ease; }
.sg-in-drawer .sg-welcome { padding-top: 22vh; }
.sg-kicker { margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sg-accent-text); }
.sg-title { margin: 0 0 .75rem; font-size: 1.7rem; line-height: 1.2; font-weight: 700; text-transform: none; color: var(--sg-text); }
.sg-intro { margin: 0 0 1.5rem; color: var(--sg-text); opacity: .85; line-height: 1.5; }
.sg-start { min-width: 200px; padding: .9rem 2rem; }
.sg-welcome-meta { margin: .75rem 0 0; font-size: .85rem; color: var(--sg-muted); }

.sg-step { margin: 0; padding: 0; border: 0; min-width: 0; animation: sg-in .25s ease; }
.sg-question {
  display: block;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sg-text);
}
.sg-question-hint { margin: -.75rem 0 1.25rem; color: var(--sg-muted); line-height: 1.45; }
.sg-answers { display: flex; flex-direction: column; gap: .75rem; }
.sg-answer {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 56px;
  padding: .9rem 1rem;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: var(--sg-soft);
  color: var(--sg-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sg-answer:hover { border-color: var(--sg-accent); }
.sg-answer:focus-visible { outline: 3px solid color-mix(in srgb, var(--sg-accent) 40%, transparent); outline-offset: 2px; }
.sg-answer.is-selected { border-color: var(--sg-accent); background: var(--sg-soft-2); }
.sg-icon { flex: 0 0 auto; font-size: 1.4rem; line-height: 1; }
.sg-answer-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.sg-label { font-weight: 700; line-height: 1.3; }
.sg-hint { font-size: .85rem; color: var(--sg-muted); line-height: 1.35; }
.sg-chevron { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--sg-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s ease, transform .15s ease; }
.sg-answer:hover .sg-chevron, .sg-answer.is-selected .sg-chevron { stroke: var(--sg-accent); transform: translateX(2px); }

/* ---------- Résultats ---------- */
.sg-results { animation: sg-in .25s ease; }
.sg-results-title { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 700; text-transform: none; color: var(--sg-text); }
.sg-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.sg-summary li { padding: .25rem .7rem; border-radius: 999px; background: var(--sg-soft-2); color: var(--sg-text); font-size: .82rem; }

.sg-advice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  padding: .9rem 1rem;
  border-left: 3px solid var(--sg-accent);
  border-radius: 0 8px 8px 0;
  background: var(--sg-soft);
}
.sg-advice-icon { font-size: 1.3rem; line-height: 1.2; }
.sg-advice-body { flex: 1; min-width: 0; }
.sg-advice-title { margin: 0 0 .2rem; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sg-accent-text); }
.sg-advice-text { margin: 0; line-height: 1.5; white-space: pre-line; }
.sg-advice.is-loading .sg-advice-text {
  height: 2.6em;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.09) 50%, rgba(0,0,0,.05) 75%);
  background-size: 200% 100%;
  animation: sg-shimmer 1.2s infinite linear;
}

.sg-limit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin: 0 0 1.25rem;
  padding: .9rem 1rem;
  border: 1px dashed var(--sg-accent);
  border-radius: 8px;
}
.sg-limit p { margin: 0; flex: 1 1 240px; }

.sg-fallback, .sg-empty { color: var(--sg-muted); margin: 0 0 1rem; }
/* Grille des résultats : CSS grid, indépendante des colonnes/flottants du thème
   (des cartes de hauteurs différentes ne peuvent plus « accrocher » et décaler les lignes) */
.sg-guide .sg-products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin: 0 !important;
  padding: 0;
  float: none !important;
}
.sg-guide .sg-products::before, .sg-guide .sg-products::after { display: none !important; content: none !important; }
.sg-guide .sg-products > * {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  box-sizing: border-box;
}
/* Dans le panneau : 2 produits par ligne quelle que soit la grille du thème */
.sg-in-drawer .sg-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 380px) { .sg-guide .sg-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.sg-feedback { margin: 1.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--sg-border); text-align: center; }
.sg-feedback-q { margin: 0 0 .6rem; font-weight: 600; }
.sg-feedback-btns { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.sg-rate {
  padding: .5rem 1rem;
  border: 1.5px solid var(--sg-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sg-text);
  cursor: pointer;
  font-size: .92rem;
  transition: border-color .15s ease, background .15s ease;
}
.sg-rate:hover { border-color: var(--sg-accent); background: var(--sg-soft); }
.sg-feedback-thanks, .sg-feedback-help { margin: .4rem 0 0; color: var(--sg-muted); }
.sg-feedback-help a { color: var(--sg-accent-text); font-weight: 600; }

.sg-loading { display: flex; gap: .4rem; justify-content: center; padding: 2.5rem 0; }
.sg-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--sg-accent); animation: sg-dot 1s infinite ease-in-out; }
.sg-loading span:nth-child(2) { animation-delay: .15s; }
.sg-loading span:nth-child(3) { animation-delay: .3s; }

@keyframes sg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sg-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes sg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 767px) {
  .sg-banner { flex-wrap: wrap; padding: 1rem 1.1rem; gap: .9rem; }
  .sg-banner-visual { width: 52px; height: 52px; }
  .sg-banner-visual svg { width: 42px; height: 42px; }
  .sg-banner-text { flex-basis: calc(100% - 70px); }
  .sg-banner-btn { flex: 1 1 100%; }
}
@media (max-width: 575px) {
  .sg-guide { padding: 1.25rem 1rem; }
  .sg-guide.sg-in-drawer { padding: 1.25rem 1.1rem 2rem; }
  .sg-in-drawer .sg-topbar { top: 0; margin: -1.25rem -1.1rem .75rem; padding: 1rem 1.1rem .5rem; }
  .sg-in-drawer .sg-welcome { padding-top: 12vh; }
  .sg-title { font-size: 1.4rem; }
  .sg-question { font-size: 1.25rem; }
  .sg-float { bottom: 14px; padding: .7rem; }
  .sg-float--right { right: 14px; }
  .sg-float--left { left: 14px; }
  .sg-float-label { display: none; }
  .sg-float-icon { font-size: 1.4rem; }
  .sg-cta .sg-btn { width: 100%; }
  .sg-tb { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-guide *, .sg-drawer, .sg-drawer * { animation: none !important; transition: none !important; }
}
