/*
 * Styles for WooCommerce Cart and Checkout Pages
 */

.woocommerce-cart, .woocommerce-checkout {
    background-color: var(--color-background);
}

.woocommerce {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 20px;
}

/* --- CART PAGE --- */

/* Page Title */
.woocommerce-cart .entry-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--color-primary-accent);
    text-align: center;
    margin-bottom: 3rem;
}

/* Cart Table */
.woocommerce-cart-form {
    margin-bottom: 4rem;
}

.shop_table {
    border: none !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.shop_table thead th {
    background-color: var(--color-primary-accent);
    color: #fff;
    font-family: var(--font-sans-serif);
    font-weight: bold;
    text-transform: uppercase;
    padding: 1.2rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border: none;
}

.shop_table td {
    border-top: 1px solid #f0f0f0;
    padding: 1.5rem 1rem;
    vertical-align: middle;
}

/* Product Row Items */
.shop_table .product-remove a {
    color: #ccc;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.shop_table .product-remove a:hover {
    color: red;
}

.shop_table .product-thumbnail img {
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.shop_table .product-name a {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--color-primary-accent);
    text-decoration: none;
    font-weight: bold;
}

.shop_table .product-price, 
.shop_table .product-subtotal {
    font-family: var(--font-sans-serif);
    font-weight: bold;
    color: var(--color-text-dark);
}

/* Quantity Input */
.shop_table .quantity input {
    width: 50px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Coupon & Update Cart */
.actions {
    padding: 1.5rem !important;
    background-color: #f9f9f9;
}

.coupon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coupon input {
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

button[name="apply_coupon"],
button[name="update_cart"] {
    background-color: var(--color-text-dark);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

button[name="apply_coupon"]:hover,
button[name="update_cart"]:hover {
    background-color: #000;
}

/* Cart Totals */
.cart-collaterals {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

.cart_totals {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.cart_totals h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-primary-accent);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-secondary-accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.cart_totals table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart_totals th, .cart_totals td {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart_totals th {
    text-align: left;
    font-weight: normal;
    color: #666;
}

.cart_totals td {
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
}

.cart_totals .order-total td {
    color: var(--color-secondary-accent);
    font-size: 1.4rem;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout a.checkout-button {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--color-primary-accent);
    color: #fff;
    padding: 1rem;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    letter-spacing: 1px;
}

.wc-proceed-to-checkout a.checkout-button:hover {
    background-color: var(--color-secondary-accent);
    color: var(--color-text-dark);
    transform: translateY(-2px);
}

/* --- CHECKOUT PAGE --- */

.woocommerce-checkout .col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.woocommerce-checkout h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-primary-accent);
    margin-bottom: 1.5rem;
}

.woocommerce-checkout label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout textarea,
.select2-container .select2-selection--single {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    height: auto;
}

/* Order Review Box */
#order_review_heading {
    margin-top: 3rem;
    text-align: center;
}

.woocommerce-checkout-review-order {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.woocommerce-checkout-review-order table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.woocommerce-checkout-review-order th,
.woocommerce-checkout-review-order td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.woocommerce-checkout-review-order .order-total th,
.woocommerce-checkout-review-order .order-total td {
    border-bottom: none;
    font-size: 1.3rem;
    color: var(--color-primary-accent);
}

/* Payment Methods */
#payment {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1.5rem;
}

#payment ul.payment_methods {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

#payment ul.payment_methods li {
    margin-bottom: 1rem;
}

#place_order {
    width: 100%;
    background-color: var(--color-secondary-accent);
    color: var(--color-text-dark);
    padding: 1rem;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

#place_order:hover {
    background-color: var(--color-primary-accent);
    color: #fff;
}

/* Responsive */
@media (max-width: 900px) {
    .woocommerce-checkout .col2-set {
        grid-template-columns: 1fr;
    }
    
    .shop_table thead {
        display: none; /* Hide headers on mobile for cleaner look */
    }
    
    .shop_table tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .shop_table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.5rem 0;
        text-align: right;
    }
    
    .shop_table td::before {
        content: attr(data-title);
        font-weight: bold;
        text-align: left;
        color: #888;
    }
    
    .shop_table .product-thumbnail {
        justify-content: center;
    }
    
    .shop_table .product-remove {
        justify-content: flex-end;
    }
}
