/* =========================
   AZIEL V2.5 PAYMENT GRID
   Shared Theme Compatible
========================= */

.payment-grid {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.pay-card {
    position: relative;

    min-height: 108px;
    padding: 16px 12px;

    border-radius: 20px;

    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);

    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    transition:
        transform var(--motion-duration-fast, .22s) var(--motion-ease-standard, ease),
        border-color var(--motion-duration-fast, .22s) var(--motion-ease-standard, ease),
        background-color var(--motion-duration-fast, .22s) var(--motion-ease-standard, ease),
        box-shadow var(--motion-duration-fast, .22s) var(--motion-ease-standard, ease);
}

.pay-card:hover {
    transform: translateY(-3px);
    border-color: rgba(168, 85, 247, .45);
    box-shadow: var(--shadow-md);
}

.pay-card.active {
    border-color: var(--primary);
    background: rgba(168, 85, 247, .14);
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, .35),
        0 0 22px rgba(168, 85, 247, .22);
}

.pay-card.active::after {
    content: "✓";

    position: absolute;
    top: 10px;
    right: 10px;

    width: 22px;
    height: 22px;

    border-radius: 50%;

    background: var(--success);
    color: #fff;

    display: grid;
    place-items: center;

    font-size: 12px;
    font-weight: 900;
}

.pay-logo,
.pay-card img {
    width: 58px;
    height: 42px;

    object-fit: contain;
    margin: 0;

    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .22));
}

.pay-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;

    text-align: center;
}

.pay-info span {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.auto-pay-badge,
.manual-pay-badge {
    padding: 4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 900;
}

.auto-pay-badge {
    color: var(--success);
    background: rgba(34, 197, 94, .12);
}

.manual-pay-badge {
    color: var(--warning);
    background: rgba(250, 204, 21, .12);
}

.pay-loading,
.pay-empty,
.pay-error {
    padding: 12px 0;

    color: var(--text-muted);
    font-size: 13px;
}

/* =========================
   QR CONFIRM MODAL
========================= */

.payment-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 16px;

    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(14px);
}

.payment-confirm-modal.show {
    display: flex;
}

.payment-confirm-box {
    transform: translateY(10px) scale(.985);
    transition:
        transform var(--motion-duration-normal, .25s) var(--motion-ease-emphasized, ease),
        opacity var(--motion-duration-normal, .25s) var(--motion-ease-enter, ease);
}

.payment-confirm-modal.show .payment-confirm-box {
    transform: translateY(0) scale(1);
}

.payment-confirm-box {
    position: relative;

    width: min(430px, 100%);
    max-height: 88vh;

    overflow-y: auto;

    padding: 20px;

    border-radius: 26px;

    color: var(--text);
    background: var(--surface-strong);
    border: 1px solid rgba(168, 85, 247, .35);

    box-shadow: var(--shadow-lg);
}

.payment-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background: var(--danger);
    color: #fff;

    font-size: 18px;
    cursor: pointer;
}

.payment-confirm-box h2 {
    margin: 0 42px 14px 0;

    color: var(--primary);
    font-size: 25px;
}

.payment-modal-summary {
    margin-bottom: 16px;
    padding: 14px;

    border-radius: 16px;

    background: var(--surface);
    border: 1px solid var(--border);
}

.payment-modal-summary p {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin: 7px 0;

    color: var(--text-muted);
    font-size: 13px;
}

.payment-modal-summary b {
    color: var(--text-muted);
}

.payment-modal-summary span {
    color: var(--text);
    font-weight: 800;
    text-align: right;
}

.payment-modal-qr {
    text-align: center;
}

#modalPaymentLogo {
    width: 90px;
    height: 46px;

    object-fit: contain;
    display: block;

    margin: 6px auto 10px;
}

#modalQrImage {
    width: 220px;
    height: 220px;
    max-width: 100%;

    display: block;
    margin: 12px auto;

    object-fit: contain;
    padding: 10px;

    background: #fff;
    border-radius: 18px;
}

#modalAccountName,
#modalAccountNumber {
    margin: 6px 0;

    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.payment-amount-big {
    margin: 10px auto 0;

    text-align: center;

    color: var(--warning);
    font-size: 28px;
    font-weight: 950;
}

.payment-timer {
    margin-top: 10px;

    text-align: center;

    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.payment-timer span {
    display: block;

    margin-top: 4px;

    color: var(--danger);
    font-size: 22px;
    font-weight: 950;
}

#confirmPaymentOrderBtn {
    width: 100%;
    height: 52px;

    margin-top: 14px;

    border: none;
    border-radius: 16px;

    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;

    font-weight: 900;
    cursor: default;

    animation: az-motion-soft-pulse 1.4s var(--motion-ease-standard, ease) infinite;
}

#confirmPaymentOrderBtn:disabled {
    opacity: .85;
}

@keyframes az-motion-soft-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .65;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
    .payment-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .pay-card {
        min-height: 58px;
        padding: 10px 14px;

        border-radius: 16px;

        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
    }

    .pay-logo,
    .pay-card img {
        width: 34px;
        height: 34px;
        max-width: 34px;
        max-height: 34px;
    }

    .pay-info {
        align-items: flex-start;
        text-align: left;
    }

    .pay-info span {
        font-size: 13px;
    }

    .auto-pay-badge,
    .manual-pay-badge {
        font-size: 9px;
        padding: 3px 7px;
    }

    .pay-card.active::after {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    .payment-confirm-box {
        width: 100%;
        border-radius: 24px;
        padding: 18px;
    }

    .payment-confirm-box h2 {
        font-size: 22px;
    }

    #modalQrImage {
        width: 210px;
        height: 210px;
    }
}
