/* Final checkout UX polish. Loaded last. */

.checkout-page--final {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(360px, .72fr);
    gap: clamp(18px, 3vw, 34px);
    align-items: start;
    padding: clamp(18px, 3vw, 34px);
}

.checkout-copy--final,
.checkout-form--final {
    min-width: 0;
}

.checkout-alert {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    margin: 16px 0;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(35, 88, 246, .10), rgba(255, 122, 0, .10));
    border: 1px solid rgba(35, 88, 246, .12);
}

.checkout-alert > img {
    width: 22px;
    height: 22px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    color: #2358f6;
    box-shadow: 0 10px 22px rgba(17, 26, 54, .08);
}

.checkout-alert b {
    display: block;
    color: #111a36;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.15;
}

.checkout-alert span {
    display: block;
    margin-top: 3px;
    color: #5f6b84;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.checkout-cart-list--final {
    overflow: hidden;
    border: 1px solid rgba(17, 26, 54, .07);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(17, 26, 54, .06);
}

.checkout-cart-list--final .checkout-cart-list__head {
    padding: 14px 16px;
    background: #f7f9ff;
    border-bottom: 1px solid rgba(17, 26, 54, .06);
}

.checkout-cart-item--final {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(17, 26, 54, .055);
}

.checkout-cart-item--final:last-child {
    border-bottom: 0;
}

.checkout-cart-item--final > img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 16px;
    background: #f4f6fb;
}

.checkout-cart-item--final div {
    min-width: 0;
}

.checkout-cart-item--final b {
    display: block;
    color: #111a36;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.2;
}

.checkout-cart-item--final p {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0 0;
    color: #657087;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.checkout-cart-item--final p img {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

.checkout-cart-item--final strong {
    display: block;
    margin-top: 7px;
    color: #111a36;
    font-size: 16px;
    font-weight: 1000;
    letter-spacing: -.035em;
}

.checkout-form--final {
    position: sticky;
    top: 16px;
    padding: clamp(16px, 2.2vw, 24px);
    border: 1px solid rgba(17, 26, 54, .08);
    border-radius: 26px;
    background: linear-gradient(180deg, #fff, #f8faff);
    box-shadow: 0 18px 46px rgba(17, 26, 54, .09);
}

.checkout-form--final .checkout-form__head {
    margin-bottom: 14px;
}

.checkout-form--final .checkout-form__head h2 {
    margin: 0 0 6px;
    color: #111a36;
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1;
    letter-spacing: -.05em;
}

.checkout-form--final .checkout-form__head p {
    margin: 0;
    color: #657087;
    font-weight: 800;
    line-height: 1.4;
}

.checkout-fieldset {
    display: grid;
    gap: 10px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(17, 26, 54, .06);
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
}

.checkout-fieldset legend {
    padding: 0 6px;
    color: #2358f6;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.checkout-form--final label {
    display: grid;
    gap: 6px;
    color: #111a36;
    font-size: 13px;
    font-weight: 900;
}

.checkout-form--final input,
.checkout-form--final select,
.checkout-form--final textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(17, 26, 54, .11);
    border-radius: 14px;
    background: #fff;
    color: #111a36;
    font-size: 14px;
    font-weight: 800;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(17, 26, 54, .035);
}

.checkout-form--final textarea {
    min-height: 84px;
    resize: vertical;
}

.checkout-form--final input:focus,
.checkout-form--final select:focus,
.checkout-form--final textarea:focus {
    border-color: rgba(35, 88, 246, .46);
    box-shadow: 0 0 0 4px rgba(35, 88, 246, .10);
}

.checkout-form--final .is-invalid input,
.checkout-form--final .is-invalid select,
.checkout-form--final .is-invalid textarea,
.checkout-form--final .checkout-consent.is-invalid {
    border-color: rgba(224, 61, 61, .70) !important;
    box-shadow: 0 0 0 4px rgba(224, 61, 61, .10) !important;
}

.form-errors--final {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 16px;
    background: #fff3f3;
    border: 1px solid rgba(224, 61, 61, .20);
    color: #981b1b;
}

.form-errors--final b {
    display: block;
    margin-bottom: 4px;
    font-weight: 950;
}

.form-errors--final p {
    margin: 3px 0 0;
    font-size: 13px;
    font-weight: 800;
}

.checkout-payment-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(35, 88, 246, .07);
    color: #111a36;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.3;
}

.checkout-payment-note img {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.checkout-consent {
    display: grid !important;
    grid-template-columns: 20px 1fr;
    gap: 9px !important;
    align-items: start;
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(17, 26, 54, .06);
}

.checkout-consent input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin-top: 2px;
}

.checkout-consent span {
    color: #5f6b84;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.checkout-summary-line--final {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #111a36;
    color: #fff;
}

.checkout-summary-line--final span {
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 850;
}

.checkout-summary-line--final b {
    color: #fff;
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 1000;
    letter-spacing: -.045em;
}

.checkout-submit-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 12px;
}

.checkout-submit-button {
    min-height: 52px;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #2358f6, #5b36ff) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    box-shadow: 0 16px 34px rgba(35, 88, 246, .30) !important;
}

.checkout-submit-button span {
    color: #fff !important;
}

.checkout-submit-button img {
    filter: brightness(0) invert(1) !important;
}

.checkout-telegram {
    width: 100%;
    min-height: 46px;
    border-radius: 15px;
    background: #eef3ff;
    color: #2358f6;
    font-weight: 950;
}

.checkout-note--final {
    margin: 10px 0 0;
    color: #657087;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 900px) {
    .checkout-page--final {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 14px;
    }

    .checkout-copy--final h1 {
        font-size: clamp(30px, 10vw, 44px);
        line-height: .98;
    }

    .checkout-form--final {
        position: static;
        padding: 14px;
        border-radius: 22px;
    }

    .checkout-steps,
    .checkout-trust {
        grid-template-columns: 1fr;
    }

    .checkout-cart-item--final {
        grid-template-columns: 64px 1fr;
        padding: 12px;
    }

    .checkout-cart-item--final > img {
        width: 64px;
        height: 64px;
    }

    .checkout-fieldset {
        padding: 10px;
    }

    .form-grid-two {
        grid-template-columns: 1fr !important;
    }

    .checkout-submit-block {
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 40;
        margin: 14px -6px -4px;
        padding: 8px;
        border-radius: 20px;
        background: rgba(255, 255, 255, .94);
        border: 1px solid rgba(17, 26, 54, .08);
        box-shadow: 0 18px 46px rgba(17, 26, 54, .20);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
}
