/* pages/static/pages/css/shop_frontend/cart.css */
/* Уникальные стили страницы «Корзина».
   Всё общее (.hero, section, .block-card, .callout, .lead) — в shop_general.css. */

/* ============================================================
   CART DEMO — демонстрация списка товаров
   ============================================================ */
.cart-demo {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 4px;
}

.cart-item {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                background-color 0.35s ease, border-color 0.35s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-strong);
}

.cart-item__thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.cart-item__info {
    min-width: 0;
}

.cart-item__name {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.98rem;
    margin-bottom: 4px;
    transition: color 0.35s ease;
}

.cart-item__meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.35s ease;
}

.cart-item__qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.cart-item__qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.cart-item__qty button:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.cart-item__qty span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.cart-item__price {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 1rem;
    white-space: nowrap;
    transition: color 0.35s ease;
}

/* ============================================================
   SUBTOTAL DEMO — промежуточная сумма
   ============================================================ */
.subtotal-demo {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 18px 0;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    font-size: 0.96rem;
    color: var(--text-primary);
    border-bottom: 1px dashed var(--border);
    transition: color 0.35s ease, border-color 0.35s ease;
}

.subtotal-row:last-child {
    border-bottom: none;
}

.subtotal-row--muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.subtotal-row--total {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 2px solid var(--accent-soft);
    border-bottom: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.subtotal-row--total span:last-child {
    color: var(--accent);
    font-size: 1.2rem;
}

/* ============================================================
   QTY DEMO — изменение количества
   ============================================================ */
.qty-demo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.qty-demo__block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 16px 14px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                background-color 0.35s ease, border-color 0.35s ease;
}

.qty-demo__block:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-strong);
}

.qty-demo__label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
    transition: color 0.35s ease;
}

.qty-demo__control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 10px;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.qty-demo__control button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.qty-demo__control button:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: scale(1.05);
}

.qty-demo__control span {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--text-heading);
    font-size: 1rem;
}

.qty-demo__remove {
    color: #ef4444 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.qty-demo__remove:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
}

.qty-demo__hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    transition: color 0.35s ease;
}

/* ============================================================
   CTA DEMO — блок с кнопками «Продолжить» и «Оформить заказ»
   ============================================================ */
.cta-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 22px 0 4px;
    padding: 26px 20px;
    background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
    border-radius: 14px;
    border: 1px dashed var(--border-strong);
    transition: background 0.35s ease, border-color 0.35s ease;
}

.cta-demo__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Базовая кнопка */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s,
                color 0.25s,
                border-color 0.25s,
                transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s;
    white-space: nowrap;
}

/* --- ГЛАВНАЯ (primary) --- */
.cta-button--primary {
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: var(--shadow-btn);
}

.cta-button--primary:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-accent);
}

.cta-button--primary:active {
    transform: translateY(-1px);
}

/* --- ВТОРИЧНАЯ (secondary) --- */
.cta-button--secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.cta-button--secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

.cta-button--secondary:active {
    transform: translateY(-1px);
}

/* --- Стрелки --- */
.cta-button__arrow {
    font-size: 1.1rem;
    transition: transform 0.25s;
    line-height: 1;
}

.cta-button--primary:hover .cta-button__arrow {
    transform: translateX(4px);
}

.cta-button__arrow--back {
    transition: transform 0.25s;
}

.cta-button--secondary:hover .cta-button__arrow--back {
    transform: translateX(-4px);
}

/* --- Подпись под кнопками --- */
.cta-demo__hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.35s ease;
    text-align: center;
}


/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 700px) {
    .cart-item {
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }

    .cart-item__thumb {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
        grid-row: 1 / 3;
    }

    .cart-item__info {
        grid-column: 2;
    }

    .cart-item__qty {
        grid-column: 2;
        justify-self: start;
    }

    .cart-item__price {
        grid-column: 2;
        justify-self: end;
        align-self: center;
        grid-row: 3;
    }

    .qty-demo {
        grid-template-columns: 1fr;
    }

    .cta-demo {
        padding: 20px 16px;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .cta-demo__buttons {
        flex-direction: column-reverse; /* главная встаёт сверху */
        gap: 10px;
    }

    .cta-button {
        width: 100%;
        padding: 14px 20px;
    }
}