body {
  font-family: 'Montserrat', Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}
.container {
  display: flex;
  flex-wrap: nowrap;
  width: min(1200px, 95vw);
  margin: 60px auto;
  padding: 40px 48px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
  overflow: visible; /* le contenu peut déborder si besoin */
  gap: 32px;
}
.config {
  flex: 1 1 350px;
  min-width: 320px;
  padding: 1rem;
  background: #fafafa;
  border-right: 1px solid #eee;
  overflow-y: auto;
  max-height: 98vh;
}
.formats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.3rem;
}
.formats input[type="radio"] {
  display: none; /* Hide the default radio button */
}
.formats label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  /* margin-bottom: 0.5rem; */ /* Remove or adjust if span has padding */
}
.formats label span {
  display: block;
  padding: 0.3rem 0.6rem;
  border: 2px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
}
.formats input[type="radio"]:checked + span {
  background-color: #2d253a;
  color: #fff;
  border-color: #2d253a;
  box-shadow: 0 2px 8px rgba(45, 37, 58, 0.3);
}
.formats label span:hover {
    background-color: rgba(45, 37, 58, 0.05);
    border-color: #2d253a;
    transform: translateY(-1px);
}
.formats input[type="radio"]:checked + span:hover {
    background-color: #4b3e5c;
    border-color: #4b3e5c;
    box-shadow: 0 4px 12px rgba(45, 37, 58, 0.4);
}
.finishes {
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.finishes > div {
  margin-bottom: 0.5rem;
}
.finishes > div:last-child {
  margin-bottom: 0;
}
.finishes > div > span {
  font-size: 0.75rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.2rem;
}
.colors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin-top: 0.2rem;
}
.color-option {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 2px solid #fff;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.color-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.color-option.selected {
  border: 3px solid #2d253a;
  box-shadow: 0 4px 12px rgba(45, 37, 58, 0.5);
  transform: translateY(-2px);
}

/* Material/color tile wrapper and label to mirror border UI */
.material-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.05rem;
}

.material-label {
  margin-top: 0.15rem;
  font-size: 0.55rem;
  font-weight: 600;
  color: #555;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  line-height: 0.9;
}
.color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ccc;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}
.color:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.color.selected {
  border: 3px solid #2d253a;
  box-shadow: 0 4px 12px rgba(45, 37, 58, 0.5);
  transform: translateY(-2px);
}
.logo-upload {
  margin-top: 0;
  margin-bottom: 0.5rem;
  text-align: center;
}
.logo-label {
  display: inline-block;
  cursor: pointer;
  color: #888;
  padding: 0.4rem 0.6rem;
  border: 2px dashed #ccc;
  border-radius: 6px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}
.logo-label:hover {
  border-color: #2d253a;
  background-color: rgba(45, 37, 58, 0.05);
  transform: translateY(-1px);
}

.logo-position {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
}

.position-control {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
  gap: 0.4rem;
}

.position-control:last-child {
  margin-bottom: 0;
}

.position-control label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #555;
  min-width: 120px;
}

.position-slider {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.position-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2d253a;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.position-slider::-webkit-slider-thumb:hover {
  background: #4b3e5c;
  transform: scale(1.1);
}

.position-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2d253a;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.position-control span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d253a;
  min-width: 35px;
  text-align: right;
}
.logo-label img {
  width: 28px;
  display: block;
  margin: 0 auto 0.2rem;
}
.logo-label span {
  font-size: 0.75rem;
}
#logoPreview img {
  max-width: 60px;
  margin-top: 0.3rem;
}
.preview {
  flex: 2 1 500px;
  min-width: 320px;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}
.mockup-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  margin-right: -160px;
}
.menu-mockup {
  width: 220px;
  height: 290px;
  /* background: #444; */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* background-color: #888; */ /* Remove default grey background */
  border-radius: 0px;
  position: relative;
  display: flex; /* Keep flex for centering text and logo */
  align-items: center; /* Keep flex for centering text and logo */
  justify-content: center; /* Keep flex for centering text and logo */
  flex-direction: column; /* Keep flex for centering text and logo */
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); /* Increased opacity for a darker shadow */
}
.mockup-base-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure the image covers the area */
}
.menu-texture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.8;
  border-radius: 0;
  z-index: 2;
}

.reflection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('img/Reflections.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
  border-radius: 0;
  z-index: 7;
}
.mockup-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Add subtle text shadow for contrast */
}
#logoOnMenu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 60%;
  max-height: 40%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: none;
  z-index: 3; /* Ensure logo stays above overlay and base image */
  transition: all 0.3s ease; /* Smooth transitions for position changes */
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  background: linear-gradient(135deg, #271E59 0%, #160be7 100%);
  color: white;
  text-align: center;
  padding: 1.5rem;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.close {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.3s ease;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Styles de validation pour les champs du formulaire */
.form-group input.valid {
  border-color: #4CAF50 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input.invalid {
  border-color: #ff4444 !important;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.form-group input.warning {
  border-color: #ff8800 !important;
  box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

/* Animation pour les transitions de validation */
.form-group input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Style pour le bouton désactivé */
.btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Message d'erreur pour les champs */
.form-group .error-message {
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group input.invalid + .error-message {
  display: block;
}

.modal-footer {
  padding: 1.5rem 2rem;
  background-color: #f8f9fa;
  border-radius: 0 0 15px 15px;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-primary, .btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.btn-primary {
  background: linear-gradient(135deg, #764ba2 0%, #0f1aeb 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}
.actions {
  position: static;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin: 1.75rem auto 0;
  z-index: 5;
}
#downloadBtn,
#quoteBtn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 2.6rem;
  background: #2d253a;
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  min-width: 180px;
}
#downloadBtn:hover,
#quoteBtn:hover {
  background: #4b3e5c;
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
}
#quoteBtn.secondary {
  background: #fff;
  color: #2d253a;
  border: 2px solid #2d253a;
}
@media (max-width: 992px) {
  .container {
    flex-direction: column;
    width: min(740px, 94vw);
    margin: 40px auto;
    padding: 28px 24px;
    gap: 28px;
  }
  .config {
    border-right: none;
    border-bottom: 1px solid #eee;
    padding: 0 0 24px 0;
    min-width: 100%;
    max-height: none;
  }
  .preview {
    min-width: 100%;
    padding: 8px 0 0;
    flex-direction: column;
    gap: 24px;
  }
  .mockup-wrapper {
    margin: 0 auto;
    transform: none;
  }
  .menu-mockup {
    width: 260px;
    height: 340px;
  }
  .actions {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }
  #downloadBtn,
  #quoteBtn {
    width: 100%;
    max-width: 260px;
    min-width: unset;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 22px 18px;
    margin: 28px auto;
    gap: 24px;
  }
  .finishes,
  .logo-position,
  .border-interface {
    padding: 0.75rem;
  }
  .formats label span {
    font-size: 0.62rem;
    padding: 0.25rem 0.5rem;
  }
  .menu-mockup {
    width: 220px;
    height: 300px;
  }
  #downloadBtn,
  #quoteBtn {
    font-size: 1rem;
  }
}

h2 {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

h3 {
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: #2d253a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.border-options {
  margin-bottom: 0.5rem;
}

.border-interface {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.border-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d253a;
  text-align: center;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.border-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
}

@media (max-width: 768px) {
  .border-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
  }
}

.border-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0.1rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.border-option:hover {
  background-color: rgba(45, 37, 58, 0.05);
  border-color: rgba(45, 37, 58, 0.2);
  transform: translateY(-1px);
}

.border-option.selected {
  background-color: rgba(45, 37, 58, 0.1);
  border-color: #2d253a;
  box-shadow: 0 4px 12px rgba(45, 37, 58, 0.2);
  transform: translateY(-1px);
}

.border-preview-box {
  width: 26px;
  height: 18px;
  border-radius: 3px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  margin-bottom: 0.1rem;
  transition: all 0.3s ease;
}

.border-option:hover .border-preview-box {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.border-option.selected .border-preview-box {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.border-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: #555;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  line-height: 0.9;
}

.border-option.selected .border-label {
  color: #2d253a;
  font-weight: 600;
}

.menu-creator-image {
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  max-height: 290px;
  z-index: 1;
}

.creator-preview {
  max-width: 100%;
  max-height: 290px;
  height: auto;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 1;
}

