/* Cart styles */
.entry-content.wp-block-post-content,
.entry-content.wp-block-post-content.is-layout-flow,
.entry-content.wp-block-post-content.wp-block-post-content-is-layout-flow,
.entry-content.wp-block-post-content.is-layout-flow.wp-block-post-content-is-layout-flow {
    background-color: #F2F3F3 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.wc-block-components-notice-banner.is-error {
    display: none !important;
}

.wc-block-components-notice-banner.is-success {
    display: none !important;
}

.cart-empty-container {
    margin: 20px;
    height: 50vh;
}

body.woocommerce-cart {
    background-color: #F2F3F3;
}

.continue-shopping-link {
    margin: 50px auto 0;
    max-width: 1450px;
    padding-left: 18px;
    padding-right: 42px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
}

.continue-shopping-link a {
    display: flex;
    align-items: center;
    color: #049AFB;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
    margin-left: 24px;
}

.continue-shopping-link a:hover {
    color: #0080d5;
}

.continue-shopping-link svg {
    margin-right: 8px;
}

.woocommerce-cart-form-container { 
    margin: 40px auto 100px;
    max-width: 1450px;
    padding-left: 42px;
    padding-right: 42px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.woocommerce-cart-form {
    width: 100%;
    height: 100%;
    max-width: 975px;
    background-color: #fff;
    padding: 24px;

     table {
        border: none !important;

         tbody {
            border-left: 1px solid #E6E6E6 !important;
            border-right: 1px solid #E6E6E6 !important;
         }
     }
}

.shop_table {
    width: 100%;
    border-collapse: collapse;
}

.shop_table th {
    background-color: #F2F7FF;
    text-align: left;
    color: #024570 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 140% !important; 
    border: none !important;
}

.shop_table th.product-thumbnail {
    font-weight: 500;
    font-size: 15px;
    color: #555;
    text-align: left;
    padding-left: 20px;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.shop_table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #4E5050 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 140% !important;
    border-top: none !important;
}

.product-thumbnail img {
    width: 80px;
    height: auto;
}

.product-name a {
    text-decoration: none;
    font-weight: 400 !important;
}

.product-name a:hover {
    color: #000;
}

.product-quantity {
    text-align: center;
}


.product-remove a.remove {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    svg {
        width: 16px;
        height: 16px;
        transition: opacity 0.2s;

        path {
            fill: #555;
        }
    }

    &:hover {
        background-color: #fff;
    }
}

.quantity-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: inline-block;
    text-align: center;
}

.cart-notice {
    background-color: #f7f7f7;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    border-left: 4px solid #2271b1;
}

.button {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #135e96;
}

/* Checkout button */
.checkout-button {
    background-color: #048AE1 !important;
    font-weight: 500 !important;
    width: 100%;
    padding: 10px 12px !important;
    text-align: center;
    font-size: 16px !important;
    border-radius: 0 !important;
    line-height: 160% !important;
    transition: background-color 0.3s ease-out !important;
}

.checkout-button:hover {
    background-color: #0080d5 !important;
}

.cart-collaterals {
    width: 100%;
    max-width: 453px;
    max-height: fit-content;
    padding: 24px;
    background-color: #fff;
}

.cart_totals {
    float: none !important;
    width: 100% !important;
}

.cart_totals h2 {
    font-size: 18px !important;
    font-weight: 600;
    line-height: 28px;
    margin-bottom: 20px;
    color: #062336;
    padding-bottom: 24px;
    border-bottom: 1px solid #E6E6E6;
}

.cart_totals table {
    width: 100%;
    border: none !important;

    th {
        background-color: #fff;
        padding-left: 0 !important;
        color: #062336 !important;
    }

    td {
        text-align: right;
        padding-right: 0 !important;
    }
}

.order-total {
    th, td {
        font-size: 18px !important;
        color: #313131 !important;

    }
}

.cart_totals .cart-subtotal td,
.cart_totals .cart-subtotal th,
.cart_totals .order-total td,
.cart_totals .order-total th,
.cart_totals tr td,
.cart_totals tr th {
    border: none !important;
}

.cart-discount .woocommerce-remove-coupon {
    display: none !important;
}

.coupon-totals {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coupon-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 28px;
    margin-bottom: 10px;
    color: #4E5050;
}

.coupon-totals form {
    display: flex;
    flex-wrap: wrap;
}

.coupon-totals .input-text {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-right: none;
    min-width: 100px;
    outline: none;
    transition: border-color 0.3s;
}

.coupon-invalid-message {
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%;
    color: #E30505;
    display: none;
}

.coupon-success-message {
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%;
    color: #4CAF50;
    display: none;
}

.coupon-totals .input-text:focus {
    border-color: #048AE1;
}

.coupon-totals .button {
    font-size: 14px;
    font-weight: 500;
    line-height: 140%;
    background-color: #fff;
    color: #4E5050;
    padding: 10px 15px;
    border-radius: 0px;
    border: 1px solid #ddd;
    border-left: none !important;
    cursor: pointer;
    transition: border-color 0.3s;
}

.coupon-totals .input-text:focus + .button,
.coupon-totals .input-text:focus ~ .button {
    border-color: #048AE1;
}


/* Responsivo */
@media (max-width: 1260px) {
    .woocommerce-cart-form-container {
        flex-direction: column;
        align-items: center;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .cart-collaterals {
        max-width: 1024px;
        width: 100%;
        max-height: none;
        box-sizing: border-box;
    }
    
    .continue-shopping-link {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .woocommerce-cart-form {
        max-width: 1024px;
    }
}

@media only screen and (max-width: 768px) {
    .woocommerce-cart table.shop_table_responsive thead {
        display: table-header-group;
    }

    .woocommerce-cart table.shop_table_responsive tbody th {
        display: table-cell;
    }

    .woocommerce-cart table.shop_table_responsive tr {
        display: table-row;
    }

    .woocommerce-cart table.shop_table_responsive tr td {
        display: table-cell;
        text-align: inherit !important;
        background-color: #fff !important;
    }

    .woocommerce-cart table.shop_table_responsive tr td::before {
        content: none;
        font-weight: normal;
        float: none;
    }

    .woocommerce-cart-form-container {
        padding-left: 40px;
        padding-right: 40px;
        margin-top: 20px;
    }

    .continue-shopping-link a {
        margin-left: 0;
    }

    .shop_table .product-remove,
    .shop_table .product-thumbnail,
    .shop_table .product-name,
    .shop_table .product-price,
    .shop_table .product-quantity,
    .shop_table .product-subtotal {
        display: table-cell !important;
    }

    .woocommerce-page .woocommerce-cart-form #coupon_code {
        width: auto !important;
        float: none !important;
    }
}

.cart-form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

@media (max-width: 699px) {
    .woocommerce-cart-form-container {
        padding-left: 15px;
        padding-right: 15px;
        margin-top: 20px;
    }
    
    .woocommerce-cart-form {
        padding: 15px;
    }
    
    .shop_table th {
        padding: 10px 5px !important;
        font-size: 12px !important;
    }
    
    .shop_table td {
        padding: 10px 5px !important;
        font-size: 12px !important;
    }
    
    /* Hide less important columns on mobile */
    .product-price {
        display: none !important;
    }
    
    /* Adjust column widths */
    .product-thumbnail {
        width: 60px !important;
    }
    
    .product-thumbnail img {
        width: 50px !important;
        height: auto !important;
    }
    
    /* Adjust header colspan */
    .shop_table thead tr th.product-thumbnail {
        padding-left: 5px !important;
    }
    
    /* Product name shorter */
    .product-name a {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    /* Center quantity */
    .product-quantity {
        min-width: 30px !important;
    }
    
    /* Compact remove button */
    .product-remove {
        width: 30px !important;
    }
    
    .product-remove a.remove svg {
        width: 14px;
        height: 14px;
    }
    
    /* Cart title */
    .cart-form-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* Continue shopping link */
    .continue-shopping-link {
        margin: 30px auto 0;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Totals section */
    .cart-collaterals {
        padding: 15px;
    }
    
    .cart_totals h2 {
        font-size: 16px !important;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    /* Coupon form */
    .coupon-totals .input-text {
        font-size: 12px;
        padding: 8px 5px;
    }
    
    .coupon-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .coupon-totals .button {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Extra small mobile screens - 499px and below */
@media (max-width: 499px) {
    /* Restructure the entire table for very small screens */
    .woocommerce-cart-form {
        padding: 10px;
    }
    
    /* Hide table header except for the product column */
    .shop_table thead th:not(.product-thumbnail) {
        display: none !important;
    }
    
    .shop_table thead th.product-thumbnail {
        display: table-cell !important;
        width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        text-align: left !important;
    }
    
    /* Restructure rows to be more compact */
    .shop_table tbody tr {
        display: block !important;
        position: relative !important;
        padding: 12px 0 8px !important;
        border-bottom: 1px solid #eee !important;
    }
    
    /* Make all cells take full width */
    .shop_table tbody td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: left !important;
        border: none !important;
        margin-bottom: 0 !important;
    }
    
    /* Show price, quantity and subtotal inline with labels */
    .shop_table tbody td.product-price:before {
        content: "Preço: ";
        font-weight: 500;
        font-size: 12px !important;
    }
    
    .shop_table tbody td.product-quantity:before {
        content: "Quantidade: ";
        font-weight: 500;
        font-size: 12px !important;
    }
    
    .shop_table tbody td.product-subtotal:before {
        content: "Subtotal: ";
        font-weight: 500;
        font-size: 12px !important;
    }
    
    /* Optimize the thumbnail and product layout */
    .shop_table tbody td.product-thumbnail {
        width: 50px !important;
        display: table-cell !important;
        vertical-align: top !important;
        padding-right: 10px !important;
    }
    
    .shop_table tbody td.product-name {
        display: table-cell !important;
        vertical-align: top !important;
        width: calc(100% - 50px) !important;
        padding-bottom: 0 !important;
    }
    
    /* Create a tight stack of price, quantity, subtotal below product name */
    .shop_table tbody td.product-price,
    .shop_table tbody td.product-quantity,
    .shop_table tbody td.product-subtotal {
        display: block !important;
        padding-left: 50px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        line-height: 1.1 !important;
        font-size: 12px !important;
        margin: 0 !important;
    }
    
    /* Container for stacked info items */
    .shop_table tbody td.product-name + td.product-price,
    .shop_table tbody td.product-price + td.product-quantity,
    .shop_table tbody td.product-quantity + td.product-subtotal {
        margin-top: 0 !important;
    }
    
    /* Product name adjustments */
    .product-name a {
        white-space: normal;
        max-width: none;
        margin-bottom: 2px;
        display: inline-block;
    }
    
    /* Position remove button at top right */
    .shop_table tbody td.product-remove {
        position: absolute !important;
        top: 5px !important;
        right: 0 !important;
        width: 30px !important;
        display: block !important;
        text-align: right !important;
    }
    
    /* Reset quantity text alignment */
    .quantity-text {
        text-align: left;
    }
    
    /* Adjust checkout button */
    .checkout-button {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }
} 