
/* =========================================================
   AGAPE SHOP — CHECKOUT
========================================================= */

.checkout-page {
    width: min(
        calc(100% - 40px),
        1200px
    );

    margin: 0 auto;

    padding: 55px 0 80px;
}


/* =========================================================
   TITRE
========================================================= */

.checkout-page h1 {
    margin-bottom: 10px;

    color: #111827;

    font-size: clamp(
        2rem,
        4vw,
        2.8rem
    );

    font-weight: 800;

    letter-spacing: -0.03em;
}

.checkout-page > p {
    margin-bottom: 35px;

    color: #6b7280;
}


/* =========================================================
   STRUCTURE
========================================================= */

.checkout-container,
.checkout-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(320px, 0.8fr);

    align-items: start;

    gap: 30px;
}


/* =========================================================
   BLOCS
========================================================= */

.checkout-card,
.checkout-form,
.checkout-summary,
.order-summary {
    padding: 28px;

    border: 1px solid #e5e7eb;

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 8px 25px rgba(
            15,
            23,
            42,
            0.07
        );
}

.checkout-card h2,
.checkout-form h2,
.checkout-summary h2,
.order-summary h2 {
    margin-bottom: 22px;

    color: #111827;

    font-size: 1.25rem;

    font-weight: 800;
}


/* =========================================================
   FORMULAIRE
========================================================= */

.checkout-form {
    display: flex;

    flex-direction: column;

    gap: 18px;
}

.checkout-form label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 0.85rem;

    font-weight: 700;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;

    min-height: 46px;

    padding: 0 13px;

    border: 1px solid #d1d5db;

    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #111827;

    font-family: inherit;

    font-size: 0.92rem;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.checkout-form textarea {
    min-height: 110px;

    padding-top: 12px;

    resize: vertical;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
    border-color: #c62828;

    box-shadow:
        0 0 0 3px rgba(
            198,
            40,
            40,
            0.10
        );
}


/* =========================================================
   GRILLE FORMULAIRE
========================================================= */

.form-row {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 15px;
}


/* =========================================================
   RÉSUMÉ
========================================================= */

.checkout-summary,
.order-summary {
    position: sticky;

    top: 110px;
}

.checkout-summary h2,
.order-summary h2 {
    padding-bottom: 18px;

    border-bottom: 1px solid #e5e7eb;
}


/* =========================================================
   PRODUITS DU RÉSUMÉ
========================================================= */

.checkout-product,
.summary-product,
.order-summary-item {
    display: flex;

    align-items: center;

    gap: 13px;

    padding: 13px 0;

    border-bottom: 1px solid #f1f5f9;
}

.checkout-product:last-child,
.summary-product:last-child,
.order-summary-item:last-child {
    border-bottom: none;
}

.checkout-product img,
.summary-product img,
.order-summary-item img {
    width: 58px;

    height: 58px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 9px;

    background: #f8fafc;
}

.checkout-product-info,
.summary-product-info {
    flex: 1;

    min-width: 0;
}

.checkout-product-name,
.summary-product-name {
    display: block;

    margin-bottom: 3px;

    overflow: hidden;

    color: #111827;

    font-size: 0.85rem;

    font-weight: 700;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.checkout-product-quantity,
.summary-product-quantity {
    color: #6b7280;

    font-size: 0.78rem;
}

.checkout-product-price,
.summary-product-price {
    color: #111827;

    font-size: 0.88rem;

    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   TOTAUX
========================================================= */

.checkout-totals {
    margin-top: 15px;

    padding-top: 15px;

    border-top: 1px solid #e5e7eb;
}

.checkout-total-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 10px;

    color: #6b7280;

    font-size: 0.9rem;
}

.checkout-total-row.total {
    margin-top: 15px;

    padding-top: 15px;

    border-top: 1px solid #e5e7eb;

    color: #111827;

    font-size: 1.15rem;

    font-weight: 800;
}


/* =========================================================
   PAIEMENT
========================================================= */

.payment-method {
    margin-top: 20px;

    padding: 16px;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    background: #f8fafc;
}

.payment-method-title {
    margin-bottom: 6px;

    color: #111827;

    font-size: 0.9rem;

    font-weight: 800;
}

.payment-method-text {
    margin: 0;

    color: #6b7280;

    font-size: 0.8rem;
}


/* =========================================================
   BOUTON PAIEMENT
========================================================= */

.checkout-submit,
.checkout-button,
.btn-checkout {
    width: 100%;

    min-height: 54px;

    margin-top: 20px;

    padding: 0 20px;

    border: none;

    border-radius: 10px;

    background: #c62828;

    color: #ffffff;

    font-family: inherit;

    font-size: 0.95rem;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 8px 18px rgba(
            198,
            40,
            40,
            0.20
        );

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.checkout-submit:hover,
.checkout-button:hover,
.btn-checkout:hover {
    background: #a61f1f;

    color: #ffffff;

    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(
            198,
            40,
            40,
            0.28
        );
}


/* =========================================================
   SÉCURITÉ
========================================================= */

.checkout-security {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    margin-top: 15px;

    color: #6b7280;

    font-size: 0.75rem;

    text-align: center;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 850px) {

    .checkout-container,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary,
    .order-summary {
        position: static;

        order: -1;
    }
}


@media (max-width: 600px) {

    .checkout-page {
        width: calc(100% - 30px);

        padding: 35px 0 60px;
    }

    .checkout-card,
    .checkout-form,
    .checkout-summary,
    .order-summary {
        padding: 20px;

        border-radius: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
