#mqs-style-switcher,
#mqs-style-switcher * {
  box-sizing: border-box;
}

#mqs-style-switcher {
  --mqs-style-ink: #151515;
  position: fixed;
  right: 22px;
  bottom: calc(22px + var(--mqs-bar-h, 0px));
  z-index: 9997;
  width: min(430px, calc(100vw - 32px));
  color: var(--mqs-style-ink);
  font-family: Montserrat, Arial, sans-serif;
  transition: bottom 220ms ease;
}

body.mqs-style-open {
  overflow: hidden;
}

.mqs-style-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  border: 0;
  background: rgba(0, 0, 0, .46);
}

.mqs-style-scrim[hidden] {
  display: none;
}

#mqs-style-switcher[hidden] {
  display: none;
}

/* La pilule n'apparaît qu'avec la grande CTA « adresses disponibles » (au
   premier scroll), pas dès l'ouverture de la démo. `is-revealed` est posée par
   style-switcher.js sur l'event `mqs-bar-shown` émis par banner.js.
   ⚠️ L'animation porte sur .mqs-style-trigger, jamais sur #mqs-style-switcher :
   un `transform` sur la racine en ferait le bloc conteneur du panneau et du
   scrim (position: fixed), qui cesseraient d'être plein écran. */
#mqs-style-switcher:not(.is-revealed) { pointer-events: none; }
#mqs-style-switcher:not(.is-revealed) .mqs-style-trigger {
  opacity: 0;
  transform: translateY(10px);
}
.mqs-style-trigger {
  transition: opacity 260ms ease, transform 260ms ease;
}

.mqs-style-trigger {
  width: fit-content;
  min-width: 355px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px 10px 15px;
  border: 1px solid rgba(20, 20, 20, .13);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  color: inherit;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .16);
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(12px);
}

.mqs-style-trigger > span:first-child {
  display: grid;
  gap: 1px;
}

.mqs-style-trigger small {
  color: #777;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mqs-style-trigger strong {
  font-size: 14px;
  font-weight: 700;
}

.mqs-style-trigger-action {
  padding-left: 14px;
  padding-right: 4px;
  border-left: 1px solid #ddd;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  width: 210px;
  max-width: 210px;
  line-height: 1.3;
}

.mqs-style-panel {
  position: relative;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid rgba(20, 20, 20, .12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

.mqs-style-panel[hidden] {
  display: none;
}

.mqs-style-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mqs-style-panel-head strong {
  display: block;
  font-size: 16px;
}

.mqs-style-panel-head p,
.mqs-style-reassurance {
  margin: 4px 0 0;
  color: #6b6b6b;
  font-size: 11px;
  line-height: 1.45;
}

.mqs-style-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #333;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.mqs-style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.mqs-style-option {
  position: relative;
  min-width: 0;
  padding: 6px;
  border: 1px solid #dedede;
  border-radius: 11px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.mqs-style-option:hover,
.mqs-style-option:focus-visible {
  border-color: #777;
  outline: none;
}

.mqs-style-option.is-current {
  border-color: #151515;
  box-shadow: 0 0 0 1px #151515;
}

.mqs-style-miniature {
  position: relative;
  height: 76px;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: #efe8dc;
}

.mqs-style-miniature > span {
  position: absolute;
  display: block;
}

.mqs-style-mini-nav { top: 8px; left: 9px; width: 42%; height: 3px; background: currentColor; opacity: .65; }
.mqs-style-mini-title { left: 9px; bottom: 30px; width: 64%; height: 8px; background: currentColor; }
.mqs-style-mini-copy { left: 9px; bottom: 20px; width: 47%; height: 3px; background: currentColor; opacity: .55; }
.mqs-style-mini-button { left: 9px; bottom: 8px; width: 28%; height: 7px; border: 1px solid currentColor; }
.mqs-style-option-contrast .mqs-style-miniature { color: #fff; background: linear-gradient(112deg, #101010 0 56%, #ee6e60 56%); }
.mqs-style-option-contrast .mqs-style-mini-title { width: 72%; height: 10px; }
.mqs-style-option-drama .mqs-style-miniature { color: #c7a76a; background: linear-gradient(135deg, #090909, #292929); }
.mqs-style-option-drama .mqs-style-mini-title { left: 16px; width: 59%; height: 9px; transform: skew(-9deg); }

.mqs-style-option-copy {
  display: grid;
  gap: 4px;
  padding: 7px 3px 3px;
}

.mqs-style-option-copy > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mqs-style-option-copy strong {
  font-size: 11px;
}

.mqs-style-option-copy em {
  color: #666;
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
}

.mqs-style-selected {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 4px 6px;
  border-radius: 999px;
  background: #fff;
  color: #151515;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .18);
}

.mqs-style-option-copy small {
  min-height: 43px;
  color: #777;
  font-size: 8px;
  line-height: 1.35;
}

.mqs-style-option-copy b {
  min-height: 22px;
  color: #3f3f3f;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.3;
}

.mqs-style-reassurance {
  margin-top: 12px;
  text-align: center;
}

.mqs-style-notice {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 10002;
  padding: 11px 15px;
  border-radius: 10px;
  background: #151515;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
  font: 600 12px/1.3 Montserrat, Arial, sans-serif;
}

/* ── Mobile ────────────────────────────────────────────────────────────────
   La pastille « Style du site » devient une petite pilule sombre occupant la
   moitié gauche, alignée juste au-dessus de la grande CTA MaQuickPage (l'autre
   moitié étant tenue par « Modifier mon site », cf. preview-onboarding.css).
   Même gabarit, même habillage que la grosse bar pour former un ensemble.
   Le breakpoint est calé sur celui de banner.css (720px). */
@media (max-width: 720px) {
  #mqs-style-switcher {
    right: auto;
    left: 20px;
    width: calc(50% - 24px);
    /* env(safe-area-inset-bottom) : aligne la pilule sur la CTA, qui prend elle
       aussi en compte la barre d'accueil iPhone (cf. banner.css). */
    bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--mqs-bar-h, 0px) + 8px);
  }


  .mqs-style-trigger {
    width: 100%;
    min-width: 0;
    height: 52px;
    margin-left: 0;
    gap: 0;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: #0f0f0f;
    color: #f4f4f2;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, .08) inset,
      0 18px 40px -14px rgba(0, 0, 0, .6);
    backdrop-filter: none;
    font-family: 'Schibsted Grotesk', -apple-system, system-ui, sans-serif;
  }

  .mqs-style-trigger > span:first-child { min-width: 0; }

  .mqs-style-trigger small {
    color: rgba(255, 255, 255, .5);
    font-size: 9.5px;
    font-weight: 700;
  }

  .mqs-style-trigger strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Sur mobile la pilule ne porte plus le texte explicatif : trop long, il
     poussait la grande CTA et se faisait recouvrir. */
  .mqs-style-trigger-action { display: none; }

  /* Panneau ouvert : on masque la grande CTA et les deux pilules, sinon trois
     calques se superposent en bas d'écran. */
  body.mqs-style-open #mqs-bar-wrap,
  body.mqs-style-open .mqs-pre-edit-btn,
  body.mqs-style-open .mqs-style-trigger { display: none; }

  .mqs-style-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .mqs-style-options {
    gap: 7px;
  }

  .mqs-style-miniature {
    height: 68px;
  }

  .mqs-style-notice {
    right: 16px;
    bottom: 82px;
  }
}

/* Très petits écrans : mêmes valeurs que la pilule « Modifier mon site »
   (cf. preview-onboarding.css) pour que les deux restent jumelles. */
@media (max-width: 360px) {
  .mqs-style-trigger { padding: 0 11px; }
  .mqs-style-trigger strong { font-size: 12.5px; }
  .mqs-style-trigger small { font-size: 9px; }
}

/* ── Desktop : même disposition que sur mobile ──────────────────────────────
   La pilule était posée en bas à droite de l'écran, sans rapport avec la grande
   CTA, et se chevauchait presque avec « Modifier mon site ». Elle vient
   maintenant se caler sur la MOITIÉ GAUCHE de la bar, comme sur mobile.
   Le wording reste celui du desktop (texte explicatif conservé) ; seuls
   l'habillage et le placement changent. */
@media (min-width: 721px) {
  #mqs-style-switcher {
    left: calc(50% - var(--mqs-bar-w, min(860px, calc(100vw - 40px))) / 2);
    right: auto;
    width: calc(var(--mqs-bar-w, min(860px, calc(100vw - 40px))) / 2 - 4px);
    bottom: calc(22px + var(--mqs-bar-h, 0px) + 8px);
  }

  .mqs-style-trigger {
    width: 100%;
    min-width: 0;
    /* Hauteur commune aux deux pilules, calée sur la plus haute des deux
       (celle-ci, qui porte deux lignes plus un texte à droite). */
    min-height: 64px;
    margin-left: 0;
    gap: 14px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    /* Même habillage que la grande CTA : les trois éléments se lisent comme un
       seul ensemble au lieu de trois objets sans rapport. */
    background: #0f0f0f;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, .08) inset,
      0 18px 44px -14px rgba(0, 0, 0, .6);
    backdrop-filter: none;
    font-family: 'Schibsted Grotesk', -apple-system, system-ui, sans-serif;
  }

  .mqs-style-trigger small { color: rgba(255, 255, 255, .5); }
  .mqs-style-trigger strong { color: #f4f4f2; font-size: 15px; }

  .mqs-style-trigger-action {
    width: auto;
    max-width: none;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .6);
    font-size: 12.5px;
    font-weight: 600;
  }
}
