/* =====================================================
   TW CART PAGE — Black & White Premium Branding
   Scoped entirely under .tw-cart-page so no other
   WooCommerce templates (shop, checkout, etc.) are touched.
===================================================== */

/* -----------------------------------------------------
   VARIABLES
----------------------------------------------------- */
.tw-cart-page {
    --tw-black: #111111;
    --tw-black-2: #1a1a1a;
    --tw-white: #ffffff;
    --tw-border: #e5e5e5;
    --tw-light-gray: #f5f5f5;
    --tw-text: #333333;
    --tw-muted: #777777;

    padding-top: 60px;
    padding-bottom: 80px;
    background: var(--tw-white);
    color: var(--tw-text);
    width: 100%;
}

/* Reset box-sizing inside this template only, in case the theme's
   global reset doesn't apply border-box consistently — this is what
   most commonly causes columns to render narrower than intended. */
.tw-cart-page,
.tw-cart-page *,
.tw-cart-page *::before,
.tw-cart-page *::after {
    box-sizing: border-box;
}

/* -----------------------------------------------------
   CONTAINER
   NOTE: renamed from the generic ".container" to
   ".tw-cart-container" — many themes already define their
   own ".container" class (often with a much smaller
   max-width) which was overriding these rules and causing
   the whole page, including the totals column, to render
   squeezed into a narrow strip. A unique class name avoids
   that collision entirely.
----------------------------------------------------- */
.tw-cart-page .tw-cart-container {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    float: none !important;
}

/* -----------------------------------------------------
   BREADCRUMB
----------------------------------------------------- */
.tw-cart-page .tw-breadcrumb {
    font-size: 14px;
    color: var(--tw-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tw-cart-page .tw-breadcrumb a {
    color: var(--tw-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tw-cart-page .tw-breadcrumb a:hover {
    color: var(--tw-black);
}

.tw-cart-page .tw-breadcrumb span {
    color: var(--tw-muted);
}

/* -----------------------------------------------------
   PAGE TITLE
----------------------------------------------------- */
.tw-cart-page .tw-page-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 45px;
    color: var(--tw-black);
    line-height: 1.1;
}

/* -----------------------------------------------------
   LAYOUT — WooCommerce's [woocommerce_cart] shortcode
   ALWAYS wraps its own output in an extra <div class=
   "woocommerce"> (this comes from WooCommerce core's
   shortcode_wrapper() function, not the theme). So the
   real structure is:

     .tw-cart-wrapper
       └── .woocommerce                 ← grid goes HERE
             ├── .woocommerce-cart-form
             └── .cart-collaterals

   Putting the grid on .tw-cart-wrapper itself was one
   level too high — it only had a single child, so the
   70/30 split never applied and everything collapsed
   into one stacked, narrower-looking column.
----------------------------------------------------- */
.tw-cart-page .tw-cart-wrapper > .woocommerce {
    display: grid !important;
    grid-template-columns: 7fr 3fr !important;
    gap: 40px !important;
    align-items: start !important;
    width: 100% !important;
}

.tw-cart-page .woocommerce-cart-form {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
}

.tw-cart-page .cart-collaterals {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 260px !important;
    float: none !important;
}

/* Table itself must always fill its grid column */
.tw-cart-page .woocommerce-cart-form table.cart {
    width: 100% !important;
}

/* If there are no items, let WooCommerce notices take full width */
.tw-cart-page .woocommerce-info,
.tw-cart-page .cart-empty {
    width: 100%;
    padding: 20px 25px;
    border: 1px solid var(--tw-border);
    background: var(--tw-light-gray);
    color: var(--tw-text);
    border-radius: 6px;
    list-style: none;
}

.tw-cart-page .wc-empty-cart-message a.button {
    display: inline-block;
    margin-top: 15px;
    background: var(--tw-black);
    color: var(--tw-white);
    padding: 14px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tw-cart-page .wc-empty-cart-message a.button:hover {
    background: #333333;
}

/* -----------------------------------------------------
   CART TABLE
----------------------------------------------------- */
.tw-cart-page table.shop_table {
    width: 100%;
    border-collapse: collapse;
    background: var(--tw-white);
    border: 1px solid var(--tw-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.tw-cart-page .woocommerce-cart-form table.cart thead tr {
    background: var(--tw-black);
}

.tw-cart-page .woocommerce-cart-form table.cart thead th {
    color: var(--tw-white);
    font-size: 18px;
    font-weight: 600;
    padding: 20px;
    text-align: left;
    border: none;
}

.tw-cart-page .woocommerce-cart-form table.cart thead th.product-remove,
.tw-cart-page .woocommerce-cart-form table.cart thead th.product-thumbnail {
    font-size: 0;
}

.tw-cart-page .woocommerce-cart-form table.cart tbody tr.cart_item {
    border-bottom: 1px solid var(--tw-border);
    transition: background 0.3s ease;
}

.tw-cart-page .woocommerce-cart-form table.cart tbody tr.cart_item:last-child {
    border-bottom: none;
}

.tw-cart-page .woocommerce-cart-form table.cart tbody tr.cart_item:hover {
    background: #fafafa;
}

.tw-cart-page .woocommerce-cart-form table.cart td {
    padding: 22px 20px;
    vertical-align: middle;
    border: none;
}

/* -----------------------------------------------------
   REMOVE BUTTON
----------------------------------------------------- */
.tw-cart-page td.product-remove {
    width: 50px;
    text-align: center;
}

.tw-cart-page td.product-remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--tw-black);
    color: var(--tw-black) !important;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tw-cart-page td.product-remove a.remove:hover {
    background: var(--tw-black);
    color: var(--tw-white) !important;
    border-color: var(--tw-black);
}

/* -----------------------------------------------------
   PRODUCT IMAGE
----------------------------------------------------- */
.tw-cart-page td.product-thumbnail {
    width: 110px;
}

.tw-cart-page td.product-thumbnail img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: var(--tw-white);
    border: 1px solid #eeeeee;
    border-radius: 6px;
    padding: 8px;
}

/* -----------------------------------------------------
   PRODUCT NAME
----------------------------------------------------- */
.tw-cart-page td.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--tw-black);
}

.tw-cart-page td.product-name a {
    color: var(--tw-black);
    text-decoration: none;
}

.tw-cart-page td.product-name a:hover {
    text-decoration: underline;
}

.tw-cart-page td.product-name .variation {
    font-size: 14px;
    color: var(--tw-muted);
    font-weight: 400;
    margin-top: 6px;
}

.tw-cart-page td.product-name dl.variation dt,
.tw-cart-page td.product-name dl.variation dd {
    font-size: 14px;
    color: var(--tw-muted);
    font-weight: 400;
    display: inline-block;
    margin: 0;
}

/* -----------------------------------------------------
   PRICE / SUBTOTAL
----------------------------------------------------- */
.tw-cart-page td.product-price,
.tw-cart-page td.product-subtotal {
    font-size: 18px;
    font-weight: 600;
    color: var(--tw-black);
}

/* -----------------------------------------------------
   QUANTITY
   Classic WooCommerce only outputs a plain number input
   (browser spinner arrows, hidden below) — there's no
   +/- button in the markup by default, like the reference
   design has. cart-quantity.js injects a wrapper with real
   clickable −/+ buttons around the existing input; this
   just styles that wrapper into a pill-shaped stepper.
----------------------------------------------------- */
.tw-cart-page td.product-quantity .quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
}

/* Stepper pill wrapper added by cart-quantity.js */
.tw-cart-page .tw-qty-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    width: 110px;
    border: 1px solid var(--tw-border);
    border-radius: 23px;
    background: var(--tw-white);
    overflow: hidden;
}

.tw-cart-page .tw-qty-stepper:focus-within {
    border-color: var(--tw-black);
}

.tw-cart-page .tw-qty-btn {
    flex: 0 0 32px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--tw-black);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.tw-cart-page .tw-qty-btn:hover {
    background: var(--tw-light-gray);
}

.tw-cart-page .tw-qty-btn:active {
    background: #eaeaea;
}

.tw-cart-page .tw-qty-stepper input.qty {
    flex: 1 1 auto;
    width: 100% !important;
    height: 100%;
    text-align: center;
    border: none !important;
    border-radius: 0 !important;
    font-size: 15px;
    font-weight: 600;
    color: var(--tw-black);
    background: transparent;
    padding: 0;
    -moz-appearance: textfield;
}

.tw-cart-page .tw-qty-stepper input.qty:focus {
    outline: none;
}

/* Fallback styling if JS hasn't run yet / is disabled —
   the plain input still looks reasonably on-brand. */
.tw-cart-page td.product-quantity .quantity input.qty {
    width: 70px;
    height: 46px;
    text-align: center;
    border: 1px solid var(--tw-border);
    border-radius: 23px;
    font-size: 16px;
    font-weight: 600;
    color: var(--tw-black);
    background: var(--tw-white);
    -moz-appearance: textfield;
}

.tw-cart-page td.product-quantity .quantity input.qty:focus {
    outline: none;
    border-color: var(--tw-black);
}

.tw-cart-page td.product-quantity .quantity input.qty::-webkit-inner-spin-button,
.tw-cart-page td.product-quantity .quantity input.qty::-webkit-outer-spin-button,
.tw-cart-page .tw-qty-stepper input.qty::-webkit-inner-spin-button,
.tw-cart-page .tw-qty-stepper input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* -----------------------------------------------------
   COUPON + UPDATE CART ROW (table tfoot)
----------------------------------------------------- */
.tw-cart-page table.cart tfoot tr td {
    background: var(--tw-light-gray);
    padding: 25px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tw-cart-page .coupon {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
}

.tw-cart-page .coupon input#coupon_code {
    height: 50px;
    border-radius: 6px;
    padding: 0 18px;
    border: 1px solid #dddddd;
    font-size: 15px;
    color: var(--tw-text);
    max-width: 220px;
    width: 100%;
    background: var(--tw-white);
}

.tw-cart-page .coupon input#coupon_code:focus {
    outline: none;
    border-color: var(--tw-black);
}

.tw-cart-page .coupon button[name="apply_coupon"] {
    height: 50px;
    padding: 0 35px;
    border-radius: 6px;
    background: var(--tw-black);
    color: var(--tw-white);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.tw-cart-page .coupon button[name="apply_coupon"]:hover {
    background: #333333;
}

.tw-cart-page button[name="update_cart"] {
    height: 50px;
    padding: 0 35px;
    border-radius: 6px;
    background: var(--tw-black);
    color: var(--tw-white);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.tw-cart-page button[name="update_cart"]:hover {
    background: #333333;
}

.tw-cart-page button[name="update_cart"]:disabled {
    background: var(--tw-border);
    color: var(--tw-muted);
    cursor: not-allowed;
}

/* -----------------------------------------------------
   CART TOTALS
----------------------------------------------------- */
.tw-cart-page .cart_totals {
    background: var(--tw-white);
    border: 1px solid var(--tw-border);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    width: 100% !important;
}

.tw-cart-page .cart_totals h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--tw-black);
    margin: 0 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tw-cart-page .cart_totals table.shop_table {
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.tw-cart-page .cart_totals table.shop_table tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--tw-border);
}

.tw-cart-page .cart_totals table.shop_table tr:last-child {
    border-bottom: none;
}

.tw-cart-page .cart_totals table.shop_table th,
.tw-cart-page .cart_totals table.shop_table td {
    padding: 0;
    border: none;
    font-size: 16px;
    color: var(--tw-text);
}

.tw-cart-page .cart_totals table.shop_table tr.order-total th,
.tw-cart-page .cart_totals table.shop_table tr.order-total td {
    font-size: 20px;
    font-weight: 700;
    color: var(--tw-black);
}

.tw-cart-page .cart_totals table.shop_table td[data-title="Shipment"] p {
    margin: 0 0 8px;
}

/* -----------------------------------------------------
   CHECKOUT BUTTON
----------------------------------------------------- */
.tw-cart-page .wc-proceed-to-checkout {
    padding: 0;
    margin-top: 20px;
}

.tw-cart-page .wc-proceed-to-checkout a.checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 58px;
    background: var(--tw-black);
    color: var(--tw-white) !important;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.tw-cart-page .wc-proceed-to-checkout a.checkout-button:hover {
    background: #000000;
}

/* -----------------------------------------------------
   RESPONSIVE
----------------------------------------------------- */
@media (max-width: 1024px) {
    .tw-cart-page .tw-cart-wrapper > .woocommerce {
        grid-template-columns: 1fr !important;
    }

    .tw-cart-page .woocommerce-cart-form,
    .tw-cart-page .cart-collaterals {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .tw-cart-page {
        padding-top: 40px;
        padding-bottom: 50px;
    }

    .tw-cart-page .tw-page-title {
        font-size: 30px;
        margin-bottom: 30px;
    }

    .tw-cart-page .woocommerce-cart-form table.cart thead {
        display: none;
    }

    .tw-cart-page .woocommerce-cart-form table.cart,
    .tw-cart-page .woocommerce-cart-form table.cart tbody,
    .tw-cart-page .woocommerce-cart-form table.cart tr,
    .tw-cart-page .woocommerce-cart-form table.cart td {
        display: block;
        width: 100%;
    }

    .tw-cart-page .woocommerce-cart-form table.cart tr.cart_item {
        position: relative;
        padding: 20px;
        border-bottom: 1px solid var(--tw-border);
    }

    .tw-cart-page .woocommerce-cart-form table.cart td {
        padding: 6px 0;
        border: none;
        text-align: left;
    }

    .tw-cart-page td.product-remove {
        position: absolute;
        top: 20px;
        right: 20px;
        width: auto;
    }

    .tw-cart-page td.product-thumbnail img {
        width: 70px;
        height: 70px;
    }

    .tw-cart-page td.product-quantity .quantity {
        justify-content: flex-start;
    }

    .tw-cart-page td[data-title]:before {
        content: attr(data-title);
        display: block;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--tw-muted);
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }

    .tw-cart-page table.cart tfoot tr td {
        flex-direction: column;
        align-items: stretch;
    }

    .tw-cart-page .coupon {
        flex-direction: column;
        align-items: stretch;
    }

    .tw-cart-page .coupon input#coupon_code {
        max-width: 100%;
    }

    .tw-cart-page .coupon button[name="apply_coupon"],
    .tw-cart-page button[name="update_cart"] {
        width: 100%;
    }

    .tw-cart-page .cart_totals {
        padding: 22px;
    }

    .tw-cart-page .cart_totals h2 {
        font-size: 26px;
    }
}