/* Rapide Paye — bouton « Acheter maintenant » et page Commander */

/* ---- Bouton sur la page produit ---- */
.rp-buy-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 15px 20px;
    background: #111;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    border-radius: 10px;
    transition: background .2s, transform .15s;
    box-sizing: border-box;
    letter-spacing: 0.3px;
}
.rp-buy-now-btn:hover { background: #333; transform: translateY(-1px); }
.rp-buy-now-btn[hidden] { display: none; }

/* ---- Page Commander ---- */
.rp-checkout,
.rp-checkout *,
.rp-checkout *::before,
.rp-checkout *::after { box-sizing: border-box; }

.rp-checkout {
    --rp-color: #27ae60;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rp-empty { text-align: center; padding: 40px; color: #999; }
.rp-empty.rp-empty-error { color: #e74c3c; }

/* Carte produit */
.rp-product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 28px;
}
.rp-product-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}
.rp-product-name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}
.rp-product-qty { font-weight: 600; color: #999; }
.rp-product-price {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    color: #27ae60;
}

/* Résumé panier */
.rp-cart-summary {
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 28px;
}
.rp-cart-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rp-cart-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rp-cart-item { display: flex; align-items: center; gap: 10px; }
.rp-cart-item-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.rp-cart-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}
.rp-cart-item-qty { font-size: 13px; color: #999; flex-shrink: 0; }
.rp-cart-item-price { font-size: 14px; font-weight: 700; color: #27ae60; flex-shrink: 0; }
.rp-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 15px;
    color: #555;
}
.rp-cart-total strong { font-size: 18px; font-weight: 900; color: #1a1a1a; }

/* Titre d'étape */
.rp-step-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 18px;
    text-align: center;
}

/* Grille de paiement */
.rp-payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.rp-payment-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
    font-family: inherit;
    color: inherit;
}
.rp-payment-card:hover { border-color: #bbb; transform: translateY(-2px); background: #fff; }
.rp-payment-card:active { transform: translateY(0); }
.rp-payment-card:focus-visible { outline: none; border-color: var(--rp-card-color); box-shadow: 0 0 0 4px rgba(0,0,0,.08); }

/* Paiement à la livraison : carte pleine largeur sous Wave / Orange Money */
.rp-payment-card.rp-card-wide {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    padding: 16px;
    gap: 14px;
}
.rp-payment-card.rp-card-wide .rp-method-logo { width: 57px; }
.rp-payment-card.rp-card-wide .rp-payment-text { text-align: left; }

.rp-method-logo {
    width: 140px;
    height: 57px;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}
.rp-payment-text { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.rp-payment-label { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.rp-payment-desc { font-size: 12px; color: #aaa; line-height: 1.3; }

.rp-payment-card.selected {
    border-color: var(--rp-card-color);
    box-shadow: 0 0 0 4px rgba(0,0,0,.06);
}
.rp-card-rapide_wave.selected { background: #f0fdff; box-shadow: 0 0 0 4px rgba(29,195,224,.15); }
.rp-card-rapide_orange_money.selected { background: #fff8f2; box-shadow: 0 0 0 4px rgba(255,102,0,.15); }
.rp-card-rapide_livraison.selected { background: #f2fbf5; box-shadow: 0 0 0 4px rgba(39,174,96,.15); }
.rp-payment-check {
    display: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
}
.rp-payment-card.selected .rp-payment-check { display: block; }

/* Bouton retour */
.rp-back-btn {
    background: none !important;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    padding: 0 0 18px;
    display: block;
    font-family: inherit;
}
.rp-back-btn:hover { color: #444; }

/* Badge méthode choisie */
.rp-chosen-method {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 10px;
}
.rp-chosen-logo {
    width: 100px;
    height: 41px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}
.rp-chosen-product {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Champs */
.rp-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.rp-field { margin-bottom: 14px; }
.rp-field-group .rp-field { margin-bottom: 0; }
.rp-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
}
.rp-req { color: #e74c3c; }
.rp-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fafafa;
    color: #1a1a1a;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
}
.rp-field input:focus {
    outline: none;
    border-color: var(--rp-color);
    box-shadow: 0 0 0 3px rgba(39,174,96,.12);
    background: #fff;
}
.rp-field input.rp-input-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,.10);
}
.rp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Erreur */
.rp-error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5b7b7;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* Bouton de validation */
.rp-submit-btn {
    width: 100%;
    padding: 17px 24px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 18px rgba(39,174,96,.30);
    transition: background .2s, transform .15s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.rp-submit-btn:hover:not(:disabled) {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(39,174,96,.35);
}
.rp-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.rp-submit-spinner { display: inline-block; animation: rp-spin 0.8s linear infinite; font-size: 20px; }
@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp-privacy-note { margin: 14px 0 0; font-size: 12px; color: #bbb; text-align: center; }

/* Écran de succès */
#rp-screen-3 { text-align: center; padding: 20px 0; }
.rp-success-icon {
    width: 80px;
    height: 80px;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    font-size: 40px;
    line-height: 80px;
    text-align: center;
    margin: 10px auto 20px;
    animation: rp-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes rp-pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.rp-success-title { font-size: 26px; font-weight: 800; color: #1a1a1a; margin: 0 0 14px; }
.rp-success-msg { font-size: 16px; color: #555; line-height: 1.6; margin: 0 0 20px; }
.rp-success-details,
.rp-success-payment {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 24px;
    text-align: left;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}
.rp-success-details strong,
.rp-success-payment strong { color: #1a1a1a; }
.rp-success-payment p { margin: 0 0 8px; }
.rp-success-payment p:last-child { margin-bottom: 0; }
.rp-success-payment .rapide-paye-pay-button {
    display: inline-block;
    background: var(--rp-color);
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}
.rp-back-shop {
    display: inline-block;
    color: #27ae60;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid rgba(39,174,96,.3);
    padding-bottom: 2px;
    transition: border-color .2s;
}
.rp-back-shop:hover { border-color: #27ae60; }

@media (max-width: 380px) {
    .rp-payment-grid { grid-template-columns: 1fr; }
    .rp-field-group { grid-template-columns: 1fr; }
}
