/* Custom Poster Studio – interface client
 * Classes volontairement simples : surchargez-les dans votre thème (Apparence > Personnaliser > CSS additionnel). */

/* Le bloc prend toute la largeur, même si le thème aligne quantité + bouton en flex */
.cps-customizer { margin: 0 0 1.2em; flex: 0 0 100%; width: 100%; max-width: 100%; order: -1; box-sizing: border-box; }
form.cart:has(> .cps-customizer), .woocommerce-variation-add-to-cart:has(> .cps-customizer) { flex-wrap: wrap; }

/* ---------- Aperçu ---------- */
.cps-preview { position: relative; display: flex; width: 100%; margin: 0 0 1.2em; flex-direction: column; align-items: center; box-sizing: border-box; }
.cps-preview-stage { position: relative; display: block; margin: 0 auto; line-height: 0; box-shadow: 0 8px 28px rgba(0,0,0,.18); background: #fff; }
.cps-preview canvas { display: block; }
/* Glisser la photo dans l'aperçu : à la souris uniquement (au doigt, la page défile et un toucher ouvre la fenêtre de recadrage) */
.cps-preview.has-crop canvas { cursor: default; }
.cps-preview-loader { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.85); line-height: 1.4; font-size: 14px; min-height: 120px; }
.cps-preview.is-loading .cps-preview-loader { display: flex; }
.cps-preview.is-loading .cps-preview-stage { min-width: 200px; min-height: 260px; }

/* Loupe en haut à droite de l'image */
.cps-preview-expand { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #222; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; line-height: 1; transition: transform .15s; }
.cps-preview-expand:hover { transform: scale(1.08); background: #fff; }
.cps-preview-expand svg { display: block; }
.cps-preview-expand .cps-icon-close { display: none; }
.cps-preview.is-fullscreen .cps-preview-expand .cps-icon-zoom { display: none; }
.cps-preview.is-fullscreen .cps-preview-expand .cps-icon-close { display: block; }

/* L'aperçu remplace la galerie produit */
.woocommerce-product-gallery.cps-has-preview { opacity: 1 !important; }
.woocommerce-product-gallery.cps-has-preview > *:not(.cps-preview) { display: none !important; }

/* Plein écran */
.cps-preview.is-fullscreen { position: fixed; inset: 0; z-index: 999999; margin: 0; background: rgba(20,20,20,.92); display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
.cps-preview.is-fullscreen .cps-preview-stage { box-shadow: 0 10px 40px rgba(0,0,0,.5); }
body.cps-noscroll { overflow: hidden; }

/* ---------- Champs ---------- */
.cps-fields { display: flex; flex-direction: column; gap: 1em; }
.cps-field { display: flex; flex-direction: column; gap: .35em; }
.cps-label { font-weight: 600; font-size: .95em; }
.cps-input { width: 100%; box-sizing: border-box; padding: .6em .75em; border: 1px solid #ccc; border-radius: 4px; font: inherit; }
textarea.cps-input { resize: vertical; min-height: 4.5em; }
.cps-input:focus { outline: none; border-color: #333; }
.cps-meta { display: flex; justify-content: space-between; gap: 1em; font-size: .8em; min-height: 1.2em; color: #777; }
.cps-field.is-warning .cps-input { border-color: #d98200; }
.cps-field.is-warning .cps-msg { color: #b36b00; }

/* Choix de police / couleur */
.cps-style { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .45em .7em; margin-top: .2em; }
.cps-style-label { font-size: .8em; color: #666; }
.cps-fonts, .cps-colors { display: flex; flex-wrap: wrap; gap: .4em; }
.cps-font { border: 1px solid #ccc; background: #fff; color: #222; border-radius: 6px; padding: .35em .7em; font-size: 1.05em; line-height: 1.2; cursor: pointer; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cps-font.is-active { border-color: #222; box-shadow: 0 0 0 1px #222; }
.cps-color { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; }
.cps-color.is-active { box-shadow: 0 0 0 2px #222; }
.cps-font:focus-visible, .cps-color:focus-visible { outline: 2px solid #2d6cdf; outline-offset: 2px; }

/* Upload photo */
.cps-upload { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: .7em 1em; border: 2px dashed #bbb; border-radius: 6px; cursor: pointer; text-align: center; font-size: .95em; transition: border-color .15s, background .15s; }
.cps-upload:hover { border-color: #333; background: rgba(0,0,0,.03); }
.cps-upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cps-field.has-photo .cps-upload { border-style: solid; }
.cps-status { font-size: .85em; min-height: 1.2em; color: #555; }
.cps-status[data-kind="ok"] { color: #2e7d32; }
.cps-status[data-kind="warn"] { color: #8a6d00; }
.cps-status[data-kind="error"] { color: #c62828; }

/* Recadrage */
.cps-crop { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1em; }
.cps-crop[hidden] { display: none; }
.cps-crop-open { display: inline-flex; align-items: center; gap: .45em; background: none; border: 1px solid #999; border-radius: 6px; padding: .45em .9em; font-size: .9em; cursor: pointer; color: inherit; }
.cps-crop-open:hover { border-color: #333; background: rgba(0,0,0,.03); }
.cps-hint { margin: 0; font-size: .8em; color: #777; }

/* Fenêtre de recadrage */
.cps-cropper { position: fixed; inset: 0; z-index: 1000000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .15s; -webkit-tap-highlight-color: transparent; }
.cps-cropper.is-open { opacity: 1; }
.cps-cropper-box { display: flex; flex-direction: column; width: min(560px, 94vw); height: min(780px, 92vh); background: #fff; color: #222; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35); font-size: 15px; line-height: 1.4; }
.cps-cropper-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: .75em 1em; border-bottom: 1px solid #eee; }
.cps-cropper-head strong { font-size: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cps-cropper-x { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: #f1f1f1; color: #222; font-size: 24px; line-height: 1; cursor: pointer; padding: 0; }
.cps-cropper-stage { position: relative; flex: 1 1 auto; min-height: 0; background: #18181b; }
.cps-cropper-stage canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.cps-cropper-stage canvas:active { cursor: grabbing; }
.cps-cropper-foot { padding: .8em 1em calc(.9em + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .55em; }
.cps-cropper-zoom { display: flex; align-items: center; gap: .6em; }
.cps-cropper-zoom input { flex: 1; accent-color: #222; }
.cps-cz { width: 38px; height: 38px; flex: none; border: 1px solid #ccc; border-radius: 50%; background: #fff; color: #222; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.cps-cropper-quality { min-height: 1.2em; font-size: .85em; }
.cps-cropper-hint { margin: 0; font-size: .8em; color: #777; }
.cps-cropper-actions { display: flex; gap: .6em; align-items: center; }
.cps-cropper-actions button { border-radius: 8px; padding: .7em 1.1em; font-size: .95em; cursor: pointer; border: 1px solid #ccc; background: #fff; color: #222; }
.cps-cropper-reset { margin-right: auto; }
.cps-cropper-actions .cps-cropper-ok { background: #111; border-color: #111; color: #fff; font-weight: 600; min-width: 7em; }
.cps-cropper-box:focus { outline: none; }
.cps-cropper button:focus-visible { outline: 2px solid #2d6cdf; outline-offset: 2px; }
@media (max-width: 600px) {
    .cps-cropper-box { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
    .cps-cropper-actions .cps-cropper-ok { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .cps-cropper { transition: none; } }

/* Style IA */
.cps-ai { display: flex; flex-direction: column; gap: .5em; padding: .75em .85em; border-radius: 8px; background: linear-gradient(135deg, rgba(124,77,255,.07), rgba(255,64,129,.06)); border: 1px solid rgba(124,77,255,.18); }
.cps-ai[hidden] { display: none; }
.cps-ai-go { align-self: flex-start; display: inline-flex; align-items: center; gap: .4em; padding: .65em 1.1em; border: 0; border-radius: 999px; background: #6a3df0; color: #fff; font-weight: 600; font-size: .95em; cursor: pointer; }
.cps-ai-go:hover { background: #5a2fe0; }
.cps-ai-go:disabled { opacity: .55; cursor: default; }
.cps-ai-progress { display: flex; flex-direction: column; gap: .3em; font-size: .85em; color: #555; }
.cps-ai-progress[hidden] { display: none; }
.cps-ai-bar { height: 6px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; }
.cps-ai-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #6a3df0, #ff4081); transition: width .4s ease; }
.cps-ai-msg { font-size: .85em; min-height: 0; }
.cps-ai-msg:empty { display: none; }
.cps-ai-msg[data-kind="error"] { color: #c62828; }
.cps-ai-msg[data-kind="ok"] { color: #2e7d32; }
.cps-ai-msg[data-kind="warn"] { color: #b26b00; }
.cps-ai-msg[data-kind="info"] { color: #555; }
.cps-ai.is-stale .cps-ai-go { box-shadow: 0 0 0 3px rgba(178, 107, 0, .35); }
.cps-ai-quota { font-size: .78em; color: #777; }
.cps-ai-quota:empty { display: none; }
.cps-ai-versions[hidden] { display: none; }
.cps-ai-versions-title { font-size: .8em; color: #555; }
.cps-ai-thumbs { display: flex; flex-wrap: wrap; gap: .4em; margin-top: .3em; }
.cps-ai-thumb { width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; }
.cps-ai-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cps-ai-thumb.is-active { border-color: #6a3df0; }
.cps-ai-unlock { display: flex; flex-direction: column; gap: .4em; padding-top: .3em; border-top: 1px dashed rgba(0,0,0,.12); }
.cps-ai-unlock[hidden], .cps-ai-row[hidden] { display: none; }
.cps-ai-unlock-text { margin: 0; font-size: .85em; }
.cps-ai-row { display: flex; gap: .4em; }
.cps-ai-row .cps-input { flex: 1; min-width: 0; }
.cps-ai-row button { flex: none; border: 1px solid #6a3df0; background: #fff; color: #6a3df0; border-radius: 6px; padding: .5em .8em; cursor: pointer; font-size: .9em; }
.cps-ai-ts:empty { display: none; }
/* Aperçu pendant la création */
.cps-preview.is-ai-running .cps-preview-stage::after { content: "✨ Création de votre aperçu…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1em;
    line-height: 1.4; font-size: 15px; font-weight: 600; color: #fff; background: linear-gradient(110deg, rgba(40,20,90,.55) 30%, rgba(106,61,240,.65) 50%, rgba(40,20,90,.55) 70%); background-size: 250% 100%; animation: cps-ai-shine 1.8s linear infinite; }
@keyframes cps-ai-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .cps-preview.is-ai-running .cps-preview-stage::after { animation: none; } .cps-ai-bar i { transition: none; } }

/* Erreurs */
.cps-errors ul { margin: 1em 0 0; padding: .8em 1em .8em 2em; background: #fdecea; color: #b71c1c; border-radius: 6px; font-size: .9em; }
.single_add_to_cart_button.cps-wait { opacity: .6; cursor: progress; }

.cps-cart-thumb { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* Galerie de photos (zone IA à plusieurs photos / incrustation) */
.cps-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: .3em 0 .2em; }
.cps-thumb, .cps-gallery-add { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.cps-thumb { background: #eee; border: 1px solid rgba(0,0,0,.12); }
.cps-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cps-thumb.is-uploading img { opacity: .55; }
.cps-thumb-num { position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.cps-thumb-wait { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid rgba(255,255,255,.6); border-top-color: #333; border-radius: 50%; animation: cps-spin .8s linear infinite; }
@keyframes cps-spin { to { transform: rotate(360deg); } }
.cps-gallery-del { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 24px; cursor: pointer; }
.cps-gallery-add { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #bbb; cursor: pointer; font-size: .78em; text-align: center; color: #444; padding: 2px; box-sizing: border-box; }
.cps-gallery-add:hover { border-color: #333; background: rgba(0,0,0,.03); }
.cps-gallery-add input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cps-gallery-plus { font-size: 1.7em; line-height: 1; }
.cps-gallery-hint { margin: 0 0 .2em; }

/* Image au choix */
.cps-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: .3em 0 .2em; }
.cps-choice { width: 64px; height: 64px; padding: 5px; border: 2px solid rgba(0,0,0,.15); border-radius: 10px; background: #f4f4f4; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cps-choice img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.cps-choice:hover { border-color: #666; }
.cps-choice.is-active { border-color: #222; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222; }
.cps-choice:focus-visible { outline: 3px solid #4a90e2; outline-offset: 2px; }
.cps-choice-name { font-size: .85em; color: #555; min-height: 1.2em; }

/* Dégradés au choix (pastilles) */
.cps-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: .3em 0 .2em; }
.cps-swatch { width: 44px; height: 44px; padding: 0; border: 2px solid rgba(0,0,0,.15); border-radius: 50%; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.cps-swatch:hover { transform: scale(1.06); }
.cps-swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222; border-color: transparent; }
.cps-swatch:focus-visible { outline: 3px solid #4a90e2; outline-offset: 3px; }
.cps-grad-choices { margin-top: .5em; }
.cps-grad-choices .cps-swatches { margin-top: .2em; }
.cps-grad-choices .cps-swatch { width: 36px; height: 36px; }

/* ---------- Pastilles et vignettes : protégées contre les styles de boutons du thème ----------
   (les thèmes WooCommerce appliquent souvent largeur 100 %, bordure, majuscules… à tous les boutons du formulaire) */
.cps-customizer .cps-swatches, .cps-customizer .cps-colors, .cps-customizer .cps-choices, .cps-customizer .cps-fonts {
    display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 10px !important; width: auto !important;
}
.cps-customizer button.cps-swatch, .cps-customizer button.cps-color, .cps-customizer button.cps-choice, .cps-customizer button.cps-font,
.cps-customizer button.cps-gallery-del {
    -webkit-appearance: none !important; appearance: none !important; box-sizing: border-box !important;
    flex: 0 0 auto !important; margin: 0 !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important;
    text-transform: none !important; letter-spacing: normal !important; text-shadow: none !important; text-indent: 0 !important;
    float: none !important; position: relative !important; transform: none; cursor: pointer !important;
}
.cps-customizer button.cps-swatch {
    width: 40px !important; height: 40px !important; padding: 0 !important; border-radius: 50% !important;
    border: 3px solid #fff !important; box-shadow: 0 0 0 1px rgba(0,0,0,.22) !important; line-height: 0 !important; font-size: 0 !important;
    background-size: cover !important; transition: transform .15s, box-shadow .15s !important;
}
.cps-customizer button.cps-swatch:hover { transform: scale(1.08); box-shadow: 0 0 0 1px rgba(0,0,0,.4) !important; }
.cps-customizer button.cps-swatch.is-active { box-shadow: 0 0 0 2px #222 !important; transform: none; }
.cps-customizer .cps-grad-choices button.cps-swatch { width: 34px !important; height: 34px !important; }
.cps-customizer button.cps-color {
    width: 32px !important; height: 32px !important; padding: 0 !important; border-radius: 50% !important;
    border: 3px solid #fff !important; background: var(--c) !important; box-shadow: 0 0 0 1px rgba(0,0,0,.22) !important; font-size: 0 !important; line-height: 0 !important;
}
.cps-customizer button.cps-color.is-active { box-shadow: 0 0 0 2px #222 !important; }
.cps-customizer button.cps-font {
    width: auto !important; height: auto !important; padding: .35em .7em !important; border: 1px solid #ccc !important; border-radius: 6px !important;
    background: #fff !important; color: #222 !important; line-height: 1.2 !important; box-shadow: none !important;
}
.cps-customizer button.cps-font.is-active { border-color: #222 !important; box-shadow: 0 0 0 1px #222 !important; }
.cps-customizer button.cps-choice {
    width: 64px !important; height: 64px !important; padding: 5px !important; border: 2px solid rgba(0,0,0,.15) !important; border-radius: 10px !important;
    background: #f4f4f4 !important; box-shadow: none !important; line-height: 0 !important;
}
.cps-customizer button.cps-choice.is-active { border-color: #222 !important; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222 !important; }
.cps-customizer button.cps-gallery-del {
    position: absolute !important; top: 3px !important; right: 3px !important; width: 24px !important; height: 24px !important; padding: 0 !important;
    border: 0 !important; border-radius: 50% !important; background: rgba(0,0,0,.65) !important; color: #fff !important; font-size: 16px !important; line-height: 24px !important;
}
.cps-customizer .cps-choice-name { margin-top: .35em; }

/* Administrateurs : « Générer ce poster » */
.cps-customizer .cps-admin-render { margin: 14px 0 6px; padding: 10px 12px; border: 1px dashed #8c8f94; border-radius: 8px; background: #f6f7f7; font-size: 14px; color: #1d2327; }
.cps-customizer .cps-ar-head { font-weight: 600; margin-bottom: 8px; }
.cps-customizer .cps-ar-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; background: #2271b1; color: #fff; border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.cps-customizer .cps-ar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cps-customizer .cps-ar-out { flex: 1 1 200px; min-width: 0; height: 38px !important; padding: 0 8px !important; margin: 0 !important; font-size: 14px !important; }
.cps-customizer button.cps-ar-go { flex: 0 0 auto; height: 38px !important; min-height: 0 !important; padding: 0 16px !important; margin: 0 !important; border: 0 !important; border-radius: 6px !important; background: #2271b1 !important; color: #fff !important; font-size: 14px !important; line-height: 38px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; width: auto !important; box-shadow: none !important; cursor: pointer; }
.cps-customizer button.cps-ar-go:disabled { opacity: .6; cursor: wait; }
.cps-customizer .cps-ar-status { margin-top: 8px; font-size: 13px; min-height: 1em; }
.cps-customizer .cps-ar-status.is-err { color: #b32d2e; font-weight: 600; }
.cps-customizer .cps-ar-file { display: block; margin-top: 6px; font-size: 13px; word-break: break-word; }
.cps-customizer .cps-ar-thumb { display: block; margin-top: 6px; }
.cps-customizer .cps-ar-thumb img { display: block; max-width: 100%; max-height: 260px; width: auto; height: auto; border: 1px solid #dcdcde; border-radius: 4px; }
.cps-customizer .cps-ar-warn { margin-top: 6px; font-size: 12px; color: #996800; }
.cps-customizer .cps-ar-note { margin-top: 8px; font-size: 11px; color: #646970; }

/* Jeux de lettres : mots cachés et Scrabble */
.cps-customizer .cps-words { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.cps-customizer .cps-word-row { display: flex; gap: 6px; align-items: center; }
.cps-customizer .cps-word-row .cps-input { flex: 1 1 auto; min-width: 0; margin: 0 !important; }
.cps-customizer button.cps-word-del { flex: 0 0 auto; width: 34px !important; height: 34px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
    border: 1px solid #ccc !important; border-radius: 50% !important; background: #fff !important; color: #555 !important; font-size: 18px !important; line-height: 1 !important; box-shadow: none !important; cursor: pointer; }
.cps-customizer button.cps-word-del[hidden] { display: none !important; }
.cps-customizer button.cps-word-add { display: inline-block; width: auto !important; min-height: 0 !important; margin: 0 0 8px !important; padding: 4px 0 !important; border: 0 !important;
    background: none !important; color: #6a3df0 !important; font-size: 14px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; cursor: pointer; }
.cps-customizer button.cps-word-add[hidden] { display: none !important; }
.cps-customizer .cps-word-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 14px; }
.cps-customizer .cps-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cps-customizer .cps-check input { margin: 0; width: 18px; height: 18px; }
.cps-customizer .cps-field--letters.is-stale .cps-gen { box-shadow: 0 0 0 3px rgba(178, 107, 0, .35); }
.cps-customizer .cps-gen-msg { display: block; margin-top: 6px; font-size: 13px; color: #8a6d3b; }
.cps-customizer .cps-gen-msg.is-error { color: #b32d2e; font-weight: 600; }

/* Aides d'affichage : mini-aperçu flottant et barre « 👁 Aperçu » (réglages du plugin) */
button.cps-float { position: fixed !important; right: 12px; bottom: 16px; left: auto; z-index: 9990; display: block !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 4px !important; border: 0 !important; border-radius: 10px !important; background: #fff !important; box-shadow: 0 6px 24px rgba(0,0,0,.28) !important;
    line-height: 0 !important; cursor: pointer; transition: bottom .2s ease; -webkit-tap-highlight-color: transparent; }
button.cps-float[hidden] { display: none !important; }
button.cps-float.is-left { left: 12px; right: auto; }
button.cps-float.above-bar { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
button.cps-float canvas { display: block; border-radius: 6px; }
.cps-float-zoom { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; background: #222; color: #fff; font-size: 12px; line-height: 24px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
button.cps-float.is-left .cps-float-zoom { right: auto; left: -7px; }
button.cps-float.is-pulse { animation: cps-pulse .55s ease; }
@keyframes cps-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1); } }
.cps-bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9989; display: flex; justify-content: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff; box-shadow: 0 -4px 18px rgba(0,0,0,.12); box-sizing: border-box; }
.cps-bottom-bar[hidden] { display: none !important; }
.cps-bottom-bar button.cps-bar-btn { display: block !important; width: 100% !important; max-width: 520px; height: 48px !important; min-height: 0 !important; margin: 0 !important; padding: 0 16px !important;
    border: 0 !important; border-radius: 999px !important; background: #222 !important; color: #fff !important; font-size: 16px !important; font-weight: 600 !important; line-height: 48px !important;
    text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; cursor: pointer; }
body.cps-has-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }

/* Cartes */
.cps-customizer .cps-map-search { position: relative; margin: 6px 0 8px; }
.cps-customizer .cps-map-q { width: 100% !important; height: 44px !important; margin: 0 !important; padding: 0 12px 0 38px !important; box-sizing: border-box !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px 50% !important; font-size: 16px !important; }
.cps-customizer .cps-map-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; margin-top: 4px; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; }
.cps-customizer .cps-map-sug[hidden] { display: none !important; }
.cps-customizer button.cps-map-opt { display: block !important; width: 100% !important; margin: 0 !important; padding: 9px 12px !important; border: 0 !important; border-bottom: 1px solid #f0f0f0 !important; border-radius: 0 !important;
    background: #fff !important; color: #222 !important; text-align: left !important; font-size: 14px !important; line-height: 1.3 !important; text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; cursor: pointer; height: auto !important; min-height: 0 !important; }
.cps-customizer button.cps-map-opt:hover, .cps-customizer button.cps-map-opt:focus { background: #f5f5f5 !important; }
.cps-customizer button.cps-map-opt b { display: block; font-weight: 600; }
.cps-customizer button.cps-map-opt span { display: block; font-size: 12px; color: #777; }
.cps-customizer .cps-map-none { padding: 10px 12px; font-size: 13px; color: #777; }
.cps-customizer .cps-map-box { display: flex; justify-content: center; width: 100%; }
.cps-customizer .cps-map-el { border-radius: 8px; overflow: hidden; background: #eee; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.cps-customizer .cps-map-hint { margin: 6px 0 10px; font-size: 13px; }
.cps-customizer .cps-map-styles { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.cps-customizer button.cps-map-style { width: 56px !important; height: 56px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 2px solid #ddd !important;
    border-radius: 8px !important; overflow: hidden; background: #fff !important; box-shadow: none !important; cursor: pointer; line-height: 0 !important; }
.cps-customizer button.cps-map-style.is-active { border-color: #222 !important; box-shadow: 0 0 0 1px #222 !important; }
.cps-customizer .cps-map-credit { margin: 6px 0 0; font-size: 11px; color: #888; }
.cps-customizer .cps-map-credit a { color: inherit; }

/* ===== Module « Carte Poke » (v3.19) ===== */
.cps-field--poke { display: flex; flex-direction: column; gap: 14px; }
.cps-poke-title { font-weight: 700; font-size: 1.05em; }
.cps-poke-row { display: flex; flex-direction: column; gap: 6px; }
.cps-poke-row > .cps-label { margin: 0; }
.cps-poke-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cps-customizer .cps-field--poke button.cps-poke-pill, .cps-customizer .cps-field--poke button.cps-poke-pill:hover, .cps-customizer .cps-field--poke button.cps-poke-pill:focus { padding: .45em 1.1em; border: 2px solid rgba(0,0,0,.18) !important; border-radius: 999px; background: #fff !important; color: #222 !important; box-shadow: none; font-weight: 600; cursor: pointer; line-height: 1.2; text-transform: none; letter-spacing: 0; min-height: 0; }
.cps-customizer .cps-field--poke button.cps-poke-pill.is-active { border-color: var(--cps-poke-accent, #7a1fa2) !important; background: var(--cps-poke-accent, #7a1fa2) !important; color: #fff !important; }
.cps-poke-types { gap: 6px; }
.cps-customizer button.cps-poke-type { width: 48px; height: 48px; padding: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75em; font-weight: 700; }
.cps-poke-ico { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.cps-poke-select { width: 100%; max-width: 100%; }
.cps-poke-custom { display: inline-flex; align-items: center; gap: 8px; font-size: .92em; cursor: pointer; margin: 0; }
.cps-poke-custombox { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-left: 3px solid rgba(0,0,0,.12); }
.cps-poke-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.cps-poke-inline select { flex: 1 1 30%; min-width: 0; }
.cps-poke-preview { font-size: .88em; color: #555; font-style: italic; }
.cps-poke-extras { display: flex; flex-direction: column; gap: 6px; }
.cps-poke-extra { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.cps-poke-total { font-size: .95em; padding-top: 4px; border-top: 1px solid rgba(0,0,0,.08); }

/* Effet holographique sur l'aperçu : reflet arc-en-ciel + étoiles, inclinaison 3D */
/* Carte : coins arrondis, bords nets pendant l'inclinaison (pas de fond blanc qui dépasse, anticrénelage) */
.cps-preview-stage.cps-is-card { background: transparent !important; overflow: hidden; isolation: isolate; box-shadow: 0 10px 30px rgba(40, 10, 60, .28); }
.cps-preview-stage.cps-is-card canvas { border-radius: inherit; }
.cps-preview-stage.cps-has-holo { transform: perspective(1200px) rotateY(var(--hr, 0deg)) rotateX(var(--ht, 0deg)) translateZ(0); transition: transform .12s ease-out;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; outline: 1px solid transparent; will-change: transform; }
.cps-holo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; border-radius: inherit; }
.cps-holo > div { position: absolute; inset: 0; }
.cps-holo-rainbow {
  background: linear-gradient(115deg, transparent 20%, rgba(255,0,132,.55) 32%, rgba(255,214,0,.55) 40%, rgba(0,255,170,.55) 48%, rgba(0,170,255,.55) 56%, rgba(170,0,255,.55) 64%, transparent 76%);
  background-size: 250% 250%; background-position: var(--hx, 50%) var(--hy, 50%);
  mix-blend-mode: color-dodge; opacity: calc(var(--ho, .5) * .55);
}
.cps-holo-stars {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 60%, transparent 61%), radial-gradient(1.2px 1.2px at 27% 64%, #fff 60%, transparent 61%),
    radial-gradient(2px 2px at 44% 31%, #fff 60%, transparent 61%), radial-gradient(1.3px 1.3px at 58% 82%, #fff 60%, transparent 61%),
    radial-gradient(1.8px 1.8px at 71% 22%, #fff 60%, transparent 61%), radial-gradient(1.1px 1.1px at 86% 57%, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 35% 90%, #fff 60%, transparent 61%), radial-gradient(1.4px 1.4px at 93% 9%, #fff 60%, transparent 61%);
  background-size: 140px 140px; mix-blend-mode: overlay;
  -webkit-mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0%, rgba(0,0,0,.25) 45%, transparent 75%);
          mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0%, rgba(0,0,0,.25) 45%, transparent 75%);
  opacity: .9;
}
.cps-holo-stars.has-texture { background-size: cover; background-position: var(--hx, 50%) var(--hy, 50%); mix-blend-mode: color-dodge; opacity: .6; }
.cps-holo-c { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; }
/* Reflet métallique (miroir) sur toute la carte : large bande claire qui glisse avec l'inclinaison */
.cps-holo-sheen { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.3) 45%, rgba(210,220,235,.12) 52%, rgba(255,255,255,0) 66%);
  background-size: 260% 260%; background-position: calc(100% - var(--hx, 50%)) calc(100% - var(--hy, 50%));
  mix-blend-mode: soft-light; opacity: var(--hs, .35); }
.cps-preview-stage.cps-has-holo { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.cps-preview:has(.cps-is-card) .cps-preview-expand { display: none !important; }
.cps-holo-glare { background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 12%, rgba(255,255,255,0) 24%); mix-blend-mode: soft-light; }
@media (prefers-reduced-motion: reduce) { .cps-preview-stage.cps-has-holo { transform: none; } }

/* Carte Poke : exemples de cartes réalisées sous l'aperçu */
.cps-samples { margin-top: 12px; }
.cps-samples-title { margin-bottom: 6px !important; }
/* Colonne collante : la carte + les exemples tiennent dans l'écran */
/* Taille de l'aperçu sur ordinateur : calculée sur une réserve fixe. Avec --cps-header-offset, qui change
   quand l'en-tête se replie au défilement, la carte rétrécissait et se décalait au premier défilement. */
@media (min-width: 1025px) {
  body .cps-pdp .cps-preview, body .cps-pdp .woocommerce-product-gallery { max-width: min(440px, calc((100vh - 180px) * 0.716)) !important; }
  body .cps-pdp .cps-preview:has(.cps-samples) { max-width: min(440px, calc((100vh - 280px) * 0.716)) !important; }
}
.cps-samples-title { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6d6672; margin-bottom: 8px; text-align: center; }
.cps-samples-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
button.cps-sample { all: unset; cursor: pointer; width: 22%; max-width: 78px; display: block; border-radius: 6px; transition: transform .15s; }
button.cps-sample:hover, button.cps-sample.is-active { transform: translateY(-3px); }
button.cps-sample.is-active .cps-sample-stage { outline: 3px solid #781391; outline-offset: 2px; }
.cps-sample-stage { position: relative; display: block; overflow: hidden; line-height: 0; box-shadow: 0 6px 16px rgba(40,10,60,.25); }
.cps-sample-stage img { width: 100%; height: auto; display: block; }
.cps-sample-big { text-align: center; }
.cps-sample-big .cps-sample-stage { margin: 0 auto; }
button.cps-sample-back { margin-top: 10px; background: #fff !important; color: #781391 !important; border: 2px solid #781391 !important; border-radius: 999px; padding: .5em 1.2em; font-weight: 600; cursor: pointer; }

/* Vitrine de cartes réalisées (section « La dernière collection ») */
.cps-holo-showcase { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin: 0 auto; padding: 10px; }
.cps-holo-showcase.cps-showcase-1 { grid-template-columns: minmax(0, 340px); justify-content: center; }
.cps-showcase-card { margin: 0; }
.cps-showcase-card .cps-sample-stage { box-shadow: 0 14px 34px rgba(40, 10, 60, .30); }
@media (max-width: 600px) { .cps-holo-showcase { gap: 12px; padding: 4px; } }

/* Carte Poke : photos de l'animal, option aperçu */
.cps-poke-photos .cps-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.cps-poke-photos .cps-status[data-kind="error"] { color: #b32d2e; }
.cps-poke-photos .cps-status[data-kind="ok"] { color: #2e7d32; }
.cps-poke-exnote { margin: 6px 0 0; font-size: 13px; color: #781391; }
body.cps-poke-preview-opt .cpd-badge, body.cps-poke-preview-opt .lvs-badge, body.cps-poke-preview-opt .cps-delivery, body.cps-poke-preview-opt .cpd-auto { display: none !important; }

/* Précisions (facultatif) */
.cps-poke-notesrow textarea.cps-poke-notes { width: 100%; min-height: 76px; resize: vertical; font: inherit; line-height: 1.4; }
.cps-poke-notesrow .cps-meta { text-align: right; font-size: 12px; opacity: .7; }
/* Carte sans holo (carte photo) : léger reflet et halo autour du curseur */
.cps-holo--light .cps-holo-glare { background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(255,255,255,.28) 0%, rgba(255,255,255,.1) 14%, rgba(255,255,255,0) 28%); }
/* Aperçu plein écran : bouton visible pour revenir au formulaire */
.cps-preview .cps-fs-back { display: none; }
.cps-preview.is-fullscreen .cps-fs-back { display: inline-block; margin-top: 14px; background: #fff !important; color: #781391 !important; border: 2px solid #781391 !important; border-radius: 999px; padding: .5em 1.2em; font-weight: 600; cursor: pointer; font-size: 15px; }
.cps-preview.is-fullscreen:has(.cps-sample-big:not([hidden])) .cps-fs-back { display: none; }
/* Exemples dessinés en canvas : mêmes dimensions qu'une image, pas de sélection ni de menu image */
.cps-sample-stage canvas.cps-sample-img { width: 100%; height: auto; display: block; }
.cps-sample, .cps-sample-big, .cps-showcase-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- Aperçu en relief (WebGL) : toile sur châssis, poster mat ou semi-brillant ---------- */
.cps-preview-stage.cps-is-gl { background: transparent !important; box-shadow: none !important; }
.cps-preview-stage.cps-is-gl > canvas.lower-canvas { visibility: hidden; }
.cps-toile-gl { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 1;
  filter: drop-shadow(10px 18px 16px rgba(0,0,0,.28)) drop-shadow(2px 4px 4px rgba(0,0,0,.18)); }
.cps-preview.cps-no-zoom .cps-preview-expand { display: none !important; }

/* Versions IA : vignettes carrées centrées sur la tête ; adresse e-mail sur sa propre ligne (le thème élargissait les boutons) */
.cps-ai .cps-ai-thumbs { display: flex !important; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cps-ai .cps-ai-thumbs .cps-ai-thumb { flex: none !important; width: 64px !important; height: 64px !important; min-width: 0 !important; max-width: none !important; padding: 0 !important; margin: 0 !important; border: 2px solid transparent !important; border-radius: 8px !important; background: #fff !important; box-shadow: 0 1px 4px rgba(0,0,0,.15); overflow: hidden; line-height: 0; }
.cps-ai .cps-ai-thumbs .cps-ai-thumb img { width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; object-position: 50% 40%; display: block; }
.cps-ai .cps-ai-thumbs .cps-ai-thumb.is-active { border-color: #6a3df0 !important; box-shadow: 0 0 0 2px rgba(106,61,240,.25); }
.cps-ai .cps-ai-step-email, .cps-ai .cps-ai-step-code { flex-direction: column; align-items: stretch; }
.cps-ai .cps-ai-step-email .cps-input, .cps-ai .cps-ai-step-code .cps-input { width: 100% !important; min-height: 42px; padding: .5em .8em !important; box-sizing: border-box; }
.cps-ai .cps-ai-row button { width: 100% !important; }

/* ---- « Ajouter au panier et découvrir le résultat après commande » (fiche produit) ---- */
.cps-after-order { flex-basis: 100%; width: 100%; margin-top: 10px; }
.cps-buy-col { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; align-self: stretch; }
.cps-buy-col > .single_add_to_cart_button { width: 100%; flex: 1 1 auto; }
.cps-buy-col > .cps-after-order { margin-top: 10px; flex: 0 0 auto; }
.cps-buy-col > .cps-after-order[hidden] { display: none !important; }
.cps-after-order[hidden] { display: none !important; }
.cps-after-order .cps-after-order-btn { width: 100%; white-space: normal; line-height: 1.3; padding: .8em 1em; border: 2px solid #6a3df0 !important; background: #fff !important; color: #6a3df0 !important; border-radius: 999px; font-weight: 600; }
.cps-after-order .cps-after-order-btn:hover { background: #f4efff !important; }
.cps-after-order-note { margin: 6px 4px 0; font-size: .8em; color: #666; line-height: 1.4; }

/* ---- Page de confirmation / Mon compte : « Créez votre portrait » ---- */
.cps-ao { margin: 0 0 32px; padding: 20px; border-radius: 14px; background: #f7f3ff; border: 1px solid #e2d8fb; }
.cps-ao-title { margin: 0 0 8px; }
.cps-ao-intro { margin: 0 0 16px; }
.cps-ao-item { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding: 16px 0; border-top: 1px solid #e2d8fb; }
.cps-ao-item:first-child { border-top: 0; }
.cps-ao-stage { flex: 1 1 320px; max-width: 520px; line-height: 0; }
.cps-ao-stage canvas, .cps-ao-final { max-width: 100%; height: auto !important; border-radius: 6px; box-shadow: 0 6px 24px rgba(40,20,90,.18); }
.cps-ao-loading { line-height: 1.4; padding: 40px 0; color: #777; }
.cps-ao-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; }
.cps-ao-name { margin: 0; font-size: 1.1em; }
.cps-ao-left { margin: 0; font-size: .9em; color: #555; }
.cps-ao .cps-ao-go { align-self: flex-start; padding: .7em 1.2em; border: 0; border-radius: 999px; background: #6a3df0; color: #fff; font-weight: 600; cursor: pointer; }
.cps-ao .cps-ao-go:disabled, .cps-ao .cps-ao-choose:disabled { opacity: .55; cursor: default; }
.cps-ao .cps-ao-choose { align-self: flex-start; padding: .7em 1.2em; border-radius: 999px; background: #2e7d32; color: #fff; border: 0; font-weight: 600; cursor: pointer; }
.cps-ao .cps-ao-choose[hidden], .cps-ao-versions[hidden] { display: none; }
.cps-ao-msg { margin: 0; font-size: .9em; }
.cps-ao-msg:empty { display: none; }
.cps-ao-msg[data-kind="err"] { color: #c62828; }
.cps-ao-versions span { font-size: .85em; color: #555; }
.cps-ao-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cps-ao .cps-ao-thumb { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #fff; overflow: hidden; line-height: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.cps-ao .cps-ao-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.cps-ao .cps-ao-thumb.is-active { border-color: #6a3df0; }
.cps-ao-help { margin: 0; font-size: .8em; color: #777; }
.cps-ao-ok { margin: 0; color: #2e7d32; font-weight: 600; }

/* Aperçu 3D (WebGL) : le voile « Création de votre aperçu… » passe au-dessus de la toile / du poster */
.cps-preview.is-ai-running .cps-preview-stage::after { z-index: 5; border-radius: 4px; }

/* ---- Exemples pré-rendus du produit ---- */
.cps-ex { margin: 4px 0 12px; }
.cps-ex[hidden] { display: none !important; }
.cps-ex-title { font-size: .85em; color: #555; margin-bottom: 6px; line-height: 1.3; }
.cps-ex-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cps-ex-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; cursor: pointer; outline: none; }
.cps-ex-item > img { width: 64px !important; height: 64px !important; max-width: none !important; object-fit: cover; object-position: 50% 35%; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 1px 5px rgba(0,0,0,.2); transition: transform .15s, border-color .15s; display: block; }
.cps-ex-item:hover > img, .cps-ex-item:focus-visible > img { transform: scale(1.06); }
.cps-ex-item.is-active > img { border-color: #6a3df0; box-shadow: 0 0 0 3px rgba(106,61,240,.25); }
.cps-ex-label { font-size: .72em; line-height: 1.2; text-align: center; color: #444; }
.cps-ex-item.is-active .cps-ex-label { color: #6a3df0; font-weight: 600; }
.cps-ex-admin { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 68px; }
.cps-ex-admin button { padding: 0 4px !important; min-height: 0 !important; line-height: 16px !important; font-size: 10px !important; border: 1px solid #ccc !important; background: #fff !important; color: #555 !important; border-radius: 3px !important; cursor: pointer; }
.cps-ex-admin img.emoji { width: 1em !important; height: 1em !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; display: inline !important; vertical-align: -0.1em !important; }
.cps-ai .cps-ai-ex-add { align-self: flex-start; padding: .35em .8em !important; border: 1px dashed #6a3df0 !important; background: #fff !important; color: #6a3df0 !important; border-radius: 999px !important; font-size: .78em !important; cursor: pointer; line-height: 1.3 !important; }
.cps-ai .cps-ai-ex-add span { color: #999; font-weight: normal; }
.cps-ai .cps-ai-ex-add[hidden] { display: none !important; }

/* Total des portraits (même style que la carte) ; lien « Effacer » des variations inutile sur nos fiches */
.cps-var-total[hidden] { display: none !important; }
.cps-var-total del { color: #999; font-weight: normal; margin-right: 4px; }
form.cart:has(.cps-customizer) .reset_variations { display: none !important; }

/* ---------- Cadrage de la tête (3.39.0) ---------- */
.cps-customizer button.cps-thumb-head {
    -webkit-appearance: none !important; appearance: none !important; box-sizing: border-box !important; position: absolute !important;
    left: auto !important; right: 3px !important; bottom: 3px !important; top: auto !important; margin: 0 !important; min-width: 0 !important; min-height: 0 !important;
    width: auto !important; height: 20px !important; padding: 0 6px !important; border: 0 !important; border-radius: 10px !important;
    background: #781391 !important; color: #fff !important; font-size: 10.5px !important; font-weight: 600 !important; line-height: 20px !important;
    text-transform: none !important; letter-spacing: 0 !important; box-shadow: 0 1px 3px rgba(0,0,0,.35) !important; cursor: pointer !important; white-space: nowrap !important;
}
.cps-customizer button.cps-thumb-head.is-set { background: #1f8f4e !important; }
.cps-hf { position: fixed; inset: 0; z-index: 100000; background: rgba(15,10,25,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cps-hf-panel { background: #fff; border-radius: 14px; padding: 18px; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); font-size: 14px; color: #222; }
.cps-hf-title { margin: 0 0 4px !important; font-weight: 700; font-size: 17px; }
.cps-hf-text { margin: 0 0 12px !important; color: #555; line-height: 1.4; }
.cps-hf-stage { position: relative; display: block; margin: 0 auto; width: fit-content; max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.cps-hf-stage img { display: block; max-width: 100%; max-height: 58vh; width: auto; height: auto; margin: 0; pointer-events: none; }
.cps-hf-frame { position: absolute; box-sizing: border-box; border: 3px solid #FFD84D; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; touch-action: none; }
.cps-hf-stage { overflow: hidden; border-radius: 8px; }
.cps-hf-handle { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: #FFD84D; border: 3px solid #781391; cursor: nwse-resize; touch-action: none; }
.cps-hf-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.cps-hf-actions button { -webkit-appearance: none; appearance: none; border-radius: 999px !important; padding: 10px 18px !important; font-size: 14px !important; font-weight: 600 !important; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; line-height: 1.2 !important; width: auto !important; margin: 0 !important; }
.cps-hf-skip { background: #fff !important; color: #781391 !important; border: 2px solid #781391 !important; }
.cps-hf-ok { background: #781391 !important; color: #fff !important; border: 2px solid #781391 !important; }

/* 3.46.0 : pas de modèle de base visible pendant le chargement (l'aperçu arrive avec un exemple) */
.cps-preview.is-loading .cps-preview-stage canvas { visibility: hidden; }
.cps-ex-imgs { margin-top: 8px; padding: 4px 10px !important; font-size: 12px !important; border: 1px dashed #781391 !important; background: #fff !important; color: #781391 !important; border-radius: 4px !important; cursor: pointer; }
.cps-ex-imgs[disabled] { opacity: .6; cursor: wait; }

/* 3.46.6 : création après commande, barre de progression sur l'image */
.cps-ao-stage { position: relative; }
.cps-ao-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(30,12,50,.55); backdrop-filter: blur(3px); border-radius: 6px; line-height: 1.4; }
.cps-ao-overlay[hidden] { display: none; }
.cps-ao-ov-box { width: 100%; max-width: 340px; padding: 16px 18px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center; }
.cps-ao-ov-title { font-weight: 700; margin-bottom: 10px; }
.cps-ao-ov-track { height: 10px; border-radius: 999px; background: #eee6f7; overflow: hidden; }
.cps-ao-ov-fill { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#781391,#a64dc4); transition: width .25s linear; }
.cps-ao-ov-label { margin-top: 8px; font-size: .85em; color: #555; }
