/* =====================================================================
   SHIM-ME Hub — WooCommerce Cart Page  (v0.5.1)
   Scope: body.woocommerce-cart
   Mirrors the cart-line + summary panel from Checkout.html design.
   ===================================================================== */

/* ---- Page wrapper -------------------------------------------------- */

/* Two-column page layout: the cart form (2/3) beside Cart Totals (1/3). The
   parent .woocommerce wraps the notices, form.woocommerce-cart-form, the
   .cart-collaterals and the hidden attribution inputs — flex it so the form and
   collaterals sit side by side, notices on their own full-width row. */
body.woocommerce-cart .woocommerce {
    padding: 56px 0 100px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 32px !important;
}

body.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper {
    flex: 0 0 100% !important;
}

body.woocommerce-cart .woocommerce > form.woocommerce-cart-form {
    flex: 2 1 0 !important;
    min-width: 0 !important;
}

body.woocommerce-cart .woocommerce > .cart-collaterals {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* ---- Page heading from Total entry-title --------------------------- */

body.woocommerce-cart .entry-title,
body.woocommerce-cart h1.page-title {
    font-family: var(--shim-display) !important;
    font-weight: 800 !important;
    font-size: clamp(40px, 5vw, 72px) !important;
    line-height: 0.95 !important;
    text-transform: uppercase !important;
    color: var(--shim-text) !important;
    margin: 0 0 40px !important;
    letter-spacing: -0.01em !important;
}

/* ---- Cart table ---------------------------------------------------- */

body.woocommerce-cart table.shop_table.cart {
    border: 1px solid var(--shim-line) !important;
    background: var(--shim-bg-3) !important;
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 32px !important;
    font-family: var(--shim-body) !important;
}

/* Table head */
body.woocommerce-cart table.shop_table.cart thead {
    background: var(--shim-bg-2) !important;
    border-bottom: 1px solid var(--shim-line) !important;
}

body.woocommerce-cart table.shop_table.cart thead th {
    font-family: var(--shim-mono) !important;
    font-size: 10px !important;
    color: var(--shim-text-mute) !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    padding: 14px 20px !important;
    font-weight: 600 !important;
    border: none !important;
    text-align: left !important;
    background: transparent !important;
}

/* Table body rows */
body.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    border-bottom: 1px solid var(--shim-line) !important;
}

body.woocommerce-cart table.shop_table.cart tbody tr.cart_item:last-child {
    border-bottom: none !important;
}

body.woocommerce-cart table.shop_table.cart tbody td {
    padding: 20px !important;
    border: none !important;
    vertical-align: middle !important;
    background: transparent !important;
    color: var(--shim-text) !important;
}

/* Product thumbnail cell — image stays centered in its cell. 0.8.4 left-aligned
   it to chase the × remove control; reverted here. The × already has its own
   breathing room from the centered min-width:64px remove cell below, so the
   image does not need to move. */
body.woocommerce-cart table.shop_table td.product-thumbnail {
    width: 110px !important;
    padding: 16px 20px !important;
    text-align: center !important;
}

body.woocommerce-cart table.shop_table td.product-thumbnail a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 90px !important;
    height: 90px !important;
    background:
        radial-gradient(ellipse at center, rgba(227,29,30,0.12), transparent 65%),
        var(--shim-bg-2) !important;
    border: 1px solid var(--shim-line) !important;
    padding: 10px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-decoration: none !important;
}

body.woocommerce-cart table.shop_table td.product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)) !important;
    background: transparent !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Product name */
body.woocommerce-cart table.shop_table td.product-name a {
    font-family: var(--shim-display) !important;
    font-weight: 800 !important;
    font-size: 22px !important;
    text-transform: uppercase !important;
    color: var(--shim-text) !important;
    text-decoration: none !important;
    letter-spacing: -0.01em !important;
    line-height: 1 !important;
    display: block !important;
    margin-bottom: 6px !important;
}

body.woocommerce-cart table.shop_table td.product-name a:hover {
    color: var(--shim-red) !important;
}

/* Variation attributes (Shim Details) under name — aligned two-column grid:
   each detail on its own row, labels in a column, values beside them. Replaces
   the old inline flex (which kept the dt/dd pairs on one line). */
body.woocommerce-cart table.shop_table td.product-name dl.variation {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    column-gap: 8px !important;
    row-gap: 2px !important;
    margin: 8px 0 0 !important;
}

body.woocommerce-cart table.shop_table td.product-name dl.variation dt,
body.woocommerce-cart table.shop_table td.product-name dl.variation dd {
    font-family: var(--shim-mono) !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    letter-spacing: 0.12em !important;
    float: none !important;
}

body.woocommerce-cart table.shop_table td.product-name dl.variation dt {
    font-weight: 600 !important;
    color: var(--shim-text-mute) !important;
    opacity: 0.65 !important;
}

body.woocommerce-cart table.shop_table td.product-name dl.variation dd {
    font-weight: 600 !important;
    color: var(--shim-text) !important;
}

body.woocommerce-cart table.shop_table td.product-name dl.variation dd p {
    display: inline !important;
    margin: 0 !important;
}

/* Price cells */
body.woocommerce-cart table.shop_table td.product-price .amount,
body.woocommerce-cart table.shop_table td.product-subtotal .amount {
    font-family: var(--shim-display) !important;
    font-weight: 800 !important;
    font-size: 22px !important;
    color: #fff !important;
    line-height: 1 !important;
}

/* Quantity cell */
body.woocommerce-cart table.shop_table td.product-quantity .quantity {
    display: inline-flex !important;
    border: 1px solid var(--shim-line-2) !important;
    background: var(--shim-bg-2) !important;
}

body.woocommerce-cart table.shop_table td.product-quantity .qty {
    background: transparent !important;
    border: none !important;
    width: 56px !important;
    padding: 10px 8px !important;
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    color: #fff !important;
    text-align: center !important;
    height: auto !important;
    border-radius: 0 !important;
}

/* Remove column: the auto table layout ignores width but honors min-width, so
   give it a real min-width and center the × in it. Paired with the left-aligned
   thumbnail below, the × ends up with roughly equal space on each side. */
body.woocommerce-cart table.shop_table th.product-remove,
body.woocommerce-cart table.shop_table td.product-remove {
    min-width: 64px !important;
    text-align: center !important;
}
body.woocommerce-cart table.shop_table td.product-remove {
    padding: 20px 0 !important;
}

body.woocommerce-cart table.shop_table td.product-remove a.remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: transparent !important;
    border: 1px solid var(--shim-line-2) !important;
    color: var(--shim-text-mute) !important;
    font-size: 14px !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    transition: border-color .15s ease, color .15s ease, background .15s ease !important;
    font-weight: 400 !important;
}

body.woocommerce-cart table.shop_table td.product-remove a.remove:hover {
    background: var(--shim-red) !important;
    border-color: var(--shim-red) !important;
    color: #fff !important;
}

/* ---- Cart actions row ---------------------------------------------- */

/* The actions cell must stay a real table-cell so its colspan spans the full
   table width (display:flex took it out of the table layout and collapsed it).
   overflow:hidden clears the floated children. */
body.woocommerce-cart table.shop_table.cart td.actions {
    background: var(--shim-bg-2) !important;
    padding: 16px 20px !important;
    border-top: 1px solid var(--shim-line) !important;
    display: table-cell !important;   /* was display:flex - that broke the colspan width */
    width: auto !important;
    text-align: left !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Discount group: floats left with real width to type into. */
body.woocommerce-cart table.shop_table.cart td.actions .coupon {
    float: left !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 50% !important;
    max-width: 560px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code {
    background: #000 !important;
    border: 1px solid var(--shim-line-2) !important;
    color: var(--shim-text) !important;
    padding: 0 14px !important;
    font-family: var(--shim-mono) !important;
    font-size: 12px !important;
    letter-spacing: 0.06em !important;
    border-radius: 0 !important;
    flex: 1 1 auto !important;
    width: auto !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon input#coupon_code::placeholder {
    color: var(--shim-text-mute) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
    font-size: 11px !important;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon button[name="apply_coupon"] {
    flex: 0 0 auto !important;
}

/* Update cart: floats to the far right. */
body.woocommerce-cart table.shop_table.cart td.actions button[name="update_cart"] {
    float: right !important;
    margin: 0 !important;
}

/* Apply coupon + Update cart: identical height (48px), typography, and muted
   colour. Apply coupon adopts the Update cart style per Nolan; opacity:1 forces
   Update cart out of its dimmed disabled look so the two always match. The
   coupon code input keeps its own styling above. */
body.woocommerce-cart table.shop_table.cart td.actions .coupon button[name="apply_coupon"],
body.woocommerce-cart table.shop_table.cart td.actions button[name="update_cart"] {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 18px !important;
    font-size: 12px !important;
    letter-spacing: 0.72px !important;
    line-height: 18px !important;
    color: var(--shim-text-mute) !important;   /* rgb(110,108,104) cart muted label tone */
    opacity: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* ---- Cart totals / collaterals ------------------------------------ */

/* Collaterals is now the 1/3 flex child of .woocommerce (see Page wrapper).
   The panel fills that column; override WooCommerce's float:right / 48% width. */
body.woocommerce-cart .cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
}

body.woocommerce-cart .cart_totals {
    max-width: 100% !important;
    background: var(--shim-bg-3) !important;
    border: 1px solid var(--shim-line) !important;
}

body.woocommerce-cart .cart_totals h2 {
    padding: 20px 24px !important;
    border-bottom: 1px solid var(--shim-line) !important;
    background:
        radial-gradient(ellipse at top right, rgba(227,29,30,0.18), transparent 60%),
        var(--shim-bg-2) !important;
    font-family: var(--shim-display) !important;
    font-weight: 800 !important;
    font-size: 24px !important;
    text-transform: uppercase !important;
    color: var(--shim-text) !important;
    margin: 0 !important;
}

/* Totals as clean flex rows (label … value). The Woo two-column table squeezed
   the shipment options into one word per line; converting the table to flex
   rows lets the shipment row stack and use the full column width (below).
   Horizontal padding stays at 24px to align rows with the panel header. */
body.woocommerce-cart .cart_totals table.shop_table {
    border: none !important;
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

body.woocommerce-cart .cart_totals table,
body.woocommerce-cart .cart_totals tbody {
    display: block !important;
    width: 100% !important;
}

body.woocommerce-cart .cart_totals tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

body.woocommerce-cart .cart_totals tr:last-child {
    border-bottom: 0 !important;
}

body.woocommerce-cart .cart_totals th {
    text-align: left !important;
    padding: 0 !important;
    white-space: nowrap !important;
    font-family: var(--shim-mono) !important;
    font-size: 10px !important;
    color: var(--shim-text-mute) !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
}

body.woocommerce-cart .cart_totals td {
    text-align: right !important;
    padding: 0 !important;
    color: var(--shim-text) !important;
    border: none !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals td .amount {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #fff !important;
}

/* Order total: the VALUE carries the emphasis (16px). The label drops back to
   match every other row label (it inherits the 10px .cart_totals th rule). */
body.woocommerce-cart .cart_totals tr.order-total td,
body.woocommerce-cart .cart_totals tr.order-total td .amount {
    font-size: 16px !important;
}

body.woocommerce-cart .cart_totals tr.order-total td .amount {
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2 !important;
}

/* Shipment row stacks: heading on top, options span the full column below. */
body.woocommerce-cart .cart_totals tr.shipping {
    flex-direction: column !important;
    align-items: stretch !important;
}

body.woocommerce-cart .cart_totals tr.shipping th {
    margin-bottom: 4px !important;
}

body.woocommerce-cart .cart_totals tr.shipping td {
    text-align: left !important;
}

/* Shipping method options: radio centered with the text, name left / price
   right, price toned down so it isn't louder than the labels. */
body.woocommerce-cart .cart_totals ul#shipping_method {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-cart .cart_totals ul#shipping_method li {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
}

body.woocommerce-cart .cart_totals ul#shipping_method li:last-child {
    border-bottom: 0 !important;
}

body.woocommerce-cart .cart_totals ul#shipping_method li input[type="radio"] {
    margin: 0 !important;
    flex: 0 0 auto !important;
    accent-color: rgb(227,29,30) !important;   /* brand red */
}

body.woocommerce-cart .cart_totals ul#shipping_method li label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 14px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    font-family: var(--shim-mono) !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    color: var(--shim-text-dim) !important;
    text-transform: none !important;
}

body.woocommerce-cart .cart_totals ul#shipping_method li label .amount {
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: rgb(214,212,208) !important;
    white-space: nowrap !important;
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-destination {
    margin-top: 10px !important;
    opacity: 0.7 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

/* "Change address" link: match the shipping-destination line directly above it
   (was inheriting 16px). Keep brand red; underline on hover. */
body.woocommerce-cart .cart_totals .shipping-calculator-button {
    font-size: 12px !important;
}
body.woocommerce-cart .cart_totals .shipping-calculator-button:hover {
    text-decoration: underline !important;
}

/* Checkout CTA */
body.woocommerce-cart .wc-proceed-to-checkout {
    padding: 20px 24px !important;
    border-top: 1px solid var(--shim-line) !important;
    background: transparent !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: flex !important;
    width: 100% !important;
    justify-content: center !important;
    background: var(--shim-red) !important;
    border-color: var(--shim-red) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 18px 28px !important;
    letter-spacing: 0.08em !important;
    border-radius: 0 !important;
    text-decoration: none !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: var(--shim-red-deep) !important;
    border-color: var(--shim-red-deep) !important;
    transform: translateY(-1px) !important;
}

/* ---- Empty cart ---------------------------------------------------- */

body.woocommerce-cart .cart-empty {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    text-transform: uppercase !important;
    color: var(--shim-text-mute) !important;
    margin: 60px 0 20px !important;
}

body.woocommerce-cart .return-to-shop .button {
    background: var(--shim-red) !important;
    border-color: var(--shim-red) !important;
    color: #fff !important;
}

/* ---- Cross-sell products ------------------------------------------ */

body.woocommerce-cart .cross-sells > h2 {
    font-family: var(--shim-mono) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.22em !important;
    color: var(--shim-red) !important;
    margin: 40px 0 24px !important;
}

/* ---- Responsive ---------------------------------------------------- */

@media (max-width: 768px) {
    /* Stack the two-column layout: cart form above Cart Totals, both full width. */
    body.woocommerce-cart .woocommerce > form.woocommerce-cart-form,
    body.woocommerce-cart .woocommerce > .cart-collaterals {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    body.woocommerce-cart .cart_totals {
        width: 100% !important;
    }

    body.woocommerce-cart table.shop_table.cart thead {
        display: none !important;
    }

    body.woocommerce-cart table.shop_table.cart tbody td {
        display: block !important;
        text-align: left !important;
        padding: 10px 16px !important;
    }

    body.woocommerce-cart table.shop_table.cart tbody td.product-thumbnail {
        width: 100% !important;
    }

    /* Stack the floated actions children full-width on narrow screens. */
    body.woocommerce-cart table.shop_table.cart td.actions .coupon {
        float: none !important;
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 8px !important;
    }

    body.woocommerce-cart table.shop_table.cart td.actions button[name="update_cart"] {
        float: none !important;
        width: 100% !important;
        justify-content: center !important;
    }
}
