﻿/* Файл wwwroot\css\cart.css */

/* Стили для корзины */
.cart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

    .cart-container h1 {
        color: #333;
        font-size: 24px;
        margin-bottom: 20px;
        border-bottom: 2px solid #cc0000;
        padding-bottom: 10px;
    }

/* Пустая корзина */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

    .empty-cart img {
        width: 120px;
        height: 120px;
        opacity: 0.5;
        margin-bottom: 20px;
    }

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

    .empty-cart p {
        color: #999;
        font-size: 16px;
        margin-bottom: 30px;
    }

.continue-shopping-btn {
    display: inline-block;
    background: #cc0000;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}

    .continue-shopping-btn:hover {
        background: #990000;
    }

/* Содержимое корзины */
.cart-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.cart-items {
    flex: 2;
    min-width: 300px;
}

.cart-summary {
    flex: 1;
    min-width: 250px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    height: fit-content;
}

    .cart-summary h3 {
        color: #333;
        font-size: 18px;
        margin-top: 0;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #ddd;
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

    .summary-row.total {
        font-weight: bold;
        color: #333;
        font-size: 18px;
        border-top: 2px solid #cc0000;
        padding-top: 15px;
        margin-top: 15px;
    }

.checkout-btn {
    display: block;
    background: #cc0000;
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0 10px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}

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

.clear-cart-btn {
    display: block;
    background: white;
    color: #cc0000;
    border: 1px solid #cc0000;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: all 0.2s;
}

.checkout-btn,
.clear-cart-btn {
    box-sizing: border-box; /* паддинги и границы включаются в width: 100% */
}


    .clear-cart-btn:hover {
        background: #ffeeee;
    }

.continue-shopping-link {
    display: block;
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-top: 15px;
}

    .continue-shopping-link:hover {
        color: #cc0000;
        text-decoration: underline;
    }

/* Таблица корзины */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

    .cart-table thead tr {
        background: #f5f5f5;
        border-bottom: 2px solid #ddd;
    }

    .cart-table th {
        text-align: left;
        padding: 12px 10px;
        color: #333;
        font-size: 14px;
        font-weight: bold;
    }

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

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: normal;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.cart-item-sku {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
}

.cart-item-info-text {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.cart-item-price {
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

.cart-item-total {
    color: #cc0000;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

/* Контролы количества */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s;
}

    .quantity-btn:hover {
        background: #f5f5f5;
        border-color: #cc0000;
        color: #cc0000;
    }

.quantity-input {
    width: 70px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    -moz-appearance: textfield;
}

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

    .quantity-input:focus {
        outline: none;
        border-color: #cc0000;
    }

/* Кнопка удаления */
.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

    .remove-btn svg {
        stroke: #999;
        stroke-width: 2;
    }

    .remove-btn:hover {
        background: #ffeeee;
    }

        .remove-btn:hover svg {
            stroke: #cc0000;
        }

/* Бейдж корзины */
.cart-badge {
    background: #cc0000;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .cart-content {
        flex-direction: column;
    }

    .cart-table {
        font-size: 12px;
    }

    .cart-item-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-image {
        width: 40px;
        height: 40px;
    }

    .quantity-control {
        flex-wrap: wrap;
    }
}
