/* TNNT Customer Cart Styles v1.0.0 */

/* 1. Wrapper Layout */
.tnnt-cart-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
    min-height: 75vh; /* Increased to push footer down further on large screens */
    margin-bottom: 0;
}

/* 2. Left Column: Cart Items */
.tnnt-cart-items {
    flex: 1 1 60%; /* Take up remaining space */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Soft shadow */
    border: 1px solid #eee;
    padding: 25px;
    min-width: 0; /* Prevent flex overflow */
}

/* 3. Right Column: Cart Totals */
.tnnt-cart-totals {
    flex: 0 0 380px; /* Fixed width for Sidebar */
    max-width: 380px;
    width: 100%;
    background: #fff; /* White background as requested */
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 30px;
    position: sticky;
    top: 30px; /* Sticky scroll */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Ensure shadow makes it pop */
}

/* RESET INNER WOO ELEMENTS (Universal Override) */
html body .tnnt-cart-totals .cart-collaterals .cart_totals,
html body .tnnt-cart-totals .cart_totals {
    width: 100% !important;
    float: none !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: block !important;
    position: static !important;
    max-width: 100% !important;
}

html body .tnnt-cart-totals .cart-collaterals {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Reset Table elements inside */
body.woocommerce-cart .tnnt-cart-totals table,
body.woocommerce-cart .tnnt-cart-totals tbody,
body.woocommerce-cart .tnnt-cart-totals tr,
body.woocommerce-cart .tnnt-cart-totals th,
body.woocommerce-cart .tnnt-cart-totals td {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    display: block !important;
}

/* Restore Flex for Total Rows Only */
body.woocommerce-cart .tnnt-cart-totals .shop_table tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 0 !important;
     border-bottom: 1px solid #f1f1f1 !important;
}

body.woocommerce-cart .tnnt-cart-totals .shop_table th,
body.woocommerce-cart .tnnt-cart-totals .shop_table td {
    width: auto !important;
    display: block !important;
    border: none !important;
}

/* 4. Cart Table Styling */
.tnnt-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tnnt-cart-table th {
    text-align: left;
    padding: 15px 10px;
    font-size: 13px;
    text-transform: uppercase;
    color: #555;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
}

.tnnt-cart-table td {
    padding: 20px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f1f1;
}

.tnnt-cart-table tr:last-child td {
    border-bottom: none;
}

/* Product Details */
.tnnt-cart-item-thumb img {
    width: 80px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tnnt-cart-item-name a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    display: block;
    margin-bottom: 5px;
}

.tnnt-cart-item-name a:hover {
    color: #0071e3;
}

.tnnt-cart-item-price {
    color: #333;
    font-weight: 500;
}

/* Quantity Input */
.tnnt-cart-quantity .quantity {
    display: inline-flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #e1e1e1;
}

.tnnt-cart-quantity .quantity button {
    background: transparent;
    border: none;
    width: 30px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: #555;
}

.tnnt-cart-quantity .quantity input.qty {
    background: transparent;
    border: none;
    width: 40px;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
    height: 32px;
    padding: 0;
}
.tnnt-cart-quantity .quantity input::-webkit-outer-spin-button,
.tnnt-cart-quantity .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove Button */
.tnnt-cart-remove {
    color: #999;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 5px;
}

.tnnt-cart-remove:hover {
    color: #ff3b30;
}

/* Actions Bar (Coupon & Update) */
.tnnt-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.tnnt-coupon-form {
    display: flex;
    gap: 10px;
}

.tnnt-coupon-form input {
    height: 44px;
    border: 1px solid #ddd;
    padding: 0 15px;
    border-radius: 6px;
    min-width: 200px;
}

.tnnt-btn-apply {
    height: 44px;
    background: #333;
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.tnnt-btn-update {
    height: 44px;
    background: transparent;
    color: #555;
    border: 1px solid #ddd;
    padding: 0 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tnnt-btn-update:hover {
    background: #f5f5f7;
    color: #333;
    border-color: #bbb;
}

/* 5. Cart Totals Styling */
.tnnt-cart-totals h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tnnt-totals-table {
    width: 100%;
}

.tnnt-totals-table tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f1f1f1;
}

.tnnt-totals-table th {
    font-weight: 500;
    color: #666;
    text-align: left;
    width: auto;
}

.tnnt-totals-table td {
    font-weight: 700;
    color: #333;
    text-align: right;
    width: auto;
}

.tnnt-totals-table tr:last-child {
    border-bottom: none;
}

.tnnt-totals-table tr.order-total {
    border-top: 2px solid #ddd;
    margin-top: 10px;
    padding-top: 20px;
}

.tnnt-totals-table tr.order-total th,
.tnnt-totals-table tr.order-total td {
    font-size: 18px;
    color: #000;
}

/* Checkout Button */
.tnnt-checkout-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: #0071e3;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    transition: background 0.2s;
    line-height: 1.4;
    border: none;
    cursor: pointer;
}

.tnnt-checkout-btn:hover {
    background: #005bb5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tnnt-cart-wrapper {
        flex-direction: column;
        padding: 15px;
    }
    
    .tnnt-cart-items, 
    .tnnt-cart-totals {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .tnnt-cart-table thead {
        display: none; /* Hide headers on mobile */
    }
    
    .tnnt-cart-table tr {
        display: block;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    .tnnt-cart-table td {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        border: none;
        text-align: right;
    }
    
    .tnnt-cart-table td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #555;
        text-align: left;
    }
    
    .tnnt-cart-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tnnt-coupon-form {
        flex-direction: column;
    }
    
    .tnnt-coupon-form input {
        width: 100%;
    }
}
