/* ========== КОРЗИНА ========== */

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cart-container h1 {
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

/* ========== ОСНОВНАЯ СЕТКА ========== */

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

/* ========== ТАБЛИЦА КОРЗИНЫ ========== */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cart-table th {
    padding: 15px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e7e7e7;
}

.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* ========== ЯЧЕЙКА ТОВАРА ========== */

.product-cell {
    width: 40%;
}

.product-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 4px;
    flex-shrink: 0;
}

.product-image-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #f8f9fa;
    border-radius: 4px;
    flex-shrink: 0;
}

.product-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 500;
    color: #0066c0;
    text-decoration: none;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-name:hover {
    color: #c45500;
    text-decoration: underline;
}

.product-brand {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.stock-warning {
    font-size: 12px;
    color: #cc0000;
    margin-top: 5px;
}

/* ========== ЯЧЕЙКА ЦЕНЫ ========== */

.price-cell {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* ========== СЕЛЕКТОР КОЛИЧЕСТВА ========== */

.quantity-cell {
    min-width: 120px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #ff9900;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    padding: 0 4px;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.multiplicity-hint {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* ========== ЯЧЕЙКА СУММЫ ========== */

.total-cell {
    font-weight: 600;
    color: #b12704;
    white-space: nowrap;
}

.item-total {
    font-weight: 600;
}

/* ========== КНОПКА УДАЛЕНИЯ ========== */

.remove-cell {
    text-align: center;
    width: 40px;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    color: #cc0000;
}

/* ========== ИТОГО КОРЗИНЫ ========== */

.cart-summary {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.cart-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7e7e7;
    font-size: 18px;
    font-weight: 600;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.summary-row.total {
    border-top: 1px solid #e7e7e7;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 600;
}

.summary-price,
.total-price {
    font-weight: 600;
}

.total-price {
    color: #b12704;
}

/* ========== КНОПКИ ========== */

.btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    background: #ff9900;
    color: #000;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 20px;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-checkout:hover {
    background: #e68900;
}

.btn-continue {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    color: #333;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    margin-top: 10px;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-continue:hover {
    background: #e0e0e0;
}

/* ========== ПУСТАЯ КОРЗИНА ========== */

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
}

.empty-cart p {
    margin-bottom: 20px;
    color: #666;
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-width: 992px) {
    .cart-layout {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: 15px;
    }
    
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-table {
        overflow-x: auto;
        display: block;
        -webkit-overflow-scrolling: touch;
    }
    
    .cart-table th,
    .cart-table td {
        white-space: nowrap;
    }
    
    .product-cell {
        min-width: 250px;
    }
    
    .product-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .product-image,
    .product-image-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .product-details {
        text-align: center;
    }
    
    .cart-summary {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .cart-container h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 12px 10px;
    }
    
    .quantity-selector {
        flex-direction: column;
        gap: 5px;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 50px;
        height: 28px;
        font-size: 12px;
    }
}