/* ==========================================================================
   MugEdit - Éditeur de mug (front-office)
   Personnalisation des couleurs : surcharger les variables --me-* dans le thème.
   ========================================================================== */
.mugedit {
  --me-accent: #1f6feb;
  --me-accent-dark: #1857bd;
  --me-accent-soft: #e8f0fe;
  --me-accent-fade: rgba(31, 111, 235, .1);
  --me-on-accent: #ffffff;
  --me-slider: var(--me-accent);
  --me-text: #1d2433;
  --me-muted: #6b7385;
  --me-border: #e3e6ec;
  --me-bg: #f5f6f8;
  --me-card: #ffffff;
  --me-danger: #d93a3a;
  --me-success: #1f9d55;
  --me-warn: #b7791f;
  --me-radius: 12px;
  --me-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  color: var(--me-text);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 2rem;
}
.mugedit *, .mugedit *::before, .mugedit *::after { box-sizing: border-box; }
.mugedit [hidden] { display: none !important; }
body.mugedit-page #wrapper { background: var(--me-bg, #f5f6f8); }
body.mugedit-page #content-wrapper, body.mugedit-page #main { width: 100%; }

.me-ico { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; vertical-align: middle; }

/* ---------- En-tête ---------- */
.me-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 4px 0 18px; }
.me-title { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: -.01em; text-transform: none; color: var(--me-text); }
.me-subtitle { margin: 2px 0 0; color: var(--me-muted); font-size: 1rem; }
.me-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; color: var(--me-muted); font-size: 13px; }
.me-steps li { display: flex; align-items: center; gap: 7px; }
.me-steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--me-accent-soft); color: var(--me-accent); font-weight: 700; font-size: 12px; }

.me-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--me-radius); background: #fff8e6; border: 1px solid #f3dfa8; }
.me-draft span { flex: 1 1 260px; }

/* ---------- Grille ---------- */
.me-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.me-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.me-col-side { position: sticky; top: 12px; }
.me-card { background: var(--me-card); border: 1px solid var(--me-border); border-radius: var(--me-radius); box-shadow: var(--me-shadow); padding: 14px; }
.me-card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--me-muted); margin: 0 0 10px; display: flex; align-items: baseline; gap: 6px; }
.me-card-title small { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Zones ---------- */
.me-zones { display: flex; flex-direction: column; gap: 6px; }
.me-zone { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1.5px solid var(--me-border); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; color: var(--me-text); transition: border-color .15s, background .15s; }
.me-zone:hover { border-color: #c5cbd6; }
.me-zone.is-active { border-color: var(--me-accent); background: var(--me-accent-soft); }
.me-zone-ico { width: 44px; height: 33px; flex: 0 0 44px; }
.me-zone-ico rect, .me-zone-ico path { fill: #fff; stroke: #9aa3b5; stroke-width: 2; }
.me-zone-ico .hl { fill: #d6e2fb; stroke: none; }
.me-zone.is-active .me-zone-ico .hl { fill: var(--me-accent); opacity: .55; }
.me-zone-label { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; }
.me-zone-label small { font-weight: 400; color: var(--me-muted); font-size: 12px; }
.me-zone-dot { position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--me-success); opacity: 0; transition: opacity .2s; }
.me-zone.has-content .me-zone-dot { opacity: 1; }

/* ---------- Ajouter ---------- */
.me-add { display: grid; gap: 8px; }
.me-add-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 12px; border: 1.5px dashed #b9c3d6; border-radius: 10px; background: #fafbfd; color: var(--me-text); cursor: pointer; text-align: left; font-weight: 600; transition: all .15s; }
.me-add-btn:hover { border-color: var(--me-accent); background: var(--me-accent-soft); color: var(--me-accent-dark); }
.me-add-btn .me-ico { width: 28px; height: 28px; color: var(--me-accent); }
.me-add-btn span { display: flex; flex-direction: column; line-height: 1.25; }
.me-add-btn small { font-weight: 400; color: var(--me-muted); font-size: 12px; }
.me-add-btn.is-busy { pointer-events: none; opacity: .6; }
.me-text-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.me-text-presets button { border: 1px solid var(--me-border); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--me-text); }
.me-text-presets button:hover { border-color: var(--me-accent); color: var(--me-accent); }
.me-text-presets [data-preset="title"] { font-family: 'Bebas Neue', sans-serif; font-size: 14px; letter-spacing: .05em; }
.me-text-presets [data-preset="script"] { font-family: 'Pacifico', cursive; }
.me-text-presets [data-preset="neon"] { font-family: 'Righteous', sans-serif; color: #e8338e; text-shadow: 0 0 6px rgba(232, 51, 142, .6); }
.me-text-presets [data-preset="retro"] { font-family: 'Bangers', sans-serif; letter-spacing: .04em; color: #f2a007; text-shadow: 1.5px 1.5px 0 #1d2433; }
.me-text-presets [data-preset="arc"] { font-family: 'Montserrat', sans-serif; font-weight: 700; }

/* ---------- Nuancier ---------- */
.me-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.me-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfd5df; cursor: pointer; padding: 0; position: relative; }
.me-swatch.is-active { box-shadow: 0 0 0 2px var(--me-accent); }
.me-swatch-none { background: linear-gradient(135deg, #fff 45%, #e53935 45%, #e53935 55%, #fff 55%); }
.me-swatch-custom { width: 26px; height: 26px; border: 0; padding: 0; border-radius: 50%; cursor: pointer; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: 0 0 0 1px #cfd5df; position: relative; }
.me-swatch-custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.me-swatches-sm .me-swatch, .me-swatches-sm .me-swatch-custom { width: 22px; height: 22px; }

/* ---------- Calques ---------- */
.me-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.me-layer { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.me-layer:hover { background: #f4f6fa; }
.me-layer.is-active { border-color: var(--me-accent); background: var(--me-accent-soft); }
.me-layer-thumb { width: 34px; height: 34px; border-radius: 6px; background: #eef1f5 center/cover no-repeat; display: grid; place-items: center; flex: 0 0 34px; color: var(--me-muted); font-weight: 700; overflow: hidden; }
.me-layer-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.me-layer-btn { border: 0; background: none; padding: 3px; border-radius: 6px; color: var(--me-muted); cursor: pointer; display: grid; }
.me-layer-btn:hover { background: #e6e9ef; color: var(--me-text); }
.me-layer-btn .me-ico { width: 16px; height: 16px; }
.me-layer-warn { color: var(--me-warn); display: grid; }
.me-layer-warn .me-ico { width: 16px; height: 16px; }
/* En-tête de la carte Calques : simple titre sur ordinateur, bouton repli/dépli sur mobile */
.me-layers-toggle { display: flex; align-items: baseline; gap: 6px; width: 100%; border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; cursor: default; pointer-events: none; }
.me-layers-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--me-accent-soft); color: var(--me-accent); font-size: 11px; letter-spacing: 0; align-self: center; }
.me-layers-card.is-empty .me-layers-count { display: none; }
.me-layers-chevron { display: none; width: 18px; height: 18px; margin-left: auto; align-self: center; transition: transform .2s; }
.me-empty { color: var(--me-muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- Barre d'outils ---------- */
.me-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--me-card); border: 1px solid var(--me-border); border-radius: var(--me-radius); padding: 6px 8px; box-shadow: var(--me-shadow); }
.me-tb-group { display: flex; gap: 2px; padding-right: 8px; border-right: 1px solid var(--me-border); }
.me-tb-group:last-child, .me-tb-right { border-right: 0; }
.me-tb-right { margin-left: auto; }
.me-tb { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: #3b4356; }
.me-tb:hover:not(:disabled) { background: #eef1f6; }
.me-tb.is-active { background: var(--me-accent-soft); color: var(--me-accent); }
.me-tb:disabled { opacity: .35; cursor: default; }
.me-tb-danger:hover:not(:disabled) { color: var(--me-danger); background: #fdecec; }
.me-zone-size { color: var(--me-muted); font-size: 12px; white-space: nowrap; }

/* ---------- Scène 2D ---------- */
.me-stage { position: relative; margin-top: 10px; background: repeating-conic-gradient(#eceff3 0% 25%, #f6f7f9 0% 50%) 50% / 20px 20px; border: 1px solid var(--me-border); border-radius: var(--me-radius); padding: 14px; min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.me-canvas-holder { width: 100%; display: flex; justify-content: center; }
.me-canvas-holder .canvas-container { box-shadow: 0 6px 24px rgba(16, 24, 40, .12); border-radius: 4px; }
.me-stage.is-dragover { outline: 3px dashed var(--me-accent); outline-offset: -8px; }
.me-drop { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 10px; background: var(--me-accent-fade); color: var(--me-accent-dark); font-weight: 700; font-size: 1.1rem; pointer-events: none; }
.me-drop .me-ico { width: 32px; height: 32px; }
.me-stage.is-dragover .me-drop { display: flex; }
.me-stage-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; color: var(--me-muted); }
.me-stage-empty p { margin: 0 0 8px; }
.me-stage-empty-actions { pointer-events: auto; display: flex; gap: 8px; justify-content: center; }
.me-stage-hint { color: var(--me-muted); font-size: 12px; margin: 6px 2px 0; }

/* ---------- Propriétés ---------- */
.me-props { margin-top: 12px; }
.me-props-empty { display: flex; align-items: center; gap: 10px; color: var(--me-muted); padding: 6px 2px; }
.me-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--me-border); margin: -4px -4px 12px; padding: 0 4px; overflow-x: auto; }
.me-tabs button { border: 0; background: none; padding: 8px 12px; font-weight: 600; color: var(--me-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.me-tabs button.is-active { color: var(--me-accent); border-bottom-color: var(--me-accent); }
.me-tab { display: flex; flex-direction: column; gap: 10px; }
.me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.me-row-tight { gap: 10px; }
.me-grow { flex: 1 1 160px; }
.me-input { width: 100%; border: 1px solid #ccd3de; border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; background: #fff; }
.me-input:focus { outline: 2px solid var(--me-accent-soft); border-color: var(--me-accent); }
.me-input-sm { width: auto; padding: 5px 8px; }
textarea.me-input { resize: vertical; min-height: 56px; font-size: 15px; }
.me-btn-group { display: inline-flex; border: 1px solid var(--me-border); border-radius: 9px; padding: 1px; }
.me-btn-group .me-tb { width: 32px; height: 32px; }
.me-label { font-size: 12px; font-weight: 600; color: var(--me-muted); text-transform: uppercase; letter-spacing: .04em; }
.me-help { margin: -4px 0 0; color: var(--me-muted); font-size: 12px; }
.me-range { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; margin: 0; font-weight: 500; font-size: 13px; }
.me-range input[type=range] { width: 100%; accent-color: var(--me-slider); }
.me-range output { text-align: right; color: var(--me-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.me-range.me-range-r { grid-template-columns: 110px 1fr 46px 16px; gap: 8px; }
.me-range-reset { display: inline-grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--me-muted); cursor: pointer; transition: color .15s, opacity .15s; }
.me-range-reset:hover, .me-range-reset:focus-visible { color: var(--me-accent); }
.me-range-reset .me-ico { width: 14px; height: 14px; }
.me-range.is-default .me-range-reset { opacity: .35; pointer-events: none; }
.me-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.me-check input { accent-color: var(--me-slider); width: 16px; height: 16px; }
.me-color-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
input[type=color] { width: 36px; height: 30px; border: 1px solid #ccd3de; border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.me-fieldset { border: 1px solid var(--me-border); border-radius: 10px; padding: 8px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.me-fieldset legend { width: auto; padding: 0 6px; margin: 0; font-size: 14px; border: 0; }
.me-fieldset:has(input[type=checkbox]:not(:checked)) > :not(legend) { opacity: .45; }
.me-seg { display: inline-flex; flex-wrap: wrap; background: #eef1f5; border-radius: 9px; padding: 3px; gap: 2px; align-self: flex-start; }
.me-seg button { border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--me-muted); font-size: 13px; }
.me-seg button.is-active { background: #fff; color: var(--me-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* Police */
.me-font-picker { position: relative; flex: 1 1 220px; display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.me-font-current { flex: 1 1 auto; min-width: 0; text-align: left; cursor: pointer; font-size: 17px; padding-right: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%236b7385'/%3E%3C/svg%3E") no-repeat right 6px center / 20px; }
.me-font-step { flex: 0 0 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--me-border); border-radius: 8px; background: #fff; color: var(--me-text); cursor: pointer; }
.me-font-step:hover { border-color: var(--me-accent); color: var(--me-accent); }
.me-font-panel { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); min-width: 280px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--me-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); }
.me-font-head { flex: 0 0 auto; display: none; align-items: center; justify-content: space-between; }
.me-font-close { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--me-muted); }
.me-font-search { width: 100%; font-size: 16px; flex: 0 0 auto; }
.me-font-cats { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.me-font-cats::-webkit-scrollbar { display: none; }
.me-font-cats button { flex: 0 0 auto; border: 1px solid var(--me-border); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--me-text); }
.me-font-cats button.is-active { background: var(--me-accent); border-color: var(--me-accent); color: var(--me-on-accent); }
.me-font-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; overscroll-behavior: contain; }
.me-font-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.me-font-list li:hover, .me-font-list li.is-hl { background: var(--me-bg); }
.me-font-list li.is-active { background: var(--me-accent-soft); box-shadow: inset 3px 0 0 var(--me-accent); }
.me-font-sample { font-size: 21px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--me-text); }
.me-font-list small { font-size: 11px; color: var(--me-muted); font-family: inherit; }
.me-font-list .me-font-empty { cursor: default; color: var(--me-muted); font-size: 14px; }
.me-font-backdrop { display: none; }
.me-file-input { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.me-add-btn { position: relative; }
.me-toast { position: fixed; z-index: 10050; left: 50%; bottom: 20px; transform: translate(-50%, 30px); max-width: min(520px, calc(100vw - 24px)); display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: #2b1d1d; color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.me-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.me-toast .me-ico { color: #ffb4a8; flex: 0 0 auto; }
.me-toast a { color: #fff; text-decoration: underline; }

/* Effets */
.me-fx-presets, .me-filter-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.me-fx-presets button, .me-filter-presets button { border: 1.5px solid var(--me-border); background: #fff; border-radius: 10px; padding: 6px 4px; cursor: pointer; font-size: 12px; color: var(--me-text); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.me-fx-presets button:hover, .me-filter-presets button:hover { border-color: #b9c3d6; }
.me-fx-presets button.is-active, .me-filter-presets button.is-active { border-color: var(--me-accent); background: var(--me-accent-soft); }
.me-fx-sample { font: 700 22px/1.2 'Montserrat', sans-serif; color: #2b3445; }
.fx-shadow { text-shadow: 2px 2px 3px rgba(0, 0, 0, .45); }
.fx-outline { color: #fff; -webkit-text-stroke: 1.2px #1d2433; }
.fx-neon { color: #fff; text-shadow: 0 0 3px #ff2fa0, 0 0 8px #ff2fa0, 0 0 12px #ff2fa0; background: #1d2433; border-radius: 4px; padding: 0 4px; }
.fx-retro { color: #f2a007; text-shadow: 2px 2px 0 #1d2433; -webkit-text-stroke: .6px #1d2433; }
.fx-relief { color: #e85d3a; text-shadow: 1px 1px 0 #a33a1f, 2px 2px 0 #a33a1f; }
.fx-glow { color: #2b3445; text-shadow: 0 0 6px #ffd84a, 0 0 10px #ffd84a; }
.me-gradient-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.me-gradient-presets button { width: 40px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .1); cursor: pointer; }

/* Qualité image */
.me-quality { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.me-quality.is-good { background: #e9f7ef; color: #17683b; }
.me-quality.is-bad { background: #fff4e5; color: #8a5a12; }
.me-quality .me-ico { width: 18px; height: 18px; }

/* ---------- 3D ---------- */
.me-3d-card { padding: 0; overflow: hidden; }
.me-3d { position: relative; width: 100%; aspect-ratio: 1 / 1; background: radial-gradient(120% 90% at 50% 25%, #ffffff 0%, #eef1f5 55%, #dfe4ec 100%); cursor: grab; }
.me-3d:active { cursor: grabbing; }
.me-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.me-3d-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.me-3d-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--me-muted); font-size: 12px; pointer-events: none; white-space: nowrap; transition: opacity .4s; }
.me-3d-hint .me-ico { width: 16px; height: 16px; }
.me-3d.is-touched .me-3d-hint { opacity: 0; }
.me-3d-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; color: var(--me-muted); }
.me-3d-fallback canvas { max-width: 100%; height: auto !important; border: 1px solid var(--me-border); border-radius: 6px; background: #fff; }
.me-3d-views { display: flex; border-top: 1px solid var(--me-border); }
.me-3d-views button { flex: 1; border: 0; background: #fff; padding: 9px 4px; font-weight: 600; font-size: 13px; color: var(--me-muted); cursor: pointer; border-right: 1px solid var(--me-border); display: grid; place-items: center; }
.me-3d-views button:last-child { border-right: 0; flex: 0 0 48px; }
.me-3d-views button:hover { color: var(--me-text); background: #f7f8fa; }
.me-3d-views button.is-active { color: var(--me-accent); background: var(--me-accent-soft); }

/* ---------- Achat ---------- */
.me-buy { display: flex; flex-direction: column; gap: 10px; }
.me-buy select.me-input { margin-top: -4px; }
.me-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.me-price { display: flex; flex-direction: column; line-height: 1.1; }
.me-price-unit { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.me-price-old { color: var(--me-muted); text-decoration: line-through; font-size: 13px; }
.me-price-old:empty { display: none; }
.me-price small { color: var(--me-muted); font-size: 12px; margin-top: 3px; }
.me-price-note { margin: -4px 0 0; color: var(--me-muted); font-size: 12px; }
.me-price-note:empty { display: none; }
.me-qty { display: inline-flex; align-items: center; border: 1px solid #ccd3de; border-radius: 10px; overflow: hidden; }
.me-qty button { width: 36px; height: 40px; border: 0; background: #f4f6f9; font-size: 18px; cursor: pointer; color: var(--me-text); }
.me-qty button:hover { background: #e8ecf2; }
.me-qty input { width: 52px; height: 40px; border: 0; text-align: center; font: 600 16px/1 inherit; -moz-appearance: textfield; }
.me-qty input::-webkit-inner-spin-button, .me-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.me-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px dashed var(--me-border); }
.me-total strong { font-size: 1.15rem; }
.me-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; line-height: 1.2; }
.me-btn:active { transform: translateY(1px); }
.me-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.me-btn-sm .me-ico { width: 16px; height: 16px; }
.me-btn-block { width: 100%; }
.me-btn-primary { background: var(--me-accent); color: var(--me-on-accent) !important; }
.me-btn-primary:hover { background: var(--me-accent-dark); color: var(--me-on-accent); text-decoration: none; }
.me-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.me-btn-ghost { background: #fff; color: var(--me-text); border-color: #ccd3de; }
.me-btn-ghost:hover { background: #f4f6f9; text-decoration: none; }
.me-btn-cart { padding: 14px; font-size: 16px; }
.me-btn-cart .me-ico { width: 22px; height: 22px; }
.me-msg { font-size: 13px; }
.me-msg:empty { display: none; }
.me-msg.is-error { color: var(--me-danger); }
.me-msg.is-success { color: var(--me-success); }
.me-msg a { font-weight: 700; }
.me-desc { font-size: 13px; color: #3b4356; }
.me-desc p:last-child { margin-bottom: 0; }

/* ---------- Overlay / modale ---------- */
.me-overlay, .me-modal { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; background: rgba(17, 24, 39, .45); padding: 16px; }
.me-overlay-box, .me-modal-box { background: #fff; border-radius: 16px; padding: 24px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); width: min(420px, 100%); position: relative; }
.me-overlay-box p { margin: 12px 0; font-weight: 600; }
.me-progress { height: 6px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.me-progress span { display: block; height: 100%; width: 0; background: var(--me-accent); transition: width .2s; }
.me-modal-box h3 { font-size: 1.2rem; margin: 10px 0 12px; }
.me-modal-box img { width: 100%; max-width: 320px; border-radius: 10px; background: #f3f5f8; }
.me-modal-check { width: 52px; height: 52px; border-radius: 50%; background: #e3f6eb; color: var(--me-success); display: grid; place-items: center; margin: 0 auto; }
.me-modal-check .me-ico { width: 30px; height: 30px; }
.me-modal-close { position: absolute; top: 10px; right: 10px; border: 0; background: none; cursor: pointer; color: var(--me-muted); padding: 4px; }
.me-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.me-spinner { display: inline-block; width: 34px; height: 34px; border: 3px solid #dfe4ec; border-top-color: var(--me-accent); border-radius: 50%; animation: me-spin .8s linear infinite; }
@keyframes me-spin { to { transform: rotate(360deg); } }

/* ---------- Zone « Côté » (texte vertical) ---------- */
.mugedit.is-zone-side [data-no-side] { display: none !important; }
.mugedit:not(.is-zone-side) [data-only-side] { display: none !important; }
.me-vert { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 4px; }
.mugedit.is-zone-side .me-add { grid-template-columns: minmax(0, 1fr); }
.me-vert-label { font-size: 12px; font-weight: 600; color: var(--me-muted); }
.me-vert .me-seg { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.me-vert .me-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; white-space: nowrap; }
.me-vert-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.me-vert-up { transform: rotate(-90deg); }
.me-vert-down { transform: rotate(90deg); }
.me-vert-stack { font-size: 8px; line-height: .95; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .me-grid { grid-template-columns: 250px minmax(0, 1fr); }
  .me-col-side { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .me-col-side .me-desc { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .mugedit { font-size: 15px; }
  /* Une seule colonne : les cartes sont réordonnées pour garder l'éditeur en haut */
  .me-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .me-col, .me-col-side { display: contents; }
  .me-col-tools > .me-card:nth-child(1) { order: 1; } /* zones */
  .me-col-tools > .me-card:nth-child(2) { order: 2; } /* ajouter */
  .me-toolbar { order: 3; }
  .me-stage { order: 4; margin-top: 0; }
  .me-stage-hint { order: 5; margin-top: -6px; }
  .me-layers-card { order: 6; padding: 10px 12px; } /* calques juste sous le mug */
  .me-props { order: 7; margin-top: 0; }
  .me-col-tools > .me-card:nth-child(3) { order: 8; } /* fond */
  .me-3d-card { order: 9; }
  .me-buy { order: 10; }
  .me-desc { order: 11; }
  /* Calques : carte repliable, masquée tant que la zone est vide (l'état vide est déjà affiché sur le mug) */
  .me-layers-card.is-empty { display: none; }
  .me-layers-card .me-card-title { margin: 0; }
  .me-layers-toggle { pointer-events: auto; cursor: pointer; min-height: 32px; align-items: center; -webkit-tap-highlight-color: transparent; }
  .me-layers-chevron { display: block; }
  .me-layers-card.is-collapsed .me-layers-chevron { transform: rotate(-90deg); }
  .me-layers { margin-top: 8px; max-height: 204px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .me-layers-card.is-collapsed .me-layers, .me-layers-card.is-collapsed .me-empty { display: none; }
  .me-layer { min-height: 48px; padding: 6px 4px 6px 8px; gap: 10px; border-color: var(--me-border); }
  .me-layer:hover { background: none; }
  .me-layer.is-active { border-color: var(--me-accent); background: var(--me-accent-soft); }
  .me-layer-thumb { width: 36px; height: 36px; flex-basis: 36px; }
  .me-layer-name { font-size: 14px; }
  .me-layer-btn { width: 40px; height: 40px; place-items: center; }
  .me-layer-btn .me-ico { width: 20px; height: 20px; }
  .me-zones { flex-direction: row; }
  .me-zones { gap: 5px; }
  .me-zone { flex: 1 1 0; min-width: 0; flex-direction: column; text-align: center; gap: 4px; padding: 8px 2px; }
  .me-zone-label { max-width: 100%; font-size: 12.5px; letter-spacing: -.01em; }
  .me-zone-ico { width: 38px; height: 28px; flex-basis: 28px; }
  .me-vert .me-seg button { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 12px; }
  .me-zone-label small { display: none; }
  .me-zone-dot { top: 8px; right: 8px; margin: 0; }
  .me-add { grid-template-columns: 1fr 1fr; }
  .me-add-btn { min-height: 56px; }
  .me-add-btn small { display: none; }
  .me-steps { display: none; }
  .me-range { grid-template-columns: 82px 1fr 40px; }
  .me-range.me-range-r { grid-template-columns: 82px 1fr 40px 20px; }
  .me-range input[type=range] { height: 28px; }
  .me-range-reset { width: 20px; height: 20px; }
  .me-stage { padding: 6px; }
  .me-toolbar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .me-toolbar::-webkit-scrollbar { display: none; }
  .me-tb { width: 40px; height: 40px; flex: 0 0 auto; }
  .me-tabs button { padding: 10px 12px; }
  .me-swatch { width: 32px; height: 32px; }
  /* Sélecteur de polices en panneau bas d'écran */
  .me-font-backdrop { display: block; position: fixed; inset: 0; z-index: 10040; background: rgba(16, 24, 40, .45); }
  .me-font-backdrop[hidden] { display: none; }
  .me-font-panel { position: fixed; z-index: 10041; left: 0; right: 0; top: auto; bottom: 0; min-width: 0; max-height: 78vh; border-radius: 16px 16px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(16, 24, 40, .25); }
  .me-font-head { display: flex; font-size: 16px; }
  .me-font-list { max-height: none; flex: 1 1 auto; min-height: 0; }
  .me-font-list li { padding: 10px 12px; }
  .me-font-sample { font-size: 24px; }
  .me-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  html.me-font-open, html.me-font-open body { overflow: hidden; }
}

/* ---------- Coloris intérieur ---------- */
.me-inner { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--me-border); }
.me-inner .me-label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--me-muted); }
.me-inner-current { color: var(--me-text); }
.me-inner-list { display: flex; flex-wrap: wrap; gap: 6px; }
.me-inner-swatch { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 62px; padding: 6px 2px 5px; border: 1.5px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--me-text); font: inherit; }
.me-inner-swatch:hover { background: #f4f6f9; }
.me-inner-swatch.is-active { border-color: var(--me-accent); background: var(--me-accent-soft); }
.me-inner-swatch:focus-visible { outline: 2px solid var(--me-accent); outline-offset: 2px; }
/* Mug vu de dessus : bord extérieur (couleur du mug) + intérieur (coloris) */
.me-inner-dot { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--me-inner) 82%, #fff) 0 18%, var(--me-inner) 55%, color-mix(in srgb, var(--me-inner) 80%, #000) 100%); box-shadow: 0 0 0 5px var(--me-outer, #fff), 0 0 0 6px rgba(16, 24, 40, .22), 0 2px 6px 6px rgba(16, 24, 40, .08); margin: 6px 0 4px; }
@supports not (background: color-mix(in srgb, red, blue)) {
  .me-inner-dot { background: var(--me-inner); }
}
.me-inner-label { font-size: 11px; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-inner-extra { font-size: 10px; line-height: 1; color: var(--me-muted); font-variant-numeric: tabular-nums; }
.me-inner-swatch.is-active .me-inner-label { font-weight: 700; }
@media (max-width: 767px) {
  .me-inner-swatch { width: 58px; }
}
