/**
 * Корзина и форма заказа — своя вёрстка вместо тильдиного t706.
 *
 * Пропорции повторяют прежнюю модалку (окно 560px, оверлей rgba(0,0,0,.8),
 * превью 70×70), цвета — фирменные: #8c251f акцент, #494949 текст.
 *
 * Шрифт: --t-text-font / --t-headline-font (TildaSans) объявлены на body в
 * tilda-bundles.min.css. Без явного указания браузер даёт Times, потому что
 * сам body font-family не задаёт — раньше шрифт приходил из классов t-name/t-descr.
 */

.bd-cart,
.bd-btn {
    font-family: var(--t-text-font, 'TildaSans', Arial, sans-serif);
}

.bd-cart {
    position: fixed;
    inset: 0;
    z-index: 4002;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bd-cart[hidden] {
    display: none;
}

.bd-cart__overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .8);
}

.bd-cart__win {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    min-height: 300px;
    margin: 65px auto;
    padding: 40px;
    background-color: #fff;
    color: #494949;
    font-size: 16px;
    line-height: 1.45;
}

.bd-cart__close {
    position: absolute;
    top: -40px;
    right: 0;
    padding: 8px;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.bd-cart__close svg {
    fill: #fff;
}

.bd-cart__heading {
    margin-bottom: 25px;
    font-family: var(--t-headline-font, 'TildaSans', Arial, sans-serif);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
}

.bd-cart__empty {
    padding: 20px 0 10px;
    color: #666;
}

/* ---- позиции ---- */

.bd-cart__products {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.bd-cart__product {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.bd-cart__product-img {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border-radius: 7px;
    background-color: #eee;
    background-position: 50%;
    background-size: cover;
}

.bd-cart__product-main {
    flex: 1 1 auto;
    min-width: 0;
}

.bd-cart__product-title {
    color: #000;
    font-size: 16px;
    font-weight: 600;
}

.bd-cart__product-title a {
    color: inherit;
    text-decoration: none;
}

.bd-cart__product-title a:hover {
    text-decoration: underline;
}

.bd-cart__product-opt {
    margin-top: 4px;
    color: #777;
    font-size: 13px;
}

.bd-cart__product-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.bd-cart__qty-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    color: #494949;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.bd-cart__qty-btn:hover {
    border-color: #8c251f;
    color: #8c251f;
}

.bd-cart__qty {
    min-width: 28px;
    text-align: center;
    font-size: 16px;
}

.bd-cart__product-del {
    margin-left: auto;
    border: 0;
    background: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.bd-cart__product-del:hover {
    color: #8c251f;
}

.bd-cart__product-sum {
    flex: 0 0 auto;
    padding-left: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.bd-cart__amount {
    padding-bottom: 20px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    text-align: right;
}

.bd-cart__steps {
    margin: 0 0 30px;
    padding-left: 22px;
    color: #494949;
    font-size: 14px;
}

.bd-cart__steps li {
    margin-bottom: 4px;
}

/* ---- форма ---- */

.bd-field {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.bd-field__label {
    display: block;
    margin-bottom: 6px;
    color: #494949;
    font-size: 16px;
}

.bd-field__hint {
    margin-bottom: 6px;
    color: #494949;
    font-size: 12px;
    opacity: .7;
}

.bd-field__input {
    box-sizing: border-box;
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border: 1px solid #494949;
    border-radius: 0;
    background: #fff;
    color: #494949;
    font-family: inherit;
    font-size: 16px;
    -webkit-appearance: none;
}

.bd-field__input::placeholder {
    color: #494949;
    opacity: .5;
}

.bd-field__input:focus {
    outline: none;
    border-color: #8c251f;
}

.bd-field__textarea {
    height: 102px;
    padding: 12px 15px;
    resize: vertical;
}

.bd-field__phone {
    position: relative;
}

.bd-field__phone-code {
    position: absolute;
    top: 0;
    left: 15px;
    display: flex;
    align-items: center;
    height: 45px;
    color: #494949;
    font-size: 16px;
    pointer-events: none;
}

.bd-field__input_phone {
    padding-left: 45px;
}

.bd-field__error {
    margin-top: 5px;
    color: #d4483b;
    font-size: 13px;
}

.bd-field_invalid .bd-field__input {
    border-color: #d4483b;
}

.bd-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #494949;
    font-size: 15px;
    cursor: pointer;
}

.bd-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bd-radio__mark {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 1px solid #494949;
    border-radius: 50%;
}

.bd-radio input:checked + .bd-radio__mark {
    border-color: #8c251f;
    box-shadow: inset 0 0 0 4px #8c251f;
}

.bd-radio input:focus-visible + .bd-radio__mark {
    outline: 2px solid #8c251f;
    outline-offset: 2px;
}

.bd-cart__total {
    margin: 30px 0 20px;
    color: #000;
    font-size: 20px;
    font-weight: 600;
    text-align: right;
}

.bd-cart__formerror {
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #fdf0ef;
    color: #d4483b;
    font-size: 14px;
}

/* ---- кнопки ---- */

.bd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 30px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease-in-out, color .2s ease-in-out, opacity .2s ease-in-out;
}

/* Кнопка «Оформить предварительный заказ» на странице товара.
   Размеры прежней тильдиной .t-btn_sm: 45px, 14px, паддинги 30px. */
.bd-btn_outline {
    min-height: 45px;
    padding: 10px 30px;
    border: 1px solid #8c251f;
    background: #fff;
    color: #8c251f;
    font-size: 14px;
}

.bd-btn_outline:hover {
    background: #8c251f;
    color: #fff;
}

/* Кнопка отправки формы: прежняя .t-btnflex_md — 60px, 16px. */
.bd-btn_primary {
    width: 100%;
    min-height: 60px;
    padding: 10px 45px;
    border: 0;
    background-color: #8c251f;
    color: #fff;
    font-size: 16px;
}

.bd-btn_primary:hover {
    background-color: #741d18;
}

.bd-btn[disabled] {
    opacity: .6;
    cursor: default;
}

/* Счётчик у иконки корзины в шапке скрыт, пока корзина пуста. */
.js-carticon-counter:empty {
    display: none;
}

@media screen and (max-width: 640px) {
    .bd-cart__win {
        margin: 55px auto 0;
        padding: 25px 20px 40px;
    }

    .bd-cart__close {
        top: -35px;
    }

    .bd-cart__heading {
        font-size: 22px;
    }

    .bd-cart__product-sum {
        padding-left: 0;
    }
}
