/* Configurateur de personnalisation */
/* Écran "application" : la page tient dans la fenêtre, seul le panneau défile (un seul ascenseur) */
.is-customizer .brand-strip, .is-customizer .site-footer { display: none; }
@media (min-width: 901px) {
    body.is-customizer { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
    .is-customizer .site-header { position: relative; }
    .is-customizer main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .is-customizer .cz { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .is-customizer .cz-main { flex: 1; min-height: 0; }
    .is-customizer .cz-panel { position: static; max-height: none; height: 100%; overscroll-behavior: contain; }
    .is-customizer .cz-views { overflow-y: auto; }
    .is-customizer .cz-stage { min-height: 0; overflow: hidden; }
}
.cz { background: #f0f0ee; }
.cz-bar { background: #fff; border-bottom: 1px solid var(--line-soft); }
.cz-bar__inner { display: flex; align-items: center; gap: 20px; min-height: 58px; }
.cz-back { text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.cz-bar__title { flex: 1; font-family: var(--font-title); text-transform: uppercase; font-size: 18px; }
.cz-bar__price { font-weight: 800; font-size: 20px; white-space: nowrap; }
.cz-bar__price small { font-weight: 400; font-size: 13px; color: var(--muted); }

.cz-main { display: grid; grid-template-columns: 110px minmax(0, 1fr) 420px; min-height: calc(100vh - 230px); }

.cz-views { display: flex; flex-direction: column; gap: 8px; padding: 16px 10px; background: #fff; border-right: 1px solid var(--line-soft); }
.cz-view { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.cz-view img { width: 76px; height: 90px; object-fit: contain; background: var(--bg-soft); border-radius: 2px; }
.cz-view[aria-selected="true"] { border-color: var(--ink); }
.cz-view[aria-selected="true"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -3px; height: 3px; background: #e0892a; border-radius: 2px; }
.cz-view__count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.cz-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 64px 12px; }
.cz-canvas-wrap { position: relative; width: 100%; max-width: 760px; }
.cz-canvas-wrap .canvas-container { margin: 0 auto; }
.cz-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); background: rgba(240,240,238,.7); }
.cz-loading[hidden] { display: none; }
.cz-stage__tools { position: absolute; left: 16px; top: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.cz-tool { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cz-tool svg { width: 20px; height: 20px; }
.cz-tool:hover:not(:disabled) { border-color: var(--ink); }
.cz-tool:disabled { opacity: .35; cursor: default; }
.cz-tool.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cz-tools__sep { height: 1px; width: 26px; margin: 2px auto; background: var(--line); }
.cz-tool--zoom { width: auto; min-width: 42px; padding: 0 8px; border-radius: 21px; font-size: 12px; font-weight: 800; }
.cz-canvas-wrap.is-zoomed canvas { cursor: grab; }
.cz-canvas-wrap.is-panning canvas { cursor: grabbing !important; }
@media (max-width: 900px) { .cz-tools__sep { width: 1px; height: 26px; margin: auto 2px; } }
.cz-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 28px; line-height: 1; cursor: pointer; z-index: 3; }
.cz-nav--prev { left: 12px; }
.cz-nav--next { right: 12px; }
.cz-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; text-align: center; }

.cz-panel { background: #fff; border-left: 1px solid var(--line-soft); padding: 8px 24px 24px; overflow-y: auto; max-height: calc(100vh - 150px); position: sticky; top: 142px; }
.cz-step { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.cz-step__title { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 14px; }
.cz-step__title span { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.cz-step__title em { font-style: normal; font-family: var(--font); text-transform: none; font-weight: 600; color: var(--ink-soft); }

.cz-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.cz-color { width: 50px; height: 50px; padding: 3px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; overflow: hidden; }
.cz-color img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: 50%; }
.cz-color[aria-checked="true"] { border: 2px solid var(--ink); }

.cz-zone-group + .cz-zone-group { margin-top: 12px; }
.cz-zone-group__title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.cz-zone { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 6px; }
.cz-zone.is-active { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.cz-zone__name { flex: 1; font-weight: 700; font-size: 14px; }
.cz-zone__name small { display: block; font-weight: 400; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.cz-zone__actions { display: flex; gap: 6px; }
.cz-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.cz-chip:hover { border-color: var(--ink); }
.cz-chip svg { width: 14px; height: 14px; }
.cz-chip.is-filled { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Éditeur de l'élément sélectionné : fenêtre flottante à droite (la maquette reste visible), voile léger derrière */
/* Position : centrée sur la colonne de droite quand la place le permet (la maquette reste manipulable), sinon centrée
   à l'écran (customizer.js pose --cz-editor-left) */
.cz-editor { position: fixed; z-index: 60; left: var(--cz-editor-left, 50%); top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 18px 22px 20px; border-radius: 10px; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .3), 0 0 0 1px var(--line-soft); overscroll-behavior: contain; }
/* Voile visuel seulement : les clics passent (déplacement du texte / logo sur la maquette pendant l'édition) */
.cz-editor::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(20, 20, 20, .14); pointer-events: none; }
.cz-editor__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); position: sticky; bottom: -20px; background: #fff; padding-bottom: 4px; }
.cz-editor__foot .btn { min-width: 130px; }
.cz-editor__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); position: sticky; top: -18px; background: #fff; z-index: 1; }
.cz-editor__head strong { font-size: 16px; }
.cz-editor__close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.cz-editor__close:hover { border-color: var(--ink); }
.cz-editor__headbtns { display: flex; align-items: center; gap: 6px; flex: none; }
.cz-editor__toggle { display: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.cz-editor__chev { width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.cz-editor.is-collapsed .cz-editor__chev { transform: translateY(2px) rotate(-135deg); }
/* Smartphone : panneau en bas d'écran limité à 44 % de la hauteur pour laisser la maquette visible et manipulable ;
   bouton de repli pour ne garder que la barre de titre, défilement de la page bloqué pendant l'édition (html.cz-lock) */
@media (max-width: 900px) {
    .cz-editor { right: 0; left: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 44vh; max-height: 44dvh; border-radius: 14px 14px 0 0; padding: 10px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .22), 0 0 0 1px var(--line-soft); }
    .cz-editor::before { display: none; }
    .cz-editor__head { top: -10px; margin-bottom: 10px; padding-bottom: 8px; }
    .cz-editor__toggle { display: flex; }
    .cz-editor.is-collapsed { max-height: none; overflow: hidden; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .cz-editor.is-collapsed > :not(.cz-editor__head) { display: none; }
    .cz-editor.is-collapsed .cz-editor__head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
    .cz-editor__foot { bottom: -16px; }
    html.cz-lock, html.cz-lock body { overflow: hidden; height: 100%; overscroll-behavior: none; }
}
.cz-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cz-font { padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-font[aria-checked="true"] { border: 2px solid var(--ink); }
.cz-threads { display: flex; flex-wrap: wrap; gap: 6px; }
.cz-thread { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); cursor: pointer; box-shadow: inset 0 0 0 2px #fff; }
.cz-thread[aria-checked="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--ink); }

.cz-logo-choices { display: grid; gap: 8px; margin-bottom: 12px; }
.cz-choice { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; text-align: left; }
.cz-choice:hover { border-color: var(--ink); }
.cz-choice svg { width: 26px; height: 26px; flex: none; }
.cz-choice strong { display: block; font-size: 14px; }
.cz-choice small { display: block; color: var(--muted); font-size: 12px; }
.cz-logo-current { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cz-logo-current img { width: 72px; height: 72px; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--line-soft); background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.cz-logo-current p { margin: 0 0 4px; }

.cz-options { display: grid; gap: 8px; }
.cz-option { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.cz-option:has(input:checked) { border-color: var(--ink); background: var(--bg-soft); }
.cz-option input { width: 18px; height: 18px; accent-color: var(--ink); }
.cz-option img { width: 38px; height: 38px; object-fit: contain; }
.cz-option__text { flex: 1; font-size: 14px; }
.cz-option__text small { display: block; color: var(--muted); font-size: 12px; }
.cz-option__price { font-weight: 800; font-size: 14px; white-space: nowrap; }

.cz-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cz-size { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; text-align: center; }
.cz-size.has-qty { border-color: var(--ink); background: var(--bg-soft); }
.cz-size label { display: block; font-weight: 800; font-size: 14px; }
.cz-size input { width: 100%; height: 34px; border: 1px solid var(--line-soft); border-radius: 3px; text-align: center; font-weight: 700; }
.cz-size.is-disabled { opacity: .4; }

.cz-summary { padding: 18px 0 0; }
.cz-lines { list-style: none; margin: 0 0 6px; padding: 0 0 0 10px; font-size: 13px; color: var(--ink-soft); }
.cz-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.cz-info { border: 0; background: none; padding: 0; vertical-align: middle; cursor: help; }
.cz-info svg { width: 15px; height: 15px; }
.cz-pending-note { display: flex; gap: 8px; align-items: flex-start; background: #fff8e6; border: 1px solid #f1d58a; border-radius: var(--radius); padding: 10px; margin: 12px 0 0; }
.cz-pending-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.cz-confirm { margin: 14px 0 0; }

.cz-modal { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cz-modal[hidden] { display: none; }
.cz-modal__box { background: #fff; border-radius: 8px; padding: 16px; width: min(640px, 100%); }
.cz-modal__box video { width: 100%; border-radius: 4px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.cz-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1180px) {
    .cz-main { grid-template-columns: 90px minmax(0, 1fr) 360px; }
    .cz-view img { width: 60px; height: 72px; }
}
@media (max-width: 900px) {
    .cz-main { grid-template-columns: 1fr; }
    .cz-views { flex-direction: row; justify-content: center; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 8px; overflow-x: auto; }
    .cz-view img { width: 54px; height: 64px; }
    .cz-stage { padding: 12px 8px; }
    .cz-stage__tools { position: static; flex-direction: row; justify-content: center; margin-bottom: 8px; }
    .cz-nav { top: 45%; width: 36px; height: 36px; font-size: 22px; }
    .cz-nav--prev { left: 4px; }
    .cz-nav--next { right: 4px; }
    .cz-panel { max-height: none; position: static; border-left: 0; padding: 0 16px 24px; }
    .cz-bar__title { display: none; }
    .cz-bar__inner { justify-content: space-between; }
}

/* Tailles de broderie */
.cz-tiers { display: grid; gap: 6px; }
.cz-tier { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 14px; text-align: left; }
.cz-tier strong { font-weight: 800; white-space: nowrap; }
.cz-tier[aria-checked="true"] { border: 2px solid var(--ink); padding: 8px 11px; }

.cz-option.is-disabled { opacity: .5; cursor: not-allowed; }

/* Étoiles MICHELIN : choix graphique 1 / 2 / 3 */
.cz-stars { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 4px; padding: 10px 12px 12px; border: 1px solid var(--ink); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--bg-soft); }
.cz-option-wrap:has(.cz-stars) .cz-option { border-radius: var(--radius) var(--radius) 0 0; }
.cz-stars__label { width: 100%; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cz-star { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 800; font-size: 13px; }
.cz-star img { height: 26px; width: auto; max-width: 100%; object-fit: contain; }
.cz-star small { font-weight: 600; color: var(--ink-soft); font-size: 12px; }
.cz-star:hover { border-color: var(--ink); }
.cz-star[aria-checked="true"] { border: 2px solid var(--ink); padding: 7px 5px; background: #fff; }

/* Fils utilisés par le logo */
.cz-thread-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.cz-thread-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px 2px 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.cz-thread-chip i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }

/* Règle de retour des articles personnalisés */
.cz-return-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-soft); }
.cz-return-note .icon { margin-top: 2px; }
.cz-return-note--warn { background: #fdf0f1; border: 1px solid #f0c2c6; color: var(--danger); }
