/**
 * WC Instant Checkout — Base Styles
 *
 * Minimal and overridable. All classes are prefixed with "wcic-".
 * No !important — Oxygen styles take priority.
 */

/* ============================================
   Bouton "Acheter maintenant" (fiche produit)
   ============================================ */

.wcic-instant-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5em;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.5em;
    font-weight: 600;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================
   Résumé produit — [instant_checkout_summary]
   ============================================ */

.wcic-summary {
    margin-bottom: 1.5em;
}

.wcic-summary__product {
    display: flex;
    gap: 1.5em;
    align-items: flex-start;
}

.wcic-summary__image {
    flex-shrink: 0;
    width: 120px;
}

.wcic-summary__image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.wcic-summary__details {
    flex: 1;
}

.wcic-summary__title {
    margin: 0 0 0.25em;
    font-size: 1.25em;
}

.wcic-summary__description {
    margin-bottom: 0.5em;
    opacity: 0.8;
    font-size: 0.9em;
}

.wcic-summary__price {
    font-size: 1.35em;
    font-weight: 700;
}

.wcic-summary__subscription {
    margin-top: 0.25em;
    font-size: 0.85em;
    opacity: 0.7;
}

.wcic-summary__quantity {
    margin-top: 0.25em;
    font-size: 0.85em;
    opacity: 0.7;
}

/* ============================================
   Paiement — [instant_checkout_payment]
   ============================================ */

.wcic-payment {
    margin-top: 1.5em;
}

/* Hide WC elements we don't need on our mini-checkout */
.wcic-payment .woocommerce-form-coupon-toggle,
.wcic-payment .woocommerce-form-login-toggle,
.wcic-payment .checkout_coupon,
.wcic-payment .woocommerce-form-login,
.wcic-payment .woocommerce-info:not(.wc-stripe-express-checkout-info) {
    display: none;
}

/* Gateway list */
.wcic-payment .wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
}

.wcic-payment .wc_payment_method {
    margin-bottom: 0.75em;
    padding: 1em;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.wcic-payment .wc_payment_method label {
    cursor: pointer;
    font-weight: 600;
}

.wcic-payment .payment_box {
    margin-top: 0.75em;
    padding-top: 0.75em;
}

/* Submit button */
.wcic-payment__submit,
.wcic-payment .place-order button#place_order {
    width: 100%;
    padding: 0.85em 1.5em;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

/* Loading state: WC adds .processing to the form during submission */
.wcic-payment__form.processing .place-order button#place_order {
    opacity: 0.6;
    pointer-events: none;
}

/* Notices */
.wcic-notice {
    padding: 1em;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    text-align: center;
}

/* ============================================
   Order confirmation
   ============================================ */

.wcic-confirmation {
    text-align: center;
    padding: 2em 1em;
}

.wcic-confirmation .woocommerce-notice--success {
    padding: 1em 1.5em;
    margin-bottom: 1em;
    border-radius: 6px;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    font-size: 1.1em;
}

.wcic-confirmation__account {
    font-size: 0.95em;
    color: #555;
}

.wcic-confirmation__account a {
    font-weight: 600;
    text-decoration: underline;
}

.wcic-confirmation__ok {
    margin-top: 1.2em;
    padding: 0.7em 2.5em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

/* ============================================
   Modal (iframe checkout)
   ============================================ */

.wcic-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
}

.wcic-modal {
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    max-width: 800px;
    height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wcic-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    color: #666;
    z-index: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}

.wcic-modal__close:hover {
    color: #000;
}

.wcic-modal__loading {
    text-align: center;
    padding: 3em 1em;
    color: #888;
    font-size: 0.95em;
}

.wcic-modal__iframe {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
    display: block;
    transition: opacity 0.3s ease;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .wcic-summary__product {
        flex-direction: column;
        gap: 0.75em;
    }

    .wcic-summary__image {
        width: 100%;
        max-width: 200px;
    }
}
