/**
 * Styles pour le formulaire frontend
 */

/* Reset box-sizing pour éviter les débordements */
.velo-devis-wrapper,
.velo-devis-wrapper * {
  box-sizing: border-box;
}

.velo-devis-wrapper {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0;
  /* overflow-x: hidden; - Retiré car empêche le sticky de fonctionner */
  width: 100%;
}

/* Layout avec deux colonnes */
.velo-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  align-items: start;
  /* overflow-x: hidden; - Retiré car empêche le sticky de fonctionner */
}

/* Colonne du formulaire */
.velo-form-column {
  background: #ffffff;
  border-radius: 8px;
}

/* Colonne du récapitulatif */
.velo-summary-column {
  position: relative;
  align-self: stretch;
  min-height: 100vh;
}

.velo-summary-sticky {
  position: sticky;
  top: 145px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.velo-summary-sticky h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 15px;
}

.velo-summary-sticky .form-actions {
  margin-top: 25px;
  padding-top: 0;
  border-top: none;
}

.velo-summary-sticky .btn-submit {
  width: 100%;
  padding: 15px 20px;
}

.velo-form-section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.velo-form-section h3 {
  margin: 0 0 30px 0;
  color: #333;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.velo-form-section h3 i {
  color: #0066cc;
  font-size: 18px;
}

.section-legend {
  display: block;
  margin: -15px 0 20px 0;
  padding: 10px 12px;
  background: #f0f7ff;
  border-left: 4px solid #0066cc;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
}

.section-header h3 {
  margin-bottom: 0;
}

.btn-help {
  background: none;
  border: none;
  color: #0066cc;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 5px 10px;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-help:hover {
  color: #0052a3;
  background: rgba(0, 102, 204, 0.05);
  border-radius: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea,
.bike-selector select.bike-type,
.bike-selector input.bike-quantity,
.accessory-item input.accessory-quantity,
.transfert-fields select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  height: auto;
  line-height: normal;
  transition: border-color 0.3s;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.bike-selector select.bike-type:focus,
.bike-selector input.bike-quantity:focus,
.accessory-item input.accessory-quantity:focus,
.transfert-fields select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group input[readonly] {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

/* Sélecteurs de vélos */
#velos-container {
  margin-bottom: 15px;
}

/* Grille de cartes de vélos */
.bikes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.bike-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.bike-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  transform: translateY(-2px);
}

.bike-card.bike-card-active {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.bike-card-image {
  width: 100%;
  height: 200px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bike-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bike-card-no-image {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bike-card-no-image i {
  font-size: 60px;
  color: white;
  opacity: 0.7;
}

.bike-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bike-card-content h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

.bike-card-description {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
  flex: 1;
}

.bike-card-description p {
  margin: 0 0 8px 0;
}

.bike-card-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
}

.bike-card-quantity label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  flex-shrink: 0;
}

.bike-quantity-input {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s;
}

.bike-quantity-input:focus {
  outline: none;
  border-color: #0066cc;
}

.bike-card-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 2px solid #e0e0e0;
}

.bike-card-price .bike-price {
  font-weight: bold;
  color: #0066cc;
  font-size: 20px;
}

.bike-card-price .bike-price-daily {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Info tailles vélos juniors */
.junior-sizes-info {
  grid-column: 1 / -1;
  background: #fff3cd;
  border: 2px solid #ffc107;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-top: 10px;
}

.junior-sizes-info h4 {
  margin: 0 0 12px 0;
  color: #856404;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.junior-sizes-info p {
  margin: 0;
  color: #856404;
  font-size: 15px;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
  .bikes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bikes-grid {
    grid-template-columns: 1fr;
  }
}

/* Ancien système de sélection (caché) */
.bike-selector {
  margin-bottom: 10px;
  padding: 15px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  display: none;
}

.bike-selector-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.bike-selector select.bike-type {
  flex: 1;
  min-width: 0;
}

.bike-selector input.bike-quantity {
  width: 80px;
  text-align: center;
  min-width: 80px;
}

.bike-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.bike-selector .bike-price {
  font-weight: bold;
  color: #0066cc;
  font-size: 18px;
}

.bike-price-daily {
  font-size: 13px;
  color: #666;
  font-style: italic;
}

.btn-add,
.btn-remove-bike {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-add {
  background: #0066cc;
  color: white;
}

.btn-add:hover {
  background: #0052a3;
}

.btn-remove-bike {
  background: #dc3545;
  color: white;
  padding: 8px 12px;
}

.btn-remove-bike:hover {
  background: #c82333;
}

/* Accessoires */
.accessories-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.accessory-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: white;
  border-radius: 4px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.accessory-item:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.accessory-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accessory-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.accessory-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.accessory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.accessory-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.accessory-name {
  font-weight: 600;
  font-size: 16px;
  color: #333;
}

.accessory-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.accessory-item input.accessory-quantity {
  width: 70px;
  padding: 6px;
  text-align: center;
  min-width: 70px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-weight: 600;
}

.accessory-description {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
}

.accessory-description p {
  margin: 0 0 6px 0;
}

.accessory-item input.accessory-quantity:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.accessory-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.accessory-price {
  font-weight: bold;
  color: #0066cc;
  font-size: 16px;
}

.accessory-price-daily {
  font-size: 13px;
  color: #666;
  font-style: italic;
}

/* Transferts */
.transfer-price-display {
  margin-top: 15px;
}

.transfer-info-paid,
.transfer-info-free {
  padding: 12px;
  border-radius: 4px;
  font-size: 15px;
  text-align: center;
}

.transfer-info-paid {
  background: white;
  border: 2px solid #0066cc;
  color: #333;
}

.transfer-info-paid strong {
  color: #0066cc;
  font-size: 18px;
}

.transfer-info-free {
  background: #e8f5e9;
  border: 2px solid #4caf50;
  color: #2e7d32;
}

/* Transfert de bagages */
.bagages-info-box {
  background: #fff8e1;
  border: 2px solid #ffa726;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.bagages-info-box h4 {
  margin: 0 0 15px 0;
  color: #e65100;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bagages-info-box ul {
  margin: 0 0 15px 0;
  padding-left: 20px;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
}

.bagages-info-box li {
  margin-bottom: 8px;
}

.bagages-info-box strong {
  color: #e65100;
}

.bagages-warning {
  margin: 0;
  padding: 10px;
  background: #ffebee;
  border-left: 4px solid #d32f2f;
  border-radius: 4px;
  font-size: 13px;
  color: #c62828;
  font-weight: 600;
}

.etapes-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 15px;
  padding: 15px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.etape-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px;
  font-size: 13px;
  transition: background 0.2s;
}

.etape-checkbox:hover {
  background: #f5f5f5;
  border-radius: 4px;
}

.etape-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.bagages-price-display {
  margin-top: 15px;
  padding: 15px;
  background: white;
  border: 2px solid #ffa726;
  border-radius: 6px;
  text-align: center;
}

.bagages-price-display strong {
  color: #e65100;
  font-size: 20px;
}

/* Récapitulatif mobile - caché par défaut */
.velo-summary-mobile {
  display: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 30px;
}

.velo-summary-mobile h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 15px;
}

.velo-summary-mobile .form-actions {
  margin-top: 25px;
  padding-top: 0;
  border-top: none;
}

.velo-summary-mobile .btn-submit {
  width: 100%;
  padding: 15px 20px;
}

/* Récapitulatif dans la sidebar sticky */
.summary-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 15px;
}

.summary-line:last-child {
  border-bottom: none;
}

.summary-line span:first-child {
  color: rgba(255, 255, 255, 0.9);
}

.summary-line span:last-child {
  font-weight: 600;
  font-size: 16px;
}

/* Enlever la bordure sous la ligne "Transfert bagages" */
.summary-line:has(#summary-bagages) {
  border-bottom: none;
}

/* Enlever la bordure sous la ligne "Récupération vélos" */
.summary-line:has(#summary-recuperation) {
  border-bottom: none;
}

/* Enlever les bordures de la ligne TVA */
.summary-line.summary-tva {
  border-top: none;
  border-bottom: none;
}

.summary-total {
  font-size: 20px;
  font-weight: bold;
  margin-top: 15px;
  padding-top: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: none;
}

.summary-total span:last-child {
  font-size: 32px;
  color: #ffd700;
}

.btn-submit {
  padding: 15px 40px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Messages */
.form-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 4px;
  display: none;
}

.form-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 1024px) {
  .velo-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Cacher le récapitulatif desktop sur mobile */
  .velo-summary-column {
    display: none;
  }

  /* Afficher le récapitulatif mobile */
  .velo-summary-mobile {
    display: block;
  }
}

@media (max-width: 768px) {
  .velo-summary-sticky {
    padding: 20px;
  }

  .velo-summary-mobile {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .bike-selector-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .bike-selector input.bike-quantity {
    width: 60px;
  }

  .bike-price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .transfert-fields {
    grid-template-columns: 1fr;
  }

  .transfert-fields span {
    display: none;
  }

  .summary-total span:last-child {
    font-size: 24px;
  }
}

/* Modale d'aide au choix des vélos */
.velo-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: auto;
}

.velo-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  margin: 20px;
  padding: 30px;
  border-radius: 8px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #000;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 30px;
  color: #333;
  font-size: 24px;
  text-align: center;
}

.bikes-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.bike-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  border: 2px solid #e0e0e0;
  transition: all 0.3s;
}

.bike-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  transform: translateY(-2px);
}

.bike-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 10px;
}

.bike-card h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.junior-sizes-info {
  background: #e8f4f8;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #0066cc;
}

.junior-sizes-info h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #0066cc;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.junior-sizes-info p {
  margin: 0;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
}

.junior-sizes-info strong {
  color: #0066cc;
}

@media (max-width: 768px) {
  .bikes-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .accessory-item {
    flex-direction: column;
  }
  .bike-card img {
    height: 150px;
  }

  .modal-content {
    padding: 20px;
    margin: 10px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-help {
    align-self: flex-end;
  }

  .etapes-container {
    grid-template-columns: 1fr;
  }

  .bagages-info-box ul {
    padding-left: 15px;
  }

  .bagages-etapes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Styles pour le transfert de bagages */
.bagages-transfer-container {
  margin-top: 20px;
}

.bagages-etapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.bagages-etape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #495057;
  user-select: none;
}

.bagages-etape-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.bagages-etape-checkbox {
  display: none;
}

.bagages-etape-checkbox:checked + .bagages-etape-label {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.bagages-etape-btn:has(.bagages-etape-checkbox:checked) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
}

.bagages-etape-label {
  width: 100%;
  text-align: center;
  transition: all 0.2s ease;
}

.bagages-price-display {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
}

.bagages-price-display.has-price {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 2px solid #667eea;
}

.bagages-price-breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dee2e6;
  font-size: 14px;
  color: #6c757d;
}
