:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8e9ee;
    --muted: #9aa0ad;
    --accent: #a5b4fc;
    --accent-ink: #0f1115;
    --danger: #f87171;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", system-ui, sans-serif;
    line-height: 1.5;
}

.cart {
    max-width: 1100px;
    margin: 0 auto;
    padding: 120px 16px 80px;
}

/* Заголовок */
.cart__step {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.cart__title {
    margin: 0 0 32px;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 600;
    line-height: 1.1;
}

.cart__error {
    margin: 0 0 24px;
    padding: 12px 16px;
    border: 1px solid rgba(248, 113, 113, .35);
    border-radius: 12px;
    background: rgba(248, 113, 113, .08);
    color: var(--danger);
}

/* Пустая корзина */
.cart-empty {
    padding: 56px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.cart-empty__text {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 18px;
}

/* Сетка */
.cart__layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* Список */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.cart-item__image {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(165, 180, 252, .25), transparent);
}

.cart-item__course {
    display: block;
    color: var(--text);
    font-family: "Cormorant Garamond", serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.cart-item__course:hover { color: var(--accent); }

.cart-item__tariff {
    display: inline-block;
    margin: 8px 0 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(165, 180, 252, .14);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.cart-item__change {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.cart-item__change:hover { color: var(--text); }

.cart-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-item__side form { margin: 0; }

.cart-item__price {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.cart-item__remove {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.cart-item__remove:hover { color: var(--danger); }

/* Итог */
.cart-summary {
    position: sticky;
    top: 96px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.cart-summary__label {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cart-summary__row {
    color: var(--muted);
    margin-bottom: 12px;
}

.cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cart-summary__total strong { font-size: 24px; }

.cart-summary__note {
    margin: 16px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

/* Кнопки */
.cart-btn {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: opacity .2s, background .2s;
}

.cart-btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.cart-btn--primary:hover { opacity: .88; }

.cart-btn--ghost {
    border: 1px solid var(--border);
    color: var(--text);
}

.cart-btn--ghost:hover { background: var(--surface-2); }

.cart-btn--block {
    display: block;
    width: 100%;
}

.cart-btn--block + .cart-btn--block { margin-top: 10px; }

/* Мобильные */
@media (max-width: 860px) {
    .cart { padding-top: 96px; }

    .cart__layout { grid-template-columns: 1fr; }

    .cart-summary { position: static; }
}

@media (max-width: 520px) {
    .cart-item {
        grid-template-columns: 88px 1fr;
        gap: 14px;
    }

    .cart-item__side {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-item__course { font-size: 20px; }
}