/********************************************
  Conteneur principal
*********************************************/
.chauffeur-calculator {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Arial', sans-serif;
}

/********************************************
  Mise en page globale
*********************************************/
.calculator-content {
    display: flex;
    flex-direction: column; /* On empile verticalement : .vehicle-selection au-dessus, puis .main-form */
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/********************************************
  Section "Vehicle Selection" (DESKTOP par défaut)
*********************************************/
.vehicle-selection {
    /* Si .vehicle-selection est après .main-form dans le HTML,
       on utilise order: -1 pour le placer au-dessus. */
    order: -1;
    display: flex;
    flex-direction: column;
    padding-top: 0px;
    width: 100%;
}

.vehicle-selection h3 {
    margin: 0;
    padding: 17px;
    background-color: #DCB57E !important;
    color: white !important;
    text-align: center;
    border-radius: 8px;
    font-weight: bold !important;
    font-size: 16px !important;
}

/* === Par défaut (desktop) : 4 véhicules sur une seule ligne === */
.vehicles-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;        /* Pas de retour à la ligne */
    gap: 20px;
    margin-top: 15px;
    justify-content: space-between;
    align-items: center;
}

.vehicle-item {
    width: calc(25% - 20px);
    box-sizing: border-box;
    padding: 8px;
    background: #F8FAFC; 
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.vehicle-item:hover {
    border-color: #DCB57E;
}

.vehicle-item.selected {
    border-color: #DCB57E;
    background-color: #DCB57E;
}

.vehicle-item.selected .vehicle-info h4,
.vehicle-item.selected .vehicle-info p {
    color: white;
}

.vehicle-item img {
    width: 100%;
    max-width: 150px;
    height: auto;
    margin-bottom: 6px;
}

.vehicle-info h4 {
    margin: 0 0 2px;
    font-size: 15px;
    color: #333;
}

.vehicle-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/********************************************
  Section "Main Form"
*********************************************/
.main-form {
    flex: 1;
    /* On retire la limite de 800px pour qu'il s'aligne avec la largeur du bloc véhicules */
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 0px;
}

.get-price-btn {
    width: 100%;
    padding: 15px;
    background-color: #DCB57E;
    color: white;
    border: none;
    border-radius: 8px !important;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    margin-top: -10px;
    font-weight: normal;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px !important;
    font-size: 14px;
    background: #F8FAFC !important;
    height: 50px !important;
}

.email-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.email-group input {
    flex: 1;
    height: 42px;
}

#view-price-btn {
    padding: 0 25px;
    background-color: #DCB57E;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
    height: 50px;
    line-height: 42px;
}

#view-price-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.title-banner {
    width: 100%;
    padding: 15px;
    background-color: #DCB57E !important;
    color: white !important;
    border: none;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    margin-bottom: 20px;
    text-align: center;
}

/********************************************
  Section "Map"
*********************************************/
.map-container {
    position: relative;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#map {
    height: 400px;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
}

/********************************************
  Section "Route Info"
*********************************************/
.route-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.info-box {
    flex: 1;
    padding: 15px;
    background: #F8FAFC;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: center;
}

.info-box .label {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.info-box .value {
    font-size: 24px;
    font-weight: normal;
}

.info-box .unit {
    font-size: 14px;
    position: relative;
    top: -8px;
    left: 2px;
}

.info-box.price {
    background-color: #DCB57E;
    color: white;
}

.info-box.price .label {
    color: white;
}

.finalize-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #DCB57E !important;
    color: white !important;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold !important;
    font-size: 16px !important;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.finalize-btn:hover {
    background-color: #DCB57E !important;
    color: black !important;
}

/********************************************
  MEDIA QUERIES
  -> On rétablit l'affichage mobile/tablette 
     (comme c'était avant)
********************************************/

/* Tablette et petits écrans (<= 1024px) */
@media (max-width: 1024px) {
    /* On repasse .vehicles-grid en grille
       pour éviter que les 4 voitures se serrent sur une ligne */
    .vehicles-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        justify-items: center;
    }
    /* On enlève la largeur forcée à 25% */
    .vehicle-item {
        width: 100%;
    }
}

/* Ecran <= 768px */
@media (max-width: 768px) {
    .route-info {
        flex-direction: column;
        gap: 10px;
    }
    .info-box {
        margin: 5px 0;
    }

    /* Sur petits écrans, chaque véhicule peut redevenir vertical */
    .vehicle-item {
        flex-direction: column;
        text-align: center;
    }
    .vehicle-item img {
        margin: 0 0 10px 0;
    }
}

/* Ecran <= 480px (smartphones) */
@media (max-width: 480px) {
    .calculator-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .main-form {
        width: 100%;
        padding: 0;
    }

    .vehicle-selection {
        width: 100%;
        margin-top: 0;
        padding-top: 0;
    }

    /* 2 colonnes de véhicules sur mobile */
    .vehicles-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 15px;
    }
    .vehicle-item {
        width: 100%;
        padding: 8px;
    }
    .vehicle-item img {
        max-width: 120px;
        margin-bottom: 5px;
    }
    .vehicle-info h4 {
        font-size: 14px;
    }
    .vehicle-info p {
        font-size: 12px;
    }

    .map-container {
        margin: 15px 0;
    }
    #map {
        height: 300px;
    }
    .route-info {
        flex-direction: row;
        gap: 10px;
    }
    .info-box {
        padding: 10px;
    }
    .info-box .value {
        font-size: 20px;
    }
    .finalize-btn {
        margin-top: 15px;
    }
}