/* =============================== */
/*             BASE                */
/* =============================== */

:root {
    --radius: 14px;
    --shadow: 0 2px 8px #0002;
    --bg: #fff;
    --spacing: 20px;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
    background: #f3f3f3;
    color: #333;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
}

/* =============================== */
/*        LAYOUT 3 COLONNES        */
/* =============================== */

.layout {
    display: grid;
    grid-template-columns: 300px 1fr 330px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.left-panel,
.center-panel,
.right-panel {
    background: var(--bg);
    padding: var(--spacing);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    overflow: visible !important; /* FIX */
}

/* =============================== */
/*            SECTIONS             */
/* =============================== */

.section {
    margin-bottom: 28px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* =============================== */
/*              INTRO              */
/* =============================== */

.intro {
    background: #fff;
    padding: 18px 20px;
    margin: 20px auto;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 2px 6px #0001;
    font-size: 16px;

    overflow: visible !important; /* FIX */
}

/* =============================== */
/*           PANEL TEXTE           */
/* =============================== */

.panel-text input[type="text"],
.panel-text textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
}

.panel-text .slider {
    width: 100%;
    margin: 10px 0;
}

/* =============================== */
/*           PANEL IMAGE           */
/* =============================== */

.panel-image input[type="file"] {
    width: 100%;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.panel-image .preview {
    width: 100%;
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* =============================== */
/*              CANVAS             */
/* =============================== */

/* On s'assure que le canvas lui-même ne force pas une largeur de 100% */
#previewDesign1,
#previewDesign2 {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;  /* Empêche le canvas de s'étirer */
    height: auto !important; /* Garde les proportions de la plaque */
    display: block;
    margin: 0 auto;          /* Sécurité supplémentaire pour le centrage */
}

/* Le conteneur doit devenir un flexbox pour piloter son enfant (le canvas) */
#previewDesign1Container,
#previewDesign2Container {
    background: #fff; /* Ou #f8f9fa si tu veux voir les limites */
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px; 
    margin-bottom: 10px;

    /* --- AJOUTS POUR LE CENTRAGE --- */
    display: flex;          /* Active le mode Flexbox */
    justify-content: center; /* Centre horizontalement */
    align-items: center;     /* Centre verticalement */
    aspect-ratio: 4 / 3;    /* Maintient le format rectangulaire */
    overflow: hidden;
}

/* =============================== */
/*        CHOIX DYNAMIQUES         */
/* =============================== */

.choix-produit {
    background: #fff;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px;

    overflow: visible !important; /* FIX */
}

#faceSelector { display: none; }

.is-hidden {
    display: none;
}

.prix-ligne {
    display: none;
}

#wrapperDesign1,
#wrapperDesign2 {
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 5px;
    transition: border-color 0.2s ease;

    overflow: visible !important; /* FIX */
}

#wrapperDesign1.active,
#wrapperDesign2.active {
    border-color: #007bff; /* bleu */
}
/* =============================== */
/*     PANNEAUX PAR FACE (PRIX)    */
/* =============================== */

.face-block {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.face-title {
    background: #f0f0f0;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.face-content {
    display: none;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4em;
}

.face-block.active .face-content {
    display: block;
}

/* Lignes de détails (multiligne OK) */
.price-detail-line {
    margin-left: 10px;
    padding: 2px 0;
}

