/* =========================================================================
   Корзина medstern.ru — стили. Цвета/шрифты сайта: #4e4e4e, #66c6ba,
   Roboto Light/Regular. Подключается из _includes/header.html.
   ========================================================================= */

/* ---------- значок корзины в шапке ---------- */
.header .header-cart {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin: 0 30px 0 0;
    vertical-align: middle;
    color: #cecece;
    text-decoration: none;
}
.header .header-cart:hover {
    color: #fff;
}
.header-cart svg {
    width: 24px;
    height: 24px;
    display: block;
}
.header-cart__count {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #66c6ba;
    color: #fff;
    font: 11px/18px 'Roboto Regular', Arial, sans-serif;
    text-align: center;
    box-sizing: border-box;
}

/* ---------- блок покупки (в .price-block вместо «Получить КП») ---------- */
.cart-buy {
    display: flex;
    align-items: flex-end;   /* кнопка по низу с полями выбора */
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 20px;
}
.cart-buy__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.cart-buy__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}
.cart-buy__label {
    font: 13px 'Roboto Light', sans-serif;
    color: #999;
}
.cart-buy__select {
    min-width: 210px;
    max-width: 360px;
    height: 55px;            /* та же высота, что у кнопки .btn — низ и верх в одну линию */
    padding: 0 34px 0 12px;
    border: 1px solid #d5dadd;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2366c6ba' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    font: 15px 'Roboto Light', sans-serif;
    color: #4e4e4e;
    cursor: pointer;
}
.cart-buy__select:focus {
    outline: none;
    border-color: #66c6ba;
}
.cart-buy__btn[disabled],
.cart-lar__btn[disabled] {
    opacity: .45;
    cursor: default;
}

/* ---------- ларингоскоп: полоса «в корзину» под конструктором ---------- */
.cart-lar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 18px;
    border: 1px solid #e3eeec;
    border-radius: 6px;
    background: #f6fbfa;
}
.cart-lar__title {
    font: 15px 'Roboto Light', sans-serif;
    color: #4e4e4e;
}
.cart-lar__price {
    margin-top: 4px;
    font: 22px 'Roboto Regular', sans-serif;
    color: #4e4e4e;
}
.cart-lar__btn {
    flex-shrink: 0;
}

/* ---------- анимация пересчёта чисел ---------- */
.cart-num {
    transition: color .3s;
}
.cart-num.is-counting {
    color: #3fa99b;
}

/* ---------- липкая плашка «В корзину» под шапкой ---------- */
.cart-sticky {
    position: fixed;
    left: 0;
    right: 0;
    top: 70px;
    z-index: 999990;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid #e3eaea;
    box-shadow: 0 8px 20px rgba(30, 50, 50, .08);
    transform: translateY(-115%);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
}
.cart-sticky.is-visible {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}
.cart-sticky__inner {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 1170px;
    margin: 0 auto;
    padding: 10px 15px;
    box-sizing: border-box;
}
.cart-sticky__info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.cart-sticky__title {
    font: 16px 'Roboto Regular', sans-serif;
    color: #3b3f41;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-sticky__opt {
    margin-top: 2px;
    font: 14px 'Roboto Light', sans-serif;
    color: #7a8284;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-sticky__change {
    margin-left: 6px;
    color: #66c6ba;
    border-bottom: 1px dashed #66c6ba;
}
.cart-sticky__price {
    font: 22px 'Roboto Regular', sans-serif;
    color: #3b3f41;
    white-space: nowrap;
}
.cart-sticky .cart-sticky__btn {
    height: 46px;
    padding: 0 30px;
    line-height: 46px;
    flex-shrink: 0;
}
.cart-sticky__btn[disabled] {
    opacity: .45;
    cursor: default;
}
html.mobile-menu-open .cart-sticky {
    display: none;
}

/* ---------- всплывающее «добавлено в корзину» ---------- */
.cart-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: calc(100% - 32px);
    padding: 14px 20px;
    border-radius: 6px;
    background: #2b2f31;
    color: #fff;
    font: 15px 'Roboto Light', sans-serif;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform .25s, opacity .25s;
}
.cart-toast.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
}
.cart-toast__link {
    color: #66c6ba;
    white-space: nowrap;
    text-decoration: none;
    font-family: 'Roboto Regular', sans-serif;
}

/* ---------- страница корзины ---------- */
.cart-page {
    padding: 44px 0 70px;
    background: #f3f6f6;
    color: #4e4e4e;
    font: 17px/1.5 'Roboto Light', sans-serif;
}
.cart-page .block-title {
    margin-bottom: 26px;
}
.cart-card {
    background: #fff;
    border: 1px solid #e6ecec;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(40, 70, 70, .06);
}
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}
.cart-items {
    padding: 8px 28px 10px;
}
.cart-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 18px 0 14px;
    border-bottom: 1px solid #edf1f1;
}
.cart-card__title {
    font: 20px 'Roboto Regular', sans-serif;
}
.cart-count {
    font-size: 15px;
    color: #999;
}

/* строка товара: название | количество | сумма | удалить */
.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 150px 32px;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #edf1f1;
}
.cart-row:last-child {
    border-bottom: 0;
}
.cart-row__name a {
    color: #3b3f41;
    text-decoration: none;
    font: 17px/1.35 'Roboto Regular', sans-serif;
}
.cart-row__name a:hover {
    color: #66c6ba;
}
.cart-row__opt {
    margin-top: 4px;
    font-size: 15px;
    color: #6f7678;
}
.cart-row__art {
    display: table;
    margin-top: 6px;
    padding: 1px 8px;
    border-radius: 3px;
    background: #f1f5f5;
    font-size: 13px;
    color: #8a9294;
}
.cart-row__sum {
    text-align: right;
    white-space: nowrap;
    font: 18px 'Roboto Regular', sans-serif;
}
.cart-row__each {
    margin-top: 2px;
    font: 13px 'Roboto Light', sans-serif;
    color: #999;
}
.cart-row__qty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-qty__btn {
    width: 34px;
    height: 36px;
    border: 1px solid #dbe2e3;
    background: #fff;
    color: #4e4e4e;
    font: 18px/1 Arial, sans-serif;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.cart-qty__btn:first-child {
    border-radius: 6px 0 0 6px;
}
.cart-qty__btn:last-child {
    border-radius: 0 6px 6px 0;
}
.cart-qty__btn:hover {
    border-color: #66c6ba;
    color: #66c6ba;
}
.cart-qty__input {
    width: 46px;
    height: 36px;
    border: 1px solid #dbe2e3;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    text-align: center;
    font: 15px 'Roboto Regular', sans-serif;
    color: #4e4e4e;
    -moz-appearance: textfield;
}
.cart-qty__input::-webkit-outer-spin-button,
.cart-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cart-row__del {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #b5bcbe;
    font: 24px/1 Arial, sans-serif;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cart-row__del:hover {
    background: #fdecec;
    color: #d9534f;
}

/* правая колонка: итог + форма */
.cart-side {
    position: sticky;
    top: 90px;
    padding: 24px 26px 26px;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.cart-total__label {
    font-size: 18px;
}
.cart-total__sum {
    font: 28px 'Roboto Regular', sans-serif;
    color: #3b3f41;
    text-align: right;
    white-space: nowrap;
}
.cart-total__onreq {
    display: block;
    margin-top: 2px;
    font: 13px 'Roboto Light', sans-serif;
    color: #999;
    white-space: normal;
}
.cart-note {
    margin: 10px 0 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf1f1;
    font-size: 14px;
    line-height: 1.45;
    color: #8a9294;
}
.cart-order {
    margin-top: 20px;
}
.cart-order__title {
    margin: 0 0 16px;
    font: 22px 'Roboto Regular', sans-serif;
    color: #3b3f41;
}
.cart-field {
    display: block;
    margin: 0 0 12px;
}
.cart-field__label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #6f7678;
}
.cart-field__label i {
    font-style: normal;
    color: #66c6ba;
}
.cart-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid #dbe2e3;
    border-radius: 6px;
    background: #fbfcfc;
    font: 16px 'Roboto Light', sans-serif;
    color: #3b3f41;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.cart-input:focus {
    outline: none;
    border-color: #66c6ba;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 198, 186, .18);
}
.cart-form__pay {
    margin: 16px 0 12px;
    padding: 0;
    border: 0;
}
.cart-form__pay legend {
    margin-bottom: 8px;
    font-size: 14px;
    color: #6f7678;
}
.cart-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #e3e9ea;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.cart-radio small {
    color: #999;
    font-size: 13px;
}
.cart-radio input {
    margin: 2px 0 0;
    accent-color: #66c6ba;
}
.cart-radio.is-checked {
    border-color: #66c6ba;
    background: #f2fbf9;
}
.cart-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6f7678;
    cursor: pointer;
}
.cart-agree input {
    margin: 3px 0 0;
    flex: none;
    accent-color: #66c6ba;
}
.cart-agree a {
    color: #66c6ba;
}
.cart-side .smart-captcha {
    max-width: 100%;
    overflow: hidden;
    margin: 4px 0 6px;
    transform-origin: 0 0;
}
.cart-form__msg {
    min-height: 1em;
    margin: 8px 0;
    font-size: 14px;
}
.cart-form__msg.is-error {
    color: #d9534f;
}
.cart-form__submit {
    width: 100%;
    padding: 0 20px;
}
.cart-form__submit[disabled] {
    opacity: .6;
    cursor: default;
}

/* пустая корзина и «заказ оформлен» */
.cart-empty,
.cart-result {
    max-width: 560px;
    margin: 10px auto 0;
    padding: 46px 30px;
    text-align: center;
    background: #fff;
    border: 1px solid #e6ecec;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(40, 70, 70, .06);
}
.cart-empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    padding: 18px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #eef7f6;
    color: #66c6ba;
}
.cart-empty__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.cart-empty__title {
    font: 22px 'Roboto Regular', sans-serif;
    color: #3b3f41;
}
.cart-empty__text {
    margin: 8px 0 22px;
    font-size: 15px;
    color: #8a9294;
}
.cart-result__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #66c6ba;
    color: #fff;
    font: 34px/64px Arial, sans-serif;
}
.cart-result__text {
    margin: 0 auto 24px;
    font-size: 19px;
    line-height: 1.5;
}

/* ---------- мобильный ---------- */
@media (max-width: 1000px) {
    .cart-layout {
        grid-template-columns: minmax(0, 1fr);   /* не даём содержимому (капче) растянуть колонку шире экрана */
    }
    .cart-side {
        position: static;
    }
}
@media (max-width: 860px) {
    /* шапка: лого | телефон+почта | корзина | бургер */
    .header .header-cart {
        order: 2;
        margin: 0 18px 0 0;
    }
    .header .header-box > .burger-btn {
        order: 3;
    }
    .cart-buy {
        width: 100%;
        justify-content: flex-start;
    }
    .cart-buy__fields,
    .cart-buy__field,
    .cart-buy__select {
        width: 100%;
        max-width: none;
    }
    .cart-buy__btn {
        width: 100%;
    }
    .cart-lar {
        flex-direction: column;
        align-items: stretch;
    }
    .cart-lar__btn {
        width: 100%;
    }
    .cart-page {
        padding: 22px 0 40px;
        font-size: 16px;
    }
    .cart-page .block-title {
        margin-bottom: 16px;
    }
    /* карточки шире: меньше боковых отступов страницы и карточки */
    .cart-page .container {
        padding: 0 8px;
    }
    .cart-page .block-title {
        padding: 0 6px;
    }
    .cart-layout {
        gap: 12px;
    }
    .cart-items {
        padding: 4px 14px 6px;
    }
    .cart-side {
        padding: 18px 14px 20px;
    }
    .cart-row__name a {
        font-size: 16px;
    }
    .cart-row__opt {
        font-size: 14px;
    }
    .cart-buy__select {
        height: 46px;
    }
    /* липкая плашка на телефоне — компактная */
    .cart-sticky {
        top: 56px;
    }
    .cart-sticky__inner {
        gap: 12px;
        padding: 8px 12px;
    }
    .cart-sticky__title {
        font-size: 14px;
    }
    .cart-sticky__opt {
        font-size: 12px;
    }
    .cart-sticky__price {
        font-size: 16px;
    }
    .cart-sticky .cart-sticky__btn {
        width: auto;
        height: 40px;
        padding: 0 16px;
        font-size: 15px;
        line-height: 40px;
    }
    /* название — на всю ширину до крестика; крестик у правого края;
       ниже: количество слева, сумма справа */
    .cart-row {
        grid-template-columns: auto 1fr 28px;
        grid-template-areas:
            "name name del"
            "qty  sum  sum";
        gap: 12px 8px;
        padding: 16px 0;
    }
    .cart-row__name { grid-area: name; min-width: 0; }
    .cart-row__del {
        grid-area: del;
        justify-self: end;
        align-self: start;
        width: 28px;
        height: 28px;
        margin: -4px -6px 0 0;
    }
    .cart-row__qty { grid-area: qty; justify-content: flex-start; }
    .cart-row__sum { grid-area: sum; align-self: center; justify-self: end; }
    .cart-total__sum {
        font-size: 24px;
    }
    .cart-empty,
    .cart-result {
        padding: 34px 18px;
    }
    .cart-toast {
        bottom: 12px;
        flex-wrap: wrap;
        gap: 6px 14px;
    }
}
/* узкие телефоны: лого + телефон/почта + корзина + бургер в одну строку */
@media (max-width: 374px) {
    .header .header-cart {
        margin-right: 10px;
    }
    .header .logo,
    .header .logo-en {
        width: 92px !important;
        background-size: 92px 25px !important;
    }
    .header .tel {
        margin-right: 10px !important;
        font-size: 12px !important;
    }
    .header .tel .tel-mail {
        font-size: 10px !important;
    }
}

/* ларингоскоп: прокрутка к конструктору с учётом фиксированной шапки */
#lar {
    scroll-margin-top: 110px;
}
