/* Variables CSS globales (valeurs par défaut pour pages qui ne chargent pas le fichier de variables) */
:root {
  --primary-dark: #2d2d2d;
  --primary-orange: #c9980b;
  --primary-green: #708d23;
  --background-light: #f8f9fa;
  --border-color: #dee2e6;
  --text-dark: #333;
  --text-muted: #6c757d;
}

.panier-background {
  background: url(../images/bandeaux/clavier.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding: 24px 12px;
  min-height: 61vh;
}

.provisoire {
  border: 2px dashed orange;
  padding: 10px;
  margin-bottom: 10px;
  background-color: #fff8e1;
  width: 450px;
}

.coulReliure {
  display: inline-block;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  margin-left: 20px;
  margin-right: 20px;
  vertical-align: middle;
}
/* Animation pour le caddie : entrer depuis la droite hors-écran, traverser et sortir à gauche en rétrécissant */
.animated-caddie {
  position: fixed;
  top: 40%;
  left: 0;
  width: 375px;
  max-width: 90vw;
  transform-origin: center;
  z-index: 9999;
  pointer-events: none;
  animation: caddieSlide 16s linear infinite;
}

@keyframes caddieSlide {
  0% {
    transform: translateX(110vw) translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateX(-110vw) translateY(-50vh) scale(0.35);
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .animated-caddie {
    top: 45%;
    width: 300px;
  }
}
@media (max-width: 420px) {
  .animated-caddie {
    top: 48%;
    width: 220px;
  }
}
/* Empêcher le débordement horizontal causé par l'animation */
html,
body {
  overflow-x: hidden;
}

/* Conteneur réservé pour le caddie afin que la hauteur de la page reste stable */
.caddie-container {
  min-height: 408px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .caddie-container {
    min-height: 260px;
  }
}
@media (max-width: 420px) {
  .caddie-container {
    min-height: 200px;
  }
}

/* Styles pour le modal du panier */
.modal-panier {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: "Roboto", sans-serif;
}

.modal-contenu {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--primary-dark);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.btn-fermer {
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.btn-fermer:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.panier-vide {
  text-align: center;
  color: var(--text-muted);
  font-size: 18px;
  padding: 40px 20px;
}

/* Items du panier */
.items-panier {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.item-panier {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-light);
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-code {
  font-weight: 500;
  color: var(--primary-dark);
  font-family: "Roboto Mono", monospace;
}

.item-designation {
  color: var(--text-dark);
  font-weight: 400;
}

.item-format {
  font-size: 12px;
  color: var(--text-muted);
}

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

.item-quantite button {
  background: white;
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  color: var(--primary-dark);
  transition: all 0.2s ease;
}

.item-quantite button:hover {
  background: var(--primary-dark);
  color: white;
}

.item-quantite span {
  min-width: 30px;
  text-align: center;
  font-weight: 500;
}

.item-prix {
  font-weight: 500;
  color: var(--primary-orange);
  text-align: right;
  min-width: 80px;
}

.btn-supprimer {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.btn-supprimer:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Total du panier */
.panier-total {
  border-top: 2px solid var(--primary-dark);
  padding-top: 15px;
  text-align: right;
  font-size: 18px;
  color: var(--primary-dark);
}

/* Footer du modal */
.modal-footer {
  background: var(--background-light);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--border-color);
}

.btn-vider {
  background: #dc3545;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-vider:hover {
  background: #c82333;
}

.btn-commander {
  background: var(--primary-orange);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.btn-commander:hover {
  background: #d43f1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(240, 81, 36, 0.3);
}

/* Icône du panier (pour la navigation) */
.icone-panier {
  position: relative;
  cursor: pointer;
  padding: 10px;
  color: var(--primary-dark);
  font-size: 24px;
  transition: color 0.2s ease;
}

.icone-panier:hover {
  color: var(--primary-orange);
}

.compteur-panier {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary-orange);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 6px;
  color: white;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  background: #28a745;
}

.notification-error {
  background: #dc3545;
}

.notification-warning {
  background: #ffc107;
  color: #333;
}

.notification-info {
  background: var(--primary-dark);
}

/* Popup notification panier */

.notification-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #fff;
  border: 2px solid var(--primary-dark);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 10001;
  min-width: 320px;
  max-width: 95vw;
  padding: 28px 32px;
  font-family: "Roboto", sans-serif;
  color: var(--primary-dark);
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notification-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popup-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.btn-panier,
.btn-continuer {
  background: var(--primary-dark, #2a256d);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-panier:hover,
.btn-continuer:hover {
  background: var(--primary-orange, #f05124);
}

/* Responsive pour le modal */
@media (max-width: 768px) {
  .modal-contenu {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px 20px;
  }

  .item-panier {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .item-details {
    align-items: center;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn-vider,
  .btn-commander {
    width: 100%;
  }
}

/* Animation d'ouverture du modal */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-panier[style*="flex"] .modal-contenu {
  animation: modalFadeIn 0.3s ease;
}

.item-couleur img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid red !important;
  background: #fff;
  display: inline-block;
}

/* ========================================
   STYLES POUR LA FINALISATION DE COMMANDE
======================================== */

.commande-form h3,
.connexion-required h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
  border-bottom: 2px solid #262626;
  padding-bottom: 8px;
}

.commande-options {
  display: grid;
  gap: 20px;
  margin-bottom: 25px;
}

.option-group {
  margin-bottom: 15px;
}

.option-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #555;
}

.option-group select,
.option-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.option-group select:focus,
.option-group textarea:focus {
  outline: none;
  border-color: #007bff;
}

.option-group label input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.commande-resume {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #28a745;
  margin: 20px 0;
}

.commande-resume p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #666;
}

.commande-resume .total-final {
  font-size: 1.1rem;
  color: #333;
  border-top: 2px solid #28a745;
  padding-top: 10px;
  margin-top: 15px;
}

.btn-commander {
  width: 100%;
  background: #28a745;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-commander:hover {
  background: #1e7e34;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* Styles pour clients non connectés */
.connexion-required {
  text-align: center;
  padding: 20px;
  width: 400px;
  margin-left: auto;
  margin-right: auto;
  background: var(--blanc3);
  border-radius: 8px;
  box-shadow: 2px 2px 6px var(--gris3);
  border: 3px dotted transparent;
  animation: connexion-blink-border 1.6s linear infinite;
}

.connexion-required p {
  margin-bottom: 25px;
  color: #666;
  font-size: 1.1rem;
}

@keyframes connexion-blink-border {
  0% {
    border-color: transparent;
  }
  40% {
    border-color: var(--or1);
  }
  60% {
    border-color: var(--or2);
  }
  100% {
    border-color: transparent;
  }
}

.connexion-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-connexion,
.btn-creer-compte {
  padding: 12px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-connexion {
  background: #007bff;
  color: white;
}

.btn-connexion:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

.btn-creer-compte {
  background: transparent;
  color: #007bff;
  border: 2px solid #007bff;
}

.btn-creer-compte:hover {
  background: #007bff;
  color: white;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .panier-actions {
    padding: 20px;
    margin-top: 20px;
  }

  .connexion-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-connexion,
  .btn-creer-compte {
    width: 200px;
    text-align: center;
  }

  .commande-resume {
    padding: 15px;
  }
}
/* Layout : placer l'encart de finalisation à gauche du récapitulatif */
.panier-summary-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: flex-end;
  margin-top: 20px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.panier-summary-wrapper .recap-panier {
  flex: 0 0 360px;
}
.panier-summary-wrapper .panier-actions {
  flex: 0 0 420px;
  order: -1; /* afficher à gauche */
}
@media (max-width: 900px) {
  .panier-summary-wrapper {
    flex-direction: column;
    gap: 14px;
  }
  .panier-summary-wrapper .panier-actions,
  .panier-summary-wrapper .recap-panier {
    flex: none;
    width: 100%;
    order: 0;
  }
}
/* Formulaire perso */
.etapes-ascenseur {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.etape {
  display: flex;
  align-items: center;
  margin-right: 40px;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.etape:hover {
  background: #f8f9fa;
}

.etape-numero {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.etape-numero.active {
  background: var(--or2);
  color: var(--blanc1);
}

.etape-numero:not(.active) {
  background: var(--border-color);
  color: var(--gris6);
}

.etape-texte {
  font-weight: 600;
  transition: all 0.3s ease;
}

.etape.active .etape-texte {
  color: var(--bleu2);
}

.etape:not(.active) .etape-texte {
  color: var(--gris6);
}

.separateur {
  width: 30px;
  height: 2px;
  background: var(--border-color);
  align-self: center;
  margin: 0 20px;
}

.etape-contenu {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
  background: var(--gris7);
  border-radius: 12px;
  margin-left: auto;
  margin-right: auto;
}

.etape-contenu.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.produit-selectionne-cadre {
  background: var(--blanc3);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.1),
    0 4px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 20px auto;
}

.personnalisation-options {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 40px 0;
}

.option-btn {
  background: linear-gradient(135deg, var(--or2) 0%, var(--or3) 100%);
  color: var(--blanc1);
  border: none;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(240, 81, 36, 0.3);
  min-width: 200px;
}

.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 81, 36, 0.4);
}

.btn-suivant {
  background: var(--vert1);
  color: var(--blanc1);
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin: 20px auto;
  display: block;
  transition: all 0.3s ease;
}

.btn-suivant:hover {
  background: var(--vert2);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .etapes-ascenseur {
    flex-wrap: wrap;
    justify-content: center;
  }

  .etape {
    margin: 5px;
  }

  .separateur {
    display: none;
  }

  .personnalisation-options {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
}

/* Formulaire de devis */
.photo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  background: #f1f1f1c9;
  border-radius: 10px;
  padding: 10px;
}

.layout-2-colonnes {
  display: grid; 
  grid-template-columns: 100% 100%; 
  gap: 30px; 
  align-items: start;
}
/* Layout responsif 2 colonnes */
        @media (max-width: 992px) {
            .layout-2-colonnes {
                grid-template-columns: 1fr !important;
                gap: 20px !important;
            }
        }
        
        @media (max-width: 768px) {
            .layout-2-colonnes {
                gap: 15px !important;
                padding: 0 10px !important;
            }
            
            .produit-selectionne-cadre {
                padding: 20px !important;
            }
        }