/* =========================================
   16. КОРЗИНА
   ========================================= */
.cart-item {
    transition: 0.2s;
}

.cart-item:hover {
    border-color: var(--brand-red) !important;
}

.cart-buttons-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.cart-buttons-row .btn {
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

.cart-buttons-row .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Убираем стрелки у input number */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* =========================================
   МОБИЛЬНАЯ ВЕРСИЯ КОРЗИНЫ (GRID)
   ========================================= */
@media (max-width: 768px) {
    .cart-item {
        display: grid !important;
        grid-template-columns: 64px 1fr auto !important;
        grid-template-areas: 
            "img title remove"
            "img sku   qty"
            "img price price" !important;
        gap: 8px 12px !important;
        padding: 16px !important;
        align-items: start !important;
        position: relative !important;
    }

    .cart-item__link {
        grid-area: img;
        width: 64px !important;
        height: 64px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .cart-item__img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    /* Блок с названием */
    .cart-item > div:nth-child(2) {
        grid-area: title;
        min-width: 0 !important;
    }

    .cart-item__title {
        font-size: 14px !important;
        line-height: 1.3 !important;
        margin-bottom: 2px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .cart-item__sku {
        grid-area: sku;
        font-size: 12px !important;
        color: var(--text-muted) !important;
    }

    /* Кнопка удаления */
    .cart-item .js-remove-item {
        grid-area: remove;
        position: static !important;
        padding: 4px 8px !important;
        font-size: 14px !important;
        height: 28px !important;
        width: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 4px !important;
    }

    /* Кнопки количества */
    .cart-item__qty {
        grid-area: qty;
        margin: 0 !important;
        justify-self: end !important;
        align-self: center !important;
    }

    .cart-item__qty .btn {
        padding: 2px 8px !important;
        height: 28px !important;
        font-size: 16px !important;
    }

    .cart-item__count {
        font-size: 14px !important;
        min-width: 24px !important;
    }

    /* Цена */
    .cart-item__price {
        grid-area: price;
        text-align: left !important;
        font-size: 16px !important;
        margin-top: 4px !important;
        color: var(--brand-red) !important;
    }

    /* Кнопки внизу */
    .cart-buttons-row {
        flex-direction: column;
        width: 100%;
    }
    .cart-buttons-row .btn {
        width: 100%;
    }
    
    /* Итог */
    #cart-content > div:nth-child(2) {
        text-align: center !important;
        padding: 16px !important;
    }
    #cart-content > div:nth-child(2) span:first-child {
        display: block;
        margin-bottom: 4px;
    }
}