/* ============================================
   Корзина — табличный layout десктоп + карточки мобильный
   Префикс ct- (cart) для изоляции
   ============================================ */
.ct-wrap {
    max-width: 940px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333;
    padding: 10px 0;
}
.ct-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}
.ct-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #046189;
    text-decoration: none;
    margin-bottom: 20px;
}
.ct-back-link:hover { text-decoration: underline; }
.ct-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px; height: 30px;
    padding: 0 8px;
    background: #046189;
    color: #fff;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 600;
}

/* ===== Прогресс-бар доставки ===== */
.ct-delivery-bar { padding: 18px 24px; border-radius: 12px; font-size: 15px; margin-bottom: 20px; }
.ct-delivery-free {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f0faf4, #e8f5e9);
    border: 1px solid #c8e6c9;
}
.ct-delivery-icon {
    width: 48px; height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(25,162,77,0.15);
}
.ct-delivery-text { color: #2e7d32; line-height: 1.5; font-size: 15px; }
.ct-delivery-congrats { font-weight: 700; font-size: 17px; display: block; margin-bottom: 2px; }
.ct-delivery-progress {
    background: #f8fbfd;
    border: 1px solid #d6e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ct-delivery-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ct-delivery-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #046189;
    font-weight: 500;
    font-size: 15px;
}
.ct-delivery-amount { font-size: 20px; font-weight: 700; color: #046189; }
.ct-progress-track {
    height: 10px;
    background: #e4edf2;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}
.ct-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #046189, #19a24d);
    border-radius: 5px;
    position: relative;
    min-width: 10px;
}
.ct-progress-glow {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    border-radius: 0 5px 5px 0;
}
.ct-delivery-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #999;
}
.ct-delivery-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f8fa;
    border: 1px solid #e8eaed;
    color: #888;
    font-size: 15px;
}
.ct-delivery-info svg { flex-shrink: 0; }

/* ===== Заголовок таблицы (десктоп) ===== */
.ct-table-header {
    display: grid;
    grid-template-columns: 90px 1fr 80px 120px 80px 100px 60px;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 2px solid #e8e8e8;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ct-table-header > div { display: flex; align-items: center; }
.ct-th-qty, .ct-th-price, .ct-th-sum, .ct-th-del { justify-content: center; }

/* ===== Строка товара (десктоп — grid) ===== */
.ct-products { display: flex; flex-direction: column; }
.ct-row {
    display: grid;
    grid-template-columns: 90px 1fr 80px 120px 80px 100px 60px;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f1f3;
    align-items: center;
}
.ct-row:last-child { border-bottom: none; }

/* Фото */
.ct-td-photo { display: flex; align-items: center; justify-content: center; }
.ct-td-photo img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }

/* Название */
.ct-td-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; justify-content: center; }
.ct-product-link { font-size: 15px; font-weight: 500; color: #333; text-decoration: none; line-height: 1.3; }
.ct-product-link:hover { color: #046189; }

/* Вес */
.ct-td-weight { font-size: 14px; color: #777; text-align: center; }
.ct-mob-price { display: none; }

/* Кол-во */
.ct-td-qty { display: flex; justify-content: center; }
.ct-qty {
    display: flex;
    align-items: center;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
}
.ct-qty-btn {
    width: 36px; height: 36px;
    background: #f7f8fa;
    border: none;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.ct-qty-btn:hover { background: #eee; }
.ct-qty-input {
    width: 40px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border: none;
    border-left: 1px solid #d0d5dd;
    border-right: 1px solid #d0d5dd;
    line-height: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
}

/* Цена */
.ct-td-price { text-align: center; font-size: 15px; color: #333; }
.ct-price-old { font-size: 13px; color: #bbb; text-decoration: line-through; display: block; }

/* Сумма */
.ct-td-sum { text-align: center; }
.ct-line-sum-value { font-size: 17px; font-weight: 700; color: #1a1a1a; }
.ct-line-saving { display: block; font-size: 12px; color: #999; margin-top: 2px; }

/* Удалить */
.ct-td-del { display: flex; justify-content: center; }
.ct-del-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 6px;
    color: #bbb;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}
.ct-del-btn:hover { color: #DA292B; background: #fff5f5; }
.ct-del-btn svg { flex-shrink: 0; }
.ct-del-text { display: none; }

/* Бейдж акции */
.ct-sale-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    background: #c54d34;
    color: #fff;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.85;
}
.ct-sale-badge svg { flex-shrink: 0; }

/* ===== Итого ===== */
.ct-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 2px solid #e8e8e8;
    margin-top: 10px;
}
.ct-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.ct-total-label { font-size: 18px; color: #333; font-weight: 500; }
.ct-total-count { font-size: 16px; color: #555; font-weight: 500; margin-left: 8px; }
.ct-total-sum { font-size: 30px; font-weight: 700; color: #1a1a1a; }

/* Кнопки */
.ct-checkout-btn {
    width: 100%;
    padding: 20px;
    font-size: 19px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: #19a24d;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(25,162,77,0.3);
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}
.ct-checkout-btn:hover { background: #15883f; box-shadow: 0 6px 20px rgba(25,162,77,0.4); transform: translateY(-1px); }
.ct-continue-btn {
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-family: inherit;
    color: #4da054;
    background: transparent;
    border: 2px solid #84c79e;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}
.ct-continue-btn:hover { border-color: #1a8a24; background: #f8fbfd; }

/* Доверие */
.ct-trust {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 8px;
}
.ct-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999;
}
.ct-trust-item svg { flex-shrink: 0; width: 16px; height: 16px; }
.ct-pay-icons {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding-top: 6px;
}
.ct-pay-icons img { height: 22px; opacity: 0.5; }

/* ===== Мобильная адаптация: таблица → карточки ===== */
@media (max-width: 700px) {
    .ct-wrap { max-width: 100%; padding: 10px 0; }
    .ct-title { font-size: 22px; gap: 10px; }
    .ct-count-badge { min-width: 24px; height: 24px; font-size: 13px; }
    .ct-delivery-bar { padding: 12px 14px; font-size: 13px; border-radius: 8px; margin-bottom: 14px; }
    .ct-delivery-congrats { font-size: 14px; }
    .ct-delivery-text { font-size: 13px; }
    .ct-delivery-icon { width: 36px; height: 36px; }
    .ct-delivery-label { font-size: 13px; }
    .ct-delivery-amount { font-size: 16px; }
    .ct-progress-track { height: 6px; }

    /* Скрываем заголовок таблицы */
    .ct-table-header { display: none; }

    /* Строка → карточка: 2 колонки через grid */
    .ct-row {
        display: grid;
        grid-template-columns: 52px 1fr;
        grid-template-rows: auto;
        gap: 0 15px;
        padding: 12px 0;
        position: relative;
    }

    /* Фото — занимает все строки, по центру вертикально */
    .ct-td-photo {
        grid-column: 1;
        grid-row: 1 / 4;
        align-self: center;
        width: 52px;
    }
    .ct-td-photo img { width: 52px; height: 52px; border-radius: 6px; }

    /* Название — строка 1, колонка 2 */
    .ct-td-name {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding-right: 28px;
    }
    .ct-product-link { font-size: 14px; }

    /* Вес + цена — строка 2, колонка 2 */
    .ct-td-weight {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        font-size: 12px;
        color: #999;
        margin-top: 2px;
    }

    /* Кнопка удаления — абсолютно позиционированная */
    .ct-td-del {
        position: absolute;
        top: 12px;
        right: 0;
    }
    .ct-del-btn { padding: 4px; }
    .ct-del-btn svg { width: 14px; height: 14px; }

    /* Кол-во — строка 3, колонка 2 */
    .ct-td-qty {
        grid-column: 2;
        grid-row: 3;
        margin-top: 6px;
        justify-self: start;
    }
    .ct-td-price { display: none; }
    .ct-mob-price { display: inline; color: #888; }
    .ct-td-sum {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
        align-self: center;
        margin-top: 6px;
        text-align: right;
    }
    .ct-line-sum-value { font-size: 16px; }

    .ct-qty-btn { width: 30px; height: 30px; font-size: 16px; }
    .ct-qty-input { width: 34px; font-size: 14px; line-height: 30px; height: 30px; }

    .ct-total-sum { font-size: 22px; }
    .ct-total-label { font-size: 15px; }
    .ct-checkout-btn { padding: 14px; font-size: 16px; border-radius: 8px; }
    .ct-continue-btn { padding: 12px; font-size: 15px; border-radius: 8px; }
    .ct-trust { gap: 10px; }
    .ct-trust-item { font-size: 10px; }
    .ct-pay-icons img { height: 16px; }
    .ct-sale-badge { font-size: 9px; padding: 1px 5px; }
    .ct-back-link { margin-bottom: 15px; font-size: 13px; }
    .ct-summary { gap: 12px; padding-top: 12px; }
}
