/**
 * PhotoBox Customizer - CSS Principal
 */

/* Container principal */
.photobox-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Indicateur d'étapes */
.photobox-steps {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.photobox-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 150px;
}

.photobox-steps .step.active {
    border-color: #007bff;
    background: #e7f1ff;
}

.photobox-steps .step.completed {
    border-color: #28a745;
    background: #d4edda;
}

.photobox-steps .step-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dee2e6;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1em;
}

.photobox-steps .step.active .step-number {
    background: #007bff;
    color: white;
}

.photobox-steps .step.completed .step-number {
    background: #28a745;
    color: white;
}

.photobox-steps .step-label {
    font-size: 0.9em;
    text-align: center;
    color: #6c757d;
}

.photobox-steps .step.active .step-label,
.photobox-steps .step.completed .step-label {
    color: #212529;
    font-weight: 500;
}

/* Panneaux d'étapes */
.step-panel {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.step-panel h2 {
    margin-bottom: 10px;
    color: #212529;
}

.step-description {
    color: #6c757d;
    margin-bottom: 30px;
}

/* Éditeur de personnalisation */
.photobox-editor {
    display: grid;
    grid-template-columns: 200px 1fr 350px;
    gap: 20px;
    min-height: 500px;
}

/* Navigation des faces */
.faces-navigation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.face-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.face-tab:hover {
    background: #e9ecef;
}

.face-tab.active {
    background: #e7f1ff;
    border-color: #007bff;
}

.face-tab .face-dimensions {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
}

/* Zone de prévisualisation */
.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.current-face-label {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.face-dimensions-display {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

#preview-canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#preview-canvas-container:hover {
    border-color: #007bff;
}

#preview-canvas {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

.preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.preview-actions .btn {
    padding: 8px 12px;
}

/* Panneau d'outils */
.tools-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}

.tool-section {
    margin-bottom: 25px;
}

.tool-section h4 {
    font-size: 1em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

/* Grilles de sélection */
.texture-grid,
.template-grid,
.ribbon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.texture-item,
.template-item {
    aspect-ratio: 1;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.texture-item:hover,
.template-item:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.texture-item.active,
.template-item.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.texture-item img,
.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.texture-item.no-texture,
.template-item.no-template {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    font-size: 0.75em;
    color: #6c757d;
    text-align: center;
}

/* Rubans */
.ribbon-grid {
    grid-template-columns: repeat(5, 1fr);
}

.ribbon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ribbon-item:hover {
    background: #e9ecef;
}

.ribbon-item.active {
    border-color: #007bff;
    background: #e7f1ff;
}

.ribbon-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.ribbon-name {
    font-size: 0.7em;
    text-align: center;
    color: #6c757d;
}

/* Outils texte */
.text-tools {
    padding: 10px 0;
}

#btn-add-text {
    width: 100%;
    margin-bottom: 15px;
}

.text-options {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.text-options .form-group {
    margin-bottom: 12px;
}

.text-options label {
    font-size: 0.85em;
    margin-bottom: 5px;
    display: block;
    color: #495057;
}

/* Options USB */
.usb-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.usb-option {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.usb-option:hover {
    border-color: #007bff;
    background: #f0f7ff;
}

.usb-option.active {
    border-color: #007bff;
    background: #e7f1ff;
}

.usb-option .option-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
}

.usb-option .option-icon i {
    font-size: 2em;
    color: #007bff;
}

.usb-option .option-content h4 {
    margin: 0 0 8px 0;
    color: #212529;
}

.usb-option .option-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.usb-email-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* Récapitulatif */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.summary-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.summary-section h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.summary-faces {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.summary-face-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background: white;
}

.summary-face-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.summary-face-item span {
    display: block;
    padding: 5px;
    font-size: 0.85em;
    color: #666;
}

.summary-face-preview {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.summary-face-preview img {
    width: 100%;
    height: auto;
}

.summary-face-preview .face-name {
    padding: 5px;
    text-align: center;
    font-size: 0.8em;
    background: white;
}

.summary-ribbon-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-ribbon-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.summary-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.summary-photo-item {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.summary-photo-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.summary-photo-item .photo-qty-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}

.ribbon-color-preview {
    flex-shrink: 0;
}

/* Navigation étapes */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.step-navigation .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Compteur de tirages */
.prints-counter {
    text-align: center;
    padding: 15px;
    background: #e7f1ff;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.prints-counter span {
    font-weight: bold;
    font-size: 1.3em;
    color: #007bff;
}

/* Loader */
.photobox-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Erreurs de validation */
.validation-errors {
    margin-bottom: 20px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

/* Responsive */
@media (max-width: 1200px) {
    .photobox-editor {
        grid-template-columns: 150px 1fr 300px;
    }
}

@media (max-width: 992px) {
    .photobox-editor {
        grid-template-columns: 1fr;
    }
    
    .faces-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .face-tab {
        flex: 1;
        min-width: 120px;
    }
    
    .tools-panel {
        max-height: none;
    }
    
    .photobox-steps {
        flex-wrap: wrap;
    }
    
    .photobox-steps .step {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .photobox-container {
        padding: 10px;
    }
    
    .step-panel {
        padding: 15px;
    }
    
    .texture-grid,
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ribbon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .usb-option {
        flex-direction: column;
        text-align: center;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .step-navigation .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Styles pour le récapitulatif (Étape 4) ===== */

/* Grille des tirages dans le récap */
.summary-prints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.summary-print-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.summary-print-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
}

.summary-print-item .print-placeholder {
    width: 80px;
    height: 80px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    font-size: 24px;
}

.summary-print-item .print-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-print-item .print-name {
    font-size: 11px;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-print-item .print-qty {
    font-size: 12px;
    font-weight: bold;
    color: #007bff;
}

/* Faces dans le récap */
.summary-face-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin: 5px;
    min-width: 100px;
}

.summary-face-item.has-customization {
    border-color: #28a745;
    background: #d4edda;
}

.summary-face-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
}

.summary-face-item .face-name {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.summary-face-item .face-status {
    font-size: 11px;
    color: #6c757d;
}

.summary-face-item.has-customization .face-status {
    color: #28a745;
}

@media (max-width: 576px) {
    .summary-prints-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary-print-item img,
    .summary-print-item .print-placeholder {
        width: 60px;
        height: 60px;
    }
}

/* ===== Bouton confirmation Étape 4 - Jaune puis Vert ===== */
.confirmation-box {
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    transition: all 0.3s ease;
}

.confirmation-box.confirmed {
    background: #d4edda;
    border-color: #28a745;
}

.confirmation-label {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    margin: 0;
}

.confirmation-label input[type="checkbox"] {
    display: none;
}

.confirmation-checkmark {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border: 3px solid #ffc107;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.confirmation-checkmark::after {
    content: '';
    width: 8px;
    height: 14px;
    border: solid transparent;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    margin-bottom: 3px;
}

.confirmation-label input:checked ~ .confirmation-checkmark {
    background: #28a745;
    border-color: #28a745;
}

.confirmation-label input:checked ~ .confirmation-checkmark::after {
    border-color: white;
}

.confirmation-box.confirmed .confirmation-checkmark {
    border-color: #28a745;
}

.confirmation-text {
    flex: 1;
}

.confirmation-text strong {
    font-size: 16px;
    color: #856404;
}

.confirmation-box.confirmed .confirmation-text strong {
    color: #155724;
}

/* ===== Bouton images à recadrer - Étape 2 ===== */
.btn-next-crop {
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    animation: pulse-warning 2s infinite;
    margin-left: auto;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
}

.btn-next-crop:hover {
    animation: none;
    background-color: #e0a800 !important;
}

/* ===== Liste des champs texte - Étape 1 ===== */
.text-layers-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

.text-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.text-layer-item:last-child {
    border-bottom: none;
}

.text-layer-item:hover {
    background: #e9ecef;
}

.text-layer-item.active {
    background: #e7f1ff;
    border-left: 3px solid #007bff;
}

.text-layer-item .layer-preview {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-layer-item .layer-actions {
    display: flex;
    gap: 5px;
}

.text-layer-item .layer-actions button {
    padding: 4px 8px;
    font-size: 12px;
}

/* ===== NOUVELLE MISE EN PAGE ÉTAPE 1 ===== */

/* Sélecteur de faces en ligne */
.faces-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.face-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.face-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.face-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.face-preview-mini {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.face-info {
    display: flex;
    flex-direction: column;
}

.face-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.face-size {
    font-size: 12px;
    color: #6c757d;
}

/* Layout éditeur */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
}

@media (max-width: 992px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

/* Zone canvas */
.canvas-area {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.canvas-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

/* Panneau d'outils à droite */
.tools-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tool-section {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tool-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.tool-section h4 .material-icons {
    font-size: 18px;
    color: #667eea;
}

/* Textures en petits ronds */
.texture-circles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.texture-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.2s ease;
}

.texture-circle:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.texture-circle.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.texture-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.texture-circle.no-texture {
    background: #f8f9fa;
    color: #6c757d;
    font-size: 18px;
}

/* Grille de décorations */
.decoration-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.decoration-item {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.decoration-item:hover {
    border-color: #667eea;
}

.decoration-item.active {
    border-color: #667eea;
    background: #667eea10;
}

.decoration-item img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
}

/* ===== ÉTAPE 2 - RUBAN ===== */
.ribbon-selection {
    max-width: 800px;
    margin: 0 auto;
}

.ribbon-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.ribbon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-width: 120px;
}

.ribbon-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ribbon-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.ribbon-color {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
}

.ribbon-label {
    font-weight: 500;
    color: #333;
}

/* ========================================
   MESSAGE PAS DE RUBAN
   ======================================== */
.no-ribbon-info {
    text-align: center;
    padding: 40px 20px;
}
.no-ribbon-icon {
    margin-bottom: 15px;
}
.auto-skip-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 10px 20px;
    background: #e7f1ff;
    border-radius: 8px;
    color: #495057;
    font-size: 0.95em;
}

/* ========================================
   NOUVEAU LAYOUT INVERSÉ (Outils à gauche, Canvas à droite)
   ======================================== */

.editor-layout-reversed {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    align-items: start;
}

.editor-layout-reversed .tools-panel {
    overflow-y: auto;
    min-height: 400px;
}

.editor-layout-reversed .decoration-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .editor-layout-reversed {
        grid-template-columns: 1fr;
    }
    
    .editor-layout-reversed .tools-panel {
        order: 2;
    }
    
    .editor-layout-reversed .canvas-area {
        order: 1;
    }
}

/* ========================================
   NOUVEAU BOUTON AJOUTER TEXTE
   ======================================== */

.btn-add-text-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-add-text-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-add-text-new:active {
    transform: translateY(0);
}

.btn-add-text-new .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-text-new .btn-icon .material-icons {
    font-size: 24px;
}

/* ========================================
   LISTE DES TEXTES (Multi-texte)
   ======================================== */

.text-layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.text-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.text-layer-item:hover {
    background: #e9ecef;
}

.text-layer-item.active {
    background: #e7f1ff;
    border-color: #667eea;
}

.text-layer-item .text-preview {
    flex: 1;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-layer-item .text-layer-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.text-layer-item:hover .text-layer-actions,
.text-layer-item.active .text-layer-actions {
    opacity: 1;
}

.text-layer-item .btn-layer-action {
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.2s;
}

.text-layer-item .btn-layer-action:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

.text-layer-item .btn-layer-action.btn-delete:hover {
    color: #dc3545;
}

/* Nouveau styles pour la liste de textes */
.text-layers-list .no-texts {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 15px;
    font-style: italic;
}

.text-layer-item .text-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.text-layer-item .text-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #667eea;
    color: white;
    border-radius: 10px;
    margin-left: auto;
}

.text-layer-item .btn-select-text,
.text-layer-item .btn-delete-text-item {
    padding: 4px 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-layer-item .btn-select-text i,
.text-layer-item .btn-delete-text-item i {
    font-size: 18px;
}

.text-layer-item .btn-select-text:hover {
    background: #e7f1ff;
    color: #667eea;
}

.text-layer-item .btn-delete-text-item:hover {
    background: #ffe7e7;
    color: #dc3545;
}

/* ========================================
   OPTION TEXTE EN ARC
   ======================================== */

.arc-text-option {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.arc-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.arc-toggle input[type="checkbox"] {
    display: none;
}

.arc-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
}

.arc-toggle input:checked + .arc-toggle-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.arc-toggle-label .material-icons {
    font-size: 18px;
}

.arc-controls {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.arc-controls label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.arc-controls #arc-value {
    font-weight: 600;
    color: #667eea;
}

.arc-presets {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 4px;
}

.arc-preset {
    flex: 1;
    padding: 6px 4px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arc-preset .arc-icon {
    font-size: 16px;
    line-height: 1;
}

.arc-preset .arc-label {
    font-size: 8px;
    margin-top: 2px;
    color: #666;
    white-space: nowrap;
}

.arc-preset:hover {
    border-color: #667eea;
    background: #e7f1ff;
}

.arc-preset.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.arc-preset.active .arc-label {
    color: rgba(255,255,255,0.9);
}

/* ========================================
   ACTIONS TEXTE AMÉLIORÉES
   ======================================== */

.text-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.text-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.text-actions .btn .material-icons {
    font-size: 18px;
}

#btn-duplicate-text {
    color: #667eea;
    border-color: #667eea;
}

#btn-duplicate-text:hover {
    background: #667eea;
    color: white;
}

/* ========================================
   BOUTON ORANGE - Logique gérée par JS
   ======================================== */

/* Le bouton est caché par défaut via style="display:none" dans le HTML */
/* JS ajoute/retire la classe .show-crop-btn pour l'afficher/masquer */
#btn-crop-warning.show-crop-btn {
    display: inline-flex !important;
}

/* Quand le bouton est visible, cacher le bouton Continuer */
#btn-crop-warning.show-crop-btn ~ #btn-step3-next {
    display: none !important;
}

/* ========================================
   PHOTOPRINT - Corrections CSS
   ======================================== */

/* Titres en noir dans les sections de l'éditeur photo */
.pp-editor-section h4,
.pp-editor-section h5,
.pp-editor-section .section-title,
.pp-crop-panel h4,
.pp-crop-panel h5,
.photo-editor-sidebar h4,
.photo-editor-sidebar h5,
.editor-section-title {
    color: #333 !important;
}

/* Bouton Enregistrer texte */
#btn-save-text {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

#btn-save-text:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* ========================================
   SELECT POLICE - Correction hauteur
   ======================================== */

#text-font {
    height: auto !important;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
}

#text-font option {
    padding: 8px 12px;
    min-height: 30px;
    line-height: 1.4;
}

/* Options du texte - meilleur espacement */
#text-options .form-group {
    margin-bottom: 15px;
}

#text-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

#text-options .form-control,
#text-options .form-control-sm {
    height: auto;
    min-height: 38px;
}

/* ========================================
   ZONES NON GRAVABLES
   ======================================== */
.exclusion-zone-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    justify-content: center;
}
.exclusion-zone-legend .legend-swatch {
    width: 16px;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    border-radius: 2px;
}
