/* Корзина и оформление заказа (4 шага). Цвета — из палитры сайта (переменные в site.css) */
.checkout-page {
    padding-top: 1.5rem;
}

.checkout-title {
    margin-bottom: 1.5rem;
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem);
    font-weight: 700;
    color: var(--hc-primary);
}

/* ===== Шаги ===== */
.checkout-steps {
    display: flex;
    gap: .5rem;
    margin: 0 0 1.5rem;
    padding: .75rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--hc-shadow-soft);
    list-style: none;
    counter-reset: step;
}

.checkout-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

    .checkout-step,
    .checkout-step > a {
        color: #7a8794;
        text-decoration: none;
    }

        .checkout-step:not(:last-child)::after {
            content: "";
            position: absolute;
            top: 50%;
            right: -.25rem;
            width: .5rem;
            height: 2px;
            background: #dbe8f7;
        }

.checkout-step {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .6rem;
    border-radius: 999px;
}

    .checkout-step > a {
        display: flex;
        align-items: center;
        gap: .55rem;
        width: 100%;
    }

.checkout-step-num {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eef3f9;
    color: #7a8794;
    font-weight: 700;
}

.checkout-step-name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-step.current {
    background: var(--hc-sky-soft);
    color: var(--hc-primary);
}

    .checkout-step.current .checkout-step-num {
        background: var(--hc-primary);
        color: #fff;
    }

.checkout-step.done .checkout-step-num {
    background: #e6f4ea;
    color: #1e7e34;
}

.checkout-step.done > a:hover {
    color: var(--hc-primary);
}

/* ===== Сообщения проверок оформления ===== */
.checkout-message {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: -.5rem 0 1.25rem;
    padding: .9rem 1.1rem;
    border-radius: 14px;
    font-weight: 600;
    line-height: 1.45;
}

    .checkout-message i {
        flex-shrink: 0;
        margin-top: .1rem;
        font-size: 1.15rem;
    }

.checkout-message-error {
    background: #fdecee;
    color: #c82333;
}

.checkout-message-info {
    background: #fff4e0;
    color: #8a5a00;
}

/* Адрес из другой страны — выбрать нельзя */
.checkout-option-disabled {
    cursor: not-allowed;
    opacity: .6;
    background: #f7f9fc;
}

    .checkout-option-disabled:hover {
        border-color: #dbe8f7;
    }

.checkout-option-note {
    margin-top: .2rem;
    color: #c82333 !important;
    font-weight: 600;
}

/* ===== Кнопки ===== */
.checkout-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem 1.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--hc-primary);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(27, 110, 194, 0.3);
}

    .checkout-btn-primary:hover {
        background: var(--hc-primary-dark);
        color: #fff;
    }

    .checkout-btn-primary:disabled {
        background: #b9c7d6;
        color: #fff;
        box-shadow: none;
        opacity: 1;
    }

.checkout-btn-confirm {
    padding: 1rem 1.5rem;
    font-size: 1.15rem;
}

.checkout-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1.5rem;
    border: 2px solid #dbe8f7;
    border-radius: 999px;
    background: #fff;
    color: var(--hc-primary);
    font-weight: 600;
}

    .checkout-btn-outline:hover {
        border-color: var(--hc-primary);
        background: var(--hc-sky-soft);
        color: var(--hc-primary);
    }

.checkout-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hc-primary);
    font-weight: 600;
    text-decoration: none;
}

    .checkout-link:hover {
        text-decoration: underline;
    }

.checkout-link-danger {
    color: #c82333;
}

/* ===== Итог (правая колонка) ===== */
.checkout-summary {
    position: sticky;
    top: 150px;
    padding: 1.5rem;
    border-radius: var(--hc-radius);
    background: #fff;
    box-shadow: var(--hc-shadow);
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid #e8f0fa;
    color: #4a5866;
}

    .checkout-summary-row strong {
        color: #2b3a4a;
        white-space: nowrap;
    }

.checkout-summary-discount strong {
    color: #1e7e34;
}

.checkout-summary-total {
    margin-bottom: 1.25rem;
    padding: .9rem 0 .25rem;
    border-bottom: 0;
}

    .checkout-summary-total span {
        color: #2b3a4a;
        font-weight: 700;
    }

    .checkout-summary-total strong {
        color: var(--hc-primary);
        font-size: 1.5rem;
    }

.checkout-summary > .checkout-summary-row:last-of-type:not(.checkout-summary-total) {
    margin-bottom: 1.25rem;
}

/* ===== Корзина: товары ===== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--hc-shadow-soft);
}

.cart-item-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--hc-sky-soft) 0%, #fff 100%);
    color: #b9c7d6;
    font-size: 1.8rem;
}

    .cart-item-img img {
        max-width: 76px;
        max-height: 76px;
        object-fit: contain;
    }

.cart-item-name {
    display: block;
    color: #2b3a4a;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

    .cart-item-name:hover {
        color: var(--hc-primary);
    }

.cart-item-price {
    margin-top: .2rem;
    color: #7a8794;
    font-size: .92rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    height: 42px;
    overflow: hidden;
    border: 2px solid #dbe8f7;
    border-radius: 999px;
    background: #fff;
}

    .cart-item-qty button {
        width: 38px;
        height: 100%;
        border: 0;
        background: transparent;
        color: var(--hc-primary);
        font-size: 1.1rem;
    }

        .cart-item-qty button:hover {
            background: var(--hc-sky-soft);
        }

        .cart-item-qty button:disabled {
            opacity: .5;
        }

    .cart-item-qty input {
        width: 42px;
        height: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        font-size: 1.05rem;
        font-weight: 700;
        text-align: center;
    }

.cart-item-total {
    min-width: 90px;
    color: var(--hc-primary);
    font-size: 1.15rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.cart-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
    background: #fff;
    color: #c82333;
}

    .cart-item-remove:hover {
        border-color: #c82333;
        background: #c82333;
        color: #fff;
    }

.cart-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
}

/* Пустая корзина */
.checkout-empty {
    padding: 3rem 1rem;
    border-radius: var(--hc-radius);
    background: #fff;
    box-shadow: var(--hc-shadow-soft);
    text-align: center;
}

.checkout-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--hc-sky-soft);
    color: var(--hc-primary);
    font-size: 2.4rem;
}

/* ===== Карточки и выбор вариантов (адрес, доставка, оплата) ===== */
.checkout-card {
    padding: 1.4rem;
    border-radius: var(--hc-radius);
    background: #fff;
    box-shadow: var(--hc-shadow-soft);
}

.checkout-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    color: var(--hc-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.checkout-options {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.checkout-option {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0;
    padding: .9rem 1rem;
    border: 2px solid #dbe8f7;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

    .checkout-option:hover {
        border-color: #b9d0ec;
    }

    .checkout-option:has(input:checked) {
        border-color: var(--hc-primary);
        background: var(--hc-sky-soft);
    }

    .checkout-option .form-check-input {
        flex-shrink: 0;
        width: 1.35em;
        height: 1.35em;
        margin: 0;
        border: 2px solid #b9d0ec;
        cursor: pointer;
    }

        .checkout-option .form-check-input:checked {
            border-color: var(--hc-primary);
            background-color: var(--hc-primary);
        }

.checkout-option-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--hc-sky-soft);
    color: var(--hc-primary);
    font-size: 1.2rem;
}

.checkout-option:has(input:checked) .checkout-option-icon {
    background: var(--hc-primary);
    color: #fff;
}

.checkout-option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.4;
}

    .checkout-option-text strong {
        color: #2b3a4a;
    }

    .checkout-option-text span {
        color: #4a5866;
        font-size: .93rem;
    }

.checkout-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    padding: .8rem 1rem;
    border: 2px dashed #b9d0ec;
    border-radius: 14px;
    background: #fff;
    color: var(--hc-primary);
    font-weight: 600;
}

    .checkout-add:hover {
        border-color: var(--hc-primary);
        background: var(--hc-sky-soft);
    }

/* Бонусы */
.checkout-bonus .form-check-label {
    color: #2b3a4a;
    font-weight: 600;
}

.checkout-bonus .form-check-input:checked {
    border-color: var(--hc-primary);
    background-color: var(--hc-primary);
}

.checkout-bonus-input {
    max-width: 320px;
    margin-top: .75rem;
}

    .checkout-bonus-input .form-control,
    .checkout-bonus-input .input-group-text {
        border: 2px solid #dbe8f7;
    }

    .checkout-bonus-input .form-control {
        border-radius: 12px 0 0 12px;
    }

    .checkout-bonus-input .input-group-text {
        border-left: 0;
        border-radius: 0 12px 12px 0;
        background: var(--hc-sky-soft);
        color: var(--hc-primary);
        font-weight: 700;
    }

/* ===== Подтверждение ===== */
.checkout-error {
    margin-bottom: 1.25rem;
    padding: .9rem 1.1rem;
    border-radius: 14px;
    background: #fdecee;
    color: #c82333;
    font-weight: 600;
}

.checkout-table {
    margin: 0;
    vertical-align: middle;
}

    .checkout-table thead th {
        padding: .9rem 1rem;
        border-bottom: 2px solid #e8f0fa;
        background: var(--hc-sky-soft);
        color: var(--hc-primary);
        font-weight: 700;
    }

    .checkout-table td {
        padding: .7rem 1rem;
        border-bottom-color: #f0f5fb;
        color: #2b3a4a;
    }

    .checkout-table tr:last-child td {
        border-bottom: 0;
    }

.checkout-table-img {
    width: 64px;
}

    .checkout-table-img img {
        width: 52px;
        height: 52px;
        object-fit: contain;
    }

.checkout-table-name {
    font-weight: 600;
}

.checkout-card.p-0 {
    overflow: hidden;
}

/* Карточки в одном ряду (доставка/оплата, адрес/доставка/оплата) — одной высоты.
   Карточка со списком товаров по высоте не растягивается. */
.row > [class*="col-"] > .checkout-card:not(.p-0) {
    height: 100%;
}

.checkout-info {
    color: #2b3a4a;
    line-height: 1.6;
}

    .checkout-info .checkout-card-title {
        margin-bottom: .6rem;
        font-size: 1rem;
    }

/* ===== Адаптив ===== */
@media (max-width: 991.98px) {
    .checkout-summary {
        position: static;
    }

    .checkout-step-name {
        display: none;
    }

    .checkout-step.current .checkout-step-name {
        display: inline;
    }

    .checkout-step {
        flex: 0 0 auto;
    }

        .checkout-step.current {
            flex: 1 1 auto;
        }
}

@media (max-width: 575px) {
    .cart-item {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        grid-template-areas:
            "img info remove"
            "img qty total";
        gap: .6rem .8rem;
    }

    .cart-item-img {
        grid-area: img;
        width: 64px;
        height: 64px;
    }

        .cart-item-img img {
            max-width: 58px;
            max-height: 58px;
        }

    .cart-item-info {
        grid-area: info;
    }

    .cart-item-qty {
        grid-area: qty;
        justify-self: start;
    }

    .cart-item-total {
        grid-area: total;
        min-width: 0;
    }

    .cart-item-remove {
        grid-area: remove;
        justify-self: end;
    }

    .checkout-steps {
        border-radius: 18px;
    }
}
