/**
 * Ridni Express Pay — Google Pay Button Styles.
 *
 * Modified Layout: Google Pay button injected directly next to
 * the "Підтримати" submit button for a unified side-by-side design.
 */

/* ─────────── Express Section Wrapper ─────────── */

.ridni-express-pay-wrap {
    width: 100%;
    margin: 16px 0 12px;
    box-sizing: border-box;
}

.ridni-express-heading {
    font-size: 16px;
    font-weight: 500;
    color: var(--e-global-color-adafd37);
    margin-top: 20px;
    padding-bottom: 15px;
}

/* ─────────── Google Pay Button — FULL WIDTH ─────────── */

.ridni-express-pay-buttons {
    width: 100%;
}

.ridni-express-btn {
    width: 100% !important;
    min-width: 100% !important;
    height: 48px;
    box-sizing: border-box;
}

/* ─────────── Side-by-Side Flex Layout (.wcdp-has-gpay) ─────────── */
.wcdp-has-gpay {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    /* Align bottom because submit natively has margin-top:30px */
    justify-content: space-between;
    flex-direction: row !important;
}

.wcdp-has-gpay .wcdp-button {
    flex: 1 1 200px;
    max-width: 100%;
    order: 2;
    /* Force Standard Button to the Right */
}

.wcdp-has-gpay #ridni-express-pay-container {
    margin: 30px 0 0 0;
    padding: 0;
    flex: 1 1 200px;
    max-width: 100%;
    order: 1;
    /* Force Google Pay Button to the Left */
}

.wcdp-has-gpay .ridni-express-heading {
    display: none;
    /* Hide heading when side-by-side with submit button */
}

/* Identical height (60px) and rounded corners (33px) for perfect match */
.wcdp-has-gpay .ridni-express-btn,
.wcdp-has-gpay .ridni-express-btn .gpay-button-fill,
.wcdp-has-gpay .ridni-express-btn .gpay-button {
    height: 60px !important;
    border-radius: 33px !important;
    min-width: 100% !important;
    width: 100% !important;
}

/* ─────────── Responsive ─────────── */
@media (max-width: 600px) {

    .wcdp-has-gpay {
        flex-direction: column;
        align-items: stretch;
    }

    .wcdp-has-gpay #ridni-express-pay-container {
        margin-top: 20px;
    }

    .wcdp-has-gpay .wcdp-button {
        margin-top: 0 !important;
        width: 100% !important;
    }

    .ridni-express-btn,
    .ridni-express-btn>button,
    .ridni-express-btn>div,
    .ridni-express-btn .gpay-button {
        height: 60px !important;
        /* Keep large tap target on mobile */
        border-radius: 33px !important;
    }
}

/* ─────────── Protect Google Pay Button from Theme/Form CSS ─────────── */
/* Ensure aggressive external form CSS does NOT break the Google Pay button layout */
form.wcdp-form button.gpay-button,
.zbir-form button.gpay-button,
.wcdp-has-gpay button.gpay-button {
    margin: 0 !important;
    border: 0 !important;
    min-width: 0 !important;
    font-size: inherit !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Restore the correct background color since we override all backgrounds above */
form.wcdp-form button.gpay-button.black,
.zbir-form button.gpay-button.black,
.wcdp-has-gpay button.gpay-button.black {
    background-color: #000 !important;
}

form.wcdp-form button.gpay-button.white,
.zbir-form button.gpay-button.white,
.wcdp-has-gpay button.gpay-button.white {
    background-color: #fff !important;
}