/*
 * AM Design — personnalisation : CSS de base MINIMAL (structure, pas de charte).
 * Désactivable : add_filter( 'amd/perso/load_css', '__return_false' ); le thème reprend tout.
 * Variables surchargeables par le thème.
 */
.amd-perso {
	--amd-perso-gap: 1rem;
	--amd-perso-border: currentColor;
	--amd-perso-accent: #1e8bff;
	--amd-perso-error: #b00020;
	--amd-perso-swatch-size: 2rem;
	display: grid;
	gap: var(--amd-perso-gap);
	margin: 0 0 var(--amd-perso-gap);
}
.amd-perso__group { display: grid; gap: var(--amd-perso-gap); }
.amd-perso__field { border: 0; margin: 0; padding: 0; min-width: 0; }
.amd-perso__field[hidden] { display: none; }
.amd-perso__label { display: block; font-weight: 600; margin-bottom: .25rem; padding: 0; }
.amd-perso__help, .amd-perso__file-rules, .amd-perso__counter, .amd-perso__sizes-total { font-size: .875em; margin: .25rem 0; opacity: .85; }
.amd-perso__input { box-sizing: border-box; width: 100%; max-width: 100%; }
.amd-perso__input--number, .amd-perso__input--size { max-width: 8rem; }
.amd-perso__choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.amd-perso__choice { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.amd-perso__choice--image, .amd-perso__choice--color { flex-direction: column; text-align: center; }
.amd-perso__choice-image { display: block; width: 6rem; height: auto; }
.amd-perso__swatch { display: block; width: var(--amd-perso-swatch-size); height: var(--amd-perso-swatch-size); border-radius: 50%; background: var(--amd-swatch, #ccc); border: 1px solid rgba(0, 0, 0, .3); }
.amd-perso__choice-input:checked ~ .amd-perso__swatch,
.amd-perso__choice-input:checked ~ .amd-perso__choice-image { outline: 3px solid var(--amd-perso-accent); outline-offset: 2px; }
.amd-perso__choice-input:focus-visible ~ .amd-perso__swatch,
.amd-perso__choice-input:focus-visible ~ .amd-perso__choice-image { outline: 3px dashed var(--amd-perso-accent); outline-offset: 3px; }
.amd-perso__font-sample { font-size: 1.4em; }
.amd-perso__sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.amd-perso__size { display: grid; gap: .25rem; }
.amd-perso__files { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.amd-perso__file { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.amd-perso__file-thumb { width: 64px; height: 64px; object-fit: cover; }
.amd-perso__file.is-error .amd-perso__file-status { color: var(--amd-perso-error); }
.amd-perso__file-warning { flex-basis: 100%; margin: 0; font-size: .875em; color: #8a5a00; }
.amd-perso__preview { margin-top: .5rem; padding: .75rem; border: 1px dashed var(--amd-perso-border); overflow-wrap: anywhere; }
.amd-perso__preview[hidden] { display: none; }
.amd-perso__preview-label { display: block; font-size: .75em; text-transform: uppercase; opacity: .7; }
.amd-perso__preview-text { font-size: 1.5em; white-space: pre-wrap; }
.amd-perso__error, .amd-perso__form-error { color: var(--amd-perso-error); font-weight: 600; margin: .25rem 0 0; }
.amd-perso__field.has-error .amd-perso__input { border-color: var(--amd-perso-error); }
.amd-perso__required { color: var(--amd-perso-error); }
.amd-price__summary { display: grid; gap: .25rem; margin: 0 0 1rem; }
.amd-price__row { display: flex; justify-content: space-between; gap: 1rem; }
.amd-price__row[hidden] { display: none; }
.amd-price__value { margin: 0; font-weight: 700; }
.amd-perso-recap__thumb { width: 48px; height: 48px; object-fit: cover; vertical-align: middle; }
.amd-perso__editing { padding: .5rem .75rem; border-left: 4px solid var(--amd-perso-accent); background: rgba(30, 139, 255, .08); }
.amd-perso-dup { margin-left: .75rem; font-size: .875em; }
/* Atelier étiquettes (aperçu en direct). */
.amd-atelier-label { display: grid; gap: .75rem; }
.amd-atelier-label__ui { display: grid; gap: .75rem; min-width: 0; }
.amd-atelier-label__tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.amd-atelier-label__tabs[hidden] { display: none; }
.amd-atelier-label__tab, .amd-atelier-label__apply-all, .amd-atelier-label__picto { cursor: pointer; border: 1px solid rgba(0, 0, 0, .25); background: #fff; color: inherit; border-radius: .4rem; padding: .35rem .7rem; font: inherit; }
.amd-atelier-label__tab[aria-selected="true"], .amd-atelier-label__picto[aria-pressed="true"] { outline: 3px solid var(--amd-perso-accent); outline-offset: 1px; }
.amd-atelier-label__tab.is-done::after { content: " ✓"; }
.amd-atelier-label__apply-all { margin-left: auto; font-size: .875em; }
.amd-atelier-label__preview { padding: .75rem; background: repeating-conic-gradient(#f3f3f3 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: .5rem; }
.amd-atelier-label__svg { display: block; width: 100%; max-width: 30rem; max-height: 14rem; margin: 0 auto; }
.amd-atelier-label__controls { display: grid; gap: .6rem; }
.amd-atelier-label__line { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; align-items: center; margin: 0; }
.amd-atelier-label__line-label { grid-column: 1 / -1; font-weight: 600; }
.amd-atelier-label__count { font-size: .8em; opacity: .75; }
.amd-atelier-label__font { display: grid; gap: .25rem; margin: 0; }
.amd-atelier-label__group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.amd-atelier-label__legend { font-weight: 600; margin-bottom: .25rem; padding: 0; width: 100%; }
.amd-atelier-label__swatch { position: relative; cursor: pointer; }
.amd-atelier-label__swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amd-atelier-label__chip { display: block; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--amd-chip, #ccc); border: 1px solid rgba(0, 0, 0, .3); }
.amd-atelier-label__swatch input:checked + .amd-atelier-label__chip { outline: 3px solid var(--amd-perso-accent); outline-offset: 2px; }
.amd-atelier-label__swatch input:focus-visible + .amd-atelier-label__chip { outline: 3px dashed var(--amd-perso-accent); outline-offset: 3px; }
.amd-atelier-label__picto { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .25rem; }
.amd-atelier-label__sheet-caption { margin: 0; font-size: .875em; opacity: .85; }
.amd-atelier-label__sheet { max-height: 22rem; overflow: auto; border: 1px solid rgba(0, 0, 0, .12); border-radius: .5rem; padding: .5rem; background: #fafafa; }
.amd-atelier-label__sheet-svg { display: block; width: 100%; height: auto; }
.amd-atelier-label .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.amd-perso-recap__thumb--label { width: 96px; height: 48px; object-fit: contain; background: #fff; }
/* Fiche en étapes. */
.amd-perso__field--offstep, .amd-perso--steps .amd-perso__group-title { display: none !important; }
/* Groupe dont aucun champ n'est dans l'étape courante (ou tous masqués par condition) : pas de cadre vide. */
.amd-perso--steps .amd-perso__group:not(:has(> .amd-perso__field:not(.amd-perso__field--offstep):not([hidden]))) { display: none; }
.amd-perso__steps-list { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0 0 .5rem; padding: 0; counter-reset: amdstep; }
.amd-perso__step { counter-increment: amdstep; }
.amd-perso__step[hidden] { display: none; }
.amd-perso__step-btn { background: none; border: 0; padding: .25rem 0; font: inherit; color: inherit; cursor: pointer; opacity: .7; }
.amd-perso__step-btn::before { content: counter(amdstep) ". "; }
.amd-perso__step.is-done .amd-perso__step-btn { opacity: .9; }
.amd-perso__step.is-current .amd-perso__step-btn { opacity: 1; font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.amd-perso__progress { height: 4px; background: rgba(0, 0, 0, .1); border-radius: 2px; overflow: hidden; margin-bottom: .75rem; }
.amd-perso__progress-bar { display: block; height: 100%; width: 0; background: var(--amd-perso-accent); transition: width .2s ease; }
.amd-perso__step-title { font-size: 1.1em; margin: 0 0 .5rem; }
.amd-perso__stepnav { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.amd-perso__stepnav [hidden] { display: none; }
.amd-perso__step-next { margin-left: auto; }
.amd-perso__recap-list { margin: 0; display: grid; gap: .4rem; }
.amd-perso__recap-row { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: .5rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.amd-perso__recap-row dt { font-weight: 600; }
.amd-perso__recap-row dd { margin: 0; overflow-wrap: anywhere; }
.amd-perso__recap-edit { background: none; border: 0; padding: 0; margin-left: .25rem; font: inherit; font-size: .875em; text-decoration: underline; cursor: pointer; color: inherit; }
@media (max-width: 480px) { .amd-perso__recap-row { grid-template-columns: 1fr; } }
/* Choix de police replié (polices chargées à l'ouverture). */
.amd-perso__fontpicker { border: 1px solid rgba(0, 0, 0, .25); border-radius: .4rem; padding: .25rem .6rem; }
.amd-perso__fontpicker-summary { cursor: pointer; padding: .35rem 0; font-size: 1.15em; }
.amd-perso__fontpicker[open] .amd-perso__choices { padding: .5rem 0; }
.amd-perso__choice--font .amd-perso__choice-label { font-size: 1.25em; }
.amd-perso__faces { margin: .5rem 0; }
.amd-atelier-label__picto-img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.amd-atelier-label__font { padding: .25rem .6rem; }
