/**
 * PhotoBox V2 — même charte que CamsLAB V2 (crème, framboise, Inter), sans aperçu 3D.
 * Se pose par-dessus photobox-customizer.css : étapes en pastilles, faces en liste, outils en
 * cartes, navigation collée en bas de l'écran sur téléphone.
 */
#photobox-customizer {
    --pbx-ac: #B54892; --pbx-ac-d: #9A3A7B; --pbx-ac-l: #F7E8F2; --pbx-tx: #2B2522; --pbx-tx2: #6B6158;
    --pbx-bd: #ECE4D9; --pbx-bd2: #DDD3C6; --pbx-fond: #FEF9F4; --pbx-ok: #2F7D4F;
    max-width: 1440px; padding: 16px 20px 28px; color: var(--pbx-tx);
    font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#photobox-customizer button, #photobox-customizer input, #photobox-customizer select, #photobox-customizer textarea { font-family: inherit; }

/* Étapes */
#photobox-customizer .photobox-steps { position: sticky; top: 0; z-index: 20; justify-content: center; align-items: center; gap: 6px; margin: 0 0 18px; padding: 10px 12px; background: #fff; border: 1px solid var(--pbx-bd); border-radius: 16px; box-shadow: 0 2px 10px rgba(43, 37, 34, .05); flex-wrap: wrap; }
#photobox-customizer .photobox-steps .step { flex-direction: row; gap: 8px; min-width: 0; padding: 6px 12px; border: 0; border-radius: 999px; background: none; }
#photobox-customizer .photobox-steps .step + .step::before { content: ''; width: 18px; height: 1px; margin-right: 6px; background: var(--pbx-bd2); }
#photobox-customizer .photobox-steps .step.active { background: var(--pbx-ac-l); }
#photobox-customizer .photobox-steps .step.completed { background: none; }
#photobox-customizer .photobox-steps .step-number { width: 24px; height: 24px; font-size: 12px; background: none; border: 1.5px solid var(--pbx-bd2); color: var(--pbx-tx2); }
#photobox-customizer .photobox-steps .step.active .step-number { background: var(--pbx-ac); border-color: var(--pbx-ac); color: #fff; }
#photobox-customizer .photobox-steps .step.completed .step-number { background: var(--pbx-ok); border-color: var(--pbx-ok); color: #fff; font-size: 0; }
#photobox-customizer .photobox-steps .step.completed .step-number::after { content: '✓'; font-size: 12px; }
#photobox-customizer .photobox-steps .step-label { font-size: 13px; color: var(--pbx-tx2); white-space: nowrap; }
#photobox-customizer .photobox-steps .step.active .step-label { color: var(--pbx-ac-d); font-weight: 600; }
#photobox-customizer .photobox-steps .step.completed .step-label { color: var(--pbx-tx); font-weight: 500; }

/* Panneaux */
#photobox-customizer .step-panel { padding: 24px; border: 1px solid var(--pbx-bd); border-radius: 18px; box-shadow: none; background: #fff; }
#photobox-customizer .step-panel h2 { font-size: 22px; font-weight: 700; color: var(--pbx-tx); margin: 0 0 6px; }
#photobox-customizer .step-description { color: var(--pbx-tx2); margin-bottom: 20px; }

/* Faces : liste de cartes avec aperçu */
#photobox-customizer .faces-selector { background: none; gap: 8px; padding: 0 0 14px; margin-bottom: 16px; border-bottom: 1px solid var(--pbx-bd); }
#photobox-customizer .face-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid var(--pbx-bd); border-radius: 12px; background: #fff; box-shadow: none; }
#photobox-customizer .face-card:hover { border-color: var(--pbx-bd2); }
#photobox-customizer .face-card.active { border-color: var(--pbx-ac); background: var(--pbx-ac-l); box-shadow: none; }
#photobox-customizer .face-preview-mini { width: 54px; height: 40px; border-radius: 6px; background: repeating-linear-gradient(92deg, rgba(120, 80, 40, .08) 0 3px, transparent 3px 11px), linear-gradient(180deg, #e9cfa6, #d9b583); color: rgba(90, 58, 28, .5); overflow: hidden; }
#photobox-customizer .face-preview-mini img { width: 100%; height: 100%; object-fit: cover; }
#photobox-customizer .face-name { font-weight: 700; font-size: 13.5px; color: var(--pbx-tx); }
#photobox-customizer .face-size { font-size: 12px; color: var(--pbx-tx2); }

/* Zone de travail */
#photobox-customizer .editor-layout { gap: 20px; }
#photobox-customizer .canvas-area { background: var(--pbx-fond); border-radius: 16px; padding: 16px; }
#photobox-customizer .canvas-header { border: 0; padding: 0 0 10px; }
#photobox-customizer .current-face-label { font-weight: 700; font-size: 15px; color: var(--pbx-tx); }
#photobox-customizer .face-dimensions-display { color: var(--pbx-tx2); background: none; }
#photobox-customizer #preview-canvas-container { max-width: 100%; border: 0; border-radius: 6px; box-shadow: 0 16px 40px rgba(43, 37, 34, .2); background: #fff; }
#photobox-customizer .canvas-actions .btn, #photobox-customizer .preview-actions .btn { border-radius: 10px; border-color: var(--pbx-bd); background: #fff; color: var(--pbx-tx); }
#photobox-customizer .canvas-actions .btn:hover { border-color: var(--pbx-ac); color: var(--pbx-ac-d); }

/* Outils */
#photobox-customizer .tools-panel { padding: 0; background: none; border: 0; box-shadow: none; }
#photobox-customizer .tool-section { padding: 14px; margin-bottom: 12px; border: 1px solid var(--pbx-bd); border-radius: 14px; background: #fff; box-shadow: none; }
#photobox-customizer .tool-section h4 { font-size: 13px; font-weight: 700; color: var(--pbx-tx); text-transform: none; letter-spacing: 0; border: 0; padding: 0; margin: 0 0 10px; }
#photobox-customizer .tool-section h4 .material-icons { color: var(--pbx-ac); font-size: 18px; }
#photobox-customizer .texture-circle { border: 2px solid #fff; box-shadow: 0 0 0 1px var(--pbx-bd2); }
#photobox-customizer .texture-circle.active { box-shadow: 0 0 0 2.5px var(--pbx-ac); border-color: #fff; }
#photobox-customizer .decoration-item { border: 1px solid var(--pbx-bd); border-radius: 10px; background: var(--pbx-fond); }
#photobox-customizer .decoration-item.active { border-color: var(--pbx-ac); background: var(--pbx-ac-l); box-shadow: none; }
#photobox-customizer .btn-add-text-new { border: 1.5px dashed var(--pbx-bd2); border-radius: 12px; background: var(--pbx-fond); color: var(--pbx-tx); box-shadow: none; }
#photobox-customizer .btn-add-text-new:hover { border-color: var(--pbx-ac); background: var(--pbx-ac-l); color: var(--pbx-ac-d); transform: none; }
#photobox-customizer .btn-add-text-new .btn-icon { background: var(--pbx-ac); }
#photobox-customizer .text-layer-item { border-radius: 10px; border-color: var(--pbx-bd); }
#photobox-customizer .text-layer-item.active { border-color: var(--pbx-ac); background: var(--pbx-ac-l); }
#photobox-customizer .arc-toggle input:checked + .arc-toggle-label, #photobox-customizer .arc-preset.active { background: var(--pbx-ac-l); border-color: var(--pbx-ac); color: var(--pbx-ac-d); }
#photobox-customizer input[type=range] { accent-color: var(--pbx-ac); }
#photobox-customizer .form-control, #photobox-customizer textarea, #photobox-customizer select { border-radius: 10px; border-color: var(--pbx-bd2); }
#photobox-customizer .form-control:focus, #photobox-customizer textarea:focus { border-color: var(--pbx-ac); box-shadow: 0 0 0 3px rgba(181, 72, 146, .15); }
#photobox-customizer #btn-save-text, #photobox-customizer .btn-success { background: var(--pbx-ok); border-color: var(--pbx-ok); border-radius: 10px; }
#photobox-customizer .btn-danger { border-radius: 10px; }

/* Ruban, clé USB, récapitulatif */
#photobox-customizer .ribbon-option, #photobox-customizer .usb-option { border: 1px solid var(--pbx-bd); border-radius: 14px; box-shadow: none; }
#photobox-customizer .ribbon-option.active, #photobox-customizer .usb-option.active { border-color: var(--pbx-ac); background: var(--pbx-ac-l); box-shadow: none; }
#photobox-customizer .usb-option .option-icon { background: var(--pbx-ac-l); color: var(--pbx-ac); }
#photobox-customizer .summary-section { border: 1px solid var(--pbx-bd); border-radius: 14px; background: #fff; }
#photobox-customizer .summary-section h4 { font-size: 15px; font-weight: 700; color: var(--pbx-tx); border: 0; }
#photobox-customizer .summary-face-item.has-customization { border-color: var(--pbx-ac); }
#photobox-customizer .confirmation-box { border-radius: 14px; border-color: var(--pbx-bd2); background: var(--pbx-fond); }
#photobox-customizer .confirmation-box.confirmed { border-color: var(--pbx-ok); background: #EEF7F1; }
#photobox-customizer .prints-counter { border-radius: 999px; background: var(--pbx-ac-l); color: var(--pbx-ac-d); }

/* Navigation entre étapes */
#photobox-customizer .step-navigation { gap: 10px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--pbx-bd); }
#photobox-customizer .step-navigation .btn { height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
#photobox-customizer .step-navigation .btn-primary, #photobox-customizer .btn-primary { background: var(--pbx-ac); border-color: var(--pbx-ac); color: #fff; }
#photobox-customizer .step-navigation .btn-primary:hover, #photobox-customizer .btn-primary:hover { background: var(--pbx-ac-d); border-color: var(--pbx-ac-d); }
#photobox-customizer .step-navigation .btn-secondary { background: #fff; border: 1px solid var(--pbx-bd2); color: var(--pbx-tx); }
#photobox-customizer .btn-next-crop, #photobox-customizer #btn-crop-warning { background: #FFF4E5; border: 1.5px solid #C77A12; color: #7a4a0a; border-radius: 999px; }
#photobox-customizer .photobox-loader { background: rgba(254, 249, 244, .85); }
#photobox-customizer .spinner { border-top-color: var(--pbx-ac); }

/* Tirages inclus (Photo Print intégré) : mêmes couleurs */
#photobox-customizer #step-3 .photoprint-container { border: 0; padding: 0; }

/* Écrans moyens : outils sous la face */
@media (max-width: 992px) {
    #photobox-customizer .editor-layout, #photobox-customizer .editor-layout-reversed { display: flex; flex-direction: column; }
    #photobox-customizer .editor-layout-reversed .tools-panel { order: 2; width: 100%; }
    #photobox-customizer .canvas-area { order: 1; }
}

/* Téléphone : étapes compactes, faces en ruban, navigation collée en bas */
@media (max-width: 640px) {
    #photobox-customizer { padding: 10px 10px 90px; }
    #photobox-customizer .photobox-steps { padding: 8px; border-radius: 0 0 14px 14px; margin: -10px -10px 12px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; }
    #photobox-customizer .photobox-steps .step:not(.active) .step-label { display: none; }
    #photobox-customizer .photobox-steps .step + .step::before { width: 10px; margin-right: 2px; }
    #photobox-customizer .step-panel { padding: 14px 12px; border-radius: 14px; }
    #photobox-customizer .step-panel h2 { font-size: 18px; }
    #photobox-customizer .faces-selector { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    #photobox-customizer .face-card { flex: none; padding: 6px 12px 6px 6px; }
    #photobox-customizer .face-preview-mini { width: 40px; height: 30px; }
    #photobox-customizer .face-size { display: none; }
    #photobox-customizer .canvas-area { padding: 8px; margin: 0 -4px; }
    #photobox-customizer .step-navigation { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--pbx-bd); box-shadow: 0 -6px 20px rgba(43, 37, 34, .1); }
    #photobox-customizer .step-navigation .btn { height: 48px; flex: 1; justify-content: center; padding: 0 12px; }
    #photobox-customizer .step-navigation { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: nowrap; }
    #photobox-customizer .step-navigation .btn { width: auto; }
    body.pbx-plein #photobox-customizer .photobox-steps { margin: 0 -10px 12px; border-radius: 14px; }
    #photobox-customizer .step-navigation .btn-secondary { flex: 0 1 auto; max-width: 42%; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #photobox-customizer #preview-canvas-container { max-width: 100%; overflow: hidden; }
    #photobox-customizer .tool-section { padding: 12px; }
}

/* ---------- Plein écran : l'atelier prend toute la page, le thème est masqué ---------- */
body.pbx-plein { background: #FEF9F4 !important; }
body.pbx-plein #header, body.pbx-plein #footer, body.pbx-plein .breadcrumb, body.pbx-plein #wrapper .breadcrumb,
body.pbx-plein #content-wrapper > .page-header, body.pbx-plein #main > .page-header, body.pbx-plein #left-column, body.pbx-plein #right-column,
body.pbx-plein .elementor-location-header, body.pbx-plein .elementor-location-footer,
body.pbx-plein header.ce-header, body.pbx-plein footer.ce-footer { display: none !important; }
body.pbx-plein #wrapper { padding: 0 !important; margin: 0 !important; background: none !important; }
body.pbx-plein #wrapper > .container, body.pbx-plein #content-wrapper { width: 100% !important; max-width: none !important; padding: 0 !important; margin: 0 !important; flex: 1 1 100% !important; }
body.pbx-plein #main .page-content, body.pbx-plein #content.page-content { padding: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; }
body.pbx-plein #photobox-customizer { max-width: 1440px; margin: 0 auto; padding-top: 0; }
#photobox-customizer .pbx-barre { display: none; }
body.pbx-plein #photobox-customizer .pbx-barre {
    display: flex; align-items: center; gap: 14px; height: 60px; margin: 0 0 6px;
}
.pbx-retour { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border: 1px solid #DDD3C6; border-radius: 999px; background: #fff; color: #2B2522 !important; font-size: 13px; font-weight: 500; text-decoration: none !important; }
.pbx-retour:hover { border-color: #B54892; color: #9A3A7B !important; }
.pbx-retour i { font-size: 18px; }
.pbx-nom { min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pbx-plein #photobox-customizer .photobox-steps { top: 0; }
@media (max-width: 640px) {
    body.pbx-plein #photobox-customizer .pbx-barre { height: 52px; gap: 10px; }
    .pbx-retour span { display: none; }
    .pbx-retour { padding: 0 9px; }
    .pbx-nom { font-size: 14px; }
}

/* Plein écran (l'atelier est rattaché à <body> par le gabarit) */
html.pbx-plein-html, body.pbx-plein { overflow: hidden !important; }
body.pbx-plein > #photobox-customizer {
    position: fixed !important; inset: 0; z-index: 9000; overflow-y: auto; -webkit-overflow-scrolling: touch;
    max-width: none !important; width: auto !important; margin: 0 !important;
    padding: 0 max(20px, calc((100vw - 1440px) / 2)) 28px !important; background: #FEF9F4;
}
@media (max-width: 640px) {
    body.pbx-plein > #photobox-customizer { padding: 0 10px 96px !important; }
}

/* ===================== Atelier « comme la maquette » ===================== */
/* En-tête : retour + nom de la boîte, étapes, continuer */
#photobox-customizer .pbx-tete { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; padding: 10px 16px; background: #fff; border: 1px solid var(--pbx-bd); border-radius: 16px; }
#photobox-customizer .pbx-tete .pbx-barre { display: flex !important; align-items: center; gap: 12px; height: auto !important; margin: 0 !important; flex: none; min-width: 0; max-width: 32%; }
.pbx-nom-bloc { display: flex; flex-direction: column; min-width: 0; }
.pbx-nom-bloc .pbx-nom { font-size: 15px; }
.pbx-sous { font-size: 12px; color: #6B6158; white-space: nowrap; }
#photobox-customizer .pbx-tete .photobox-steps { position: static; flex: 1; min-width: 0; margin: 0 !important; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
.pbx-suivant { flex: none; height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: #B54892; color: #fff; font: 600 14px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.pbx-suivant:hover { background: #9A3A7B; }
.pbx-suivant[hidden] { display: none; }
body.pbx-plein > #photobox-customizer { padding: 0 0 28px !important; }
body.pbx-plein #photobox-customizer .pbx-tete { position: sticky; top: 0; z-index: 30; margin: 0 0 18px; border: 0; border-bottom: 1px solid #ECE4D9; border-radius: 0; padding: 10px max(20px, calc((100vw - 1440px) / 2)); }
body.pbx-plein #photobox-customizer .photobox-step-content { max-width: 1440px; margin: 0 auto; padding: 0 20px; }

/* Étape 1 : trois colonnes (faces · face en grand · outils) */
#photobox-customizer #step-1 { padding: 0; border: 0; background: none; box-shadow: none; }
#photobox-customizer #step-1 > h2 { display: none; }
#photobox-customizer .pbx-atelier { display: grid !important; grid-template-columns: 250px minmax(0, 1fr) 330px; grid-template-areas: "faces centre outils"; gap: 18px; align-items: start; }
#photobox-customizer .pbx-atelier > .pbx-col-faces { grid-area: faces; }
#photobox-customizer .pbx-atelier > .canvas-area { grid-area: centre; }
#photobox-customizer .pbx-atelier > .tools-panel { grid-area: outils; width: auto !important; max-height: none !important; }
.pbx-col-faces { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; background: #fff; border: 1px solid #ECE4D9; border-radius: 16px; }
.pbx-col-titre { font-size: 15px; }
#photobox-customizer .pbx-col-faces .faces-selector { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 0; border: 0; overflow: visible; }
#photobox-customizer .pbx-col-faces .face-card { width: 100%; min-width: 0; max-width: none; margin: 0; }
.face-preview-mini.pbx-mini-img { background-size: cover !important; background-position: center !important; }
.face-preview-mini.pbx-mini-img i { display: none; }
.pbx-resume { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: #FEF9F4; font-size: 12px; color: #6B6158; }
.pbx-resume b { font-size: 13px; color: #2B2522; }
#photobox-customizer .pbx-atelier > .canvas-area { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid #ECE4D9; border-radius: 16px; }
.pbx-vues { display: inline-flex; padding: 3px; border-radius: 999px; background: #F3EDE4; }
.pbx-vues button { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: #6B6158; font: 600 13px Inter, sans-serif; cursor: pointer; }
.pbx-vues button.on { background: #fff; color: #9A3A7B; box-shadow: 0 1px 4px rgba(43, 37, 34, .12); }
.canvas-area.pbx-en-3d > :not(.pbx-vues):not(.pbx-3d) { display: none !important; }
#photobox-customizer .pbx-atelier > .tools-panel { padding: 16px; background: #fff; border: 1px solid #ECE4D9; border-radius: 16px; }

/* Vue 3D */
.pbx-3d { width: 100%; }
.pbx-3d[hidden] { display: none; }
.pbx-scene { height: 440px; display: grid; place-items: center; perspective: 1400px; cursor: grab; touch-action: none; user-select: none; background: radial-gradient(ellipse at 50% 60%, #fff 0%, #F6EFE6 70%); border-radius: 14px; overflow: hidden; }
.pbx-scene:active { cursor: grabbing; }
.pbx-cube { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.pbx-f { position: absolute; left: 0; top: 0; box-sizing: border-box; border: 1px solid rgba(90, 58, 28, .28); background: repeating-linear-gradient(92deg, rgba(120, 80, 40, .08) 0 3px, transparent 3px 11px), linear-gradient(180deg, #e9cfa6, #d9b583); background-size: cover; background-position: center; box-shadow: inset 0 0 18px rgba(90, 58, 28, .18); backface-visibility: hidden; }
.pbx-f.pbx-f-img { background-size: 100% 100%; }
.pbx-f[data-face-id] { cursor: pointer; }
.pbx-f[data-face-id]:hover { outline: 2px solid #B54892; outline-offset: -2px; }
.pbx-f-bottom { background: linear-gradient(180deg, #cfae80, #b8946a); }
.pbx-3d-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12.5px; color: #6B6158; }
.pbx-3d-btns { display: inline-flex; gap: 6px; }
.pbx-3d-btns button { height: 34px; min-width: 34px; padding: 0 12px; border: 1px solid #DDD3C6; border-radius: 999px; background: #fff; color: #2B2522; font: 600 13px Inter, sans-serif; cursor: pointer; }
.pbx-3d-btns button:hover { border-color: #B54892; color: #9A3A7B; }
.pbx-3d-note { margin: 6px 0 0; font-size: 12px; color: #6B6158; }

@media (max-width: 1200px) {
    #photobox-customizer .pbx-atelier { grid-template-columns: 220px minmax(0, 1fr) 300px; }
    .pbx-suivant { padding: 0 14px; }
}
@media (max-width: 992px) {
    #photobox-customizer .pbx-atelier { grid-template-columns: minmax(0, 1fr); grid-template-areas: "faces" "centre" "outils"; }
    .pbx-col-faces { position: static; padding: 12px; }
    .pbx-col-titre, .pbx-resume span { display: none; }
    #photobox-customizer .pbx-col-faces .faces-selector { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    #photobox-customizer .pbx-col-faces .face-card { width: auto; flex: none; }
    #photobox-customizer .pbx-tete { flex-wrap: wrap; gap: 8px 12px; }
    #photobox-customizer .pbx-tete .pbx-barre { max-width: none; flex: 1 1 auto; }
    #photobox-customizer .pbx-tete .photobox-steps { flex-basis: 100%; order: 3; }
    .pbx-suivant { display: none; }
    .pbx-scene { height: 340px; }
}
@media (max-width: 640px) {
    body.pbx-plein #photobox-customizer .pbx-tete { padding: 8px 10px; }
    body.pbx-plein #photobox-customizer .photobox-step-content { padding: 0 10px; }
    #photobox-customizer .pbx-atelier > .canvas-area { padding: 10px; }
    .pbx-scene { height: 300px; }
    .pbx-3d-pied > span:first-child { flex-basis: 100%; }
}
/* la gravure prend la teinte du bois : blanc = bois, texte foncé = gravure */
.pbx-f.pbx-f-img { background-color: #e2c49a; }
.pbx-f.pbx-f-img { background-blend-mode: multiply; }
.face-preview-mini.pbx-mini-img { background-color: #e2c49a !important; background-blend-mode: multiply; }
#photobox-customizer .pbx-atelier #preview-canvas-container { width: 100%; max-width: 100%; box-sizing: border-box; margin: 0; overflow: hidden; }
@media (min-width: 993px) { #photobox-customizer #step-1 > .step-navigation { display: none; } }
.pbx-sonde { position: absolute; z-index: 7; }
/* bois de la boîte sur les faces non personnalisées, dos arrondi d'une boîte livre */
.pbx-f.pbx-f-tex { box-shadow: inset 0 0 22px rgba(40, 25, 10, .22); }
.pbx-f.pbx-f-dos { border: 0; box-shadow: none; backface-visibility: visible; }
.pbx-f.pbx-f-dos:not(.pbx-f-img):not(.pbx-f-tex) { background: linear-gradient(180deg, #d9b583, #c9a06e); }
.pbx-f-bottom.pbx-f-tex { filter: brightness(.85); }
.pbx-3d-note b { color: #2B2522; }

/* Récapitulatif : aperçus cliquables, visionneuse */
.summary-face-item img, .summary-photo-item img { cursor: zoom-in; transition: transform .15s; }
.summary-face-item img:hover, .summary-photo-item img:hover { transform: scale(1.04); }
.pbx-vis { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: rgba(28, 22, 20, .88); }
.pbx-vis figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: min(1100px, 100%); }
.pbx-vis img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); background: #fff; }
.pbx-vis figcaption { color: #fff; font: 600 15px Inter, sans-serif; }
.pbx-vis-x { position: absolute; top: 16px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; cursor: pointer; }
.pbx-vis-nav { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.pbx-vis-x:hover, .pbx-vis-nav:hover { background: #B54892; }
.pbx-vis.pbx-vis-seule .pbx-vis-nav { visibility: hidden; }
@media (max-width: 640px) { .pbx-vis { padding: 12px 6px; gap: 4px; } .pbx-vis-nav { width: 38px; height: 38px; font-size: 24px; } }

/* Colonne des outils alignée sur la face : la liste des dessins défile dans sa propre zone */
#photobox-customizer .pbx-atelier .decoration-grid { max-height: 330px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #DDD3C6 transparent; }
#photobox-customizer .pbx-atelier .decoration-grid::-webkit-scrollbar { width: 6px; }
#photobox-customizer .pbx-atelier .decoration-grid::-webkit-scrollbar-thumb { background: #DDD3C6; border-radius: 3px; }
@media (min-width: 993px) {
    #photobox-customizer .pbx-atelier > .tools-panel { position: sticky; top: 84px; max-height: calc(100vh - 110px) !important; overflow-y: auto !important; }
}
@media (max-width: 992px) {
    #photobox-customizer .pbx-atelier .decoration-grid { max-height: 260px; }
}
/* plus de teinte bois forcée : seules les faces sans texture sont « gravées » sur le bois de la boîte */
.pbx-f.pbx-f-img { background-color: transparent; background-blend-mode: normal; }
.face-preview-mini.pbx-mini-img { background-color: transparent !important; background-blend-mode: normal; }
.pbx-f.pbx-grave, .face-preview-mini.pbx-grave { background-blend-mode: multiply; }
/* Zoom : la face agrandie défile dans son cadre */
#photobox-customizer .pbx-atelier #preview-canvas-container.pbx-zoome { overflow: auto !important; max-height: 70vh; display: block; text-align: left; }
#photobox-customizer .canvas-actions button:disabled { opacity: .4; cursor: default; }
/* Bois appliqué sur toute la boîte : voile pendant la mise à jour des faces */
.pbx-voile { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; background: rgba(254, 249, 244, .82); font-family: Inter, sans-serif; color: #2B2522; }
.pbx-voile > div { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 34px; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(43, 37, 34, .18); }
.pbx-voile b { font-size: 16px; }
.pbx-voile-n { font-size: 13px; color: #6B6158; }
.pbx-voile-rond { width: 34px; height: 34px; border: 3px solid #F7E8F2; border-top-color: #B54892; border-radius: 50%; animation: pbxTourne .8s linear infinite; }
@keyframes pbxTourne { to { transform: rotate(360deg); } }
/* légende de la zone non gravable : mêmes hachures que sur la face */
#photobox-customizer .exclusion-zone-legend .legend-swatch { width: 16px; height: 12px; border: 1px dashed #A2481F; background: repeating-linear-gradient(135deg, rgba(162, 72, 31, .7) 0 2px, rgba(255, 255, 255, .6) 2px 6px); border-radius: 2px; }
