/* ==========================================================================
   STYLES SPÉCIFIQUES À LA PAGE DE PAIEMENT (CHECKOUT)
   ========================================================================== */

/* 1. Conteneur et Disposition Générale
------------------------------------------*/
.checkout-container {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.checkout-container h1 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.checkout-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem; /* Espace entre le formulaire et le résumé */
}

/* Colonne principale du formulaire */
.customer-info {
    flex: 2; /* Prend 2/3 de la largeur */
    min-width: 320px;
}

/* Colonne latérale du résumé */
.checkout-summary {
    flex: 1; /* Prend 1/3 de la largeur */
    background-color: #FFFFFF;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    height: fit-content; /* S'adapte à la hauteur de son contenu */
    position: sticky;
    top: 120px; /* Colle sous le header lors du défilement */
}


/* 2. Sections du Formulaire
------------------------------------------*/
.customer-info section {
    margin-bottom: 2.5rem;
}

.customer-info h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-field.full-width {
    grid-column: 1 / -1; /* Le champ prend toute la largeur */
}

.form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

/* Style pour les options de paiement */
.payment-options {
    display: grid;
    gap: 1rem;
}

.payment-option {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.payment-option label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

/* Masque le bouton radio par défaut */
.payment-option input[type="radio"] {
    display: none;
}

/* Style de l'option au survol */
.payment-option:hover {
    border-color: var(--secondary-orange);
}

/* Style de l'option quand elle est sélectionnée */
/* Note: :has() est supporté par les navigateurs modernes */
.payment-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
    background-color: var(--cream);
}


/* 3. Résumé de la Commande
------------------------------------------*/
.checkout-summary h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-item img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.summary-item .item-info {
    flex-grow: 1;
    font-size: 0.95rem;
}

.summary-item .item-price {
    font-weight: 600;
    white-space: nowrap;
}

.checkout-summary hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 1.5rem 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Bouton de paiement */
.form-actions {
    margin-top: 2.5rem;
}

.btn-block {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* 4. Responsive
------------------------------------------*/
@media (max-width: 992px) {
    .checkout-layout {
        flex-direction: column-reverse; /* Le résumé passe en haut sur mobile */
    }

    .checkout-summary {
        position: static; /* Le résumé ne colle plus au scroll */
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr; /* Une seule colonne pour les champs */
    }
}