﻿/* ==================== Container ==================== */
.cart-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 30px;
}

/* ==================== Header ==================== */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

    .cart-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #222;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .cart-header h3 i {
            color: #28a745;
        }

.cart-count {
    background: #28a745;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ==================== Cart Item ==================== */
.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: all 0.3s ease;
}

    .cart-item:hover {
        background: #fff;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

.cart-image img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-info h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.5;
}

.cart-info .price {
    color: #28a745;
    font-weight: 700;
    font-size: 15px;
}

/* ==================== Action Buttons ==================== */
.cart-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.25);
}

    .btn-checkout:hover {
        background: linear-gradient(135deg, #218838, #1aa179);
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(40, 167, 69, 0.35);
        color: #fff !important;
    }

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffe5e5;
    color: #dc3545 !important;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .btn-delete:hover {
        background: #dc3545;
        color: #fff !important;
        transform: scale(1.05);
    }

/* ==================== Footer ==================== */
.cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    margin-top: 15px;
    border-top: 2px dashed #eee;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 15px;
}

    .cart-footer strong {
        color: #222;
        font-size: 16px;
        margin-right: 6px;
    }

    .cart-footer .total-price {
        color: #28a745;
        font-size: 18px;
    }

/* ==================== Tablet ==================== */
@media (max-width: 992px) {
    .cart-item {
        grid-template-columns: 80px 1fr auto;
        gap: 12px;
        padding: 12px;
    }

    .cart-image img {
        width: 80px;
        height: 80px;
    }

    .btn-checkout {
        padding: 9px 14px;
        font-size: 13px;
    }
}

/* ==================== Mobile ==================== */
@media (max-width: 768px) {
    .cart-container {
        padding: 15px;
        border-radius: 10px;
    }

    .cart-header h3 {
        font-size: 16px;
    }

    /* چیدمان آیتم به صورت عمودی */
    .cart-item {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "image info"
            "action action";
        gap: 10px;
        padding: 12px;
    }

    .cart-image {
        grid-area: image;
    }

        .cart-image img {
            width: 70px;
            height: 70px;
        }

    .cart-info {
        grid-area: info;
    }

        .cart-info h4 {
            font-size: 14px;
        }

        .cart-info .price {
            font-size: 14px;
        }

    /* دکمه‌ها تمام‌عرض و زیر هم */
    .cart-action {
        grid-area: action;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-checkout {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn-delete {
        width: 100%;
        height: 42px;
    }

    .cart-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 8px;
    }

        .cart-footer > div {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f0f0f0;
        }

            .cart-footer > div:last-child {
                border-bottom: none;
            }
}

/* ==================== Small Mobile ==================== */
@media (max-width: 480px) {
    .cart-header h3 {
        font-size: 15px;
    }

    .cart-count {
        font-size: 12px;
        padding: 3px 10px;
    }

    .btn-checkout {
        font-size: 13px;
        padding: 11px 14px;
    }

    .cart-footer .total-price {
        font-size: 16px;
    }
}
