/* Cart Page Styles */

/* Layout */
.woocommerce-cart .woocommerce, 
.woocommerce-page.woocommerce-cart .entry-content .woocommerce {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.woocommerce-cart .woocommerce-cart-form {
    flex: 1 1 60%;
    min-width: 300px;
}

.woocommerce-cart .cart-collaterals {
    flex: 1 1 30%;
    min-width: 300px;
}

.woocommerce table.shop_table thead tr,
.woocommerce table.shop_table tbody tr {
    display: flex;
}

/* Cart Table Alignment */
.woocommerce table.shop_table.cart thead th {
    background-color: transparent;
    color: var(--color-text, #0f172a);
    font-family: var(--font-secondary, sans-serif);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 15px 10px;
    border-bottom: 2px solid var(--color-border, #e5e7eb) !important;
    text-align: center; /* Default center for alignment */
}

/* Product & Price Columns Left/Right specifics */
.woocommerce table.shop_table.cart thead th.product-name,
.woocommerce table.shop_table.cart thead th.product-thumbnail {
    text-align: left;
}

.woocommerce table.shop_table.cart tbody td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--color-border, #e5e7eb) !important;
    vertical-align: middle;
    text-align: center; /* Match header center */
}

.woocommerce table.shop_table.cart tbody td.product-name,
.woocommerce table.shop_table.cart tbody td.product-thumbnail {
    text-align: left;
}

/* Specific Column Widths to prevent shifting */
.woocommerce table.shop_table.cart .product-remove { width: 40px; }
.woocommerce table.shop_table.cart .product-thumbnail { width: 100px; }
.woocommerce table.shop_table.cart .product-name { width: auto; } /* Fill remaining space */
.woocommerce table.shop_table.cart .product-price { width: 15%; }
.woocommerce table.shop_table.cart .product-quantity { width: 15%; }
.woocommerce table.shop_table.cart .product-subtotal { width: 15%; }

/* Product Item */
.woocommerce table.shop_table.cart .product-thumbnail img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.woocommerce table.shop_table.cart .product-name a {
    color: var(--color-text, #0f172a);
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
    display: block;
    line-height: 1.4;
}

/* Quantity Input */
.woocommerce .quantity {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.woocommerce .quantity .qty {
    width: 60px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    padding: 0;
    height: 40px;
}

/* Remove Icon */
.woocommerce a.remove {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--color-muted, #6b7280) !important;
    background: transparent;
    font-weight: bold;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
}

.woocommerce a.remove:hover {
    background: var(--color-error-soft, rgba(220,38,38,0.1)) !important;
    color: var(--color-error, #dc2626) !important;
}

/* Coupon & Actions */
.actions {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.coupon {
    display: flex;
    gap: 10px;
    padding: 10px;
}

.coupon input.input-text {
    padding: 10px 15px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 4px;
    min-width: 200px;
    height: 42px;
}

button.button[name="apply_coupon"] {
    background-color: var(--color-secondary, #0b0b0b);
    color: #fff;
    border: none;
    padding: 0 20px;
    height: 42px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

button.button[name="update_cart"] {
    background-color: transparent;
    color: var(--color-text, #0f172a);
    border: 1px solid var(--color-border, #e5e7eb);
    padding: 0 20px;
    height: 42px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Cart Totals */
.cart-collaterals .cart_totals {
    background: var(--color-surface, #fff);
    padding: 30px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
    float: none;
}

.cart-collaterals .cart_totals h2 {
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    color: var(--color-text, #0f172a);
}

.cart-collaterals .cart_totals table.shop_table {
    width: 100%;
    border: none;
    border-collapse: collapse;
    border-radius: 0;
    margin: 0;
}

.cart-collaterals .cart_totals table.shop_table th {
    text-align: left;
    padding: 15px 0;
    font-weight: 600;
    color: var(--color-text, #0f172a);
    width: 40%;
}

.cart-collaterals .cart_totals table.shop_table td {
    text-align: right;
    padding: 15px 0;
    color: var(--color-text, #0f172a);
}

.cart-collaterals .wc-proceed-to-checkout a.checkout-button {
    display: block;
    text-align: center;
    background-color: var(--color-primary, #e11d29); /* Identidade visual: vermelho/primary */
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 20px;
}

.cart-collaterals .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: var(--color-primary-hover, #b91c1c);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .woocommerce-cart .woocommerce,
    .woocommerce-page.woocommerce-cart .entry-content .woocommerce {
        flex-direction: column;
        gap: 20px;
        padding: 0 10px; /* Reduzir padding lateral */
    }

    .woocommerce table.shop_table.cart thead {
        display: none;
    }

    .woocommerce table.shop_table.cart tbody tr {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid var(--color-border, #e5e7eb);
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        position: relative;
        background: #fff; /* Garantir fundo branco */
    }

    .woocommerce table.shop_table.cart tbody td {
        display: block;
        border: none !important;
        padding: 5px 0;
        width: 100%;
        text-align: right;
        font-size: 14px; /* Ajustar tamanho da fonte */
    }
    
    .woocommerce table.shop_table.cart tbody td:before {
        content: attr(data-title);
        float: left;
        font-weight: 700;
        font-size: 13px;
        color: var(--color-text);
    }
    
    /* Cart Totals Mobile */
    .cart-collaterals .cart_totals {
        padding: 20px; /* Reduzir padding interno */
        width: --webkit-fill-available !important;
    }

    /* ...rest of mobile... */

    .woocommerce table.shop_table.cart tbody td.product-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        width: auto;
    }
    
    .woocommerce table.shop_table.cart tbody td.product-remove:before { display: none; }

    .woocommerce table.shop_table.cart tbody td.product-thumbnail {
        text-align: center;
    }
    
    .woocommerce table.shop_table.cart tbody td.product-thumbnail:before { display: none; }
    
    .woocommerce table.shop_table.cart tbody td.product-name {
        width: 100%;
        text-align: center;
    }
    .woocommerce table.shop_table.cart .product-quantity {
        width: 100%;
    }
    
    .woocommerce table.shop_table.cart tbody td.product-name:before { display: none; }

    .woocommerce table.shop_table.cart tbody td.product-name a {
        text-align: left;
    }
    .actions {
        flex-direction: column;
    }
    
    .coupon {
        width: 100%;
        flex-direction: column;
    }
    
    .coupon input.input-text {
        width: 100%;
    }
    
    button.button[name="apply_coupon"], 
    button.button[name="update_cart"] {
        width: 100%;
    }
}
