/* Product checkout popup + account plan-order modal */

.pina-product-checkout-modal,
.pina-plan-order-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pina-product-checkout-modal.is-open,
.pina-plan-order-modal.is-open {
    display: flex;
}

.pina-product-checkout-modal-backdrop,
.pina-plan-order-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.pina-product-checkout-modal-dialog,
.pina-plan-order-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 28px 28px 26px;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

.pina-plan-order-modal-dialog {
    max-width: 800px;
}

.pina-product-checkout-modal-close,
.pina-plan-order-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
}

.pina-product-checkout-modal-close:hover,
.pina-plan-order-modal-close:hover {
    color: #333;
}

.pina-product-checkout-modal-dialog h3,
.pina-plan-order-modal-dialog h3 {
    margin: 0 0 8px;
    color: #2ba82b;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    padding-right: 28px;
}

.pina-product-checkout-title {
    text-align: center;
    padding-left: 28px;
    padding-right: 28px;
    margin-bottom: 18px;
}

.pina-product-checkout-loading,
.pina-plan-order-loading {
    display: none;
    padding: 24px 0;
    color: #666;
    font-size: 16px;
    text-align: center;
}

.pina-product-checkout-modal.is-loading .pina-product-checkout-modal-dialog {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pina-product-checkout-modal.is-loading .pina-product-checkout-title,
.pina-product-checkout-modal.is-loading .pina-product-checkout-content,
.pina-product-checkout-modal.is-loading .pina-product-checkout-error {
    display: none;
}

.pina-product-checkout-modal.is-loading .pina-product-checkout-loading,
.pina-plan-order-modal.is-loading .pina-plan-order-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    margin: 0;
    min-height: 160px;
}

.pina-product-checkout-error,
.pina-plan-order-error {
    margin: 12px 0 0;
    color: #c00;
    font-size: 14px;
    display: none;
}

.pina-product-checkout-error.is-visible,
.pina-plan-order-error.is-visible {
    display: block;
}

.pina-product-checkout-proceed {
    display: block;
    width: 100%;
    margin-top: 22px;
    border: 2px solid #049b55;
    color: #fff;
    background: #049b55;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 30px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.pina-product-checkout-proceed:hover,
.pina-product-checkout-proceed:focus {
    background: #2ba82b;
    border-color: #2ba82b;
}

.pina-product-checkout-proceed:disabled {
    opacity: 0.6;
    cursor: default;
}

.pina-product-checkout-proceed.submitting {
    pointer-events: none;
    opacity: 1;
    padding-right: 48px;
}

.pina-product-checkout-proceed .rotater {
    display: none;
    animation: pina-btn-rotate 1s infinite linear;
    font-size: 22px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    margin: 0;
}

.pina-product-checkout-proceed.submitting .rotater {
    display: block;
}

@keyframes pina-btn-rotate {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.pina-product-checkout-modal.is-loading .pina-product-checkout-proceed {
    display: none;
}

.pina-product-checkout-modal .asp-upp-payment-plans-wrapper {
    margin-bottom: 8px;
}

.pina-product-checkout-modal .asp-upp-pay-options {
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

.pina-product-checkout-modal .asp-upp-pay-options li.asp-upp-active,
.pina-product-checkout-modal .asp-upp-pay-options li input:focus {
    background: #049b55;
    border-color: #049b55;
    color: #fff;
    outline: none;
}

.pina-product-checkout-modal .asp-upp-payment-plan-payments-schedule table {
    font-size: 14px;
}

.pina-plan-order-modal .asp-account-view-plan-order table,
.pina-plan-order-modal table.shop_table {
    width: 100%;
    text-align: left;
}

.pina-plan-order-modal table.shop_table th,
.pina-plan-order-modal table.shop_table td {
    text-align: left;
}

.user-orders-table .order-plan-actions a {
    display: inline-block;
    font-weight: 600;
    color: #049b55;
}

.user-orders-table .order-plan-actions a:hover {
    color: #2ba82b;
}

body.pina-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .user-orders-table.shop_table.subscription_list td:first-child:before {
        content: "Order #: ";
    }
    .user-orders-table.shop_table.subscription_list td:nth-child(2):before {
        content: "Items: ";
    }
    .user-orders-table.shop_table.subscription_list td:nth-child(3):before {
        content: "Amount: ";
    }
    .user-orders-table.shop_table.subscription_list td:nth-child(4):before {
        content: "Date: ";
    }
    .user-orders-table.shop_table.subscription_list td.order-plan-actions:before {
        content: "Actions: ";
        font-weight: bold;
        margin-right: 5px;
    }
    .user-orders-table.shop_table.subscription_list td.order-plan-actions a {
        display: inline;
    }
}
