.ah-wc-cart-1 {
    --ah-cart-line: color-mix(in srgb, var(--ahura-c-text-primary) 9%, transparent);
    --ah-cart-surface: color-mix(in srgb, var(--ahura-c-text-primary) 3%, var(--ahura-c-bg-primary));
    --ah-cart-muted: var(--ahura-c-text-secondary);
    --ah-cart-accent: var(--ahura-theme-primary, #1d67e8);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
        "items totals"
        "cross totals";
    align-items: start;
    gap: 24px 32px;
    margin: 24px 0 40px;
    color: var(--ahura-c-text-primary);
}

.ah-wc-cart-1 .woocommerce-cart-form {
    grid-area: items;
    min-width: 0;
}

.woocommerce .ah-wc-cart-1 .cart-collaterals {
    display: contents;
}

/* Items table */
.woocommerce .ah-wc-cart-1 table.shop_table.cart {
    margin: 0;
    border: 1px solid var(--ah-cart-line);
    border-radius: 16px;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--ahura-c-bg-primary);
    overflow: hidden;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart thead th {
    padding: 16px;
    border: none;
    background-color: var(--ah-cart-surface);
    color: var(--ah-cart-muted);
    font-size: 13px;
    font-weight: 500;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td {
    padding: 20px 16px;
    border: none;
    border-top: 1px solid var(--ah-cart-line);
    background-color: transparent;
    vertical-align: middle;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-remove {
    width: 32px;
    padding-inline-end: 0;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-thumbnail {
    width: 72px;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-thumbnail a {
    display: block;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-thumbnail img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    background-color: var(--ah-cart-surface);
    box-shadow: none;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-name,
.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-name a {
    color: var(--ahura-c-text-primary);
    font-weight: 600;
    line-height: 1.7;
    transition: color .2s;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-name a:hover {
    color: var(--ah-cart-accent);
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-name dl.variation {
    margin: 4px 0 0;
    color: var(--ah-cart-muted);
    font-size: 13px;
    font-weight: 400;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-price {
    color: var(--ah-cart-muted);
    white-space: nowrap;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-subtotal {
    font-weight: 700;
    white-space: nowrap;
}

/* Remove button */
.woocommerce .ah-wc-cart-1 .woocommerce-cart-form__cart-item a.remove {
    --wc-red: var(--ah-cart-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--ah-cart-muted);
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    transition: background-color .2s, color .2s;
}

.woocommerce .ah-wc-cart-1 .woocommerce-cart-form__cart-item a.remove:hover {
    --wc-red: #e5484d;
    background-color: var(--wc-red);
}

/* Quantity */
.woocommerce .ah-wc-cart-1 .product-quantity .quantity:not(.hidden) {
    width: 116px;
    height: 40px;
    padding: 0 4px;
    gap: 0;
    border: 1px solid var(--ah-cart-line);
    border-radius: 999px;
    background-color: var(--ahura-c-bg-primary);
}

.woocommerce .ah-wc-cart-1 .product-quantity .quantity .mw_qty_btn {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--ahura-c-text-primary);
    transition: background-color .2s;
}

.woocommerce .ah-wc-cart-1 .product-quantity .quantity .mw_qty_btn:hover {
    background-color: var(--ah-cart-surface);
}

.woocommerce .ah-wc-cart-1 .product-quantity .quantity input.qty {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ahura-c-text-primary);
    font-weight: 600;
    text-align: center;
    box-shadow: none;
}

/* Actions row */
.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions {
    padding: 16px;
    background-color: var(--ah-cart-surface);
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon {
    display: flex;
    gap: 8px;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon .input-text {
    width: 200px;
    height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--ah-cart-line);
    border-radius: 10px;
    background-color: var(--ahura-c-bg-primary);
    color: var(--ahura-c-text-primary);
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon .input-text:focus {
    border-color: var(--ah-cart-accent);
    outline: none;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .button {
    height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 44px;
    box-shadow: none;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions button.button[name="update_cart"],
.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions button.button[name="update_cart"]:disabled[disabled] {
    border: 1px solid var(--ah-cart-line);
    background-color: var(--ahura-c-bg-primary);
    color: var(--ahura-c-text-primary);
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions button.button[name="update_cart"]:disabled[disabled] {
    opacity: .45;
}

.woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions button.button[name="update_cart"]:not(:disabled):hover {
    border-color: var(--ah-cart-accent);
    color: var(--ah-cart-accent);
}

/* Totals card */
.woocommerce .ah-wc-cart-1 .cart-collaterals .cart_totals {
    grid-area: totals;
    position: sticky;
    top: 24px;
    float: none;
    width: auto;
    padding: 24px;
    border-radius: 16px;
    background-color: var(--ah-cart-surface);
}

.woocommerce .ah-wc-cart-1 .cart_totals h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
}

.woocommerce .ah-wc-cart-1 .cart_totals table.shop_table {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.woocommerce .ah-wc-cart-1 .cart_totals table.shop_table :is(th, td) {
    padding: 10px 0;
    border: none;
    background: transparent;
    vertical-align: top;
}

.woocommerce .ah-wc-cart-1 .cart_totals table.shop_table th {
    width: auto;
    color: var(--ah-cart-muted);
    font-weight: 500;
}

.woocommerce .ah-wc-cart-1 .cart_totals table.shop_table td {
    text-align: end;
}

.woocommerce .ah-wc-cart-1 .cart_totals table.shop_table tr.order-total :is(th, td) {
    padding-top: 16px;
    border-top: 1px solid var(--ah-cart-line);
    color: var(--ahura-c-text-primary);
    font-size: 16px;
    font-weight: 700;
}

.woocommerce .ah-wc-cart-1 .cart_totals tr.order-total .amount {
    color: var(--ah-cart-accent);
    font-size: 18px;
}

.woocommerce .ah-wc-cart-1 .cart_totals .wc-proceed-to-checkout {
    padding: 20px 0 0;
}

.woocommerce-cart .ah-wc-cart-1 .wc-proceed-to-checkout a.checkout-button,
.woocommerce .ah-wc-cart-1 .wc-proceed-to-checkout a.checkout-button {
    margin: 0;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: none;
}

/* Cross-sells */
.woocommerce .ah-wc-cart-1 .cart-collaterals .cross-sells {
    grid-area: cross;
    float: none;
    width: auto;
    min-width: 0;
}

@media (max-width: 991.98px) {
    .ah-wc-cart-1 {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "items"
            "totals"
            "cross";
    }

    .woocommerce .ah-wc-cart-1 .cart-collaterals .cart_totals {
        position: static;
    }
}

/* Small screens: each row becomes a flat card */
@media (max-width: 768px) {
    .woocommerce .ah-wc-cart-1 table.shop_table.cart {
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "thumb name remove"
            "price price price"
            "qty qty qty"
            "subtotal subtotal subtotal";
        align-items: center;
        padding: 16px;
        border: 1px solid var(--ah-cart-line);
        border-radius: 16px;
        background-color: var(--ahura-c-bg-primary);
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: auto;
        padding: 10px 0;
        border-top: 1px solid var(--ah-cart-line);
        background-color: transparent;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td::before {
        float: none;
        color: var(--ah-cart-muted);
        font-weight: 500;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-thumbnail {
        grid-area: thumb;
        margin-inline-end: 12px;
        padding: 0;
        border: none;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-thumbnail::before {
        content: none;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart td.product-thumbnail img {
        width: 56px;
        height: 56px;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-name {
        grid-area: name;
        display: block;
        padding: 0 0 12px;
        border: none;
        align-self: center;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-name::before {
        content: none;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-remove {
        grid-area: remove;
        align-self: start;
        width: auto;
        margin-inline-start: 8px;
        padding: 0;
        border: none;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-price {
        grid-area: price;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-quantity {
        grid-area: qty;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr.cart_item td.product-subtotal {
        grid-area: subtotal;
        padding-bottom: 0;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart tr:not(.cart_item) {
        display: block;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0;
        border: none;
        background: transparent;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon {
        padding: 0;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon .input-text {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .woocommerce .ah-wc-cart-1 table.shop_table.cart td.actions .coupon .button {
        flex: 0 0 auto;
        width: auto;
    }

    .woocommerce .ah-wc-cart-1 .cart-collaterals .cart_totals {
        padding: 20px;
    }
}
