/* ========== КОНТЕЙНЕР КОРЗИНЫ ========== */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.cart-header {
    margin-bottom: 40px;
}

.cart-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1A1A1A;
}

.cart-items-count {
    font-size: 16px;
    color: #666;
}

/* ========== ПУСТАЯ КОРЗИНА ========== */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.empty-icon { font-size: 80px; margin-bottom: 20px; }
.empty-cart h2 { font-size: 28px; margin-bottom: 10px; color: #1A1A1A; }
.empty-cart p { color: #666; margin-bottom: 30px; font-size: 16px; }

/* ========== СОДЕРЖИМОЕ КОРЗИНЫ ========== */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* ========== ОСНОВНАЯ ЧАСТЬ КОРЗИНЫ ========== */
.cart-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* ========== ЭЛЕМЕНТ КОРЗИНЫ ========== */
.cart-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid #F0F0F0;
    position: relative;
    align-items: center;
}

.cart-item:last-child { border-bottom: none; }

/* ========== ФОТО ТОВАРА ========== */
.item-image {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    background: #F8FAFC;
    flex-shrink: 0;
}

.item-image a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    background: #F8FAFC;
}

.item-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BBB;
    font-size: 40px;
    text-decoration: none;
}

/* ========== ИНФОРМАЦИЯ О ТОВАРЕ ========== */
.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.item-name {
    font-size: 17px;
    font-weight: 600;
    color: #1A1A1A;
    text-decoration: none;
    line-height: 1.3;
}

.item-name:hover { color: #FF6B35; }

.item-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888;
    flex-wrap: wrap;
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-price-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.item-price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.item-price {
    font-size: 20px;
    font-weight: 700;
    color: #FF6B35;
}

.item-price-per-unit {
    font-size: 13px;
    color: #999;
}

/* ========== БЭЙДЖ НАБОРА ========== */
.cart-set-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #FF6B35;
    font-weight: 500;
    margin-top: 4px;
    user-select: none;
}

.toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.cart-set-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.cart-set-items {
    display: none;
    margin-top: 6px;
    padding: 8px 10px;
    background: #FFF5F0;
    border-radius: 6px;
    font-size: 12px;
}

.cart-set-items.open {
    display: block;
}

.cart-set-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: #666;
}

.cart-set-item:first-child {
    padding-top: 0;
}

.cart-set-item:last-child {
    padding-bottom: 0;
}

/* ========== ДЕЙСТВИЯ С ТОВАРОМ (правая часть) ========== */
.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    flex-shrink: 0;
}

.item-total {
    font-size: 22px;
    font-weight: 700;
    color: #1A1A1A;
    white-space: nowrap;
}

.item-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #F8FAFC;
    color: #FF6B35;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover { background: #FF6B35; color: white; }

.qty-input {
    width: 56px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.qty-input:focus { outline: none; }

/* ========== УДАЛЕНИЕ ТОВАРА ========== */
.btn-remove {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.btn-remove:hover {
    background: #FFE5E5;
    border-color: #E74C3C;
    color: #E74C3C;
}

/* ========== БОКОВАЯ ПАНЕЛЬ ========== */
.cart-sidebar {
    position: sticky;
    top: 20px;
}

.order-summary {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.order-summary h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1A1A1A;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 20px;
}

.summary-row strong {
    font-size: 18px;
    color: #FF6B35;
}

.btn-checkout {
    width: 100%;
    margin-bottom: 10px;
}

.btn-continue {
    width: 100%;
}

/* ========== РЕКОМЕНДОВАННЫЕ ТОВАРЫ ========== */
.recommended {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.recommended h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1A1A1A;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    justify-content: center;
}

.recommended-grid:has(.rec-card:only-child) {
    grid-template-columns: 160px;
}

.rec-card {
    background: #F8FAFC;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.rec-card:hover {
    transform: translateY(-2px);
}

.rec-image {
    width: 100%;
    height: 120px;
    background: #EEE;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rec-image .no-image {
    color: #BBB;
    font-size: 11px;
}

.rec-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rec-name {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-price {
    font-size: 13px;
    font-weight: 700;
    color: #FF6B35;
}

.rec-price .price-old {
    font-size: 10px;
    color: #999;
    text-decoration: line-through;
    display: block;
}

.recommended-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    background: #F8FAFC;
    border-radius: 8px;
}

/* ========== КНОПКИ ========== */
.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background: #FF6B35;
    color: white;
}

.btn-primary:hover { background: #E55A2B; }

.btn-secondary {
    background: white;
    color: #FF6B35;
    border: 2px solid #FF6B35;
}

.btn-secondary:hover { background: #FFF5F0; }

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .cart-content { grid-template-columns: 1fr; }
    .cart-item { 
        flex-direction: column;
        align-items: flex-start;
    }
    .item-image { width: 100%; height: 220px; }
    .item-actions { 
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .item-total { font-size: 18px; }
    .btn-remove { top: 12px; right: 12px; }
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input {
    -moz-appearance: textfield;
    appearance: textfield;
}