/* GarnetPay — "Choose how to pay" chooser + assisted-request flow.
 * Self-contained overlay; no markup required in page templates. */

.gpay-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(17, 17, 17, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0;
}
.gpay-overlay.is-open { opacity: 1; }

.gpay-sheet {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(24px);
    transition: transform 0.25s ease;
    -webkit-overflow-scrolling: touch;
}
.gpay-overlay.is-open .gpay-sheet { transform: translateY(0); }

@media (min-width: 640px) {
    .gpay-overlay { align-items: center; padding: 1.5rem; }
    .gpay-sheet { border-radius: 20px; }
}

/* On phones the chooser fills the screen like a dedicated page (popups/sheets
   are awkward to use on mobile). */
@media (max-width: 639px) {
    .gpay-overlay { align-items: stretch; padding: 0; }
    .gpay-sheet {
        max-width: 100%;
        border-radius: 0;
        max-height: none;
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        box-shadow: none;
    }
    .gpay-head {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
        padding-top: 1.6rem;
        border-bottom: 1px solid #f1f1f1;
    }
}

.gpay-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.4rem 0.5rem;
}
.gpay-title { font-size: 1.2rem; font-weight: 800; color: #171717; margin: 0; }
.gpay-sub { font-size: 0.85rem; color: #6b7280; margin: 0.25rem 0 0; }
.gpay-close {
    background: #f3f4f6;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    flex-shrink: 0;
}
.gpay-close:hover { background: #e5e7eb; }

.gpay-body { padding: 0.75rem 1.4rem 1.6rem; }

/* Method list */
.gpay-methods { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.5rem 0 0; }
.gpay-method {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.gpay-method:hover { border-color: #b91c1c; background: #fffafa; }
.gpay-method__icon {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 10px;
    display: grid; place-items: center;
    background: #f3f4f6; color: #b91c1c;
}
.gpay-method__icon svg { width: 22px; height: 22px; }
.gpay-method__body { flex: 1; min-width: 0; }
.gpay-method__label { font-size: 0.95rem; font-weight: 700; color: #171717; margin: 0; }
.gpay-method__desc { font-size: 0.8rem; color: #6b7280; margin: 0.15rem 0 0; }
.gpay-method__badge {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 2px 8px; border-radius: 20px; margin-left: auto; flex-shrink: 0;
}
.gpay-method__badge--online { background: #e7f5ea; color: #1a7f37; }
.gpay-method__badge--assisted { background: #eef2ff; color: #3538cd; }
.gpay-method__chev { color: #9ca3af; flex-shrink: 0; }

/* Contact form */
.gpay-form { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.6rem; }
.gpay-field label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 0.3rem; }
.gpay-field input, .gpay-field textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #171717;
    box-sizing: border-box;
}
.gpay-field input:focus, .gpay-field textarea:focus { outline: none; border-color: #b91c1c; }
.gpay-field textarea { resize: vertical; min-height: 64px; }

.gpay-summary {
    background: #f9fafb;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    color: #4b5563;
    margin-bottom: 0.4rem;
}
.gpay-summary strong { color: #171717; }

.gpay-btn {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    background: #b91c1c;
    color: #fff;
    transition: background 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1.2;
}
.gpay-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.gpay-btn:hover { background: #991b1b; }
.gpay-btn[disabled] { opacity: 0.6; cursor: default; }
.gpay-btn--ghost { background: #f3f4f6; color: #374151; }
.gpay-btn--ghost:hover { background: #e5e7eb; }
.gpay-btn--wa { background: #25d366; }
.gpay-btn--wa:hover { background: #1eb457; }

.gpay-back {
    background: none; border: 0; color: #6b7280; font-size: 0.85rem;
    cursor: pointer; padding: 0; margin-bottom: 0.6rem; display: inline-flex; align-items: center; gap: 0.3rem;
}
.gpay-back:hover { color: #171717; }

.gpay-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.85rem; margin-top: 0.2rem;
}

.gpay-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }

/* Acknowledgment */
.gpay-ack { text-align: center; padding: 0.5rem 0 0.2rem; }
.gpay-ack__icon {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem;
    background: #e7f5ea; color: #1a7f37; display: grid; place-items: center;
}
.gpay-ack__icon svg { width: 34px; height: 34px; }
.gpay-ack__title { font-size: 1.15rem; font-weight: 800; color: #171717; margin: 0 0 0.4rem; }
.gpay-ack__text { font-size: 0.9rem; color: #4b5563; margin: 0 auto 0.4rem; max-width: 380px; }
.gpay-ack__ref { font-size: 0.8rem; color: #6b7280; margin-bottom: 1.1rem; }
.gpay-ack__ref code { background: #f3f4f6; padding: 2px 8px; border-radius: 6px; color: #171717; font-weight: 700; }

.gpay-spin { animation: gpay-spin 0.9s linear infinite; }
@keyframes gpay-spin { to { transform: rotate(360deg); } }
