/* ONLINE PARK — корзина, оформление, результат оплаты.
   Размеры сняты с макета: фреймы Cart (86:8570), Cart-360 (106:7188), delete (110:18632),
   Order (108:9836), Order Pay Success (109:17644), order (109:17311). */

/* ── Общее: чекбокс, счётчик количества ──────────────────── */

.cb { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 16px; font-weight: 500; }
.cb input { position: absolute; opacity: 0; width: 0; height: 0; }
.cb-box {
    width: 24px; height: 24px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #cdcdcd; border-radius: 6px; background: var(--white); color: var(--blue);
    transition: border-color .15s;
}
.cb-box .icon { opacity: 0; }
.cb input:checked + .cb-box { border-color: var(--blue); }
.cb input:checked + .cb-box .icon { opacity: 1; }
.cb input:disabled + .cb-box { border-color: #e2e2e2; cursor: default; }
.cb input:focus-visible + .cb-box { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Степпер: две квадратные кнопки на сером и число между ними, без рамки — как в макете. */
.qty { display: inline-flex; align-items: center; }
.qty button {
    width: 48px; height: 48px; border: 0; border-radius: var(--r-8);
    background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 600;
}
.qty button:hover { background: var(--bg-grey); }
.qty input {
    width: 48px; height: 48px; border: 0; background: transparent;
    text-align: center; font-size: 16px; -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-square {
    width: 48px; height: 48px; flex: none; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--r-8); background: var(--bg); color: var(--ink);
    transition: background .15s;
}
.btn-square:hover { background: var(--bg-grey); }

/* ── Страница корзины ────────────────────────────────────── */

.cart-page .crumbs { font-size: 14px; opacity: 1; margin-bottom: 36px; }
.cart-page .crumbs span:last-child { color: var(--blue); }
.cart-page h1 { font-size: 36px; line-height: 1.2; margin-bottom: 8px; }
.cart-page h1 .cart-n { color: var(--blue); font-weight: 400; }

.cart-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.cart-tools > form { display: contents; }
.cart-tools .cb { margin-right: 16px; white-space: nowrap; }
.cart-tools .cb-box { width: 20px; height: 20px; border-radius: 5px; }
.cart-tools .btn-tool {
    height: 37px; padding: 0 12px; gap: 8px;
    border: 0; border-radius: var(--r-8); background: var(--white);
    font-size: 16px; font-weight: 500; color: var(--ink);
    display: inline-flex; align-items: center;
}
.cart-tools .btn-tool:hover { background: var(--bg-grey); }
.cart-tools .btn-tool .icon { color: var(--orange); }
.cart-tools .btn-tool-del .icon { color: var(--red); }
.cart-tools .btn-tool span { white-space: nowrap; }
.cart-note { margin-left: auto; font-size: 14px; opacity: .5; text-align: right; }

.cart { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.cart > * { min-width: 0; }
.cart-list { display: flex; flex-direction: column; gap: 10px; }

/* Позиция: галочка | картинка + название + управление | цена */
.ci {
    display: grid; grid-template-columns: 56px 1fr 199px;
    background: var(--white); border-radius: var(--r-8);
    min-height: 156px;
}
.ci-check { display: flex; align-items: center; padding-left: 16px; }
.ci-main { display: flex; gap: 18px; padding: 12px 16px 12px 0; min-width: 0; }
.ci-pic { position: relative; width: 172px; flex: none; }
.ci-pic a, .ci-pic .ci-img {
    display: flex; align-items: center; justify-content: center;
    width: 172px; height: 132px; border-radius: var(--r-8); background: var(--bg-grey); overflow: hidden;
}
.ci-pic img { width: 100%; height: 100%; object-fit: cover; }
.ci-flags { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.ci-flags .badge { height: 24px; padding: 0 8px; }
.ci-fav {
    position: absolute; top: 6px; right: 7px;
    width: 32px; height: 32px; border: 0; border-radius: var(--r-64);
    display: flex; align-items: center; justify-content: center;
    background: var(--white); color: var(--ink);
}
.ci-fav:hover { color: var(--orange); }
.ci-fav.is-on { background: var(--orange); color: var(--white); }
.ci-body { display: flex; flex-direction: column; justify-content: space-between; flex: 1 0 0; min-width: 0; }
.ci-name {
    font-size: 18px; font-weight: 500; line-height: 1.35; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ci-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ci-price {
    display: flex; flex-direction: column; justify-content: center; gap: 8px;
    padding: 12px 24px; border-left: 1px solid var(--bg-grey);
}
.ci-price b { font-size: 24px; font-weight: 700; line-height: 1; }
.ci-price s { font-size: 13px; opacity: .5; }
.ci-price .ci-changed { font-size: 16px; color: var(--red); }
.ci-price .ci-none { font-size: 16px; opacity: .5; }
.ci-off .ci-main, .ci-off .ci-price { opacity: .5; }

/* Комплект: рамка цвета акцента, товары столбиком, общий счётчик и одна кнопка удаления */
.ci-set { border: 1px solid var(--cyan); grid-template-columns: 55px 1fr 199px; }
.ci-set .ci-main { display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 12px 0; }
.ci-set-label { font-size: 14px; color: var(--orange); margin-bottom: 8px; }
.ci-set-row { display: flex; align-items: center; gap: 12px; min-height: 80px; }
.ci-set-row .ci-set-pic {
    width: 104px; height: 80px; flex: none; border-radius: var(--r-8);
    background: var(--bg-grey); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.ci-set-row img { width: 100%; height: 100%; object-fit: cover; }
/* На десктопе название и кнопка в одну строку, на мобильном кнопка уходит под название */
.ci-set-body { display: flex; align-items: center; gap: 12px; flex: 1 0 0; min-width: 0; }
.ci-set-body .ci-name { flex: 1 0 0; }
.ci-set-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.btn-set-del {
    height: 48px; padding: 0 24px; gap: 8px; min-width: 249px;
    border: 0; border-radius: var(--r-8); background: var(--bg); color: var(--ink);
    font-size: 16px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
}
.btn-set-del .icon, .btn-set-del span { opacity: .5; }
.btn-set-del:hover { background: var(--bg-grey); }
.ci-terms { margin-top: 24px; font-size: 14px; line-height: 20px; }
.ci-terms small { display: block; font-size: 13px; opacity: .5; margin-bottom: 4px; }

/* Итог справа */
.cart-total { position: sticky; top: 16px; background: var(--white); border-radius: var(--r-8); padding: 16px; }
.cart-total h2 { font-size: 24px; font-weight: 700; margin-bottom: 14px; }
.ct-row {
    display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px;
    min-height: 41px; border-bottom: 1px solid var(--bg-grey); font-size: 16px;
}
.ct-row > span:first-child { opacity: .8; }
.ct-row > span:last-child { display: flex; align-items: center; gap: 8px; }
.ct-row .badge { font-size: 11px; letter-spacing: 1px; padding: 4px 8px; }
.ct-row-total { min-height: 49px; }
.ct-promo { margin: 4px 0 8px; }
.ct-promo-form { display: flex; gap: 8px; }
.ct-promo-form input { flex: 1; min-width: 0; height: var(--ctrl-sm, 44px); padding: 0 14px; border: 1px solid var(--ink-10); border-radius: var(--r-8); background: var(--bg); font: inherit; color: var(--ink); }
.ct-promo-form input:focus { outline: none; border-color: var(--blue); }
.ct-promo-form .btn { height: var(--ctrl-sm, 44px); padding: 0 14px; white-space: nowrap; }
.ct-promo-on { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: 14px; }
.ct-promo-on b { color: var(--blue); }
.ct-promo-x { display: inline-flex; padding: 0; background: none; border: 0; cursor: pointer; color: var(--ink); opacity: .5; }
.ct-promo-x:hover { opacity: 1; }
.ct-row-total > span:last-child { font-size: 24px; font-weight: 700; }
.cart-total .btn-go {
    width: 100%; height: 52px; margin-top: 8px;
    font-size: 16px; font-weight: 500; border-radius: var(--r-8);
}

/* Пустая корзина */
.cart-empty p { font-size: 16px; opacity: .5; margin: 12px 0 24px; }

/* Совместимость со старыми блоками итогов (страница заказа в кабинете) */
.summary { position: sticky; top: 16px; background: var(--white); border-radius: var(--r-8); padding: 16px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.summary-total { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--ink-10); font-size: 20px; font-weight: 700; }

/* ── Модалка удаления ────────────────────────────────────── */

.modal-del { max-width: 340px; padding: 13px 13px 13px; border-radius: var(--r-12); }
.modal-del .modal-head { margin-bottom: 8px; gap: 12px; }
.modal-del .modal-title { font-size: 20px; line-height: 22px; }
.modal-del .modal-close { width: 18px; height: 18px; background: transparent; color: var(--red); padding: 0; flex: none; margin-top: 1px; }
.modal-del-name { padding: 12px 10px; border-radius: var(--r-8); background: var(--bg); font-size: 16px; line-height: 1.4; }
.modal-del .modal-actions { margin-top: 14px; gap: 14px; }
.modal-del .modal-actions .btn { height: 39px; font-size: 14px; font-weight: 500; padding: 0 12px; }
.modal-del .btn-no { flex: 0 0 108px; background: var(--bg); }
.modal-del .btn-yes { background: var(--red); color: var(--white); }
.modal-del .btn-yes:hover { background: #d94444; color: var(--white); }

/* ── Адаптив ─────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .cart { grid-template-columns: 1fr 320px; }
    .ci { grid-template-columns: 48px 1fr 170px; }
    .ci-set { grid-template-columns: 47px 1fr 170px; }
    .ci-price { padding: 12px 16px; }
}
@media (max-width: 991px) {
    .cart { grid-template-columns: 1fr; }
    .cart-total, .summary { position: static; }
    .cart-total { order: -1; }
}
@media (max-width: 767px) {
    .cart-page .crumbs { font-size: 13px; margin-bottom: 26px; }
    .cart-page h1 { font-size: 32px; margin-bottom: 16px; }
    .cart-tools { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .cart-tools .cb { margin-right: auto; }
    .cart-tools .btn-tool { height: 32px; width: 40px; padding: 0; justify-content: center; }
    .cart-tools .btn-tool span:not(.icon) { display: none; }
    .cart-note { flex: 0 0 100%; margin: 4px 0 0; font-size: 14px; text-align: left; }
    .cart { gap: 8px; }
    .cart-list { gap: 8px; }
    /* Карточки на мобильном — во всю ширину экрана, как в макете */
    .cart-total, .ci { margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
    .cart-total { padding: 16px 20px; }
    .cart-total h2 { font-size: 20px; margin-bottom: 10px; }
    .ct-row { min-height: 33px; font-size: 14px; }
    .ct-row-total { min-height: 39px; }
    .ct-row-total > span:last-child { font-size: 18px; }
    .cart-total .btn-go { margin-top: 8px; }

    .ci { display: flex; flex-direction: column; padding: 12px 20px; min-height: 0; }
    .ci-check { order: 0; padding: 0; }
    .ci-price { order: 1; margin: -24px 0 0 40px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--bg-grey); flex-direction: row; align-items: baseline; justify-content: flex-end; }
    .ci-price b { font-size: 24px; }
    .ci-price s { font-size: 14px; }
    .ci-price .ci-changed, .ci-price .ci-none { font-size: 13px; }
    .ci-main { order: 2; padding: 12px 0 0; gap: 16px; }
    .ci-pic, .ci-pic a, .ci-pic .ci-img { width: 104px; height: 80px; }
    .ci-flags, .ci-fav { top: 4px; }
    .ci-flags { left: 4px; }
    .ci-fav { right: 4px; }
    .ci-flags .badge { height: 19px; padding: 0 6px; font-size: 11px; }
    .ci-name { font-size: 13px; line-height: 1.25; }
    .ci-ctrl { margin-top: 8px; }
    .ci-ctrl .btn-square { margin-right: 16px; }
    .qty button, .qty input, .btn-square { width: 40px; height: 40px; }
    .qty input { font-size: 14px; }
    .btn-square .icon { width: 20px; height: 20px; }
    .ci-off .ci-main, .ci-off .ci-price { opacity: .5; }

    .ci-set { flex-direction: column; border: 0; }
    .ci-set .ci-check { display: flex; align-items: center; gap: 12px; }
    .ci-set .ci-set-label { margin: 0; font-size: 16px; font-weight: 500; }
    .ci-set .ci-price { margin-left: 0; flex-wrap: wrap; }
    .ci-set .ci-price .ci-terms { order: 3; width: 100%; margin: 8px 0 0; font-size: 13px; line-height: 1.4; text-align: left; }
    .ci-set .ci-main { padding: 12px 0 0; gap: 4px; }
    .ci-set-row { align-items: flex-start; gap: 12px; }
    .ci-set-row .ci-set-pic { width: 104px; height: 80px; }
    .ci-set-body { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ci-set-body .ci-name { flex: none; }
    .ci-set-foot { margin-top: 8px; }
    .btn-set-del { width: 100%; min-width: 0; height: 52px; }

    .modal-del { max-width: 340px; }

}
@media (max-width: 479px) {
    .ci-set-foot { flex-direction: column; align-items: stretch; }
    .ci-set-foot .qty { align-self: flex-start; }
}

/* ── Оформление заказа: три колонки, как в макете ────────── */

.co-head { display: flex; align-items: center; gap: 8px; margin: 40px 0 24px; }
.crumbs + .co-head { margin-top: 24px; }
.co-back { width: 56px; height: 43px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); }
.co-back .icon { transform: rotate(180deg); }
.co-head h1 { font-size: 36px; line-height: 1.2; }

.co { display: grid; grid-template-columns: 1fr 1fr 380px; gap: 20px; align-items: start; }
/* Без min-width:0 колонку распирают select и длинный e-mail — на 768 правая колонка уезжала за экран */
.co > * { min-width: 0; }
.co-col, .co-total { background: var(--white); border-radius: var(--r-8); padding: 16px; }
.co-col h2, .co-total h2 { font-size: 24px; line-height: 32px; margin-bottom: 16px; }
.co-total h2 { margin-bottom: 8px; }

/* Переключатели: в доставке группа отбита линиями сверху и снизу, в оплате — без линий */
.co-radios { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-top: 1px solid var(--bg-grey); border-bottom: 1px solid var(--bg-grey); }
.co-radios-plain { padding: 0; border: 0; }
.co-radio { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.co-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.co-dot { width: 20px; height: 20px; flex: none; border: 1px solid #cdcdcd; border-radius: 50%; background: var(--white); position: relative; }
.co-radio input:checked + .co-dot { border-color: var(--blue); }
.co-radio input:checked + .co-dot::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--blue); }
.co-radio input:focus-visible + .co-dot { outline: 2px solid var(--blue); outline-offset: 2px; }
.co-radio-text { min-width: 0; }
.co-radio-text b { display: block; font-size: 16px; font-weight: 500; line-height: 20px; }
.co-radio-text span { display: block; font-size: 13px; line-height: 17px; opacity: .5; }
/* СБП — выгоднее магазину, поэтому самый заметный способ; карта — мельче и бледнее */

.co-block { margin-top: 16px; }
.co-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 8px; }
.co-col h2 + .co-label-row, .co-block > .co-label-row:first-child { margin-top: 0; }
.co-label { font-size: 16px; line-height: 20px; }
.co-saved { background: 0; border: 0; padding: 0; color: var(--ink); font-size: 16px; line-height: 20px; text-decoration: underline; }
.co-saved:hover { color: var(--blue); }
.co-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.co-row > * { min-width: 0; }
/* Поле: 54px, скругление 8, после иконки пунктирная черта */
.co-col .ffield { height: 54px; gap: 16px; margin-bottom: 8px; border-radius: var(--r-8); }
.co-col .ffield > .icon { order: 0; }
.co-col .ffield:has(> .icon)::before { content: ''; order: 1; flex: none; height: 20px; border-left: 1px dashed var(--blue); opacity: .5; }
.co-col .ffield > input, .co-col .ffield > select { order: 2; font-size: 16px; }
.co-col .ffield select { flex: 1 0 0; min-width: 0; border: 0; background: 0; outline: 0; appearance: none; text-overflow: ellipsis; }
.co-col > .co-block:last-child .ffield:last-child, .co-col > .ffield:last-child { margin-bottom: 0; }

/* Итог: строки в две колонки, как блок итогов в корзине */
.co-item, .co-line {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px;
    padding: 5px 0; margin-bottom: 8px; border-bottom: 1px solid var(--bg-grey); font-size: 16px; line-height: 20px;
}
.co-item > span, .co-line > span:first-child { opacity: .8; padding-bottom: 4px; }
.co-item b, .co-line b { font-weight: 500; white-space: nowrap; }
.co-line { align-items: center; min-height: 30px; }
.co-line > span:first-child { padding-bottom: 0; }
.co-line-total { min-height: 41px; }
.co-line-total b { font-size: 24px; font-weight: 700; line-height: 32px; }
.co-submit { height: 52px; border-radius: var(--r-8); font-size: 16px; font-weight: 500; }
.co-note { font-size: 12px; opacity: .4; margin-top: 10px; }

/* СДЭК: подсказки города и расчёт стоимости на оформлении */
.cdek-city { position: relative; }
.cdek-suggest { position: absolute; left: 0; right: 0; top: calc(100% - 4px); z-index: 20; background: var(--white); border-radius: var(--r-8); box-shadow: 0 8px 24px rgba(6, 6, 6, .12); max-height: 260px; overflow-y: auto; }
.cdek-suggest button { display: block; width: 100%; text-align: left; background: 0; border: 0; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.cdek-suggest button:hover, .cdek-suggest button:focus-visible { background: var(--bg-grey); }
.cdek-quote { font-size: 14px; opacity: 1; }

/* Заказ оформлен / оплачен */
.co-done-text { font-size: 16px; font-weight: 500; line-height: 21px; max-width: 1180px; margin-bottom: 24px; }
.co-done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.co-done-btn { height: 50px; padding: 0 16px; border-radius: var(--r-8); gap: 8px; font-size: 16px; font-weight: 500; }
.co-done-card { background: var(--white); border-radius: var(--r-8); padding: 8px 16px; max-width: 580px; }
.co-done-card .co-line:last-child { border-bottom: 0; margin-bottom: 0; }
.co-done-card .co-line b { white-space: normal; overflow-wrap: anywhere; }
.co-done-card .status { justify-self: start; padding: 2px 10px; border-radius: var(--r-24); color: var(--white); font-size: 13px; font-weight: 500; }

@media (max-width: 1199px) {
    .co { grid-template-columns: 1fr 1fr; }
    .co-total { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
    .co { grid-template-columns: 1fr; gap: 8px; }
    .co-head { margin-bottom: 16px; }
    .crumbs + .co-head { margin-top: 16px; }
    .co-back { width: 40px; }
    .co-head h1 { font-size: 28px; }
    .co-col h2, .co-total h2 { font-size: 20px; line-height: 24px; }
    .co-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .co-done-btn { width: 100%; }
}

.co-done-modal { width: 452px; max-width: 100%; padding: 16px; border-radius: var(--r-8); }
.co-done-modal .modal-head { margin-bottom: 16px; }
.co-done-modal .modal-title { font-size: 24px; line-height: 32px; }
.co-done-modal .modal-close { border: 0; background: transparent; color: var(--red); padding: 0; margin-top: 4px; }
.co-done-modal .modal-lead { margin: 0; font-size: 16px; line-height: 21px; opacity: 1; }
.co-done-modal-btn { height: 53px; border-radius: var(--r-8); font-size: 16px; font-weight: 500; margin-top: 16px; }

/* ── Оплата и её результат (в макете не нарисованы) ──────── */

.co-pay { max-width: 580px; margin: 24px auto 0; background: var(--white); border-radius: var(--r-8); padding: 24px; }
.co-pay h1 { font-size: 28px; line-height: 36px; }
.co-pay-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--ink-10); }
.co-pay-sum b { font-size: 32px; line-height: 40px; }
.co-pay-note { margin-top: 20px; font-size: 14px; line-height: 21px; color: var(--ink-50); }
.co-pay-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.co-pay-actions .btn { height: 52px; padding: 0 24px; border-radius: var(--r-8); }

@media (max-width: 479px) {
    .co-pay { padding: 20px 16px; }
    .co-pay-actions .btn { width: 100%; }
}
