/* Load after the product stylesheet. Keep the native quantity and cart form. */
.kfs-product .kfs-purchase form.cart,
.kfs-product .kfs-purchase .woocommerce-variation-add-to-cart {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.kfs-product .kfs-purchase .kfs-purchase-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 520px;
    min-width: 0;
    margin: 0 auto;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: none;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 13px 46px;
    border: 1px solid var(--kfs-green, #526b54);
    border-radius: 4px;
    box-shadow: none;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: .04em;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout {
    min-height: 58px;
    background: var(--kfs-green, #526b54);
    color: #fffef9;
    font-size: 17px;
    font-weight: 600;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout > span[aria-hidden="true"] {
    position: absolute;
    right: 22px;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.single_add_to_cart_button {
    min-height: 48px;
    padding-top: 10px;
    padding-bottom: 10px;
    border-color: #a9b4a2;
    background: #f7f8f2;
    color: var(--kfs-green, #526b54);
    font-size: 14px;
    font-weight: 400;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
    border-color: #405742;
    background: #405742;
    color: #fffef9;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.single_add_to_cart_button:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
    border-color: var(--kfs-green, #526b54);
    background: var(--kfs-sage, #e9ede3);
    color: #384f3b;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.button:focus-visible {
    outline: 2px solid #405742;
    outline-offset: 4px;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.button:disabled,
.kfs-product .kfs-purchase .kfs-purchase-actions > button.button.disabled,
.kfs-product .kfs-purchase .kfs-purchase-actions > button.button[aria-disabled="true"] {
    opacity: .52;
    cursor: not-allowed;
    box-shadow: none;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.button.loading,
.kfs-product .kfs-purchase .kfs-purchase-actions > button.button[aria-busy="true"] {
    cursor: progress;
    opacity: .8;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout.loading > span[aria-hidden="true"],
.kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout[aria-busy="true"] > span[aria-hidden="true"] {
    visibility: hidden;
}

.kfs-product .kfs-purchase .kfs-purchase-actions > button.button.loading::after,
.kfs-product .kfs-purchase .kfs-purchase-actions > button.button[aria-busy="true"]::after {
    position: absolute;
    top: calc(50% - 8px);
    right: 23px;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    background: none;
    content: "";
    animation: kfs-checkout-button-spin .7s linear infinite;
}

@keyframes kfs-checkout-button-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 540px) {
    .kfs-product .kfs-purchase .kfs-purchase-actions {
        max-width: none;
        gap: 9px;
    }

    .kfs-product .kfs-purchase .kfs-purchase-actions > button.kfs-direct-checkout {
        min-height: 56px;
        font-size: 16px;
    }

    .kfs-product .kfs-purchase .kfs-purchase-actions > button.single_add_to_cart_button {
        min-height: 48px;
        flex-basis: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kfs-product .kfs-purchase .kfs-purchase-actions > button.button {
        transition: none;
    }

    .kfs-product .kfs-purchase .kfs-purchase-actions > button.button::after {
        animation: none;
    }
}
