/**
 * Mamba Critical CSS - WooCommerce Cart Page
 * 
 * Critical styles for the shopping cart page.
 * Covers cart table, totals, and proceed to checkout.
 * 
 * @package Mamba\Modules\CriticalCss
 * @since   1.1.0
 */

/* Cart container */
.woocommerce-cart .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
}

/* Cart table */
.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2em;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 1em;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.woocommerce table.shop_table thead th {
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

/* Product thumbnail */
.woocommerce table.shop_table .product-thumbnail {
    width: 100px;
}

.woocommerce table.shop_table .product-thumbnail img {
    width: 80px;
    height: auto;
    border-radius: 3px;
}

/* Product name */
.woocommerce table.shop_table .product-name {
    font-weight: 500;
}

.woocommerce table.shop_table .product-name a {
    text-decoration: none;
    color: inherit;
}

.woocommerce table.shop_table .product-name a:hover {
    text-decoration: underline;
}

/* Variation data */
.woocommerce table.shop_table .variation {
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5em;
}

.woocommerce table.shop_table .variation dt,
.woocommerce table.shop_table .variation dd {
    display: inline;
    margin: 0;
}

/* Quantity */
.woocommerce table.shop_table .product-quantity .quantity {
    display: inline-flex;
    align-items: center;
}

.woocommerce table.shop_table .quantity .qty {
    width: 60px;
    text-align: center;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Remove button */
.woocommerce table.shop_table .product-remove a {
    display: inline-block;
    font-size: 1.5em;
    color: #999;
    text-decoration: none;
}

.woocommerce table.shop_table .product-remove a:hover {
    color: #e00;
}

/* Coupon form */
.woocommerce .cart-collaterals {
    margin-top: 2em;
}

.woocommerce .coupon {
    display: flex;
    gap: 0.5em;
    align-items: center;
    flex-wrap: wrap;
}

.woocommerce .coupon label {
    display: none;
}

.woocommerce .coupon #coupon_code {
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 150px;
}

.woocommerce .coupon button {
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}

/* Update cart button */
.woocommerce button[name="update_cart"] {
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}

/* Cart totals */
.woocommerce .cart_totals {
    float: right;
    width: 48%;
    max-width: 400px;
}

.woocommerce .cart_totals h2 {
    font-size: 1.25em;
    font-weight: 700;
    margin-bottom: 1em;
}

.woocommerce .cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce .cart_totals table th,
.woocommerce .cart_totals table td {
    padding: 0.75em;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.woocommerce .cart_totals table th {
    font-weight: 600;
    width: 40%;
}

.woocommerce .cart_totals .order-total th,
.woocommerce .cart_totals .order-total td {
    font-size: 1.1em;
    font-weight: 700;
    border-bottom: none;
}

/* Proceed to checkout */
.woocommerce .wc-proceed-to-checkout {
    padding: 1em 0;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
    display: block;
    text-align: center;
    padding: 1em;
    font-weight: 700;
    font-size: 1.1em;
    border-radius: 3px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    opacity: 0.9;
}

/* Cross-sells */
.woocommerce .cross-sells {
    float: left;
    width: 48%;
    margin-top: 2em;
}

.woocommerce .cross-sells h2 {
    font-size: 1.25em;
    font-weight: 700;
    margin-bottom: 1em;
}

.woocommerce .cross-sells ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Empty cart */
.woocommerce-cart .cart-empty {
    text-align: center;
    padding: 3em;
}

.woocommerce-cart .return-to-shop {
    text-align: center;
    margin-top: 1em;
}

.woocommerce-cart .return-to-shop a {
    display: inline-block;
    padding: 0.75em 1.5em;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
}

/* Notices */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    padding: 1em;
    margin-bottom: 1.5em;
    border-radius: 3px;
}

/* Clearfix */
.woocommerce .cart-collaterals::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce .cart_totals,
    .woocommerce .cross-sells {
        float: none;
        width: 100%;
        max-width: none;
    }
    
    .woocommerce table.shop_table {
        display: block;
    }
    
    .woocommerce table.shop_table thead {
        display: none;
    }
    
    .woocommerce table.shop_table tbody,
    .woocommerce table.shop_table tr,
    .woocommerce table.shop_table td {
        display: block;
    }
    
    .woocommerce table.shop_table tr {
        margin-bottom: 1em;
        padding-bottom: 1em;
        border-bottom: 1px solid #eee;
    }
    
    .woocommerce table.shop_table td {
        border: none;
        padding: 0.5em 0;
    }
    
    .woocommerce table.shop_table td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
    }
    
    .woocommerce table.shop_table .product-thumbnail {
        width: auto;
    }
}
