.checkout-page {
    min-height: 100vh;
}

.checkout-page__mobile-summary {
    display: none;
}

.checkout-page__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.checkout-page__left {
    background: var(--color-dark-green);
    color: var(--color-vanilla-cream);
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 2.778vw, 68px) clamp(20px, 6.319vw, 154px) clamp(40px, 4.444vw, 108px) var(--edge-inset);
}

.checkout-page__right {
    background: var(--color-vanilla-cream);
    color: var(--color-dark-green);
    display: flex;
    flex-direction: column;
    padding: clamp(76px, 6.944vw, 181px) var(--edge-inset) clamp(40px, 4.444vw, 108px) clamp(20px, 6.319vw, 154px);
}

.checkout-page__grid--empty {
    grid-template-columns: 1fr;
}

.checkout-page__grid--empty .checkout-page__left {
    display: none;
}

.checkout-page__grid--empty .checkout-page__right {
    padding: clamp(76px, 6.944vw, 181px) var(--edge-inset);
    align-items: center;
}

.checkout-page__grid--empty .checkout-page__right > * {
    max-width: 480px;
    width: 100%;
}

.checkout-page__left > * + *,
.checkout-page__right > * + * {
    margin-top: clamp(40px, 2.778vw, 65px);
}

.checkout-page__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-vanilla-cream);
    text-decoration: none;
    font-size: var(--text-body);
    font-weight: 500;
}

.checkout-page__back-arrow {
    display: inline-flex;
}

.checkout-page__section-title {
    font-size: var(--text-lead);
    font-weight: 500;
    line-height: var(--lh-headings);
    margin-bottom: clamp(14px, 0.972vw, 22px);
}

.checkout-page__right .checkout-page__section-title {
    color: var(--color-dark-green);
}

#customer_details .checkout-page__address {
    margin-top: clamp(24px, 1.667vw, 40px);
}

#customer_details .woocommerce-billing-fields__field-wrapper {
    display: flex;
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: clamp(14px, 0.972vw, 22px);
}

#customer_details .form-row-first,
#customer_details .form-row-last {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
}

#customer_details .form-row-wide {
    flex: 1 1 100%;
}

#customer_details label:not(.lattesa-checkbox) {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#customer_details input.input-text,
.checkout-page__coupon-input {
    width: 100%;
    background: var(--color-vanilla-cream);
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-family: var(--font-primary);
    font-size: var(--text-body);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--color-dark-green);
    transition: border-color 0.2s ease;
}

#customer_details input.input-text:hover,
#customer_details input.input-text:focus {
    outline: none;
}

#customer_details input.input-text:-webkit-autofill,
#customer_details input.input-text:-webkit-autofill:hover,
#customer_details input.input-text:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--color-vanilla-cream) inset;
    -webkit-text-fill-color: var(--color-dark-green);
    caret-color: var(--color-dark-green);
    transition: background-color 5000s ease-in-out 0s;
}

.checkout-page__coupon-input {
    border: 2px solid var(--color-dark-green-50);
}

.checkout-page__coupon-input:focus {
    border-color: var(--color-dark-green);
    outline: none;
}

.checkout-page__coupon-input:-webkit-autofill,
.checkout-page__coupon-input:-webkit-autofill:hover,
.checkout-page__coupon-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--color-vanilla-cream) inset;
    -webkit-text-fill-color: var(--color-dark-green);
    caret-color: var(--color-dark-green);
    transition: background-color 5000s ease-in-out 0s;
}

#customer_details input.input-text::placeholder,
.checkout-page__coupon-input::placeholder {
    color: var(--color-dark-green-50);
}

.checkout-page__shipping-methods,
.checkout-page__payment-methods {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkout-page__radio-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-vanilla-cream);
    border-radius: 14px;
    padding: 14px;
    min-height: 20px;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease;
}

.checkout-page__radio-option:not(.is-disabled):hover {
    border-color: var(--color-dark-green);
}

.checkout-page__radio-option.is-disabled {
    background: transparent;
    border: 1.5px solid var(--color-vanilla-20);
    opacity: 0.6;
}

.checkout-page__radio-input,
.checkout-page__radio-dot {
    appearance: none;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1.5px solid var(--color-dark-green-30);
    position: relative;
    margin: 0;
    cursor: pointer;
}

.is-disabled .checkout-page__radio-dot {
    border-color: var(--color-vanilla-20);
    cursor: not-allowed;
}

.checkout-page__radio-input:checked,
.checkout-page__radio-dot.is-checked {
    border-color: var(--color-dark-green);
}

.checkout-page__radio-input:checked::after,
.checkout-page__radio-dot.is-checked::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--color-matcha-green);
}

.checkout-page__radio-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--text-body);
    font-weight: 500;
    color: var(--color-dark-green);
    cursor: pointer;
}

.is-disabled .checkout-page__radio-label {
    cursor: not-allowed;
    color: var(--color-vanilla-cream);
}

.checkout-page__payment-badges {
    margin-top: 12px;
}

.checkout-page__radio-text {
    display: flex;
    flex-direction: column;
}

.checkout-page__radio-note {
    font-size: var(--text-s);
    opacity: 0.6;
    font-weight: 500;
}

.checkout-page__no-shipping {
    color: var(--color-vanilla-cream);
    font-size: var(--text-body);
}

.checkout-page__terms {
    margin-top: clamp(14px, 0.972vw, 22px) !important;
}

.checkout-page__terms a {
    color: var(--color-vanilla-cream);
    text-decoration: none;
    position: relative;
}

.checkout-page__terms a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-matcha-green);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-page__terms a:hover::after {
    width: 100%;
}

.checkout-page__place-order {
    margin-top: clamp(74px, 5.139vw, 120px);
}

.checkout-page__submit-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkout-page__submit {
    width: 100%;
    justify-content: center;
}

.checkout-page__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.checkout-page__secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: var(--text-m);
    opacity: 0.6;
    text-align: center;
}

.checkout-page__coupon-note {
    font-size: var(--text-m);
    opacity: 0.6;
    margin-top: 8px;
}

.checkout-page__footer {
    border-top: 2px solid var(--color-vanilla-10);
    padding-top: clamp(24px, 1.667vw, 40px);
    margin-top: clamp(80px, 5.556vw, 130px) !important;
}

.checkout-page__footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkout-page__footer-links a {
    color: var(--color-vanilla-cream);
    font-size: var(--text-m);
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.checkout-page__footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-matcha-green);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-page__footer-links a:hover::after {
    width: 100%;
}

#checkout-cart-items.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.checkout-page__coupon {
    margin-top: clamp(24px, 1.667vw, 40px);
}

.checkout-page__coupon-row {
    display: flex;
    gap: 14px;
}

.checkout-page__coupon-input.has-error {
    border-color: var(--color-error-border);
}

.input-text.has-error {
    border-color: var(--color-error-border);
}

.coupon-error-notice,
.field-error-notice {
    display: block;
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--color-error-bg);
    border: 1.5px solid var(--color-error-border);
    border-radius: 14px;
    color: var(--color-error-text);
    font-size: var(--text-m);
    font-weight: 500;
    line-height: 1.3;
}

.checkout-page__coupon-input {
    flex: 1 1 auto;
}

.checkout-page__coupon-apply {
    flex: 0 0 auto;
    background: var(--color-dark-green);
    color: var(--color-vanilla-cream);
    border: none;
    border-radius: 14px;
    padding: 14px 24px;
    font-family: var(--font-primary);
    font-size: var(--text-body);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.checkout-page__coupon-apply:hover {
    background: var(--color-dark-vanilla);
    color: var(--color-dark-green);
}

.checkout-page__coupon-form.woocommerce-form-coupon .woocommerce-message,
.checkout-page__coupon-form.woocommerce-form-coupon .woocommerce-error {
    margin-top: 8px;
    font-size: var(--text-m);
}

.checkout-page__totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: clamp(24px, 1.667vw, 40px);
}

.checkout-page__totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-body);
    font-weight: 500;
}

.checkout-page__totals-row--discount span:last-child {
    color: var(--color-matcha-green);
}

.checkout-page__totals-row--total {
    font-size: var(--text-lead);
    padding-top: 8px;
    border-top: 2px solid var(--color-dark-green-10);
    margin-top: 8px;
}

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    list-style: none;
    background: var(--color-error);
    color: var(--color-vanilla-cream);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: var(--text-m);
    margin-bottom: clamp(14px, 0.972vw, 22px);
}

.woocommerce-message {
    background: var(--color-matcha-green);
    color: var(--color-dark-green);
}

.checkout-page__left .blockUI.blockOverlay,
.checkout-page__right .blockUI.blockOverlay {
    display: none !important;
}

@media (max-width: 1024px) and (orientation: portrait) {
    .checkout-page__grid {
        grid-template-columns: 1fr;
    }

    .checkout-page__left,
    .checkout-page__right {
        padding: 60px var(--edge-inset);
    }

    .checkout-page__mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--color-dark-green);
        padding: 16px var(--edge-inset);
        margin: -60px calc(-1 * var(--edge-inset)) 0;
        font-size: var(--text-body);
        font-weight: 500;
    }

    .checkout-page__right {
        padding-top: calc(8px + var(--checkout-submit-bar-height, 78px));
        padding-bottom: calc(8px + var(--checkout-submit-bar-height, 78px) + env(safe-area-inset-bottom, 0px));
    }

    .checkout-page__place-order {
        margin-top: 0;
    }

    .checkout-page__submit-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        background: var(--color-vanilla-cream);
        border-top: 2px solid var(--color-dark-green-10);
        padding: 16px var(--edge-inset);
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    body.lattesa-checkout-page .site-footer-legal__inner {
        padding-bottom: calc(var(--checkout-submit-bar-height, 78px) + 32px + env(safe-area-inset-bottom, 0px));
    }
}

.pay-redirect {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--edge-inset);
    background: var(--color-vanilla-cream);
}

.pay-redirect__loading,
.pay-redirect__fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 0.972vw, 22px);
    text-align: center;
}

.pay-redirect__fallback,
.pay-redirect.is-stalled .pay-redirect__loading {
    display: none;
}

.pay-redirect.is-stalled .pay-redirect__fallback {
    display: flex;
}

.pay-redirect__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-dark-green-20);
    border-top-color: var(--color-dark-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.pay-redirect__text {
    font-size: var(--text-body);
    font-weight: 500;
}
