/* Оформление заказа — /checkout */

.checkout-page__empty[hidden],
.checkout-page__main[hidden],
.checkout-page__success[hidden],
.checkout-form__block[hidden] {
    display: none !important;
}

.checkout-page__empty-text,
.checkout-page__success-text {
    margin: 0 0 24px;
    color: #4b5563;
    font-size: 16px;
    line-height: 24px;
    max-width: 640px;
}

.checkout-page__grid {
    display: grid;
    gap: 24px;
    margin-top: 8px;
}

.checkout-form {
    min-width: 0;
}

.checkout-form__fieldset {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.checkout-form__legend,
.checkout-form__title {
    margin: 0 0 12px;
    color: #111827;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
}

.checkout-form__person-types {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.checkout-form__person-type {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid #d8dce5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    line-height: 22px;
    color: #111827;
}

.checkout-form__person-type:has(input:checked) {
    border-color: #1d4e9e;
    background: #f3f7fc;
    box-shadow: inset 0 0 0 1px #1d4e9e;
}

.checkout-form__person-type input {
    width: 18px;
    height: 18px;
    accent-color: #1d4e9e;
}

.checkout-form__block {
    margin-bottom: 28px;
    padding: 20px;
    border: 1px solid #e6e8ee;
    border-radius: 12px;
    background: #fff;
}

.checkout-form__row {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.checkout-form__row:last-child {
    margin-bottom: 0;
}

.checkout-form__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.checkout-form__label {
    color: #4b5563;
    font-size: 13px;
    line-height: 18px;
}

.checkout-form__label abbr {
    text-decoration: none;
    color: #d12f2f;
}

.checkout-form__input,
.checkout-form__textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d8dce5;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.checkout-form__textarea {
    min-height: 110px;
    resize: vertical;
}

.checkout-form__input:focus,
.checkout-form__textarea:focus {
    outline: none;
    border-color: #1d4e9e;
    box-shadow: 0 0 0 3px rgba(29, 78, 158, .12);
}

.checkout-form__input.is-invalid,
.checkout-form__textarea.is-invalid {
    border-color: #d12f2f;
}

.checkout-form__agree {
    margin-bottom: 16px;
}

.checkout-form__checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #374151;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.checkout-form__checkbox input {
    margin-top: 3px;
    accent-color: #1d4e9e;
}

.checkout-form__checkbox a {
    color: #1d4e9e;
}

.checkout-form__error {
    margin: 0 0 16px;
    color: #d12f2f;
    font-size: 14px;
    line-height: 20px;
}

.checkout-form__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.checkout-form__submit {
    width: 100%;
    border: 1px solid #1d4e9e;
}

.checkout-form__submit:disabled {
    opacity: .65;
    cursor: wait;
}

.checkout-form__back {
    color: #6b7280;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
}

.checkout-form__back:hover {
    color: #1d4e9e;
}

.checkout-page__summary {
    padding: 20px;
    border: 1px solid #e6e8ee;
    border-radius: 12px;
    background: #fff;
    height: max-content;
}

.checkout-page__summary-title {
    margin: 0 0 16px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: #111827;
}

.checkout-page__summary-items {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.checkout-summary-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.checkout-summary-item__image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f6f7f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-summary-item__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.checkout-summary-item__name {
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.checkout-summary-item__meta {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 18px;
}

.checkout-summary-item__price {
    margin: 6px 0 0;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.checkout-page__summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e6e8ee;
    margin-bottom: 12px;
    color: #111827;
    font-size: 16px;
    line-height: 22px;
}

.checkout-page__summary-total strong {
    font-size: 24px;
    line-height: 30px;
}

.checkout-page__summary-note {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 13px;
    line-height: 18px;
}

.checkout-page__success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.checkout-page__success-order {
    margin: 0;
    max-width: 820px;
    padding: 16px;
    border-radius: 12px;
    background: #f6f7f9;
    color: #111827;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

@media (min-width: 768px) {
    .checkout-form__person-types {
        grid-template-columns: 1fr 1fr;
    }

    .checkout-form__row--2 {
        grid-template-columns: 1fr 1fr;
    }

    .checkout-form__actions {
        flex-direction: row;
        align-items: center;
    }

    .checkout-form__submit {
        width: auto;
        min-width: 240px;
    }

    .checkout-form__back {
        text-align: left;
    }

    .checkout-page__success-actions {
        flex-direction: row;
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .checkout-page__grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
        gap: 32px;
    }

    .checkout-page__summary {
        position: sticky;
        top: 96px;
    }
}
