/* ═══════════════════════════════════════════════════════════
   Cart Page Modern Styles (v5)
   ═══════════════════════════════════════════════════════════ */

.woocommerce-cart .woocommerce {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ─── ظرف اصلی جدول سبد ─── */
.up-cart-table-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1.5px solid #f0f0f5;
    overflow: hidden;
    margin-bottom: 30px;
}

.woocommerce-cart table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
}

.woocommerce-cart table.shop_table th {
    background: #f8f9fc;
    padding: 15px;
    font-size: 13px;
    font-weight: 800;
    color: #555;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.woocommerce-cart table.shop_table td {
    padding: 20px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f5;
    text-align: right;
}

.woocommerce-cart table.shop_table tr:last-child td {
    border-bottom: none;
}

/* ─── تصویر محصول ─── */
.product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fafbfd;
}

/* ─── نام محصول ─── */
.product-name a {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}
.product-name a:hover { color: #4837F3; }

/* ─── قیمت و جمع ─── */
.product-price, .product-subtotal {
    font-size: 14px;
    font-weight: 800;
    color: #4837F3 !important;
}

/* ─── کنترل تعداد (+ و -) ─── */
.up-qty-wrapper {
    display: inline-flex;
    align-items: center;
    background: #f4f6f9;
    border: 1.5px solid #e6e8f5;
    border-radius: 10px;
    overflow: hidden;
    direction: ltr;
}

.up-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #4837F3;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.up-qty-btn:hover { background: #ede9ff; }
.up-qty-btn.is-clicked { transform: scale(0.85); }

.up-qty-wrapper input.qty {
    width: 40px;
    height: 32px;
    border: none !important;
    background: transparent !important;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: #222;
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none;
    padding: 0 !important;
    box-shadow: none !important;
}
.up-qty-wrapper input.qty::-webkit-outer-spin-button,
.up-qty-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── دکمه حذف ─── */
.product-remove .remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff5f5;
    color: #e63946 !important;
    border-radius: 50%;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.2s;
}
.product-remove .remove:hover { background: #e63946; color: #fff !important; }

/* ─── دکمه‌های به‌روزرسانی و کد تخفیف ─── */
.woocommerce-cart table.shop_table td.actions {
    background: #f8f9fc;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.woocommerce-cart .coupon { display: flex; gap: 10px; }
.woocommerce-cart .coupon input { border-radius: 8px; border: 1px solid #ddd; padding: 8px 12px; }
.woocommerce-cart .button {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.woocommerce-cart .button:hover { background: #f0f0f5; }

/* ─── خلاصه سبد (جمع کل) ─── */
.cart-collaterals { display: flex; justify-content: flex-start; }
.woocommerce-cart .cart_totals {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1.5px solid #f0f0f5;
}
.woocommerce-cart .cart_totals h2 {
    font-size: 18px;
    font-weight: 900;
    color: #222;
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f5;
}
.woocommerce-cart .cart_totals table th { text-align: right; color: #666; }
.woocommerce-cart .cart_totals table td { text-align: left; color: #222; font-weight: 700; }
.woocommerce-cart .cart_totals .order-total td { color: #4837F3; font-size: 18px; font-weight: 900; }
.woocommerce-cart .checkout-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4837F3, #6b5bff);
    color: #fff !important;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(72, 55, 243, 0.3);
    margin-top: 20px;
}
.woocommerce-cart .checkout-button:hover { transform: translateY(-3px); }

/* ═══════════════════════════════════════════════════════════
   ریسپانسیو (تبدیل جدول به کارت در موبایل)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .woocommerce-cart table.shop_table thead { display: none; }
    .woocommerce-cart table.shop_table,
    .woocommerce-cart table.shop_table tbody,
    .woocommerce-cart table.shop_table tr,
    .woocommerce-cart table.shop_table td {
        display: block;
        width: 100%;
    }
    
    .woocommerce-cart table.shop_table tr.cart_item {
        position: relative;
        padding: 15px;
        border-bottom: 2px solid #f0f0f5;
    }
    
    .woocommerce-cart table.shop_table td {
        padding: 5px 0;
        border: none;
        text-align: center;
    }
    
    .woocommerce-cart table.shop_table td.product-thumbnail { padding-top: 10px; }
    
    .woocommerce-cart table.shop_table td.product-remove {
        position: absolute;
        top: 10px;
        left: 10px;
        width: auto;
        z-index: 10;
    }
    
    /* نمایش لیبل قیمت در موبایل */
    .woocommerce-cart table.shop_table td.product-subtotal::before {
        content: "جمع: ";
        font-weight: bold;
        color: #555;
    }
    
    .woocommerce-cart table.shop_table td.actions {
        flex-direction: column;
        gap: 15px;
    }
    .woocommerce-cart .coupon { flex-direction: column; width: 100%; }
    .woocommerce-cart .coupon input { width: 100%; }
    
    .woocommerce-cart .cart_totals { max-width: 100%; }
}