#sc-configurator,
#sc-configurator * {
  box-sizing: border-box;
}

/* Filet de sécurité : si une deuxième copie du configurateur apparaît sur
   la page pour une raison quelconque, elle est masquée immédiatement (le
   JS la supprime ensuite physiquement). Un seul exemplaire doit exister. */
#sc-configurator ~ #sc-configurator {
  display: none !important;
}

.sc-checkout .sc-delivery-hook {
  margin-top: 10px;
}

.sc-checkout .sc-delivery-hook:empty {
  display: none;
}

.sc-checkout .sc-delivery-hook > * {
  margin: 0;
}

#sc-configurator .sc-checkout .sc-delivery-hook,
#sc-configurator .sc-checkout .sc-delivery-hook * {
  background: transparent !important;
  color: #172026 !important;
}

.sc-page-shell {
  width: 100%;
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 12px;
}

#sc-configurator button,
#sc-configurator input,
#sc-configurator textarea,
#sc-configurator select {
  font: inherit;
}

#sc-configurator button {
  cursor: pointer;
}

.sc-product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  gap: 28px;
  width: 100%;
  align-items: start;
}

/* Une fois l'aperçu déplacé dans la galerie photo du produit (cas normal
   sur la fiche produit), le panneau d'aperçu d'origine ne contient plus
   rien de visible (hauteur 0) — mais tant que la grille garde 2 colonnes,
   il continue de réserver ~47% de la largeur totale pour rien, écrasant
   la colonne des choix dans l'espace restant. On repasse donc en 1 seule
   colonne pleine largeur dans ce cas précis. */
.sc-product.pc-preview-collapsed {
  grid-template-columns: 1fr;
}

.sc-product.pc-preview-collapsed .sc-config-panel {
  max-width: none;
}

.sc-preview-panel,
.sc-config-panel {
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
}

.sc-preview-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  min-height: 650px;
  overflow: hidden;
}

.sc-preview-tools,
.sc-preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
}

.sc-preview-tools {
  justify-content: flex-end;
  border-bottom: 1px solid #d9e1e7;
}

/* Miroir de la barre de zoom dans la galerie photo native (le vrai
   panneau d'aperçu est masqué à cet endroit-là — voir
   syncPreviewWithProductImages) : superposée en haut à droite de l'image,
   par-dessus, plutôt qu'insérée dans le flux normal de la page. */
.sc-preview-tools-mirror {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 6px;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  padding: 4px;
}

.sc-preview-tools span {
  margin-right: auto;
  color: #66717a;
  font-size: 14px;
}

.sc-icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #d9e1e7;
  border-radius: 6px;
  background: #fff;
  color: #172026;
  font-weight: 800;
}

.sc-preview-surface {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 530px;
  padding: 42px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 32, 38, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 38, 0.055) 1px, transparent 1px),
    #f7fafb;
  background-size: 26px 26px;
}

/* En mode logo, le cadre plus petit évite un grand vide au-dessus du
   logo (centré verticalement) — sinon l'étiquette de dimensions, placée
   juste au-dessus du logo, semble très loin du haut du cadre. */
.sc-preview-surface-logo-mode {
  min-height: 260px;
}

.sc-guide {
  display: none;
}

.sc-dimension-label {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  color: #172026;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  transition: top 0.16s ease, left 0.16s ease, width 0.16s ease;
}

.sc-dimension-label span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 999px;
  white-space: nowrap;
}

.sc-dimension-label span::before,
.sc-dimension-label span::after {
  content: '';
  width: 7px;
  height: 7px;
  border-top: 2px solid #8a97a3;
  flex-shrink: 0;
}

.sc-dimension-label span::before {
  border-left: 2px solid #8a97a3;
  transform: rotate(-45deg);
}

.sc-dimension-label span::after {
  border-right: 2px solid #8a97a3;
  transform: rotate(45deg);
}

.sc-dimension-label-secondary {
  z-index: 4;
  color: #1769aa;
  top: 34px;
}

.sc-dimension-label-secondary span {
  border-color: rgba(23, 105, 170, 0.35);
}

.sc-dimension-label-total {
  z-index: 4;
  color: #172026;
  top: auto;
  bottom: 10px;
}

.sc-dimension-label-total span {
  border-color: rgba(23, 32, 38, 0.28);
}

.sc-total-size-reminder {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e1e7;
  border-radius: 6px;
  background: #f7fafb;
  color: #66717a;
  font-size: 13px;
}

.sc-total-size-reminder strong {
  color: #172026;
}

.sc-sticker-shadow {
  position: relative;
  z-index: 4;
  max-width: 100%;
  padding: 16px 24px;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.12));
}

.sc-sticker-shadow.sc-combined-preview {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.sc-sticker-preview {
  position: relative;
  z-index: 6;
  min-width: 100px;
  color: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 72px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  transform-origin: center;
}

.sc-sticker-preview.sc-multiline {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sc-logo-preview {
  position: relative;
  z-index: 5;
  order: -1;
  display: grid;
  place-items: center;
  width: min(480px, 85vw);
  max-width: 100%;
  color: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: center;
}

.sc-logo-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.sc-sticker-preview.is-dragging,
.sc-logo-preview.is-dragging {
  cursor: grabbing;
}

.sc-sticker-preview.sc-stencil {
  -webkit-text-stroke: 2px currentColor;
  color: transparent;
}

.sc-preview-meta {
  justify-content: space-between;
  color: #66717a;
  border-top: 1px solid #d9e1e7;
}

.sc-config-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.sc-product-heading {
  padding-bottom: 0;
  border-bottom: 1px solid #d9e1e7;
}

.sc-product-heading .sc-crumb,
.sc-product-heading h1,
.sc-product-heading:has(.sc-rating[hidden]) {
  display: none;
}

.sc-crumb {
  margin: 0 0 8px;
  color: #126b8f;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.sc-product-heading h1 {
  margin: 0 0 12px;
  color: #172026;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.sc-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f3a400;
}

.sc-rating strong {
  color: #172026;
}

.sc-rating small {
  color: #66717a;
}

.sc-step {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #f3f7f8;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
}

.sc-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-step-title span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: #126b8f;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.sc-config-panel {
  counter-reset: sc-step-counter;
}

.sc-config-panel .sc-step:not([hidden]) {
  counter-increment: sc-step-counter;
}

.sc-config-panel .sc-step .sc-step-title > span {
  font-size: 0;
}

.sc-config-panel .sc-step .sc-step-title > span::before {
  content: counter(sc-step-counter);
  font-size: 13px;
}

.sc-step-title h2 {
  margin: 0;
  color: #172026;
  font-size: 18px;
}

#sc-configurator textarea,
#sc-configurator input,
#sc-configurator select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: #172026;
  background: #fff;
  border: 1px solid #c7d2da;
  border-radius: 6px;
}

#sc-configurator textarea {
  resize: vertical;
}

#sc-configurator label {
  display: grid;
  gap: 7px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.sc-specials,
.sc-font-tabs,
.sc-qty-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 42px));
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  gap: 8px;
}

#sc-configurator .sc-qty-custom-group {
  display: contents !important;
}

#sc-configurator .sc-quantity-stepper {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 8px;
}

.sc-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.sc-specials button,
.sc-font-tabs button,
.sc-mode-tabs button,
.sc-qty-row button,
.sc-font-card,
.sc-logo-card,
.sc-material-card {
  min-height: 38px;
  border: 1px solid #c7d2da;
  border-radius: 6px;
  background: #fff;
  color: #172026;
}

.sc-specials button {
  width: 38px;
}

.sc-font-tabs button {
  padding: 0 12px;
}

.sc-mode-tabs button {
  flex: 0 1 190px;
  padding: 0 14px;
  font-weight: 800;
}

.sc-mode-tabs button.active,
.sc-font-tabs button.active,
.sc-qty-row button.active,
.sc-font-card.active,
.sc-logo-card.active,
.sc-material-card.active {
  border-color: #e64123;
  box-shadow: inset 0 0 0 2px #e64123;
}

.sc-logo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sc-logo-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 10px;
  text-align: center;
}

.sc-logo-card svg {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  color: #172026;
}

.sc-logo-card span {
  color: #66717a;
  font-size: 12px;
}

.sc-font-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sc-font-card {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px 10px;
  text-align: center;
}

.sc-font-card strong {
  font-size: 16px;
  line-height: 1.8;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.sc-font-card span {
  color: #66717a;
  font-size: 12px;
}

.sc-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 30px);
  gap: 7px;
  justify-content: start;
}

.sc-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sc-material-card {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 10px;
  text-align: left;
}

.sc-material-card strong {
  overflow: visible;
  color: #172026;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.sc-material-card span {
  color: #66717a;
  font-size: 12px;
}

.sc-native-material-field {
  display: none !important;
}

.sc-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  aspect-ratio: 1;
  min-height: 0;
  border: 1px solid rgba(23, 32, 38, 0.18);
  border-radius: 6px;
  background: var(--swatch);
}

.sc-swatch.active::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #172026;
}

.sc-two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sc-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sc-two-cols > *,
.sc-size-grid > * {
  min-width: 0;
  max-width: 100%;
}

#sc-configurator .sc-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #172026;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

#sc-configurator .sc-check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: #e64123;
}

.sc-qty-row input {
  width: 96px;
}

.sc-qty-row button {
  width: 42px;
}

.sc-qty-custom-group {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  gap: 58px;
}

.sc-quantity-stepper {
  display: inline-grid;
  grid-template-columns: 42px minmax(72px, 96px) 42px;
  align-items: stretch;
  justify-content: start;
  gap: 6px;
}

#sc-configurator .sc-quantity-stepper button,
#sc-configurator .sc-quantity-stepper input {
  width: 100%;
  min-height: 40px;
  margin: 0;
}

.sc-config-panel .sc-quantity-stepper button {
  border: 1px solid #00cfff !important;
  border-radius: 6px;
  color: #04131a !important;
  background: #39dcff !important;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(0, 207, 255, 0.28);
}

.sc-config-panel .sc-quantity-stepper input {
  color: #0f172a !important;
  border-color: rgba(0, 174, 232, 0.48) !important;
  background: #e8f8ff !important;
  padding: 0 !important;
  text-align: center !important;
  -moz-appearance: textfield;
  appearance: textfield;
  box-shadow: inset 0 0 0 1px rgba(0, 207, 255, 0.12);
}

.sc-config-panel .sc-quantity-stepper input::-webkit-inner-spin-button,
.sc-config-panel .sc-quantity-stepper input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.sc-secondary-action {
  min-height: 40px;
  padding: 0 14px;
  color: #172026;
  background: #fff;
  border: 1px solid #c7d2da;
  border-radius: 6px;
  font-weight: 800;
}

.sc-checkout {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: #172026;
  border-radius: 8px;
}

.sc-checkout small {
  display: block;
  margin-bottom: 4px;
  color: #aab7bd;
}

.sc-checkout strong {
  color: #fff;
  font-size: 28px;
}

.sc-checkout-summary {
  display: grid;
  gap: 9px;
  min-width: 220px;
  width: 100%;
  font-size: 13px;
  color: #55606b;
}

.sc-checkout-summary span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  line-height: 1.2;
}

.sc-checkout-summary strong {
  color: #172026;
  font-style: normal;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  text-align: left;
}

.sc-checkout-summary em {
  color: #172026;
  font-style: normal;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  text-align: right;
}

.sc-checkout-summary small {
  margin-top: 4px;
  text-align: center;
}

.sc-checkout button,
#sc-cart-dialog button {
  min-height: 46px;
  padding: 0 22px;
  color: #fff;
  background: #e64123;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.sc-checkout button:hover,
#sc-cart-dialog button:hover {
  background: #bb2f18;
}

.sc-trust-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
}

.sc-trust-band article {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 22px;
  background: #fff;
  border: 1px solid #d9e1e7;
}

.sc-trust-band strong {
  color: #14785f;
}

.sc-trust-band span {
  color: #66717a;
}

#sc-cart-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
}

#sc-cart-dialog::backdrop {
  background: rgba(23, 32, 38, 0.45);
}

.sticker-configurator-link {
  margin: 1rem 0;
}

.sc-product-embedded {
  margin: 0;
}

/* Mode intégré (dans la colonne produit) : une seule colonne, pleine
   largeur — l'aperçu vit désormais en permanence dans la galerie photo,
   il ne partage plus jamais cet espace avec le panneau de personnalisation. */
#sc-configurator.sc-product-embedded {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

#sc-configurator.sc-product-embedded .sc-config-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: static !important;
  top: auto !important;
}

/* Aperçu live déplacé dans la galerie photo du produit (par défaut) :
   il doit ressembler exactement à une photo produit, sans aucun élément
   d'interface du configurateur qui dépasse. */
.sc-preview-in-gallery {
  margin-bottom: 16px;
  cursor: pointer;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

/* Le vrai panneau reste dans le DOM (indispensable pour le script) mais
   n'est plus affiché — sa largeur est préservée (pas de display:none)
   pour que les calculs de taille de police restent corrects. */
.sc-preview-source-hidden {
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* La colonne image (galerie produit, avec notre aperçu dedans) reste
   visible à l'écran pendant que le client fait défiler le panneau de
   personnalisation, plus long, à droite. La fenêtre de zoom est déplacée
   à la racine de la page en JS pour ne jamais être piégée par ce sticky. */
@media (min-width: 768px) {
  body:has(#sc-configurator) .product__left {
    position: sticky;
    top: 20px;
    align-self: start;
  }
}

.sc-preview-in-gallery .sc-preview-tools,
.sc-preview-in-gallery .sc-preview-meta {
  display: none !important;
}

.sc-preview-in-gallery .sc-preview-surface {
  aspect-ratio: 1 / 1;
  min-height: 0 !important;
  border-radius: 0;
  background: #ffffff;
}

/* Empêche tout saut de hauteur du carrousel en passant d'une photo native
   à l'aperçu (et inversement) : toutes les slides ont le même ratio. */
.product__carousel .carousel-item,
.product__carousel .carousel-inner {
  aspect-ratio: 1 / 1;
  width: 100% !important;
}

.product__carousel .carousel-item picture,
.product__carousel .carousel-item img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.sc-preview-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.12), rgba(0, 207, 255, 0.12));
}

.sc-preview-thumb-icon {
  font-size: 20px;
}

.sc-preview-thumb.active {
  outline: 2px solid var(--sc-accent-violet, #7b4dff);
}

/* Encadré bleu natif au toucher/clic — retiré partout, gardé uniquement
   au clavier (accessibilité) grâce à :focus-visible. */
*:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Le prix et la quantité natifs du thème n'ont pas d'utilité sur un produit
   personnalisé : tout se règle dans le configurateur, qui a son propre prix
   calculé en direct et une quantité fixée à 1. */
body:has(#sc-configurator.sc-product-embedded) .product__prices,
body:has(#sc-configurator.sc-product-embedded) .product__actions-qty-add .quantity-button,
body:has(#sc-configurator.sc-product-embedded) .product-actions__quantity {
  display: none !important;
}

/* Prix et quantité natifs du thème masqués uniquement (le configurateur
   garde les siens, plus précis puisque calculés selon la personnalisation). */


.pc-cart-edit-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sc-accent-violet, #7b4dff);
  text-decoration: underline;
}

.pc-cart-preview-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.pc-cart-preview-button,
.pc-cart-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid #d7dce8;
  border-radius: 8px;
  background: #fff;
  color: #161821;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 10px rgba(0, 112, 255, 0.12);
}

.pc-cart-preview-button:hover,
.pc-cart-edit:hover {
  color: #161821;
  text-decoration: none;
  border-color: var(--sc-accent-cyan, #00cfff);
}

.sc-preview-extracted {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
}

.sc-preview-extracted .sc-config-panel {
  width: 100%;
}

.sc-live-cover-host {
  width: 100%;
  min-height: 452px;
}

.sc-live-cover-host .sc-preview-panel {
  position: relative;
  top: auto;
  width: 100%;
  min-height: 0;
  box-shadow: none;
}

.sc-live-cover-host .sc-preview-surface {
  min-height: 330px;
  aspect-ratio: 1 / 1;
  padding: 28px;
}

.sc-preview-in-product-cover .product-cover {
  min-height: 452px;
}

.sc-product-cover-hidden {
  display: none !important;
}

.sc-example-images {
  padding: 14px 18px 18px;
  border-top: 1px solid #d9e1e7;
}

.sc-example-images-title {
  margin-bottom: 10px;
  color: #66717a;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.sc-example-images .js-qv-mask,
.sc-example-images .mask {
  width: 100%;
  height: auto;
  overflow: visible;
}

.sc-example-images .product-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.sc-example-images .thumb-container {
  width: auto;
  height: auto;
  margin: 0;
  list-style: none;
}

.sc-example-images .thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border: 1px solid #d9e1e7;
  border-radius: 6px;
}

.sc-font-picker-button,
.sc-text-editor-button {
  min-height: 44px;
  padding: 0 14px;
  color: #172026;
  background: #fff;
  border: 1px solid #c7d2da;
  border-radius: 6px;
  font-weight: 800;
  text-align: left;
}

.sc-font-picker-dialog,
.sc-text-editor-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: 86vh;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 38, 0.28);
}

.sc-font-picker-dialog::backdrop,
.sc-text-editor-dialog::backdrop {
  background: rgba(23, 32, 38, 0.55);
}

.sc-font-picker-dialog h2,
.sc-text-editor-dialog h2 {
  margin: 0 48px 14px 0;
  color: #172026;
  font-size: 22px;
}

.sc-font-picker-dialog form,
.sc-text-editor-dialog form {
  position: absolute;
  top: 12px;
  right: 12px;
}

.sc-font-picker-close,
.sc-text-editor-close {
  width: 36px;
  height: 36px;
  color: #fff;
  background: #172026;
  border: 0;
  border-radius: 50%;
  font-weight: 800;
}

.sc-font-picker-content {
  display: grid;
  gap: 12px;
}

.sc-font-picker-validate,
.sc-text-editor-validate {
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  color: #fff;
  background: #e64123;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  font-size: 16px;
}

.sc-font-picker-preview,
.sc-text-editor-preview {
  display: grid;
  place-items: center;
  min-height: 110px;
  margin-bottom: 14px;
  padding: 16px;
  color: #111;
  background:
    linear-gradient(90deg, rgba(23, 32, 38, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 38, 0.055) 1px, transparent 1px),
    #f7fafb;
  background-size: 22px 22px;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.sc-text-editor-input {
  width: 100%;
  min-height: 132px;
  padding: 12px;
  color: #172026;
  background: #fff;
  border: 1px solid #c7d2da;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.35;
  resize: vertical;
}

#sc-configurator[data-sc-text-editor-ready="1"] #sc-text-input,
#sc-configurator[data-sc-text-editor-ready="1"] .sc-text-panel .sc-specials {
  display: none;
}

.sc-gallery-dialog {
  width: min(920px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 32, 38, 0.28);
}

.sc-gallery-dialog::backdrop {
  background: rgba(23, 32, 38, 0.62);
}

.sc-gallery-dialog img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
}

.sc-gallery-dialog form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.sc-gallery-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: #111827;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.sc-cart-preview {
  margin-top: 20px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
}

.sc-cart-preview h3 {
  margin: 0 0 12px;
  color: #172026;
  font-size: 18px;
}

.sc-cart-preview-content {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
}

.sc-cart-preview-art {
  display: grid;
  place-items: center;
  min-height: 80px;
  padding: 10px;
  background: #f7fafb;
  border: 1px solid #d9e1e7;
  border-radius: 6px;
  color: #111;
  text-align: center;
  overflow: hidden;
}

.sc-cart-preview-art svg {
  width: 76px;
  height: auto;
}

#sc-configurator .sc-preview-surface.sc-dark-contrast,
.sc-font-picker-preview.sc-dark-contrast,
.sc-text-editor-preview.sc-dark-contrast,
.sc-cart-preview-art.sc-dark-contrast {
  background: #292f38 !important;
  background-image: none !important;
}

.sc-cart-preview-summary {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #66717a;
  font-size: 13px;
  line-height: 1.35;
}

.sc-cart-preview-summary > span {
  display: grid;
  grid-template-columns: minmax(105px, 120px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.sc-cart-preview-summary strong {
  color: #161821;
  font-size: 12px;
  font-weight: 700;
}

.sc-cart-preview-summary em {
  min-width: 0;
  color: #6b7280;
  font-style: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.sc-cart-preview-summary .pc-cart-customer-text em {
  color: #161821;
  font-weight: 600;
}

.sc-cart-preview-summary .sc-cart-price-ht {
  margin-top: 3px;
  padding: 5px 7px;
  border: 1px solid rgba(0, 174, 232, 0.48);
  border-radius: 4px;
  background: rgba(0, 174, 232, 0.08);
}

.sc-cart-preview-summary .sc-cart-price-ht strong,
.sc-cart-preview-summary .sc-cart-price-ht em {
  color: #161821;
  font-weight: 700;
}

.sc-cart-preview-summary .pc-cart-preview-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.sc-cart-preview-empty {
  margin: 0;
  color: #66717a;
}

.sc-reassurance-moved {
  margin: 18px 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
}

.sc-reassurance-moved .block-title,
.sc-reassurance-moved p {
  color: #66717a;
}

[data-sc-hidden-native-customization="1"],
[data-sc-hidden-empty-variants="1"],
[data-sc-hidden-native-qty="1"],
[data-sc-hidden-social-sharing="1"],
[data-sc-hidden-native-cover="1"],
[data-sc-hidden-native-buybox="1"] {
  display: none !important;
}

.sc-product-title-holder {
  max-width: 960px;
  margin: 0 auto 18px;
  padding: 0 12px;
}

.sc-product-title-holder .product-detail-name {
  margin: 0;
  color: #172026;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 1180px) {
  .sc-product {
    grid-template-columns: 1fr;
  }

  .sc-preview-panel {
    position: static;
    min-height: auto;
  }

  .sc-preview-surface {
    min-height: 380px;
  }
}

@media (max-width: 680px) {
  .sc-config-panel {
    padding: 14px;
  }

  .sc-page-shell {
    margin-top: 14px;
    padding: 0 12px;
  }

  .sc-preview-tools,
  .sc-preview-meta {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }

  .sc-preview-surface {
    min-height: 0;
    padding: 12px 10px;
  }

  .sc-sticker-shadow {
    padding: 6px 6px;
  }

  .sc-sticker-preview {
    font-size: min(40px, var(--sc-preview-font-size, 40px));
  }

  .sc-preview-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    max-height: 180px;
    min-height: 0;
    overflow: hidden;
  }

  .sc-config-editing .sc-preview-panel {
    position: static;
  }

  .sc-config-panel {
    position: relative;
    z-index: 10;
    background: #fff;
  }

  #sc-text-input {
    min-height: 112px;
    font-size: 16px;
    line-height: 1.35;
    touch-action: manipulation;
    position: relative;
    z-index: 30;
    background: #fff;
  }

  .sc-example-images {
    padding: 6px 10px 8px;
  }

  .sc-example-images-title {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .sc-example-images .product-images {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sc-example-images .thumb {
    width: 44px;
    height: 44px;
  }

  .sc-font-grid,
  .sc-two-cols,
  .sc-trust-band {
    grid-template-columns: 1fr;
  }

  /* Les choix de personnage (déclinaisons de couleur, etc.) restent sur 2
     colonnes même sur mobile : en 1 seule colonne, la liste devient bien
     trop longue à faire défiler dès qu'il y a une dizaine de choix. */
  .sc-font-grid.pc-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .sc-font-picker-dialog .sc-font-grid,
  .sc-logo-grid {
    grid-template-columns: 1fr;
  }

  #sc-configurator[data-sc-font-picker-ready="1"] .sc-font-tabs,
  #sc-configurator[data-sc-font-picker-ready="1"] .sc-font-grid {
    display: none;
  }

  .sc-font-picker-dialog .sc-font-tabs,
  .sc-font-picker-dialog .sc-font-grid {
    display: flex;
  }

  .sc-font-picker-dialog .sc-font-grid {
    display: grid;
  }

  .sc-font-picker-preview,
  .sc-text-editor-preview {
    min-height: 96px;
    font-size: 34px;
  }

  .sc-color-grid {
    grid-template-columns: repeat(auto-fill, 28px);
    gap: 6px;
  }

  .sc-swatch {
    width: 28px;
    height: 28px;
  }

  .sc-material-grid {
    grid-template-columns: 1fr;
  }

  .sc-checkout {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .sc-checkout strong {
    font-size: 24px;
  }

  .sc-product-heading h1 {
    font-size: 30px;
  }

  .sc-product-title-holder .product-detail-name {
    font-size: 30px;
  }
}

/* CreativColor — thème clair et lumineux (remplace l'ancien habillage sombre) */
#sc-configurator {
  --sc-accent-pink: #ff4fd8;
  --sc-accent-violet: #7b4dff;
  --sc-accent-cyan: #00cfff;
  --sc-accent-gradient: linear-gradient(135deg, #ff4fd8 0%, #7b4dff 48%, #00cfff 100%);
  color: #172026;
}

#sc-configurator .sc-preview-panel,
#sc-configurator .sc-config-panel {
  border: 1px solid #e3e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

#sc-configurator .sc-preview-panel {
  border-color: #e3e8f0;
  background: #fbfcfe;
}

#sc-configurator .sc-config-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #eef1f7;
}

#sc-configurator .sc-preview-tools,
#sc-configurator .sc-preview-meta {
  border-color: #e3e8f0;
  color: #64748b;
  background: #f7f9fc;
}

#sc-configurator .sc-preview-tools span,
#sc-configurator .sc-preview-meta span {
  color: #64748b;
}

#sc-configurator label,
#sc-configurator .sc-rating small {
  color: #55606b;
  background: transparent;
  border-color: #d9e1e7;
}

#sc-configurator .sc-logo-card span,
#sc-configurator .sc-font-card span,
#sc-configurator .sc-material-card span,
#sc-configurator .sc-material-card small {
  color: #64748b;
}

#sc-configurator .sc-preview-surface {
  min-height: 300px;
  background: #f5f8fc;
}

#sc-configurator .sc-sticker-shadow {
  transform: translateY(0);
}

#sc-configurator .sc-icon-button,
#sc-configurator .sc-specials button,
#sc-configurator .sc-font-tabs button,
#sc-configurator .sc-mode-tabs button,
#sc-configurator .sc-qty-row button,
#sc-configurator .sc-font-card,
#sc-configurator .sc-logo-card,
#sc-configurator .sc-material-card {
  border: 1px solid #dbe2ea;
  color: #172026;
  background: #ffffff;
  border-radius: 10px;
}

#sc-configurator .sc-icon-button:hover,
#sc-configurator .sc-specials button:hover,
#sc-configurator .sc-font-tabs button:hover,
#sc-configurator .sc-mode-tabs button:hover,
#sc-configurator .sc-qty-row button:hover,
#sc-configurator .sc-font-card:hover,
#sc-configurator .sc-logo-card:hover,
#sc-configurator .sc-material-card:hover {
  border-color: var(--sc-accent-pink);
  box-shadow: 0 0 0 1px var(--sc-accent-pink);
}

#sc-configurator .sc-step {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e9edf3;
  border-radius: 14px;
  background: #ffffff;
}

#sc-configurator .sc-step input,
#sc-configurator .sc-step select,
#sc-configurator .sc-step textarea,
#sc-configurator .sc-step button {
  max-width: 100%;
}

#sc-configurator .sc-step-title span {
  background: var(--sc-accent-gradient);
  box-shadow: 0 0 16px rgba(123, 77, 255, 0.28);
  color: #fff;
}

#sc-configurator .sc-step-title h2 {
  color: #172026;
}

#sc-configurator .sc-product-heading h1,
#sc-configurator .sc-rating strong,
#sc-configurator .sc-total-size-reminder strong {
  color: #172026;
}

#sc-configurator .sc-logo-card svg,
#sc-configurator .sc-font-card strong {
  color: #172026;
}

#sc-configurator input,
#sc-configurator textarea,
#sc-configurator select {
  border: 1px solid #d9e1e7;
  color: #172026;
  background: #ffffff;
  border-radius: 8px;
}

#sc-configurator textarea:focus,
#sc-configurator input:focus,
#sc-configurator select:focus {
  outline: none;
  border-color: var(--sc-accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 207, 255, 0.18);
}

#sc-configurator .sc-mode-tabs button.active,
#sc-configurator .sc-font-tabs button.active,
#sc-configurator .sc-qty-row button.active,
#sc-configurator .sc-font-card.active,
#sc-configurator .sc-logo-card.active,
#sc-configurator .sc-material-card.active {
  border-color: var(--sc-accent-violet);
  background: rgba(123, 77, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--sc-accent-violet);
}

#sc-configurator .sc-dimension-label span {
  color: #0f172a;
  border-color: rgba(0, 174, 232, 0.42);
  background: rgba(239, 248, 255, 0.92);
  box-shadow: none;
}

#sc-configurator .sc-guide {
  display: none;
}

#sc-configurator .sc-dimension-label-secondary span {
  color: var(--sc-accent-cyan);
  border-color: rgba(0, 207, 255, 0.50);
}

#sc-configurator .sc-sticker-preview,
#sc-configurator .sc-logo-preview,
#sc-configurator .sc-sticker-shadow,
#sc-configurator .sc-sticker-preview.is-selected-live-item,
#sc-configurator .sc-logo-preview.is-selected-live-item {
  filter: none;
}

#sc-configurator .sc-dimension-label-total span {
  color: #172026;
  border-color: rgba(15, 23, 42, 0.18);
}

#sc-configurator .sc-checkout {
  position: static;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  border: 1px solid #e3e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

#sc-configurator .sc-step .sc-checkout {
  position: static;
  margin-top: 14px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid #e9edf3;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sc-step .sc-checkout {
  position: static;
  margin-top: 14px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid #e9edf3;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#sc-configurator .sc-checkout button {
  border: 0;
  color: #fff;
  background: #1f9d55;
  box-shadow: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 22px;
}

#sc-configurator .sc-checkout button:hover {
  background: #1a8548;
}

#sc-configurator .sc-secondary-action {
  border: 0;
  color: #fff;
  background: var(--sc-accent-gradient);
  box-shadow: 0 10px 24px rgba(123, 77, 255, 0.28);
}

@media (max-width: 920px) {
  .cc-product-page:has(#sc-configurator) {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cc-product-page:has(#sc-configurator) .cc-preview-column,
  .cc-product-page:has(#sc-configurator) .cc-preview-area,
  .cc-product-page:has(#sc-configurator) .cc-configurator-wrapper,
  .cc-product-page:has(#sc-configurator) #sc-configurator,
  .cc-product-page:has(#sc-configurator) .sc-page-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important;
  }

  .cc-product-page:has(#sc-configurator) #sc-configurator.sc-product {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cc-product-page:has(#sc-configurator) .sc-preview-panel,
  .cc-product-page:has(#sc-configurator) .sc-config-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .cc-product-page:has(#sc-configurator) .sc-config-panel .sc-step {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .cc-product-page:has(#sc-configurator) .sc-qty-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 42px));
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .cc-product-page:has(#sc-configurator) .sc-qty-row > button,
  .cc-product-page:has(#sc-configurator) .sc-qty-custom-group > button {
    width: 100%;
    min-width: 0;
  }

  .cc-product-page:has(#sc-configurator) .sc-qty-custom-group {
    display: contents;
  }

  .cc-product-page:has(#sc-configurator) .sc-quantity-stepper {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 8px;
  }

  .cc-product-page:has(#sc-configurator) .sc-checkout,
  .cc-product-page:has(#sc-configurator) .sc-checkout button {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .cc-product-page:has(#sc-configurator) .sc-checkout {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-product-page:has(#sc-configurator) .cc-product-side,
  .cc-product-page:has(#sc-configurator) .cc-reassurance-inline {
    display: none !important;
  }
}

.pc-cart-line-preview {
  display: grid !important;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #ff4fd8;
  border-radius: 4px;
  background: #f7f8fc;
  color: #161821;
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

.pc-cart-line-preview > *:not(.pc-cart-preview-actions) {
  display: block !important;
}

/* Miniature déplacée sous la photo produit d'origine (product-line__image) */
.product-line__image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pc-cart-inline-thumb {
  border-radius: 8px;
  background: #f2f2f2;
  border: 1px solid #e3e8f0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
  padding: 6px;
  box-sizing: border-box;
}

.pc-cart-inline-thumb svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  flex-shrink: 0;
}

.pc-cart-inline-thumb-loading {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d9e1e7;
  border-top-color: #7b4dff;
  animation: sc-cart-thumb-spin 0.7s linear infinite;
}

@keyframes sc-cart-thumb-spin {
  to {
    transform: rotate(360deg);
  }
}

.pc-cart-line-preview strong {
  font-size: 12px;
}

.pc-cart-line-preview > strong:first-child {
  text-transform: uppercase;
  color: #6b7280;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.pc-cart-line-preview span {
  color: #6b7280;
}

.pc-cart-line-preview span strong {
  color: #161821;
  font-weight: 700;
}

.cart-item .customizations {
  display: none !important;
}

.cart-item a[data-target^="#product-customizations-modal-"] {
  display: none !important;
  pointer-events: none !important;
}

.cart-item:has(.customizations) .product-image > picture {
  visibility: hidden !important;
}

.sc-cart-product-visual {
  display: grid;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  padding: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.sc-cart-product-summary {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
}

.sc-cart-product-summary > span {
  display: grid;
  grid-template-columns: minmax(105px, 112px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.sc-cart-product-summary strong {
  color: #161821;
  font-size: 12px;
  font-weight: 600;
}

.sc-cart-product-summary em {
  min-width: 0;
  color: #6b7280;
  font-style: normal;
  text-align: right;
  overflow-wrap: anywhere;
}

.sc-cart-product-summary .sc-cart-price-ht {
  margin-top: 3px;
  padding: 5px 7px;
  border: 1px solid rgba(0, 174, 232, 0.48);
  border-radius: 4px;
  background: #f3fbff;
}

.sc-cart-product-summary .sc-cart-price-ht strong,
.sc-cart-product-summary .sc-cart-price-ht em {
  color: #161821;
  font-weight: 700;
}

.sc-cart-product-summary .pc-cart-customer-text {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.sc-cart-product-summary .pc-cart-customer-text em {
  color: #161821;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .sc-cart-preview-content {
    grid-template-columns: 1fr;
  }

  .sc-cart-preview-art {
    max-width: 130px;
  }

  .sc-cart-preview-summary > span,
  .sc-cart-product-summary > span {
    grid-template-columns: minmax(96px, 105px) minmax(0, 1fr);
    gap: 6px;
  }
}

body#checkout #cart-summary-product-list li.media {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body#checkout #cart-summary-product-list .media-left,
body#checkout #cart-summary-product-list .media-left > a,
body#checkout #cart-summary-product-list .media-left picture {
  display: block;
  box-sizing: border-box;
  width: 72px;
  min-width: 72px;
  height: 72px;
  padding: 0;
}

body#checkout #cart-summary-product-list .media-object,
body#checkout #cart-summary-product-list .sc-cart-product-visual {
  width: 72px !important;
  min-width: 72px;
  max-width: 72px !important;
  height: 72px !important;
  object-fit: contain;
}

body#checkout #cart-summary-product-list .media-body {
  display: block;
  width: auto;
  min-width: 0;
  overflow: visible;
}

/* Keep option cards inside the light grey configurator column. */
#sc-configurator,
#sc-configurator .sc-page-shell,
#sc-configurator .sc-config-panel,
#sc-configurator .sc-step,
#sc-configurator .sc-step > *,
#sc-configurator .sc-size-grid,
#sc-configurator .sc-material-grid,
#sc-configurator .sc-logo-grid,
#sc-configurator .sc-font-grid,
#sc-configurator .sc-color-grid,
#sc-configurator .sc-qty-custom-group,
#sc-configurator .sc-quantity-stepper,
#sc-configurator .sc-checkout {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

#sc-configurator .sc-qty-row {
  box-sizing: border-box;
  min-width: 0;
}

#sc-configurator .sc-config-panel {
  width: 92%;
  overflow: hidden;
}

#sc-configurator .sc-step {
  width: 100%;
  overflow: hidden;
}

#sc-configurator .sc-step input,
#sc-configurator .sc-step select,
#sc-configurator .sc-step textarea,
#sc-configurator .sc-step button {
  max-width: 100%;
  min-width: 0;
}

#sc-configurator .sc-size-grid,
#sc-configurator .sc-material-grid,
#sc-configurator .sc-logo-grid,
#sc-configurator .sc-font-grid {
  width: 100%;
}

#sc-configurator .sc-qty-row {
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

/* Font selector: readable rectangular cards with the full font name. */
#sc-configurator .sc-font-grid,
.sc-font-picker-dialog .sc-font-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100%;
}

#sc-configurator .sc-font-card,
.sc-font-picker-dialog .sc-font-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 5px !important;
  min-height: 68px !important;
  width: 100% !important;
  padding: 10px 8px !important;
  text-align: center !important;
  border-radius: 10px !important;
}

#sc-configurator .sc-font-card strong,
.sc-font-picker-dialog .sc-font-card strong {
  display: block !important;
  min-width: 0 !important;
  color: inherit !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  max-width: 100% !important;
}

#sc-configurator .sc-font-card span,
.sc-font-picker-dialog .sc-font-card span {
  display: block !important;
  min-width: 0 !important;
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
  max-width: 100% !important;
}

@media (max-width: 520px) {
  #sc-configurator .sc-font-grid,
  .sc-font-picker-dialog .sc-font-grid {
    grid-template-columns: 1fr !important;
  }

  /* Les choix de personnage restent sur 2 colonnes même sur les téléphones
     étroits (≤520px) : la règle 1 colonne ci-dessus, plus spécifique
     (#sc-configurator + !important) que celle définie plus haut, écrasait
     sinon systématiquement le fix à 2 colonnes sur ce point de rupture. */
  #sc-configurator .sc-font-grid.pc-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #sc-configurator .sc-font-card,
  .sc-font-picker-dialog .sc-font-card {
    grid-template-columns: 1fr !important;
    min-height: 62px !important;
  }

  #sc-configurator .pc-choice-grid .sc-font-card {
    grid-template-columns: 1fr !important;
    min-height: 62px !important;
  }

  #sc-configurator .sc-font-card strong,
  .sc-font-picker-dialog .sc-font-card strong {
    font-size: 21px !important;
  }
}
/* ============================================================
   Affichage uniforme desktop = mobile : preview rectangle
   centré (multiligne-friendly) + colonne noire empilée.
   Placé en dernier pour l'emporter sur les @media.
   ============================================================ */
#sc-configurator .sc-preview-surface {
  min-height: 200px !important;
  height: auto !important;
  padding: 38px 48px !important;
  align-items: start !important;
  justify-items: center !important;
  align-content: start !important;
}

#sc-configurator .sc-sticker-shadow {
  transform: translateY(0) !important;
  padding: 16px 24px !important;
  max-width: 100% !important;
}

#sc-configurator .sc-sticker-preview.sc-multiline {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
}

#sc-configurator .sc-checkout {
  position: static !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
}

/* ============================================================
   Preview panel : s'adapte au texte live (plus de carré 650px),
   et retrait des textes redondants (déjà dans le RÉSUMÉ).
   ============================================================ */
#sc-configurator .sc-preview-panel {
  min-height: 0 !important;
}

#sc-configurator #sc-real-size-label {
  display: none !important;
}

#sc-configurator .sc-preview-meta {
  display: none !important;
}

/* La barre du haut ne garde que les boutons zoom, sans bordure lourde */
#sc-configurator .sc-preview-tools {
  min-height: 0 !important;
  padding: 8px 12px !important;
  border-bottom: none !important;
}

/* ============================================================
   Étape Taille : disposition empilée (comme mobile) partout,
   + flèches +/- sur Largeur / Hauteur.
   ============================================================ */
#sc-configurator .sc-two-cols {
  grid-template-columns: 1fr !important;
}

#sc-configurator .sc-dim-stepper {
  display: flex;
  align-items: stretch;
  gap: 0px;
  margin-top: 6px;
  background: #fff;
  border-radius: 8px;
}

#sc-configurator .sc-dim-stepper input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 8px 4px !important;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  -moz-appearance: textfield;
  appearance: textfield;
}

#sc-configurator .sc-dim-stepper input::-webkit-outer-spin-button,
#sc-configurator .sc-dim-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

 #sc-configurator .sc-dim-btn {
  flex: 0 0 auto;
  width: 25px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  background: rgba(0, 179, 221, 0.43);
  color: #000;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

#sc-configurator .sc-dim-btn:hover {
  background: rgba(0, 207, 255, 0.30);
}
