/* --- Base Layout --- */
.cart-main-container {
    padding: 150px 5% 50px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 2fr 1fr; /* السلة أكبر من ملخص الدفع */
    gap: 40px;
    color: #fff;
    align-items: start;
}

/* --- Cart Section (Items) --- */
.cart-section {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(128, 0, 0, 0.2); /* لمسة أحمر سراب */
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--main-red);
    padding-bottom: 10px;
    width: fit-content;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Cart Item Card (Generated by JS) --- */
/* الكود ده هتضيفه في الـ JS لما تملأ الحاوية */
.cart-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222;
    border-radius: 8px;
    padding: 15px;
    transition: 0.3s;
}

.cart-item:hover {
    border-color: #444;
    transform: translateX(-5px);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: 20px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #fff;
    font-weight: bold;
}

/* --- Quantity Controls (+/-) --- */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 30px;
}

.qty-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--main-red);
    border-color: var(--main-red);
}

.qty-number {
    font-size: 1.1rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* زر الحذف */
.delete-btn {
    background: transparent;
    color: #666;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
}

.delete-btn:hover {
    color: var(--main-red);
    transform: scale(1.1);
}

/* --- Checkout Grid (Inputs & Summary) --- */
.checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky; /* جعل ملخص الطلب يتحرك مع التمرير */
    top: 130px;
}

/* كارت بيانات العميل */
.customer-details-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(128, 0, 0, 0.1);
}

.customer-details-card h3 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-details-card input, 
.customer-details-card textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    resize: none;
}

.customer-details-card input:focus, 
.customer-details-card textarea:focus {
    border-color: var(--main-red);
}

/* كارت ملخص الطلب */
.order-summary-card {
    background: #111;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(128, 0, 0, 0.1);
}

.summary-item {
    font-size: 0.9rem;
}

.summary-item.total {
    font-size: 1.3rem;
}

.confirm-btn {
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.confirm-btn:hover {
    background: #a00000 !important;
    letter-spacing: 1px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 968px) {
    .cart-main-container {
        grid-template-columns: 1fr; /* عرض كامل في الموبايل */
        padding-top: 120px;
    }

    .checkout-grid {
        position: static; /* إلغاء الـ sticky */
    }

    .cart-item {
        flex-wrap: wrap; /* السماح للعناصر بالالتفاف */
        gap: 15px;
        justify-content: center;
        text-align: center;
    }

    .cart-item-image {
        margin: 0;
        width: 70px;
        height: 70px;
    }

    .quantity-control {
        margin: 10px 0;
        order: 3; /* وضع الكمية في السطر الثاني */
        width: 100%;
        justify-content: center;
    }

    .delete-btn {
        position: absolute;
        top: 10px;
        left: 10px;
    }
}
