/**
 * PDP BNPL block. Colors/spacing/behavior match the approved mockup
 * (egygamer-pdp-bnpl-mockup.html). Uses logical CSS properties throughout
 * (margin-inline-*, padding-inline-*, text-align: start/end) so it mirrors
 * correctly for the Arabic storefront, which flips via `body { direction: rtl }`
 * in the egygamer_rtl theme — no [dir] attribute is set on <html> here, so
 * we rely on the inherited `direction` value rather than [dir="rtl"] selectors.
 * Font-family intentionally inherits the theme's existing stack instead of the
 * mockup's Poppins/Inter, to stay consistent with the rest of the PDP and avoid
 * an extra external font request.
 */
:root {
    --bnpl-blue: #1e6fe0;
    --bnpl-blue-tint: #eaf2ff;
    --bnpl-blue-tint-2: #dfeaff;
    --bnpl-ink: #161c2b;
    --bnpl-gray: #6b7686;
    --bnpl-gray-light: #9aa4b2;
    --bnpl-border: #e6eaf1;
    --bnpl-green: #1c9a5b;
    --bnpl-navy: #0b2e64;
    --bnpl-warn: #a8660a;
}

.egygamer-bnpl {
    margin: 14px 0 18px;
    border: 1px solid var(--bnpl-blue-tint-2);
    background: var(--bnpl-blue-tint);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.egygamer-bnpl:hover,
.egygamer-bnpl:focus {
    background: #e0edff;
    border-color: #c7dcff;
    outline: none;
}

.egygamer-bnpl:focus-visible {
    outline: 2px solid var(--bnpl-blue);
    outline-offset: 2px;
}

.egygamer-bnpl .bnpl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.egygamer-bnpl .bnpl-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.egygamer-bnpl .bnpl-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--bnpl-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.egygamer-bnpl .bnpl-icon svg {
    width: 15px;
    height: 15px;
}

.egygamer-bnpl .bnpl-text {
    font-size: 13.5px;
    line-height: 1.4;
}

.egygamer-bnpl .bnpl-headline {
    font-weight: 700;
    color: var(--bnpl-ink);
}

.egygamer-bnpl .muted {
    color: var(--bnpl-gray);
}

.egygamer-bnpl .bnpl-chevron {
    color: var(--bnpl-blue);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.egygamer-bnpl .chevron-glyph {
    display: inline-block;
}

.egygamer-bnpl .bnpl-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(30, 111, 224, .14);
}

.egygamer-bnpl .logo-chip {
    background: #fff;
    border: 1px solid var(--bnpl-border);
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
}

.egygamer-bnpl .logo-chip-more {
    font-size: 10.5px;
    color: var(--bnpl-gray-light);
    display: flex;
    align-items: center;
    padding: 3px 4px;
    font-weight: 600;
}

/* ---------- MODAL ---------- */
.egygamer-bnpl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 20, 40, .45);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 900;
}

.egygamer-bnpl-overlay.open {
    display: flex;
}

body.egygamer-bnpl-open {
    overflow: hidden;
}

.egygamer-bnpl-modal {
    background: #fff;
    width: 100%;
    max-width: 560px;
    border-radius: 16px 16px 0 0;
    padding: 22px 22px 26px;
    max-height: 82vh;
    overflow-y: auto;
    animation: egygamer-bnpl-slide-up .22s ease;
}

@keyframes egygamer-bnpl-slide-up {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.egygamer-bnpl-modal .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.egygamer-bnpl-modal .modal-title {
    font-size: 17px;
    font-weight: 600;
}

.egygamer-bnpl-modal .modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--bnpl-gray-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.egygamer-bnpl-modal .modal-sub {
    font-size: 12.5px;
    color: var(--bnpl-gray);
    margin-bottom: 16px;
}

/* Two stacked groups: BNPL apps, then bank-card instalments. They are
   separated because eligibility differs — one needs a provider account, the
   other a credit card from a participating bank. */
.egygamer-bnpl-modal .bnpl-section + .bnpl-section {
    margin-top: 22px;
}

.egygamer-bnpl-modal .bnpl-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--bnpl-gray);
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--bnpl-border);
}

.egygamer-bnpl-modal .provider-card {
    border: 1px solid var(--bnpl-border);
    border-radius: 9px;
    padding: 13px 14px;
    margin-bottom: 9px;
}

.egygamer-bnpl-modal .provider-card:last-of-type {
    margin-bottom: 2px;
}

.egygamer-bnpl-modal .provider-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Per-tenor breakdown, shown only when a provider offers more than one plan
   (typical for bank cards: 6 / 12 / 18 / 24 / 36 months). */
.egygamer-bnpl-modal .provider-plans {
    list-style: none;
    margin: 11px 0 0;
    padding: 9px 0 0;
    border-top: 1px dashed var(--bnpl-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.egygamer-bnpl-modal .provider-plan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}

.egygamer-bnpl-modal .plan-term {
    color: var(--bnpl-gray);
}

.egygamer-bnpl-modal .plan-amount {
    color: var(--bnpl-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.egygamer-bnpl-modal .plan-suffix {
    color: var(--bnpl-gray-light);
    font-weight: 400;
    margin-inline-start: 3px;
}

.egygamer-bnpl-modal .plan-rate {
    color: var(--bnpl-warn, #a8660a);
    font-weight: 600;
    margin-inline-start: 5px;
}

.egygamer-bnpl-modal .provider-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.egygamer-bnpl-modal .provider-badge {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
    text-align: center;
}

.egygamer-bnpl-modal .provider-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bnpl-ink);
}

.egygamer-bnpl-modal .provider-terms {
    font-size: 11.5px;
    color: var(--bnpl-gray);
    margin-top: 2px;
}

.egygamer-bnpl-modal .provider-amount {
    text-align: end;
}

.egygamer-bnpl-modal .provider-amount .num {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--bnpl-ink);
}

.egygamer-bnpl-modal .provider-amount .per {
    font-size: 10.5px;
    color: var(--bnpl-gray-light);
}

.egygamer-bnpl-modal .provider-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-inline-start: 8px;
    text-transform: uppercase;
    display: inline-block;
}

.egygamer-bnpl-modal .tag-0 {
    background: #e6f7ee;
    color: var(--bnpl-green);
}

.egygamer-bnpl-modal .modal-footnote {
    font-size: 11px;
    color: var(--bnpl-gray-light);
    margin-top: 14px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .egygamer-bnpl-modal {
        padding: 18px 16px 22px;
        max-height: 88vh;
    }
}
