
/* =========================================================
   AE Stripe Checkout
   Premium checkout UI — rendered inside the Catalog modal
   ========================================================= */

.ae-stripe-checkout {
    --ae-stripe-primary: #3157a4;
    --ae-stripe-primary-hover: #264783;
    --ae-stripe-primary-soft: #eef3fc;

    --ae-stripe-text: #192438;
    --ae-stripe-muted: #6c778a;

    --ae-stripe-border: #e2e7ef;
    --ae-stripe-surface: #f7f9fc;
    --ae-stripe-white: #ffffff;

    --ae-stripe-danger: #a92b25;
    --ae-stripe-success: #18794e;

    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    color: var(--ae-stripe-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ae-stripe-checkout *,
.ae-stripe-checkout *::before,
.ae-stripe-checkout *::after {
    box-sizing: border-box;
}


/* =========================================================
   Header
   ========================================================= */

.ae-stripe-checkout__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--ae-stripe-border);
}

.ae-stripe-checkout__heading {
    min-width: 0;
}

.ae-stripe-checkout__title {
    margin: 0;
    color: var(--ae-stripe-text);
    font-size: clamp(1.45rem, 3vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.2;
}

.ae-stripe-checkout__subtitle {
    max-width: 440px;
    margin: 9px 0 0;
    color: var(--ae-stripe-muted);
    font-size: 0.94rem;
    line-height: 1.6;
}

.ae-stripe-checkout__cancel {
    flex-shrink: 0;
    padding: 9px 13px;
    border: 1px solid var(--ae-stripe-border);
    border-radius: 9px;
    background: var(--ae-stripe-white);
    color: var(--ae-stripe-text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 550;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.ae-stripe-checkout__cancel:hover {
    border-color: #c4cddd;
    background: var(--ae-stripe-surface);
}

.ae-stripe-checkout__cancel:focus-visible {
    outline: 3px solid rgb(49 87 164 / 25%);
    outline-offset: 3px;
}


/* =========================================================
   Section headings
   ========================================================= */

.ae-stripe-checkout__summary h3,
.ae-stripe-checkout__payment h3 {
    margin: 0 0 20px;
    color: var(--ae-stripe-text);
    font-size: 1.04rem;
    font-weight: 680;
    letter-spacing: -0.02em;
    line-height: 1.4;
}


/* =========================================================
   Order summary
   ========================================================= */

.ae-stripe-checkout__summary {
    min-width: 0;
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--ae-stripe-border);
    border-radius: 15px;
    background: var(--ae-stripe-surface);
}

.ae-stripe-checkout__items {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.ae-stripe-checkout__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    padding: 15px 0;
    border-bottom: 1px solid var(--ae-stripe-border);
}

.ae-stripe-checkout__item:first-child {
    padding-top: 0;
}

.ae-stripe-checkout__item:last-child {
    padding-bottom: 15px;
    border-bottom: 0;
}

.ae-stripe-checkout__item-description {
    min-width: 0;
    color: var(--ae-stripe-text);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.ae-stripe-checkout__item-price {
    flex-shrink: 0;
    color: var(--ae-stripe-text);
    font-size: 0.92rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ae-stripe-checkout__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid #d7deea;
}

.ae-stripe-checkout__total span {
    color: var(--ae-stripe-muted);
    font-size: 0.94rem;
    font-weight: 550;
}

.ae-stripe-checkout__total strong {
    color: var(--ae-stripe-text);
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 1.2;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}


/* =========================================================
   Payment details
   ========================================================= */

.ae-stripe-checkout__payment {
    min-width: 0;
    margin-top: 30px;
}

.ae-stripe-checkout__payment-element {
    min-width: 0;
    width: 100%;
}


/* =========================================================
   Status messages
   ========================================================= */

.ae-stripe-checkout__message {
    display: none;
    margin: 0 0 18px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.ae-stripe-checkout__message.is-visible {
    display: block;
}

.ae-stripe-checkout__message.is-error {
    border-color: #f0c6c2;
    background: #fff5f4;
    color: var(--ae-stripe-danger);
}

.ae-stripe-checkout__message.is-success {
    border-color: #b8e0ca;
    background: #f0faf4;
    color: var(--ae-stripe-success);
}

.ae-stripe-checkout__message.is-info {
    border-color: #d0def7;
    background: #f2f6fe;
    color: var(--ae-stripe-primary);
}


/* =========================================================
   Payment button
   ========================================================= */

.ae-stripe-checkout__pay-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 25px;
    padding: 15px 22px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: var(--ae-stripe-primary);
    color: #ffffff;

    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: 0.005em;
    line-height: 1.4;
    text-align: center;

    cursor: pointer;

    box-shadow: 0 3px 8px rgb(35 66 125 / 13%);

    transition:
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease,
        opacity 160ms ease;
}

.ae-stripe-checkout__pay-button:hover:not(:disabled) {
    background: var(--ae-stripe-primary-hover);
    box-shadow: 0 5px 13px rgb(35 66 125 / 20%);
    transform: translateY(-1px);
}

.ae-stripe-checkout__pay-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgb(35 66 125 / 14%);
}

.ae-stripe-checkout__pay-button:focus-visible {
    outline: 3px solid rgb(49 87 164 / 30%);
    outline-offset: 3px;
}

.ae-stripe-checkout__pay-button:disabled {
    opacity: 0.58;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   Footer
   ========================================================= */

.ae-stripe-checkout__footer {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-top: 19px;
    border-top: 1px solid var(--ae-stripe-border);
    text-align: center;
}

.ae-stripe-checkout__footer p {
    max-width: 440px;
    margin: 0;
    color: var(--ae-stripe-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}


/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 600px) {
    .ae-stripe-checkout__header {
        gap: 12px;
        padding-bottom: 19px;
    }

    .ae-stripe-checkout__title {
        font-size: 1.4rem;
    }

    .ae-stripe-checkout__subtitle {
        margin-top: 7px;
        font-size: 0.88rem;
    }

    .ae-stripe-checkout__summary {
        margin-top: 20px;
        padding: 18px;
        border-radius: 12px;
    }

    .ae-stripe-checkout__summary h3,
    .ae-stripe-checkout__payment h3 {
        margin-bottom: 16px;
        font-size: 1rem;
    }

    .ae-stripe-checkout__item {
        gap: 12px;
        padding: 13px 0;
    }

    .ae-stripe-checkout__item-description,
    .ae-stripe-checkout__item-price {
        font-size: 0.88rem;
    }

    .ae-stripe-checkout__total {
        padding-top: 17px;
    }

    .ae-stripe-checkout__total strong {
        font-size: 1.35rem;
    }

    .ae-stripe-checkout__payment {
        margin-top: 25px;
    }

    .ae-stripe-checkout__pay-button {
        min-height: 54px;
        margin-top: 21px;
    }

    .ae-stripe-checkout__footer {
        margin-top: 22px;
        padding-top: 16px;
    }
}


/* =========================================================
   Stripe Checkout Modal
   Covers the existing Catalog popup
   ========================================================= */

.ae-stripe-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

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

    padding: 24px;

    background: rgb(15 23 42 / 72%);

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The complete checkout card */

.ae-stripe-checkout-modal__dialog {
    position: relative;

    width: 100%;
    max-width: 760px;
    max-height: calc(100dvh - 48px);

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 36px;
    border: 1px solid #e2e7ef;
    border-radius: 18px;

    background: #ffffff;
    color: #192438;

    box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
}

/* Close button */

.ae-stripe-checkout-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;

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

    width: 38px;
    height: 38px;
    padding: 0;

    border: 1px solid #e2e7ef;
    border-radius: 50%;

    background: #ffffff;
    color: #192438;

    font-size: 27px;
    line-height: 1;

    cursor: pointer;
}

.ae-stripe-checkout-modal__close:hover {
    background: #f7f9fc;
    border-color: #c4cddd;
}

.ae-stripe-checkout-modal__close:focus-visible {
    outline: 3px solid rgb(49 87 164 / 30%);
    outline-offset: 3px;
}

/* Leave room for the close button */

.ae-stripe-checkout-modal .ae-stripe-checkout__header {
    padding-right: 42px;
}

/* Prevent background page scrolling while checkout is open
   (requires the JS to add this class to body). */

body.ae-stripe-checkout-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .ae-stripe-checkout-modal {
        align-items: stretch;
        padding: 10px;
    }

    .ae-stripe-checkout-modal__dialog {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 20px);

        margin: auto 0;
        padding: 26px 20px 22px;
        border-radius: 14px;
    }

    .ae-stripe-checkout-modal__close {
        top: 10px;
        right: 10px;
    }

    .ae-stripe-checkout-modal .ae-stripe-checkout__header {
        padding-right: 34px;
    }
}



/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .ae-stripe-checkout__cancel,
    .ae-stripe-checkout__pay-button {
        transition: none;
    }

    .ae-stripe-checkout__pay-button:hover:not(:disabled) {
        transform: none;
    }
}
