/* DGateway Checkout & Modal Styles */

/* ------------------------------------------------------------------ */
/*  Modal Overlay                                                       */
/* ------------------------------------------------------------------ */

.dgw-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: dgw-fadeIn 0.2s ease;
}

@keyframes dgw-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ------------------------------------------------------------------ */
/*  Modal Container                                                     */
/* ------------------------------------------------------------------ */

.dgw-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: dgw-slideUp 0.3s ease;
}

@keyframes dgw-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------------------------------------------ */
/*  Header                                                              */
/* ------------------------------------------------------------------ */

.dgw-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px 0;
    gap: 10px;
}

.dgw-modal-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.dgw-modal-close {
    margin-left: auto;
}

.dgw-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.dgw-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
}

.dgw-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ------------------------------------------------------------------ */
/*  Amount Display                                                      */
/* ------------------------------------------------------------------ */

.dgw-modal-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin: 12px 24px;
    background: #f9fafb;
    border-radius: 10px;
}

.dgw-modal-amount-label {
    font-size: 14px;
    color: #6b7280;
}

.dgw-modal-amount-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

/* ------------------------------------------------------------------ */
/*  Body                                                                */
/* ------------------------------------------------------------------ */

.dgw-modal-body {
    padding: 0 24px 24px;
}

/* ------------------------------------------------------------------ */
/*  Method Selection                                                    */
/* ------------------------------------------------------------------ */

.dgw-modal-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dgw-modal-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.dgw-modal-method:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.dgw-modal-method-icon {
    font-size: 28px;
}

.dgw-modal-method-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.dgw-modal-method-desc {
    font-size: 12px;
    color: #9ca3af;
}

/* ------------------------------------------------------------------ */
/*  Phone Input Form                                                    */
/* ------------------------------------------------------------------ */

.dgw-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.dgw-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.dgw-modal-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.dgw-modal-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 6px 0 16px;
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                             */
/* ------------------------------------------------------------------ */

.dgw-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.dgw-modal-btn-primary {
    background: #4f46e5;
    color: #fff;
}

.dgw-modal-btn-primary:hover {
    background: #4338ca;
}

.dgw-modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dgw-modal-btn-retry {
    background: #e5e7eb;
    color: #374151;
}

.dgw-modal-btn-retry:hover {
    background: #d1d5db;
}

/* ------------------------------------------------------------------ */
/*  Processing / Status States                                          */
/* ------------------------------------------------------------------ */

.dgw-modal-processing,
.dgw-modal-success,
.dgw-modal-failed {
    text-align: center;
    padding: 24px 0;
}

.dgw-modal-processing p,
.dgw-modal-success p,
.dgw-modal-failed p {
    margin: 8px 0;
    font-size: 14px;
    color: #6b7280;
}

.dgw-modal-processing h3,
.dgw-modal-success h3,
.dgw-modal-failed h3 {
    margin: 12px 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* Spinner */
.dgw-modal-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: dgw-spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes dgw-spin {
    to { transform: rotate(360deg); }
}

/* Success check */
.dgw-modal-check {
    width: 56px;
    height: 56px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 28px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

/* Failed X */
.dgw-modal-x {
    width: 56px;
    height: 56px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 28px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.dgw-modal-ref {
    font-size: 12px;
    color: #9ca3af;
    word-break: break-all;
}

/* ------------------------------------------------------------------ */
/*  Error                                                               */
/* ------------------------------------------------------------------ */

.dgw-modal-error {
    margin: 0 24px 12px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 13px;
}

/* ------------------------------------------------------------------ */
/*  Stripe Element Container                                            */
/* ------------------------------------------------------------------ */

#dgw-stripe-element {
    min-height: 80px;
    padding: 4px 0;
}

/* ------------------------------------------------------------------ */
/*  Shortcode: Pay Button                                               */
/* ------------------------------------------------------------------ */

.dgw-pay-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.dgw-pay-button:hover {
    background: #4338ca;
}

/* ------------------------------------------------------------------ */
/*  Shortcode: Donation Form                                            */
/* ------------------------------------------------------------------ */

.dgw-donation-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.dgw-donation-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.dgw-donation-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px;
}

.dgw-donation-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.dgw-donation-amount-btn {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
}

.dgw-donation-amount-btn:hover,
.dgw-donation-amount-btn.active {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4f46e5;
}

.dgw-donation-custom {
    margin-bottom: 16px;
}

.dgw-donation-custom input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.dgw-donation-fields {
    margin-bottom: 16px;
}

.dgw-donation-fields input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.dgw-donation-submit {
    width: 100%;
    padding: 12px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.dgw-donation-submit:hover {
    background: #4338ca;
}

/* ------------------------------------------------------------------ */
/*  Shortcode: Product Card                                             */
/* ------------------------------------------------------------------ */

.dgw-product-card {
    max-width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.dgw-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.dgw-product-body {
    padding: 16px;
}

.dgw-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.dgw-product-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

.dgw-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dgw-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.dgw-product-buy {
    padding: 8px 20px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.dgw-product-buy:hover {
    background: #4338ca;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
    .dgw-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 85vh;
    }

    .dgw-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .dgw-modal-methods {
        grid-template-columns: 1fr;
    }

    .dgw-modal-amount-value {
        font-size: 18px;
    }
}
