.cart__title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
}
.cart__serial-form{
    padding-bottom: 20px;
}
.cart__serial-form-subtitle {
    font-size: 13px;
    margin-bottom: 10px;
}

.cart__serial-form-info {
    color: #e20932;
}

.cart__serial-form-info:hover {
    text-decoration: underline;
}

.cart__serial-form-input {
    display: block;
    width: 100%;
    max-width: 370px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 0;
}

.cart__product-item {
    display: flex;
    justify-content: space-between;
    padding: 13px 11px;
    border: 2px solid transparent;
    border-top-color: #ccc;
    margin-bottom: 20px;
    transition: 200ms ease all;
}

.cart__product-info {
    color: #E20932;
    font-weight: bold;
    display: block;
    width: 40%;
}

.cart__product-name:hover {
    text-decoration: underline;
}

.cart__product-amount {
    display: flex;
    align-items: flex-start;
    width: 15%;
}

.cart__amount-value {
    font-weight: bold;
    margin: 0 7px;
}

.cart__amount-value::after {
    content: attr(data-caption);
    font-weight: normal;
    padding-left: 3px;
}

.cart__amount-subtract, .cart__amount-add {
    border-radius: 50%;
    border: 1px solid #C9C9C9;
    background: white;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    text-align: center;
    transition: all .3s ease;
    cursor: pointer;
    flex: 0 0 20px;
}

.cart__amount-subtract:hover, .cart__amount-add:hover {
    border-color: #E20932;
    background: #E20932;
    color: #fff;
}

.cart__product-price {
    width: 15%;
    font-weight: bold;
}

.cart__product-remove {
    position: relative;
    background: #84898c;
    width: 15px;
    height: 15px;
    display: block;
    border-radius: 50%;
    transition: 300ms ease all;
}

.cart__product-remove:hover {
    background: #E20932;
}

.cart__product-remove:after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 7px;
    height: 7px;
    background: url('./images/sprite.png') -247px -92px no-repeat;
}

.cart__product-item:hover {
    border: 2px solid #E20932;
}

/* «−», «+» и крестик — кнопки (product.php): сброс стилей браузера, вид тот же, что был у span и ссылки */
.cart__amount-subtract, .cart__amount-add, .cart__product-remove {
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.cart__product-remove {
    border: 0;
    cursor: pointer;
}

.cart__amount-subtract:focus-visible, .cart__amount-add:focus-visible, .cart__product-remove:focus-visible {
    outline: 2px solid #E20932;
    outline-offset: 2px;
}

.cart__clear {
    display: flex;
    justify-content: flex-end;
    margin: -10px auto 20px;
}

.cart__clear-button {
    padding: 0;
    border: 0;
    background: none;
    color: #84898c;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    transition: 200ms ease color;
}

.cart__clear-button:hover,
.cart__clear-button:focus {
    color: #E20932;
}

.cart__form-features {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cart__bonus-form, .cart__promo-form {
    width: 455px;
    padding: 14px 20px 20px;
    background: #F0F0F0;
}

.cart__bonus-form {
    font-size: 14px;
    font-weight: normal;
}

.cart__bonus-form-note {
    margin-bottom: 15px;
    font-size: 12px;
    margin-top: 8px;
}

.cart__promo-form-highlight {
    font-size: 18px;
    display: block;
    font-weight: bold;
}

.cart__bonus-form-fields, .cart__promo-form-fields {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.cart__bonus-form-fields {
    margin-top: 5px;
}

.cart__bonus-form-value-field, .cart__promo-form-value-field {
    width: 255px;
    padding: 6px 12px;
    font-size: 14px;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    margin-bottom: 4px;
}

.cart__bonus-form-submit-button, .cart__promo-form-submit-button {
    color: #656c6f;
    font-weight: bold;
    cursor: pointer;
    transition: 300ms ease all;
    background-color: transparent;
    border: 1px solid #656c6f !important;
    width: auto;
    padding: 6px 12px;
}

.cart__bonus-form-submit-button:hover, .cart__promo-form-submit-button:hover {
    background: #656c6f;
    color: #fff;
}

.has-error .cart__promo-form-submit-button:hover {
    color: #656c6f;
    background: inherit;
    cursor: default;
}

.cart__bonus-used-bonuses {
    width: 100%;
    font-size: 13px;
    color: #E20932;
}

.cart__promo-form-hint {
    width: 100%;
    font-size: 13px;
    color: #656c6f; /* подсказка, не ошибка: красным — только сообщение об ошибке под полем */
}

.cart__promocodes {
    margin: 15px 0 0 auto;
    width: 100%;
    text-align: right;
    justify-content: space-between;
}

.cart__promocodes::after {
    content: '';
    display: block;
    clear: both;
}

.cart__promocode {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 4px 10px;
    border: 2px solid #93989a;
    color: #666;
    margin-right: 5px;
}

.cart__promocode:last-child {
    z-index: 9999;
    position: relative;
    background: #fff;
    transition: 600ms ease all;
}

.cart__promocode-discount {
    font-weight: bold;
}

.cart__promocode-value {
    padding: 0 4px;
    /* код бывает до 50 знаков: переносится в любом месте, плашка не шире блока и не раздвигает страницу */
    overflow-wrap: anywhere;
}

.cart__promocode-remover {
    display: inline-block;
    margin-left: 7px;
    width: 24px;
    height: 24px;
    /* кнопка пустая — её наименьшая ширина 0: плашка с длинным кодом ужимается за счёт кода, а не «×» */
    flex-shrink: 0;
    background: url('./images/close.png') center no-repeat;
    background-size: 14px;
}

.cart__promocode--template {
    display: none;
    position: relative;
}

.cart__total {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 13px 0px;
    padding-bottom: 60px;
    border-top: 3px solid #E20932;
    font-size: 24px;
    font-weight: bold;
    color: #E20932;
}

.cart__total-bonus, .cart__total-price {
    width: 50%;
    padding: 0 15px;
}

.cart__total-description, .cart__total-discount, .cart__total-bonus-info {
    font-size: 14px;
    color: #000;
    font-weight: normal;
    padding-top: 7px;
}

.cart__order-form {
    padding-bottom: 90px;
}

.cart__delivery {
    margin: 30px auto 40px;
}

.cart__delivery-title {
    font-size: 24px;
    font-weight: bold;
    padding-bottom: 30px;
}

.cart__delivery-form-label {
    display: block;
    width: 100%;
    font-weight: bold;
}

.cart__delivery-form-input {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    transition: 200ms ease all;
    margin: 5px 0;
}

.cart__delivery-form-input:focus {
    border-color: #E20932;
}

.cart__delivery-form-input:disabled {
    background-color: #f6f6f6;
    cursor: not-allowed;
}

.cart__delivey-form-groups--triple {
    display: flex;
    justify-content: space-between;
}

.cart__delivey-form-groups--triple .cart__delivery-form-group {
    width: 31%;
}

.cart__delivery-form-group {
    display: none;
}

.cart__delivery-form-group--visible {
    display: block;
}

.cart__delivery-form-group--sm {
    width: 31%;
}

.cart__payment {
    background: #F6F6F6;
    padding: 50px 0;
}

.cart__payment-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
}

.cart__payment-methods, .cart__delivery-methods {
    display: flex;
    flex-wrap: wrap;
}

.cart__delivery-methods {
    padding-top: 40px;
    justify-content: start;
    margin: 0px -5px 0px;
}

.cart__delivery-methods-title {
    width: 100%;
    font-weight: bold;
    margin: 0 5px 15px;
}

.cart__payment-method, .cart__delivery-method {
    display: inline-flex;
    position: relative;
    flex-direction: column;
    margin: 0 5px 20px;
    flex-basis: 23.5%;
}
.cart__delivery-method--hidden{
    display: none;
}
.cart__delivery-method-help {
    position: absolute;
    left: calc(100% - 22px);
    top: 2px;
    z-index: 3;
}
.cart__delivery-method-help-icon {
    width: 20px;
    height:20px;
    line-height: 20px;
    border-radius: 10px;
    background: #E20932;
    color: white;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
}
/* подсказка под значком растёт влево от его правого края и переносит строки: значок стоит у правого края способа, и
   подсказка в одну строку вправо уходила за экран (у карточек правой колонки на ПК, у строк на телефоне) — страница
   становилась шире и съезжала вбок (ECUTALL-40). Длинное слово или адрес в описании тоже переносится; подсказка
   примыкает к значку без зазора — на зазоре курсор, который ведут к тексту, теряет наведение, и подсказка гаснет */
.cart__delivery-method-help-text {
    position: absolute;
    right: 0;
    top: 100%;
    width: max-content;
    max-width: min(240px, calc(100vw - 40px));
    background: white;
    border: 1px solid #303030;
    border-radius: 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    padding: 10px;
}
.cart__delivery-method-help-text {
    display: none;
}
.cart__delivery-method-help:hover .cart__delivery-method-help-text { 
    display: block;
}
/* открытая подсказка ложится на способы ниже, а их слои — выбранная и наведённая строка (1), невидимые радиокнопки во
   всю строку (2), значки «?» (3) — закрывали бы её и забирали нажатие по ней. Значок с открытой подсказкой — выше всех.
   Его строка — не слой, иначе значок заперт в ней, а поднятая целиком она закрыла бы край рамки выбранного соседа (строки
   налегают рамками на 1 px). Выбранная строка остаётся слоем — её рамка и так поверх соседей — и поднимается целиком */
.cart__delivery-method-help:hover {
    z-index: 4;
}
.cart__delivery-method:has(.cart__delivery-method-help:hover) {
    z-index: auto;
}
.cart__delivery-method:has(input:checked):has(.cart__delivery-method-help:hover) {
    z-index: 4;
}

.cart__payment-method--hidden {
    display: none;
}

.cart__payment-method-input, .cart__delivery-method-input {
    position: absolute;
    margin: 0;
    padding: 0;
    z-index: 2;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    cursor: pointer;
}

.cart__payment-method-label, .cart__delivery-method-label {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E8E9E9;
    transition: 200ms ease all;
    width: 100%;
}

.cart__payment-method-img, .cart__delivery-method-img {
    box-sizing: border-box;
    transition: 300ms ease all;
    width: 150px;
    height: 80px;
    object-fit: scale-down;
    filter: grayscale(100%);
}

.cart__payment-method-percent, .cart__delivery-method-cost {
    font-weight: bold;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 80px;
    border-left: 1px dashed #E8E9E9;
}

.cart__payment-method:hover .cart__payment-method-percent, .cart__delivery-method:hover .cart__delivery-method-cost {
    color: #E20932;
}

.cart__payment-method:hover .cart__payment-method-img, .cart__delivery-method:hover .cart__delivery-method-img {
    filter: grayscale(0);
}

.cart__payment-method-input:checked+.cart__payment-method-label, .cart__delivery-method-input:checked+.cart__delivery-method-label {
    border-color: #E20932;
}

.cart__payment-method-input:checked+.cart__payment-method-label .cart__payment-method-img, .cart__delivery-method-input:checked+.cart__delivery-method-label .cart__delivery-method-img {
    filter: grayscale(0);
}

.cart__payment-method-input:checked+.cart__payment-method-label .cart__payment-method-percent, .cart__delivery-method-input:checked+.cart__delivery-method-label .cart__delivery-method-cost {
    color: #E20932;
    border-color: #E20932;
}

.cart__payment-method-desc, .cart__delivery-method-desc {
    margin-top: 8px;
    font-size: 13px;
}

.cart__form-group--comment {
    padding: 30px 0;
}

.cart__form-group--comment .cart__form-label {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

.cart__form-textarea {
    border: 1px solid #CBCBCB;
    padding: 6px 8px;
    width: 100%;
    height: 160px;
    display: block;
}

.cart__privacy-policy {
    position: relative;
}

.cart-privacy-policy-icon {
    width: 20px;
    height: 20px;
    border: 1px solid #E20932;
    display: inline-block;
    margin-bottom: 8px;
    position: relative;
    top: 11px;
    margin-right: 5px;
}

.cart-privacy-policy-label {
    font-weight: bold;
}

.cart-privacy-policy-link {
    color: #E20932;
}

.cart-privacy-policy-link:hover {
    text-decoration: underline;
}

.cart-privacy-policy-field:checked+.cart-privacy-policy-label .cart-privacy-policy-icon {
    background: url(./images/check.png) no-repeat;
    background-position: center;
    background-size: 80%;
}

.cart-privacy-policy-field {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    opacity: 0;
    cursor: pointer;
}

.cart-privacy-policy-link {
    position: relative;
    z-index: 4;
}

.cart__privacy-policy-info {
    margin-left: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.cart__privacy-policy-item {
    margin-bottom: 5px;
}

/* ссылка «Перейти в каталог» у пустой корзины - та же кнопка, что «Оформить» */
.cart__submit,
.cart__empty-link {
    cursor: pointer;
    border: 2px solid #e20932;
    padding: 15px 65px;
    font-size: 18px;
    font-weight: bold;
    color: #E20932;
    transition: 200ms ease all;
    width: auto;
}

.cart__submit:hover,
.cart__empty-link:hover,
.cart__empty-link:focus-visible {
    background: #E20932;
    color: #ffff;
}

/* Пустая корзина: сообщение и ссылка в каталог вместо итога и формы оформления (cart.php) */
.cart__empty {
    padding-bottom: 60px;
}

.cart__empty-text {
    margin: 0 0 30px;
    font-size: 18px;
}

.cart__empty-link {
    display: inline-block;
    text-decoration: none;
}

.cart__promo-form-help-block, .cart__bonuses-form-help-block {
    width: 100%;
    overflow-wrap: break-word; /* длинный код без пробелов из ответа сервера не раздвигает страницу */
    font-weight: bold;
    color: #e20932;
}

.cart__delivery-form-group .cart__promo-form-help-block, .cart__delivery-form-group .cart__bonuses-form-help-block {
    margin-bottom: 15px;
    min-height: 15px;
}

@media screen and (max-width: 992px) {
    .cart__form-features {
        flex-direction: column;
    }
    .cart__bonus-form, .cart__promo-form {
        width: 100%;
        margin-bottom: 20px;
    }
    .cart__bonus-form-value-field, .cart__promo-form-value-field {
        width: 100%;
        flex: 1;
        margin-right: 20px;
    }
    .cart__total {
        flex-direction: column;
    }
    .cart__payment-methods, .cart__delivery-methods {
        padding-right: 0;
    }
    .cart__delivery-form-group--sm {
        width: 100%;
    }
    .cart__delivey-form-groups--triple {
        flex-wrap: wrap;
    }
    .cart__delivey-form-groups--triple .cart__delivery-form-group {
        width: 100%;
    }
    .cart__promocodes {
        padding-left: 0;
    }
}

@media screen and (max-width: 767px) {
    .cart__form-group--comment {
        padding: 50px 15px 20px;
    }
    .cart__total-bonuses, .cart__total-price {
        width: 100%;
    }
    .cart__product-item {
        flex-direction: column;
        position: relative;
    }
    .cart__product-name {
        width: 100%;
        display: inline-block;
        margin-bottom: 15px;
    }
    .cart__product-amount {
        margin-bottom: 15px;
    }
    .cart__product-price {
        width: 100%;
    }
    .cart__product-remove {
        position: absolute;
        right: 20px;
        top: 20px;
    }
}

@media screen and (max-width: 479px) {
    .client-form__tabs {
        flex-direction: column;
    }
    .cart__payment-methods, .cart__delivery-methods {
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }
}

.cart__payment-method--hidden {
    display: none;
}

/* без галочки согласия заказ не уходит: сообщение рядом с ней (cart.js, beforeSubmit) */
.cart__privacy-policy-error {
    margin: 8px 0 0;
    color: #e20932;
    font-weight: bold;
}

.cart__privacy-policy[data-error="true"] .cart-privacy-policy-icon {
    background-color: rgba(226, 9, 50, .12);
    outline: 3px solid rgba(226, 9, 50, .12);
}

.cart-privacy-policy-field:focus-visible + .cart-privacy-policy-label .cart-privacy-policy-icon {
    outline: 2px solid #e20932;
    outline-offset: 2px;
}
