/*
 * ===================================================================
 * Custom WooCommerce Cart Page Styles (v5 - Modern List Design)
 * ===================================================================
 */
.content-area {
  margin-top: 140px;
  margin-bottom: 140px;
}

/* Hide the Update Cart button completely */
button[name="update_cart"] {
    display: none !important;
}
.pre-invoice{
    display:none !Important;
}
/* =========================================================================
 * PREMIUM MINIMAL CART REDESIGN
 * ========================================================================= */
 
 .product-price > div{
     display: flex;
    flex-wrap: wrap;
    gap: 7px;
 }
.woocommerce-cart .cart-collaterals .cart_totals tr th{
    border-top:none !important;
}
/* 1. Layout Container */
.woocommerce-cart .entry-content .woocommerce {
    max-width: 1480px;
    margin: 0 auto;
}

/* 2. Cart Table Styling */
.woocommerce-cart-form {
    margin-bottom: 40px;
}

table.shop_table.cart {
    border-collapse: separate;
    border-spacing: 0 20px; /* Space between rows */
    border: none !important;
    border-radius: 0;
    background: transparent !important;
}

table.shop_table.cart thead {
    background: transparent;
}


@media only screen and (max-width: 768px) {
    .product-price > div{
        
        justify-content:end !important;
    }
    .woocommerce #content table.cart .product-thumbnail, .woocommerce table.cart .product-thumbnail, .woocommerce-page #content table.cart .product-thumbnail, .woocommerce-page table.cart .product-thumbnail {
        display: block !Important;
    }
    .cart_totals table.shop_table_responsive tr:nth-child(2n) td, .cart_totals table.shop_table_responsive tr:nth-child(2n) td{
        border-radius: 12px;
        padding: 12px !important;
        text-align:right !important;
    
    }
    
    td.product-thumbnail::before{
        display:none !important;
    }
    .woocommerce-cart .woocommerce-cart-form{
            margin-left: 0 !Important
    }
    .woocommerce-cart .cart-collaterals .cart_totals{
        width: 100% !important;

    max-width: none !important;
    }
    .coupon{
        flex-wrap:wrap !important;
    }
    .coupon::before,.coupon::after{
        display:none !Important;
    }
    #coupon_code{
        flex-grow:1 !Important;
    }
    button[name='apply_coupon']{
       min-width: 140px !important;
       width: auto !important;
       flex-grow:1;
       padding:16px !Important;
    }
    .woocommerce-cart-form{
        margin-bottom:0;
    }
    .woocommerce table.shop_table td.actions{
        padding:0 !Important;
        border-top:0 !Important;
        display:flex;
        flex-direction:column-reverse;
        
        gap: 106px;
    }
    .woocommerce-cart .cart-collaterals .cart-totals tr,    .woocommerce-cart .cart-collaterals .cart-totals td{
            width: 100%;
            flex-wrap: wrap;
            display: flex;
            gap: 69px;
    }
     .content-area {
    margin-top: 80px;
    margin-bottom: 80px;
  }
  .woocommerce-cart-form__cart-item.cart_item{
      width:fit-content !important;
  }
  .cart-collaterals > div > table > tbody > tr.cart-subtotal  td,  .cart-collaterals > div > table > tbody > tr.order-total  td{
          flex-wrap: wrap;
    display: flex;
gap: 16px ! Important;
        max-width: 100% !important;
        justify-content: space-between !important;
      }
     .woocommerce table.shop_table_responsive tr, .woocommerce-page table.shop_table_responsive tr{
      width: calc(100vw - 32px) !important;
    }
    .shop_table:not(.order_details){
        width: auto !important;
       display: flex;
    }
    .actions{
        margin-top:16px !Important;
    }
} 
th.order-actions--heading,a.woocommerce-button.button.view.order-actions-button,a.woocommerce-button.button.wip-invoice.order-actions-button{
    display:none !important;
}
table.shop_table.cart thead th {
    border: none;
    padding: 15px 12px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* 3. Row Styling */
.cart_item {
    background: var(--color-content-bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cart_item td {
    padding: 25px 0 !important;
    border-top: 1px solid var(--color-border-subtle) !important;
    border-bottom: 1px solid var(--color-border-subtle) !important;
    background: transparent !important;
}

/* Rounded corners for the row ends */
.cart_item td:first-child { border-left: none; }
.cart_item td:last-child { border-right: none; }

/* 4. Product Components */
.product-remove a.remove {
    color: #ccc !important;
    font-weight: 300 !important;
    font-size: 24px !important;
    transition: color 0.3s ease;
    background: transparent !important;
}

.product-remove a.remove:hover {
    color: var(--color-primary) !important;
}

.product-thumbnail img {
    width: 90px !important;
    height: auto;
    border-radius: 12px;
    background: var(--color-card-bg);
}

.product-name a {
    font-family: 'Shabnam', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text-body);
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: var(--color-primary);
}

/* Price Styling */
.product-price, .product-subtotal {
    font-family: 'Shabnam', sans-serif;
}

.product-price ins, .product-subtotal bdi {
    text-decoration: none;
    font-weight: 700;
    color: var(--color-text-heading);
}

.product-price del {
    color: #b5ada5;
    font-size: 0.9em;
}

/* 5. Quantity Input Redesign */
.quantity .input-text.qty {
    width: 70px !important;
    height: 45px;
    border-radius: 8px !important;
    border: 1px solid var(--color-input-border) !important;
    background: var(--color-input-bg) !important;
    font-family: 'Shabnam', sans-serif;
    font-weight: 600;
    text-align: center;
}

/* 6. Action Area (Coupon & Update) */
.actions {
    background: transparent !important;
    border: none !important;
    padding-top: 30px !important;
}

.coupon {
    display: flex;
    gap: 10px;
    align-items:stretch;
}
.woocommerce table.shop_table td {
    border-top: none !important;
    padding: 9px 12px !important;
    vertical-align: middle !important;
    line-height: 1.5em;
}
#coupon_code {
    border-radius: 12px !important;
    background: var(--color-input-bg) !important;
    border: 1px solid var(--color-input-border) !important;
    padding: 10px 20px !important;
 max-width: 100% !important;
    width: 250px !important;
}
.custom-empty-cart-wrapper{
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 50px;
    background: var(--color-card-bg);
    border-radius: 24px;
    margin-left:auto;
    margin-right:auto;
    padding: 45px 12px;
}

.custom-empty-cart-wrapper > div{
    display: flex;
    flex-direction: column;
    gap: 4px;

}
.custom-empty-cart-wrapper a{

    width: fit-content;
    margin: 0 auto;
    margin-top: 34px;

}

button[name="apply_coupon"]{
   background: var(--color-text-h4) !important;
    color: var(--color-content-bg) !important;
    border-radius: 12px !important;
}
button[name="update_cart"] {
    
        background: var(--color-btn-primary) !important;

    color: var(--color-btn-primary-text) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important; 
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    padding:16px 21px !important;
    /*opacity: 0.7;*/
}

button[name="update_cart"]:hover:not(:disabled) {
    background: var(--color-text-muted) !important;
    color: white !important;
    opacity: 1;
}

/* 7. Cart Totals (Premium Sidebar Style) */
.cart-collaterals {
    display: flex;
    justify-content: flex-end;
}

.cart_totals {
    width: 100% !important;
    max-width: 450px;
    background: var(--color-product-card-bg);
    padding: 40px !important;
    border-radius: 24px;
    border: 1px solid var(--color-card-border);
    height:fit-content !important;
}

.cart_totals h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 25px;
    text-align: center;
    color: var(--color-text-h2);
}

.shop_table_responsive tr:not(:nth-last-child(n-1)) {
    border-bottom: 1px solid var(--color-border-subtle) !important;
}

.shop_table_responsive tr:nth-last-child(n-1){
    border-bottom: none !important;
}

.order-total bdi {
    font-size: 1.3rem;
    color: var(--color-primary);
}

/* 8. Modern Checkout Buttons */
.checkout-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 20px !important;
    border-radius: 16px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    background: var(--color-btn-primary) !important;
    box-shadow: 0 10px 20px rgba(215, 63, 63, 0.2);
    transition: all 0.3s ease !important;
}

.checkout-button:hover {
    background: var(--color-btn-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(215, 63, 63, 0.3);
}

.button.pre-invoice {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px !important;
    border-radius: 16px !important;
    background: transparent !important;
    border: 1px solid var(--color-border-muted) !important;
    color: var(--color-text-muted) !important;
    font-weight: 500;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .product-thumbnail { display: none; }
    .cart_item td { padding: 15px 5px !important; }
    .cart_totals { padding: 25px !important; }
}




.woocommerce-cart .cart-collaterals .cart_totals table{
    border:none !Important;
}

/* --- 9. Mobile Adjustments (Anti-Overflow Fixes) --- */

/* Fix Box Model globally for the card so padding doesn't push it off screen */
.cart-collaterals, .cart_totals {
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .woocommerce-cart .entry-content .woocommerce {
        display: flex;
        flex-direction: column !important;
        width: 100%;
        overflow-x: hidden; /* Kills horizontal scroll on the main page */
    }

    .cart-collaterals {
        width: 100% !important;
        margin-top: 30px;
        position: static !important;
    }

    .cart_totals {
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 20px !important; /* CRITICAL: Reduced side padding for mobile screens */
    }

    /* Force the rigid WooCommerce table to act like a modern flexbox row */
    .cart_totals table.shop_table, 
    .cart_totals table.shop_table tbody,
    .cart_totals table.shop_table tr {
        width: 100% !important;
        display: block !important; 
    }

    /* Put Title on the right and Price on the left cleanly */
    .cart_totals table.shop_table tr {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 0 !important;
        border-bottom: 1px dashed var(--color-border-muted) !important;
    }

    .cart_totals .order-total {
        border-bottom: none !important;
    }

    /* Remove the default table cell padding so they don't break flexbox */
    .cart_totals table.shop_table th, 
    .cart_totals table.shop_table td {
        padding: 0 !important;
        border: none !important;
        text-align: right;
    }

    /* Slightly shrink the huge Farsi price on tiny phone screens to prevent wrapping */
    .cart_totals .order-total bdi {
        font-size: 20px !important; 
    }

    /* Existing cart list mobile fixes */
    .product-thumbnail { display: none; }
    .cart_item td { padding: 15px 5px !important; }
    table.shop_table.cart th, table.shop_table.cart td { padding-left: 5px !important; padding-right: 5px !important; }
    
    /* Wrap the coupon input and button so they don't squish */
    .coupon { 
        flex-direction: column; 
        width: 100%;
    }
    #coupon_code { 
        max-width: 100% !important; 
        width: 100% !important;
    }
    button[name='apply_coupon'] { 
        width: 100% !important; 
        height: 50px; 
    }
}

@media (min-width: 1280px) {
    .woocommerce-cart .entry-content .woocommerce{
        display:flex;
       flex-wrap:wrap;
        width: 100% !important;
        max-width: none !important;
       justify-content: space-between;
    }
    .woocommerce-cart-form{
        flex-grow: 1;
        margin-left:24px;
    width: calc(100% - 432px) !important;
    max-width: none ! IMPORTANT;
    }
    .woocommerce-notices-wrapper{
        width:100%;
    }
.woocommerce .cart-collaterals, .woocommerce-page .cart-collaterals{
    min-width:400px;
    width:400px;
    
}
}


.woocommerce-shipping-totals{
    
    display:none !Important;
}


