
body {
    background-color: #cbd5e1;
    padding: 0;
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    /* box-shadow: 0 0 0 3px red inset; */
    scroll-behavior: smooth;
}

/* Désactive les gestes par défaut du navigateur sur le canvas */
.canvas-container {
    touch-action: none;
    -ms-touch-action: none;
}

.divLogo {
    padding: 0 1rem
}

.logo {
    height: 42px;
    padding-right: 21px;
    width: auto;
}

#left-slider {
    position: absolute;
    left: 0;
    z-index: 2;
    display: flex;
    width: 350px;
    height: 100%;
    min-height: 100%;
    background: #f1f5f9;
    overflow: visible;
}

.navBacistexte {
    display: none;
    width: 100%;
}

#navigation-bar {
    height: 100%;
    float: left;
    background-color: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    position: relative;
    z-index: 10;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow: auto;
}

#navigation-bar .nav-item {
    width: 100%;
    font-size: 10px;
    text-align: center;
    padding: 13px 0;
    cursor: pointer;
    color: #fff;
    flex-wrap: wrap;
}

/* #navigation-bar .nav-item:nth-child(1) {
    margin-top: 30px;
} */

#navigation-bar .nav-item:hover {
    background: rgba(16, 88, 99, 0.08);
    border-left-color: #105863;
}

.title {
    color: #105863;
    font-weight: 700;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    width: 100%;
}

#navigation-bar .fa {
    font-size: 25px;
    line-height: 2;
    vertical-align: bottom;
}

.img-item .fa {
    font-size: 85px;
    line-height: inherit;
    display: inline-block;
}

.img-item img {
    cursor: -webkit-grab;
    cursor: grab;
    max-width: 100%;
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    height: 100%;
}

.img-item {
    position: relative;
    cursor: pointer;
    padding: 3px;
    width: 47%;
    padding-top: 2px;
}

.img-item span {
    position: absolute;
    background-color: #1e8893;
    border-radius: 50%;
    color: #fff;
    border: 2px solid #fff;
    margin: 5px;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.7;
    z-index: 1;
}

.img-item span:hover {
    opacity: 1;
}

.img-item span .fa {
    font-size: 16px;
    line-height: normal;
    margin-bottom: 3px;
}

.basics-item,
.basicsImgItem {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    color: #999999;
}

.basicsImgItem {
    padding-bottom: 60px;
}

.size-preset small {
    display: none;
}

#left-slider #tabs {
    float: left;
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#design {
    padding: 15px !important;
}

#tabs>.tab {
    padding: 0 15px;
    padding-right: 0;
    display: none;
    -webkit-animation-duration: .25s;
    animation-duration: .25s;
    z-index: 9;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow: auto;
    background: #f1f5f9;
    border-right: 1px solid #e2e8f0;
}

/* #tabs>.tab::-webkit-scrollbar {
    width: 0;
    height: 0;
} */
#tabs>.tab.active {
    display: block;
}

#navigation-bar .nav-item.active {
    background: rgba(16, 88, 99, 0.12);
    border-left-color: #105863;
    border-right: 1px solid #e2e8f0;
}

.nav-bar {
    background: linear-gradient(135deg, #105863, #764ba2);
    width: 100%;
    min-height: 64px;
    color: #fff;
    position: relative;
    z-index: 4;
    display: flex;
    justify-content: space-between;
}

.buttonPPV {
    display: flex;
    /* justify-content: flex-end; */
    align-items: center;
    /* overflow:auto; */
}

.noPreview b {
    font-size: small;
    padding-left: 2px;
    text-transform: none;
}

.noPreview {
    font-size: 37px !important;
    background: transparent !important;
    display: flex;
    align-items: center;
}

.overrideColor {
    color: #1e8893 !important;
}

.nav-bar button {
    background: #1e8893;
    cursor: pointer;
    border: none;
    height: 80%;
    margin: 0 5px;
    font-size: 12px;
    color: #fff;
    border-radius: 0.2rem;
    padding: 0 16px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tab-title {
    color: #1e8893;
}

.controle,
#left-slider {
    background: #f1f5f9;
}

.nonControle {
    display: none !important;
    margin-left: 0;
}

.nonDivCanvasflexCentre {
    margin-left: 0 !important;
}

.Upload-images {
    cursor: pointer;
    text-align: center;
    color: #1e8893;
    padding: 18px 3px;
    margin-right: 7px;
    border-bottom: 1px solid;
    margin-bottom: 4px;
    z-index: 1;
}

.Upload-images .fa {
    font-size: 25px;
}

.popupUploadImageUploadContentUpload .Upload-images {
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

.popupUploadImageUploadContentUpload,
.popupUploadImageUploadContentRecent {
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    overflow: auto;
    width: 100%;
    height: 100%;
    padding: 4px;
    color: #1e8893;
}

.popupUploadImageUploadContentUpload.active,
.popupUploadImageUploadContentRecent.active {
    display: flex;
}

.popupUploadImageUploadContentRecent img {
    cursor: pointer;
    position: relative;
    padding: 15px 7px;
    width: 47%;
    max-height: 150px;
    object-fit: cover;
}

.transparent-option {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
}

#imageInput {
    z-index: -1;
    display: none;
    opacity: 0;
}

.FontH1 {
    position: relative;
    padding: 5px 0 10px 0;
    color: #333333;
    white-space: nowrap;
    width: 100%;
}

.text-input {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.textTitre {
    width: 100%;
    padding: 8px 2px;
}

.textTitre button {
    background: #1e8893;
    cursor: pointer;
    border: none;
    height: 80%;
    margin: 0 5px;
    font-size: 12px;
    color: #fff;
    border-radius: 0.2rem;
    padding: 12px 16px;
    text-transform: uppercase;
    white-space: nowrap;
}

.textTitre input {
    padding: 10px 4px;
    width: 80%;
}

.police-content,
.colorP {
    max-height: 250px;
    overflow: auto;
    border: 2px solid #f7f7f7f7;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

#bgColorContainer {
    margin-bottom: 60px;
}

.flexCentre {
    display: flex;
    align-items: center;
    justify-content: center;
}

.police-content a {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
    color: #050505;
    background-color: #E6E6E6;
    max-width: 100px;
    width: 29.33%;
    padding: 10px 16px;
    margin: 4px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
}

.police-content a.active {
    padding: 8px 14px;
    border: 2px solid #1e8893;
}

.police-content a b {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backgP {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding-bottom: 60px;
}

.colorP div,
.backgP div {
    display: inline-block;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 0.25rem;
    margin-left: 4px;
    margin-top: 2px;
    margin: 2px;
    border: 1px solid #CCC;
    cursor: pointer;
}

.colorP div.active,
.backgP div.active {
    border: 2px solid #1e8893;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.textMa {
    display: flex;
    align-items: center;
}

.DivCanvasflexCentre {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #cbd5e1;
    max-width: 100%;
    height: calc(100vh - 60px);
    /* height: auto; */
    margin-left: 350px;
    /* padding: 20px; */
    overflow: auto;
}

.fabric-canvas-wrapper {
    width: 100%;
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.textAlign,
.textDecor {
    display: flex;
    align-items: center;
    background-color: #E6E6E6;
    padding: 4px 5px;
    border-radius: 8px;
}

.textAlign {
    margin-right: 10px;
}

.alignP,
.decorP {
    cursor: pointer;
    padding: 4px 8px;
}

.alignP.active,
.fa-underline.active,
.fa-bold.active,
.fa-strikethrough.active {
    color: #1e8893;
}

.alignP .fa,
.textDecor .fa {
    line-height: normal;
    font-size: 16px;
}

.number-input input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.number-input input[type=number]::-webkit-inner-spin-button,
.number-input input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.number-input {
    border: 0;
    display: inline-flex;
}

.number-input,
.number-input * {
    box-sizing: border-box;
}

.number-input button {
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    background-color: #E6E6E6;
}

.number-input input[type=number] {
    max-width: 5rem;
    padding: .5rem;
    background-color: transparent;
    border: none;
    outline: none;
    border-width: 0 2px;
    font-size: 20px;
    height: 34px;
    font-weight: bold;
    text-align: center;
    color: #1e8893;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

.loading h2 {
    margin-bottom: 20px;
}

.loading p {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.loading p {
    animation: pulse 1.5s ease-in-out infinite;
}

.loading img {
    height: 60px;
    width: auto;
    animation: pulse 2s ease-in-out infinite;
}

.size-preset {
    cursor: pointer;
}

.size-preset:hover {
    border-color: #105863;
}

.size-preset.active {
    border-color: #105863;
}

.main-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

@media screen and (min-width: 768px) {
    .main-editor-layout {
        flex-direction: row;
        height: 80vh;
    }
}

.imagePopupContainer {
    flex: 2;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

.img-containerP {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media screen and (min-width: 768px) {
    .img-containerP {
        max-height: none;
        /* Laisse le PC gérer la hauteur */
    }
}


.imagePopupSidebar {
    flex: 1;
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    /* Séparateur sur mobile */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media screen and (min-width: 768px) {
    .imagePopupSidebar {
        border-top: none;
        border-left: 1px solid #e2e8f0;
        /* Séparateur sur PC */
        max-width: 300px;
    }
}

/* --- GRILLE DE FILTRES RESPONSIVE --- */

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    /* S'adapte à la largeur */
    gap: 8px;
}

.btn-filter {
    padding: 10px 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #1e8893;
    background: #fff;
    color: #1e8893;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-filter.active-filter {
    background: #1e8893;
    color: #fff;
    box-shadow: 0 4px 6px rgba(30, 136, 147, 0.2);
}

/* --- ACTIONS FINALES --- */

.buttonPopupContent {
    padding: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    background: #fff;
}

#saveButton {
    background: #27ae60;
    flex: 2;
    /* Le bouton terminer est plus large */
    border-radius: 50px;
    font-weight: bold;
    letter-spacing: 1px;
}

#RotGauche,
#RotDroite {
    flex: 1;
    background: #f1f5f9;
    border-radius: 8px;
    color: #105863;
}





/* Conteneur de retouche */
#imageEditorUI {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Stylisation du Slider de luminosité */
input[type=range] {
    -webkit-appearance: none;
    height: 6px;
    background: #d5e2e6;
    border-radius: 5px;
    margin: 15px 0;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #105863;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Boutons de filtres */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.filter-btn-action {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.filter-btn-action:hover {
    background: #105863;
    color: white;
}

.filter-btn-action.active {
    background: #105863;
    color: white;
    border-color: #105863;
}

/* Bouton Supprimer spécial */
#deleteImageBtn {
    transition: transform 0.2s;
}

#deleteImageBtn:hover {
    transform: scale(1.02);
    background: #c0392b !important;
}





/* Styles supplémentaires pour les boutons si nécessaire */
.mq-quick-tools .mq-tool-btn {
    background: #F5F5F7;
    color: #1d1d1f;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    margin-bottom: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px;
}

.mq-quick-tools .mq-tool-btn:hover {
    background: #f5f5f5;
}

.mq-quick-tools .mq-tool-btn.active {
    background: #007AFF;
    color: white;
}

.mq-tool-btn.mq-delete {
    color: #dc3545;
}

.mq-quick-tools {
    position: absolute;
    z-index: 10;
    top: 70px;
    right: -5px;
    display: flex;
    justify-content: center;
    width: 100%;
    display: none;
}



/* #canvas {
    position: relative !important;
    float: right;
    border: 1px solid rgb(11, 121, 208);
} */
.grabbing {
    cursor: grabbing;
}

.popup {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

#modalImagePopup,
#modalImagePopupUpload {
    cursor: pointer;
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 105;
    text-align: center;
    transform: translate(-50%, -50%);
    background-color: #fff;
    max-width: 100%;
    width: auto;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.popup-contentUpload {
    min-width: 410px;
    width: 95%;
    max-width: 600px;
    min-height: 410px;
}

.divPopupContent {
    padding: 10px;
}

.imagePopupContainer {
    display: table;

    position: relative;
    padding: 0 30px;
}

.popup img {
    max-width: 100%;
    height: auto;
}

.popup button {
    margin-top: 10px;
}

.img-containerP {
    max-height: 600px;
    width: 100%;
    height: 100%;
}



.popupImageHeader {
    position: relative;
    max-width: 100%;
    width: auto;
    background: #1e8893;
    text-align: right;
    padding: 12px 0px 12px 12px;
}

.popupImageCrox {
    cursor: pointer;
    display: inline-block;
    font-size: 25px;
    padding-right: 10px;
    color: #fff;
}

.objectCanvas {
    display: none;
    opacity: 0;
    width: 0;
    height: 0;
}

#saveButton {
    cursor: pointer;
    font-size: 18px;
    padding: 10px 30px;
    text-align: center;
    width: 140px;
    color: #fff;
    background: #1e8893;
    outline: none;
    border: none;
}

#RotGauche,
#RotDroite {
    cursor: pointer;
    color: #1e8893;
    font-size: 25px;
    padding: 6px 25px;
    text-align: center;
    background: transparent;
    outline: none;
    border: none;
}

.buttonPopupContent {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.imagePopupDr {
    width: 100%;
    text-align: left;
}

#delette,
#resette {
    cursor: pointer;
    font-size: 25px;
    border: none;
    text-align: left;
    background: transparent;
    margin-bottom: 10px;
    margin-top: 0;
    color: #1e8893;
}

#resette {
    font-size: 20px;
}

.popupUploadImageMenu {
    display: flex;
    width: 100%;
    color: #1e8893;
    background-color: #E6E6E6;
    margin-bottom: 10px;
}

.popupUploadImageUploadContent {
    width: 100%;
    height: 100%;
    position: absolute;
    height: 72%;
    text-align: center;
}

.popupUploadImageUpload,
.popupUploadImageRecent {
    cursor: pointer;
    width: 50%;
    display: inline-block;
    font-size: 18px;
    padding: 10px 22px;
    user-select: none;
    -webkit-transition: color .4s ease-in-out;
    -o-transition: color .4s ease-in-out;
    transition: color .4s ease-in-out;
}

.canvas-container {
    border: 1px solid #105863;
}

.popupUploadImageUpload:hover {
    background: #ddd9d98c;
}

.popupUploadImageUpload.active {
    background: #fff;
    border-right: 1px #ddd solid;
}

.tool_icon_design,
.tool_icon_taille,
.tool_icon_Arriere-plan,
.tool_icon_photo,
.tool_icon_texte {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 6px;
    width: 28px;
    height: 28px;
    transition: transform var(--transition-base);
}

.tool_icon_design {
    background-image: url(../icons/design.png);
}

.tool_icon_taille {
    background-image: url(../icons/taille.png);
}

.tool_icon_Arriere-plan {
    background-image: url(../icons/Arriere-plan.png);
}

.tool_icon_photo {
    background-image: url(../icons/photo.png);
}

.tool_icon_texte {
    background-image: url(../icons/texte.png);
}

.popupUploadImageMenu i {
    width: 100%;
    text-align: center;
}

/* .cropper-view-box,
.cropper-face {
    border-radius: 50%;
} */
.radiusCircle {
    border-radius: 50%;
}

/* 1. Agrandir les poignées (les coins et les milieux) */
.cropper-point {
    width: 10px !important;
    /* Taille de la poignée */
    height: 10px !important;
    background-color: #2196F3 !important;
    /* Couleur identique à ton Fabric.js */
    opacity: 0.9 !important;
    border-radius: 50%;
    /* Rend les points ronds (plus "touch-friendly") */
}

/* Ajustement de la position des poignées pour qu'elles restent centrées sur le bord */
.cropper-point.point-e {
    right: -5px !important;
}

.cropper-point.point-w {
    left: -5px !important;
}

.cropper-point.point-n {
    top: -5px !important;
}

.cropper-point.point-s {
    bottom: -5px !important;
}

/* Coins spécifiques */
.cropper-point.point-ne {
    right: -5px !important;
    top: -5px !important;
}

.cropper-point.point-nw {
    left: -5px !important;
    top: -5px !important;
}

.cropper-point.point-sw {
    left: -5px !important;
    bottom: -5px !important;
}

.cropper-point.point-se {
    right: -5px !important;
    bottom: -5px !important;
    width: 10px !important;
    /* On peut faire le coin SE encore plus gros */
    height: 10px !important;
}

/* 2. Épaissir les lignes de sélection (les bords) */
.cropper-line {
    background-color: transparent !important;
}

.cropper-line.line-e,
.cropper-line.line-w {
    width: 2px !important;
}

.cropper-line.line-n,
.cropper-line.line-s {
    height: 2px !important;
}

/* 3. Optionnel : Rendre le rectangle de sélection plus visible */
.cropper-view-box {
    outline: 2px solid transparent !important;
    outline-color: transparent !important;
}

.progressbarP {
    position: absolute;
    background-color: #2ca5b8;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.05s linear, height 0.05s linear;
}

.percentageP {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #FFF;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.container_upg {
    width: 400px;
    transform: scale(1.4);
    display: none;
}

.container_upg input {
    z-index: -1;
    opacity: 0;
}

.percent_upg {
    float: right;
    margin-top: 2px;
    width: 100%;
}

.progress-bar_upg {
    width: 70%;
    height: 6px;
    margin: 0 auto;
    margin-top: 30px;
    background-color: rgb(231, 231, 231);
}

.template-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: scroll;
    padding: 13px 0;
}

/* Taille de la barre de défilement horizontale */
.template-filters::-webkit-scrollbar {
    height: 4px;
    /* Épaisseur pour le scroll horizontal */
    margin-top: 10px;
    cursor: pointer;
}

/* Fond de la barre (piste) */
.template-filters::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

/* Poignée de défilement (partie mobile) */
.template-filters::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

/* Changement de couleur au survol */
.template-filters::-webkit-scrollbar-thumb:hover {
    background: #555;
}


.filter-btn {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #105863;
    color: white;
    border-color: #105863;
}

.progress-bar_upg span {
    height: 100%;
    width: 0%;
    display: block;
    background-color: #1e8893;
    transition-duration: .2s;
}

.template-preview {
    /* width: 80px; */
    height: auto;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    position: relative;
}

.template-card {
    display: flex;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
    background: #D5E2E6;
}

.template-card:hover,
.template-card.active {
    border-color: #105863;
}

.divControle {
    width: 100%;
    height: 100%;
    /* display: flex; */
    overflow: hidden;
    max-height: 80%;
}

.divTaille {
    max-height: 87%;
    padding-top: 15px !important;
    overflow-x: hidden;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    /* 2 éléments par ligne */
    gap: 16px;

    max-height: 100%;
    max-width: 100%;

    overflow-y: auto;
    /* scroll vertical */
    overflow-x: auto;
    /* scroll horizontal si besoin */

    box-sizing: border-box;
}

.template-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(45deg, #f8fafc, #e2e8f0);
}










/* --- Conteneur des contrôles --- */

.size-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

/* --- Chaque bloc de format --- */
.size-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85px;
    cursor: pointer;
    border: 1px solid transparent;
}

/* --- La Boîte de 80x80 (Le Cadre de Centrage) --- */
.preview-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #D5E2E6;
    border: 1px solid transparent;
}

/* --- Le Rectangle (L'aperçu visuel) --- */
.preview-box::before {
    content: "";
    display: block;
    background-color: #fff;
    border: 1px dashed #105863;
}

/* --- RÉGLAGES DES TAILLES VISUELLES (1cm = 1px) --- */

/* Formats A */
.size-preset[data-format="A5"] .preview-box::before {
    width: 15px;
    height: 21px;
}

.size-preset[data-format="A4"] .preview-box::before {
    width: 21px;
    height: 30px;
}

.size-preset[data-format="A3"] .preview-box::before {
    width: 30px;
    height: 42px;
}

/* Formats Photos / Posters */
.size-preset[data-format="10X15"] .preview-box::before {
    width: 10px;
    height: 15px;
}

.size-preset[data-format="13X18"] .preview-box::before {
    width: 13px;
    height: 18px;
}

.size-preset[data-format="24X30"] .preview-box::before {
    width: 24px;
    height: 30px;
}

.size-preset[data-format="30X45"] .preview-box::before {
    width: 30px;
    height: 45px;
}

.size-preset[data-format="40X60"] .preview-box::before {
    width: 40px;
    height: 60px;
}

.size-preset[data-format="50X80"] .preview-box::before {
    width: 50px;
    height: 80px;
}

/* Formats Carrés */
.size-preset[data-format="18X18"] .preview-box::before {
    width: 18px;
    height: 18px;
}

.size-preset[data-format="24X24"] .preview-box::before {
    width: 24px;
    height: 24px;
}

.size-preset[data-format="30X30"] .preview-box::before {
    width: 30px;
    height: 30px;
}

.size-preset[data-format="50X50"] .preview-box::before {
    width: 50px;
    height: 50px;
}

.size-preset[data-format="80X80"] .preview-box::before {
    width: 80px;
    height: 80px;
}

/* --- Style de l'étiquette (.class) --- */
.prixDiv {
    display: inline-block;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.class {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.style-grid {
    display: flex;
    gap: 10px;
    padding: 10px;
    flex-wrap: wrap;
}

.style-preset-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.style-preset-card span {
    font-size: 24px;
    padding: 2px 8px;
}

.price-card {
    color: #fff;
    letter-spacing: 1px;
    font-weight: 600;
    font-size: xx-small;
}

.prixtaxés,.prinad {
    border-right: 1px solid;
    font-size: small;
    padding-right: 2px;
    text-decoration: line-through;
}

.discount-tag {
    font-size: small;
    padding-right: 2px;
}

.prix,
#tailleSelect {
    color: #ed911f;
    letter-spacing: 1px;
    font-weight: 600;
    font-size: 18px;
    font-family: cursive;
}


.arrow-icon {
    cursor: pointer;
    font-size: medium;
}
.flexche {
    font-size: 18px;
}
.arrow-icon.rotated {
    transform: rotate(180deg);
}

.price-table {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    /* min-width: 320px; */
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.price-table table {
    border-collapse: collapse;
    font-size: 14px;
    max-height: 300px;
    display: inline-block;
    overflow-y: scroll;
}

.price-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.price-table th:first-child {
    border-top-left-radius: 8px;
}

.price-table th:last-child {
    border-top-right-radius: 8px;
}

.price-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
}

.price-table tr:last-child td {
    border-bottom: none;
}

.price-table tr:hover td {
    background-color: #f7fafc;
}

.price-table td:first-child {
    font-weight: 600;
    color: #4a5568;
}

.price-table td:nth-child(2) {
    color: #2c5282;
    font-weight: 700;
    font-size: 15px;
}

.price-table .economy {
    color: #38a169;
    font-weight: 600;
    font-size: 12px;
    background: #f0fff4;
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-block;
}

.price-table .original-price {
    color: #a0aec0;
    text-decoration: line-through;
    font-weight: normal;
}

.table-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed #e2e8f0;
    text-align: center;
}

.table-footer small {
    color: #718096;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.table-footer small:before {
    content: "💰";
    font-size: 14px;
}

/* Petit triangle indicateur */
.price-table:before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}


@media screen and (max-width: 919px) {
    .noPreview {
        padding: 0 !important;
    }
    .nav-bar button {
        white-space: wrap;
    }
    .templates-grid {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        display: flex;
        scrollbar-width: 1px;
        -ms-overflow-style: none;
    }

    .mq-quick-tools .mq-tool-btn {
        font-size: xx-small;
    }

    .mq-quick-tools {
        top: 46px;
    }

    .template-preview {
        width: 60px;
    }

    .fabric-canvas-wrapper {
        align-items: initial;
    }

    .template-filters {
        padding: 0;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: 1px;
        -ms-overflow-style: none;
        margin-bottom: 8px;
    }

    .template-filters::-webkit-scrollbar {
        display: none;
    }

    .nav-bar {
        min-height: 20px;
    }

    .divTaille {
        padding-top: 0px !important;
    }

    .preview-box {
        height: 60px;
        width: 60px;
    }

    .controle,
    #left-slider {
        position: relative;
        padding: 0px;
        border-radius: 4px 4px 0px 0px;
        width: 100%;
        background-color: #F2F2F2;
        display: flex;
        flex-wrap: wrap;
    }

    .navBacistexte {
        display: flex;
        justify-content: space-between;
        align-items: center;
        overflow: auto;
        padding: 4px;
        order: 5;
    }

    #left-slider #tabs {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 66px;
    }

    .flexBoxE {
        display: flex;
        flex-wrap: wrap;
    }

    .controle {
        order: 2;
    }

    .DivCanvasflexCentre {
        height: auto;
        width: 100%;
        margin-left: 0;
        padding: 20px
    }

    #navigation-bar {
        position: fixed;
        bottom: 0;
        display: flex;
        width: 100%;
        height: auto;
        order: 2;
    }

    #navigation-bar .nav-item:nth-child(1) {
        margin-top: 0;
    }

    #navigation-bar .nav-item {
        border: none !important;
    }

    #backgroundColor .tab-title {
        display: none;
    }

    .basicsImgItem,
    .basics-item:nth-child(2),
    .backgP {
        overflow: auto;
        /* height: 180px; */
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .backgP {
        padding: 30px 0 20px 0;
        padding-top: 0;
        justify-content: flex-start;
    }

    .basicsImgItem img {
        height: 75px;
        width: auto;
        max-width: none;
        object-fit: cover;
        border-radius: 4px;
    }

    .basicsImgItem img:hover {
        height: 71px;
        padding: 4px;
        background: #1e8893;
    }

    .imgeUpload {
        padding-top: 0px !important;
    }

    #tabs>.tab {
        padding: 10px 18px;
    }


    .Upload-images {
        margin-right: 0;
        padding: 0;
        padding: 5px 0;
        width: 100%;
        border-bottom: 0;
        margin-bottom: 0;
    }

    .img-item {
        width: auto;
    }

    .PFontH1 {
        position: relative;
        -webkit-animation-duration: .25s;
        animation-duration: .25s;
        padding: 8px 0 10px 0;
        color: #333333;
        white-space: nowrap;
        font-weight: 600;
        cursor: pointer;
        font-size: 10px;
    }

    .FontH1 {
        display: none;
    }

    .PFontH1 b {
        background-color: #EAEAEA;
        padding: 10px 16px;
        margin-right: 4px;
        border-radius: 50px;
    }

    .PFontH1.active b {
        background-color: #1e8893;
        color: #fff;
    }

    .navBacistexte::-webkit-scrollbar,
    .police-content::-webkit-scrollbar,
    .colorP::-webkit-scrollbar,
    .textMa::-webkit-scrollbar,
    .number-input::-webkit-scrollbar,
    .backgP::-webkit-scrollbar,
    .basics-item:nth-child(2)::-webkit-scrollbar {
        height: 0;
    }

    .basicsImgItem::-webkit-scrollbar-thumb {
        background: #A9A9A9;
    }

    .basicsImgItem {
        padding-bottom: 0;
    }

    .basicsImgItem::-webkit-scrollbar {
        height: 10px;
        -webkit-appearance: none;
    }

    .basicsImgItem::-webkit-scrollbar-thumb {
        background: #A9A9A9;
        border-radius: 8px;
        background-color: #0000008c;
        width: 80%;
    }

    .police-content a {
        overflow: visible;
        max-width: 100%;
        width: auto;
    }

    .textTitre,
    .textMa,
    .number-input,
    .colorP,
    .style-grid,
    .police-content {
        display: none;
        /* height: 180px; */
        border: none;
        padding: 4px;
        /* justify-content: center; */
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        overflow-x: auto;
    }

    .police-content {
        height: auto;
        align-items: normal;
    }

    .textMa,
    .number-input {
        justify-content: center;
        width: 100%;
    }

    .style-grid.active,
    .textTitre.active,
    .textMa.active,
    .number-input.active,
    .colorP.active,
    .police-content.active,
    .backgP.active {
        display: flex !important;
    }

    #navigation-bar .fa {
        line-height: normal;
    }

    #bgColorContainer,
    .colorP {
        margin: 0;
    }

    .nonDivCanvasflexCentre {
        width: 100%;
        height: calc(100vh - 60px);
    }

    .nonNonPreview,
    .addPanier {
        display: none;
    }
}


@media screen and (max-width: 538px) {
    .logo {
        max-width: 150px;
    }

    .imagePopupSidebar {
        flex: initial;
        gap: 0px;
    }
}

@media screen and (max-width: 490px) {
    .popup-content {
        width: 98%;
        min-width: 80%;
    }

    .divLogo {
        display: none;
    }
}

@media screen and (max-height: 325px) {
    .DivCanvasflexCentre {
        align-items: normal;
    }
}



/* --- BASE DU POPUP --- */
#imagePopup {
    display: none;
    position: fixed;
    z-index: 1000;
    /* Augmenté pour être sûr */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.editor-full-width {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    width: 95%;
    max-width: 900px;
    /* Un peu plus large pour le confort sur PC */
    height: 90vh;
    /* Hauteur maximale par rapport à l'écran */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    animation: popupFadeIn 0.2s ease-out;
}

/* --- HEADER --- */
.popupImageHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e8893;
    color: #fff;
    padding: 12px 20px;
    flex-shrink: 0;
    /* Empêche le header de rétrécir */
}

/* --- LAYOUT --- */
.divPopupContent {
    flex: 1;
    /* Prend tout l'espace restant */
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* TRÈS IMPORTANT pour flexbox et CropperJS */
}

.main-editor-layout {
    display: flex;
    flex-direction: column;
    /* Par défaut sur mobile */
}

/* --- ZONE IMAGE ET CROPPER --- */
.imagePopupContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f0f2f5;
    min-height: 0;
    /* Permet au conteneur de se réduire si besoin */
}

.imagePopupContainerImage {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 200px;
    /* Minimum de sécurité */
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Empêche le dépassement du cropper */
    background: #f0f2f5;
}

.img-containerP {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Important pour CropperJS : l'image doit être invisible mais présente */
#popupImage {
    display: block;
    max-width: 100%;
}

/* --- BARRE LATÉRALE / FILTRES --- */
.imagePopupSidebar {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    /* Ne doit pas disparaître */
    color: #1e8893;
}

.cropper-modal {
    background: #f0f2f5;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-filter {
    background: #fff;
    border: 1px solid #1e8893;
    padding: 10px 5px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    color: #1e8893;
    font-weight: 600;
}

/* --- BOUTONS --- */
.imagePopupDr {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.buttonPopupContent {
    padding-top: 10px;
    display: flex;
    justify-content: center;
}

#saveButton {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    max-width: 250px;
}

/* --- RESPONSIVE DESKTOP --- */
@media screen and (min-width: 768px) {
    .main-editor-layout {
        flex-direction: row;
        /* Côte à côte sur PC */
        height: 100%;
    }

    .imagePopupSidebar {
        width: 280px;
        border-top: none;
        border-left: 1px solid #e2e8f0;
        overflow-y: auto;
    }

    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- ANIMATION --- */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}