/* =============================================
   GD Custom Payments v2.0 — Divi Compatible
   ============================================= */

/* --- Trigger Button --- */
.gdcp-trigger {
    display: inline-block !important;
    padding: 15px 36px !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.15) !important;
    transition: transform .25s, box-shadow .25s !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
.gdcp-trigger:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
}

/* --- Overlay ---
   position:fixed + z-index:2147483647 (max 32-bit)
   ensures it floats above EVERYTHING including
   Divi headers, footers, and page containers.
   ============================================= */
.gdcp-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(10,15,30,.55) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2147483647 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 24px 12px !important;
    animation: gdcpFade .3s;
    /* Reset any inherited transforms from Divi */
    transform: none !important;
    will-change: auto !important;
}

/* --- Modal --- */
.gdcp-modal {
    background: #fff !important;
    width: 95%;
    max-width: 580px;
    margin: 0 auto;
    border-radius: 22px;
    box-shadow: 0 24px 64px -16px rgba(0,0,0,.32);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
    animation: gdcpSlide .35s ease;
    /* Reset Divi inherited styles */
    color: #1a1f36 !important;
    text-align: left !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* --- Close --- */
.gdcp-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.18);
    color: rgba(255,255,255,.85);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    line-height: 1;
    padding: 0;
}
.gdcp-close:hover {
    background: rgba(255,255,255,.3);
    color: #fff;
    transform: rotate(90deg);
}

/* --- Header --- */
.gdcp-header {
    padding: 32px 28px 24px;
    text-align: center;
    border-radius: 22px 22px 0 0;
    position: relative;
    overflow: hidden;
}
.gdcp-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.gdcp-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255,255,255,.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.gdcp-header h2 {
    margin: 0 0 6px !important;
    color: #fff !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    position: relative;
    z-index: 1;
    letter-spacing: -.3px;
    text-transform: none !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}
.gdcp-header p {
    margin: 0 !important;
    color: rgba(255,255,255,.78) !important;
    font-size: 13.5px !important;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    padding: 0 !important;
}

/* --- Body --- */
.gdcp-body { padding: 28px 28px 32px; }

/* --- Fields --- */
.gdcp-field { margin-bottom: 18px; }
.gdcp-field label {
    display: block !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    color: #1a1f36 !important;
    margin-bottom: 6px !important;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.gdcp-field input,
.gdcp-field textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 2px solid #e3e8ee !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    background: #f7f8fc !important;
    color: #1a1f36 !important;
    font-family: inherit;
    transition: all .2s;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none;
    margin: 0 !important;
    height: auto !important;
    line-height: 1.5 !important;
}
.gdcp-field input::placeholder,
.gdcp-field textarea::placeholder { color: #b0b7c3; }
.gdcp-field input:focus,
.gdcp-field textarea:focus {
    border-color: #0070ba !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0,112,186,.1) !important;
}
.gdcp-field textarea { resize: vertical; min-height: 64px; }

.gdcp-row { display: flex; gap: 14px; }
.gdcp-half { flex: 1; }

/* --- Amount --- */
.gdcp-amount-box { position: relative; }
.gdcp-dollar {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 800;
    color: #1a1f36;
    pointer-events: none;
    z-index: 1;
}
.gdcp-amount-box input {
    padding-left: 36px !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    height: 58px !important;
}

/* --- Summary --- */
.gdcp-summary {
    background: linear-gradient(135deg,#f0f7ff 0%,#f5f0ff 100%);
    border: 1px solid #d4e4f7;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 22px;
}
.gdcp-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
}
.gdcp-fee-row { color: #d97706; }
.gdcp-sum-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid rgba(0,112,186,.12);
    font-weight: 800;
    font-size: 20px;
    color: #1a1f36;
}

/* --- PayPal --- */
#gdcp-pp-area { margin-top: 8px; }
#gdcp-pp-buttons { min-height: 48px; }

/* --- Success --- */
#gdcp-success { text-align: center; padding: 20px 0; animation: gdcpFade .5s; }
.gdcp-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg,#00c853,#009624);
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,200,83,.25);
}
#gdcp-success h3 { color: #009624 !important; font-size: 22px !important; font-weight: 800 !important; margin: 0 0 6px !important; }
#gdcp-success > p { color: #3c4257 !important; font-size: 15px !important; margin: 0 0 20px !important; }

.gdcp-receipt {
    background: #f0fdf4;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
    text-align: left;
    border-left: 4px solid #00c853;
}
.gdcp-receipt div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #3c4257;
}
.gdcp-receipt div + div { border-top: 1px solid #d1fae5; }
.gdcp-receipt span { color: #6b7280; }
.gdcp-receipt strong { color: #1a1f36; font-size: 14px; word-break: break-all; }

/* --- WhatsApp --- */
.gdcp-wa-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg,#25D366,#128C7E) !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 14px 26px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 4px 16px rgba(37,211,102,.3);
    transition: all .25s;
}
.gdcp-wa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,.4);
    color: #fff !important;
}

/* --- Animations --- */
@keyframes gdcpFade { from{opacity:0} to{opacity:1} }
@keyframes gdcpSlide { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* --- Responsive --- */
@media (max-width:600px) {
    .gdcp-row { flex-direction: column; gap: 0; }
    .gdcp-half { margin-bottom: 18px; }
    .gdcp-overlay { padding: 0 !important; }
    .gdcp-modal { width: 100%; min-height: 100%; border-radius: 0; }
    .gdcp-header { border-radius: 0; padding: 26px 22px 20px; }
    .gdcp-body { padding: 22px 18px 36px; }
    .gdcp-amount-box input { font-size: 20px !important; height: 52px !important; }
    .gdcp-sum-total { font-size: 18px; }
}
