/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Container principal */
.container {
    display: flex;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* Colonne de gauche */
.left-column {
    width: 450px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.left-column h1 {
    text-align: center;
    color: #3498db;
    margin-bottom: 30px;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Sections */
.section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.section h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

/* Boutons de genre */
.gender-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gender-btn {
    flex: 1;
    padding: 10px 15px;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.gender-btn:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.gender-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

/* Boutons d'outils */
.tool-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.tool-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.order-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    margin-top: 20px;
}

.order-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Zone de drop */
.drop-zone {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

/* Contrôles de texte */
.text-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

#text-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #3498db;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    margin-bottom: 10px;
}

#font-family {
    flex: 1;
    padding: 8px;
    border: 1px solid #3498db;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

#text-color {
    width: 40px;
    height: 35px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.style-btn {
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border: 1px solid #3498db;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.style-btn:hover,
.style-btn.active {
    background: #3498db;
}

/* Boutons de catégorie */
.category-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.category-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border: 1px solid #3498db;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.category-btn:hover,
.category-btn.active {
    background: #3498db;
}

/* Grilles de galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.gallery-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
}

.gallery-item:hover {
    transform: scale(1.1);
    border-color: #3498db;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.gallery-item img {
    width: 80px !important;
    height: 80px !important;
    /* object-fit: cover; */
    border-radius: 6px;
}

.gallery-item.emoji {
    font-size: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* Liste des éléments */
.elements-list {
    max-height: 150px;
    overflow-y: auto;
}

.element-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.element-item:hover,
.element-item.selected {
    background: rgba(52, 152, 219, 0.3);
}

.element-controls {
    display: flex;
    gap: 5px;
}

.element-controls button {
    padding: 4px 8px;
    background: rgba(52, 152, 219, 0.5);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.element-controls button:hover {
    background: #3498db;
}

/* Panier */
.cart-items {
    max-height: 200px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-info {
    flex: 1;
}

.cart-item button {
    padding: 5px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Colonne de droite */
.right-column {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 40px);
}

.canvas-container {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 0px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 810px;
    height: 860px;
}

#design-canvas {
    border: 2px solid #3498db;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
    width: 100%;
    max-width: 500px;
    height: 600px;
}

#selected-genre {
    text-align: center;
    margin-top: 15px;
    color: #3498db;
    font-weight: bold;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #3498db;
}

.modal h2 {
    color: #3498db;
    margin-bottom: 30px;
    text-align: center;
}

/* Formulaire */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row input,
.form-row select {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

.form-row input::placeholder {
    color: #bbb;
}

/* Détails de commande */
.order-details {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.size-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.gender-section h4 {
    color: #3498db;
    margin-bottom: 10px;
}

.sizes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.sizes label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.sizes input {
    width: 50px;
    padding: 5px;
    border: 1px solid #3498db;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
}

.pricing {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

/* Designs dans la commande */
.order-designs {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#order-designs-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#order-designs-list img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #3498db;
}

/* Conditions et paiement */
.terms {
    margin: 20px 0;
}

.terms label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms a {
    color: #3498db;
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

.payment-section {
    margin: 30px 0;
}

.payment-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

#payment-form {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-top: 15px;
}

.payment-form-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.payment-form-content input {
    padding: 12px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

/* Bouton de soumission */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }
    
    .left-column {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .size-selection {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbars personnalisées */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}


/* Styles pour les miniatures transparentes */
.cart-thumbnail, .order-thumbnail {
    width: 60px;
    height: 72px;
    object-fit: contain;
    border-radius: 4px;
    background: transparent !important;
    border: 1px solid #3498db;
}

.cart-item img {
    background: transparent !important;
}

.order-design img {
    background: transparent !important;
}
#design-canvas {
  width: 800px;
  height: 850px;
  /* Pour éviter le redimensionnement par flexbox ou autres */
  max-width: none;
  max-height: none;
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 12px #0003;
}
.custom-popup {
  display: none;
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #1b1725;
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px #000a, 0 1px 4px #0004;
  min-width: 420px;
  max-width: 90vw;
  min-height: 220px;
  padding: 32px 30px 24px 30px;
  font-family: 'Inter', Arial, sans-serif;
}
.custom-popup .popup-content {
  position: relative;
  margin-left: 410px;
}
.custom-popup .close-popup {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 2;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.custom-popup .close-popup:hover {
  opacity: 1;
}
.custom-popup h2 {
  margin-top: 0; margin-bottom: 12px; font-size: 1.5rem;
  color: #70ffa6; letter-spacing: 1px;
}
.custom-popup .category-buttons {
  margin-bottom: 18px;
  text-align: center;
}
.custom-popup .category-buttons button {
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  margin: 0 6px;
  padding: 6px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.custom-popup .category-buttons button:hover {
  background: #70ffa6;
  color: #18132a;
}
.custom-popup .gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  justify-content: center;
}
.custom-popup .gallery-item {
  background: #222132;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s, transform 0.2s;
}
.custom-popup .gallery-item:hover {
  background: #70ffa6;
  color: #1b1725;
  transform: scale(1.08);
}

