/* =============================================
   Wave CI Payment — Styles Front-End v2.1
   ============================================= */

/* ---- Bouton principal ---- */
.wave-ci-payment-wrapper {
    display: inline-block;
}

.wave-ci-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1BB8E4;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(27,184,228,0.35);
    font-family: inherit;
}

.wave-ci-pay-btn:hover {
    background: #14a4cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(27,184,228,0.45);
}

.wave-ci-pay-btn:active  { transform: translateY(0); }
.wave-ci-pay-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.wave-ci-logo svg { display: block; }

.wave-ci-amount {
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 13px;
}

/* ---- La div .wave-ci-modal dans le shortcode reste cachée.
        Le portail #wave-ci-portal est injecté dans <body> par le JS. ---- */
.wave-ci-modal { display: none !important; }

/* =============================================
   PORTAIL — injecté directement dans <body>
   pour échapper aux contextes de rendu du thème
   (transform, filter, will-change, isolation…)
   ============================================= */
#wave-ci-portal {
    /* Caché par défaut — affiché uniquement via .is-open */
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2147483647 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    transform: none !important;
    filter: none !important;
    -webkit-transform: none !important;
    -webkit-filter: none !important;
}

/* Ouvert uniquement quand la classe .is-open est présente */
#wave-ci-portal.is-open {
    display: flex !important;
}

/* Overlay sombre derrière la box */
#wave-ci-portal .wave-ci-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.62) !important;
    z-index: -1 !important;
    cursor: pointer;
}

/* Bloquer le scroll du body */
body.wave-ci-open {
    overflow: hidden !important;
}

/* ---- Modal box ---- */
.wave-ci-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.30);
    animation: waveCiIn 0.22s ease;
    z-index: 1;

    /* Neutralise tout héritage indésirable */
    transform: none;
    filter: none;
}

@keyframes waveCiIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.wave-ci-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.wave-ci-modal-close:hover { background: #e5e7eb; color: #111; }

.wave-ci-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.wave-ci-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a2e;
}

.wave-ci-modal-amount {
    font-size: 28px;
    font-weight: 700;
    color: #1BB8E4;
    margin-bottom: 8px;
}

.wave-ci-modal-desc {
    color: #555;
    font-size: 14px;
    margin: 0 0 20px;
}

.wave-ci-info {
    color: #444;
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.6;
}

/* ---- Boutons ---- */
.wave-ci-init-btn,
.wave-ci-open-app-btn,
.wave-ci-retry-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

.wave-ci-init-btn {
    background: #1BB8E4;
    color: #fff;
    box-shadow: 0 2px 8px rgba(27,184,228,0.3);
}
.wave-ci-init-btn:hover { background: #14a4cc; transform: translateY(-1px); }
.wave-ci-init-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.wave-ci-open-app-btn {
    background: #0e9e35;
    color: #fff !important;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(14,158,53,0.3);
}
.wave-ci-open-app-btn:hover { background: #0b8a2e; }

.wave-ci-retry-btn {
    background: #f0f0f0;
    color: #333;
    margin-top: 12px;
}
.wave-ci-retry-btn:hover { background: #e0e0e0; }

/* ---- Spinner ---- */
.wave-ci-loading { text-align: center; padding: 20px 0; }

.wave-ci-spinner {
    width: 40px; height: 40px;
    border: 4px solid #e0f7fd;
    border-top-color: #1BB8E4;
    border-radius: 50%;
    animation: waveCiSpin 0.75s linear infinite;
    margin: 0 auto 14px;
}
@keyframes waveCiSpin { to { transform: rotate(360deg); } }

/* ---- Status ---- */
.wave-ci-status-area { text-align: center; padding: 16px 0; }
.wave-ci-status-icon { font-size: 48px; margin-bottom: 12px; }
.wave-ci-status-message { font-size: 16px; color: #333; margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .wave-ci-modal-box { padding: 24px 18px 20px; }
    .wave-ci-modal-amount { font-size: 22px; }
    .wave-ci-pay-btn { font-size: 14px; padding: 10px 16px; }
}
