/*
 * Better Payment Selector
 * The original OP3 select element remains in the DOM and retains all OptimizeCheckouts behavior.
 * We hide only its OP3 element after the replacement UI is successfully created.
 */
.opg-bps-original-field {
    display: none !important;
}

.opg-bps-ui {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.opg-bps-provider-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
}

.opg-bps-provider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    width: 100%;
    padding: 11px 38px 11px 14px;
    box-sizing: border-box;
    border: 2px solid #d7dce3;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.opg-bps-provider:hover {
    border-color: #8da9cf;
}

.opg-bps-provider:focus-visible {
    outline: 2px solid #0071ff;
    outline-offset: 2px;
}

.opg-bps-provider.is-selected {
    border-color: #0071ff;
    background: #f5f9ff;
    box-shadow: 0 0 0 1px rgba(0, 113, 255, .08);
}

.opg-bps-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 30px;
    color: #1c5fb8;
}

.opg-bps-card-icon svg {
    display: block;
    width: 30px;
    height: 23px;
}

.opg-bps-paypal-logo {
    display: block;
    flex: 0 0 auto;
    width: auto;
    max-width: 70px;
    height: 25px;
    object-fit: contain;
}

.opg-bps-paypal-wordmark {
    flex: 0 0 auto;
    color: #003087;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.opg-bps-check {
    position: absolute;
    top: 50%;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0071ff;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: translateY(-50%) scale(.85);
    transition: opacity .16s ease, transform .16s ease;
}

.opg-bps-provider.is-selected .opg-bps-check {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.opg-bps-card-chooser-wrap {
    margin-top: 10px;
}

.opg-bps-card-chooser-wrap[hidden] {
    display: none !important;
}

.opg-bps-card-chooser-label {
    display: block;
    margin: 0 0 6px;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
}

.opg-bps-card-chooser {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 8px 38px 8px 12px;
    box-sizing: border-box;
    border: 1px solid #cfd5dd;
    border-radius: 6px;
    background-color: #fff;
    color: #222;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.3;
}

@media (max-width: 520px) {
    .opg-bps-provider-options {
        grid-template-columns: 1fr;
    }
}

/* v0.1.5: keep provider labels on one line in narrow OP checkout columns. */
.opg-bps-provider {
    gap: 7px;
    padding: 10px 32px 10px 10px;
    font-size: 14px;
}

.opg-bps-provider-text {
    min-width: 0;
    white-space: nowrap;
}

.opg-bps-paypal-logo {
    max-width: 48px;
    height: 20px;
}

.opg-bps-paypal-wordmark {
    font-size: 15px;
    white-space: nowrap;
}

.opg-bps-check {
    right: 9px;
}

@media (max-width: 620px) {
    .opg-bps-provider {
        font-size: 13px;
        gap: 6px;
        padding-left: 8px;
        padding-right: 29px;
    }

    .opg-bps-card-icon,
    .opg-bps-card-icon svg {
        width: 26px;
    }

    .opg-bps-paypal-logo {
        max-width: 44px;
        height: 18px;
    }
}


/* v0.1.6: reclaim horizontal room and give the PayPal mark more visual weight. */
.opg-bps-provider-options {
    gap: 8px;
}

.opg-bps-provider {
    gap: 5px;
    padding-left: 7px;
    padding-right: 26px;
}

.opg-bps-paypal-logo {
    max-width: 60px;
    height: 28px;
}

.opg-bps-check {
    right: 6px;
    width: 18px;
    height: 18px;
    font-size: 11px;
}

@media (max-width: 620px) {
    .opg-bps-provider {
        gap: 4px;
        padding-left: 5px;
        padding-right: 24px;
    }

    .opg-bps-paypal-logo {
        max-width: 56px;
        height: 26px;
    }
}


/* v0.1.7: increase PayPal branding by roughly 45% for better visual balance. */
.opg-bps-paypal-logo {
    max-width: 87px;
    height: 40px;
}

@media (max-width: 620px) {
    .opg-bps-paypal-logo {
        max-width: 81px;
        height: 38px;
    }
}


/* v0.1.8: match the card icon-to-label spacing to the PayPal option. */
.opg-bps-card-icon {
    margin-right: 5px;
}
