/*
 * HyperDAF Cart Experience
 * Plugin-owned Cart presentation. WooCommerce owns cart state/calculations.
 */

body.hdc-commerce-cart-page {
    --hdc-cart-image-size: 88px;
    --hdc-cart-totals-width: 360px;
    --hdc-cart-radius: 14px;
    --hdc-cart-action-height: 48px;
    --hdc-cart-gap: 10px;
    --hdc-cart-section-gap: 18px;
}

/* The shared Commerce flow owns the outer Theme site frame. Cart only owns
 * its internal composition and can never narrow or widen the page shell. */
.hdc-cart-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.hdc-cart-page > * {
    box-sizing: border-box;
    min-width: 0;
}

/* Header */
.hdc-cart-page-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 28px;
}

.hdc-cart-page-hero__copy {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.hdc-cart-page-hero__copy .hdc-commerce-page-hero__eyebrow,
.hdc-cart-page-hero__copy h1,
.hdc-cart-page-hero__intro {
    margin: 0;
}

.hdc-cart-page-hero__intro {
    max-width: 760px;
    color: var(--hdc-muted-text);
    font-family: var(--hdc-font-ui);
    font-size: .9rem;
    line-height: 1.55;
}

.hdc-cart-continue {
    display: inline-flex;
    min-height: var(--hdc-cart-action-height);
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid var(--hdc-flat-border);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 3px));
    font-family: var(--hdc-font-ui);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.hdc-cart-continue--secondary {
    background: var(--hdc-surface);
    color: var(--hdc-text);
}

.hdc-cart-continue--secondary:hover,
.hdc-cart-continue--secondary:focus-visible {
    border-color: color-mix(in srgb, var(--hdc-primary) 52%, var(--hdc-border));
    background: color-mix(in srgb, var(--hdc-primary) 7%, var(--hdc-surface));
    color: var(--hdc-primary-hover);
}

.hdc-cart-continue--primary {
    border-color: var(--hdc-primary-hover);
    background: var(--hdc-primary);
    color: var(--hdc-button-text);
}

.hdc-cart-continue--primary:hover,
.hdc-cart-continue--primary:focus-visible {
    border-color: var(--hdc-primary-hover);
    background: var(--hdc-primary-hover);
    color: var(--hdc-button-text);
}

.hdc-cart-continue__icon,
.hdc-cart-continue__arrow {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
}

.hdc-cart-continue__arrow {
    width: 15px;
    flex-basis: 15px;
}

.hdc-cart-continue__icon .hdc-icon,
.hdc-cart-continue__arrow .hdc-icon {
    width: 100%;
    height: 100%;
}

/* Notices */
body.hdc-commerce-cart-page :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wc-block-components-notice-banner) {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 var(--hdc-cart-section-gap);
    border: 1px solid var(--hdc-border);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 3px));
    background: var(--hdc-surface);
    color: var(--hdc-text);
}

/* Main Cart layout: products + non-sticky totals, exact 10px gap. */
.hdc-cart-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, var(--hdc-cart-totals-width));
    align-items: start;
    gap: var(--hdc-cart-gap);
    margin-top: var(--hdc-cart-section-gap);
}

.hdc-cart-products,
.hdc-cart-summary,
.hdc-cart-recommendations {
    min-width: 0;
}

.hdc-cart-products {
    grid-column: 1;
    grid-row: 1;
}

.hdc-cart-summary {
    position: static;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
}

/* Product board */
.hdc-cart-form {
    width: 100%;
    margin: 0;
}

.hdc-cart-product-board {
    overflow: hidden;
    border: 1px solid var(--hdc-flat-border);
    border-radius: var(--hdc-cart-radius);
    background: var(--hdc-surface);
}

.hdc-cart-product-head,
.hdc-cart-product-row {
    display: grid;
    grid-template-columns: minmax(310px, 1fr) 100px 92px 112px 44px;
    align-items: center;
    column-gap: 14px;
}

.hdc-cart-product-head {
    min-height: 46px;
    padding: 0 14px;
    border-bottom: 1px solid var(--hdc-border);
    background: color-mix(in srgb, var(--hdc-subtle) 70%, var(--hdc-surface));
    color: var(--hdc-muted-text);
    font-family: var(--hdc-font-ui);
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hdc-cart-product-head > span:not(:first-child) {
    text-align: center;
}

.hdc-cart-product-list {
    display: grid;
}

.hdc-cart-product-row {
    min-height: calc(var(--hdc-cart-image-size) + 32px);
    padding: 15px 14px;
    border-bottom: 1px solid var(--hdc-border);
    color: var(--hdc-text);
    font-family: var(--hdc-font-ui);
}

.hdc-cart-product-row:last-child {
    border-bottom: 0;
}

.hdc-cart-product-row__product {
    display: grid;
    min-width: 0;
    grid-template-columns: var(--hdc-cart-image-size) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.hdc-cart-product-row__media {
    display: grid;
    width: var(--hdc-cart-image-size);
    height: var(--hdc-cart-image-size);
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--hdc-border);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 4px));
    background: var(--hdc-surface);
}

.hdc-cart-product-row__media a,
.hdc-cart-product-row__media img {
    display: block;
    width: 100%;
    height: 100%;
}

.hdc-cart-product-row__media img {
    object-fit: contain;
}

.hdc-cart-product-row__details {
    display: grid;
    min-width: 0;
    gap: 5px;
}

body.hdc-commerce-cart-page .hdc-cart-product-row a.hdc-cart-product-row__title {
    color: var(--hdc-cart-title-link);
    font-family: var(--hdc-font-heading);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

body.hdc-commerce-cart-page .hdc-cart-product-row a.hdc-cart-product-row__title:hover,
body.hdc-commerce-cart-page .hdc-cart-product-row a.hdc-cart-product-row__title:focus-visible {
    color: var(--hdc-cart-title-link-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.hdc-cart-product-row__meta,
.hdc-cart-product-row__meta dl,
.hdc-cart-product-row__meta p,
.hdc-cart-product-row .backorder_notification {
    margin: 0;
    color: var(--hdc-muted-text);
    font-size: .7rem;
    line-height: 1.4;
}

.hdc-cart-product-row__price,
.hdc-cart-product-row__subtotal {
    font-family: var(--hdc-font-heading);
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.hdc-cart-product-row__quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hdc-cart-product-row__quantity .qty {
    box-sizing: border-box;
    width: 72px;
    min-height: 40px;
    margin: 0;
    padding: 7px 8px;
    border: 1px solid var(--hdc-border);
    border-radius: max(8px, calc(var(--hdc-cart-radius) - 5px));
    background: var(--hdc-surface);
    color: var(--hdc-text);
    font-family: var(--hdc-font-ui);
    font-weight: 700;
    text-align: center;
}

.hdc-cart-product-row__quantity .qty:focus {
    border-color: var(--hdc-primary);
    outline: 2px solid color-mix(in srgb, var(--hdc-primary) 20%, transparent);
    outline-offset: 1px;
}

.hdc-cart-product-row__remove {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hdc-cart-remove {
    display: grid;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    place-items: center;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--hdc-danger) 24%, var(--hdc-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--hdc-danger) 5%, var(--hdc-surface));
    color: var(--hdc-danger);
    font-size: 0;
    line-height: 1;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.hdc-cart-remove > span {
    font-size: 19px;
    font-weight: 700;
}

.hdc-cart-remove:hover,
.hdc-cart-remove:focus-visible {
    border-color: var(--hdc-danger);
    background: color-mix(in srgb, var(--hdc-danger) 10%, var(--hdc-surface));
    color: var(--hdc-danger);
}

/* Coupon / update row */
.hdc-cart-actions {
    display: block;
    min-height: 68px;
    padding: 12px 14px;
    border-top: 1px solid var(--hdc-border);
    background: color-mix(in srgb, var(--hdc-subtle) 58%, var(--hdc-surface));
}

.hdc-cart-actions__row {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.hdc-cart-coupon {
    display: grid;
    width: min(100%, 410px);
    min-width: 0;
    flex: 1 1 410px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.hdc-cart-update {
    flex: 0 0 auto;
    margin-inline-start: auto;
    white-space: nowrap;
}

.hdc-cart-coupon .input-text,
.hdc-cart-action-button {
    box-sizing: border-box;
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--hdc-border);
    border-radius: max(8px, calc(var(--hdc-cart-radius) - 5px));
    background: var(--hdc-surface);
    color: var(--hdc-text);
    font-family: var(--hdc-font-ui);
}

.hdc-cart-coupon .input-text {
    width: 100%;
    padding: 8px 12px;
}

.hdc-cart-action-button {
    padding: 9px 15px;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}

.hdc-cart-action-button:hover,
.hdc-cart-action-button:focus-visible {
    border-color: color-mix(in srgb, var(--hdc-primary) 52%, var(--hdc-border));
    background: color-mix(in srgb, var(--hdc-primary) 7%, var(--hdc-surface));
    color: var(--hdc-primary-hover);
}

/* One centered 3-segment trust board below products. */
.hdc-cart-trust-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: var(--hdc-cart-gap);
    overflow: hidden;
    border: 1px solid var(--hdc-flat-border);
    border-radius: var(--hdc-cart-radius);
    background: var(--hdc-surface);
}

.hdc-cart-trust-item {
    display: grid;
    min-height: 82px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    text-align: start;
}

.hdc-cart-trust-item + .hdc-cart-trust-item {
    border-inline-start: 1px solid var(--hdc-border);
}

.hdc-cart-trust-item__icon {
    display: grid;
    box-sizing: border-box;
    width: 38px;
    height: 38px;
    place-items: center;
    margin: auto;
    border: 1px solid color-mix(in srgb, var(--hdc-primary) 50%, var(--hdc-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--hdc-primary) 7%, var(--hdc-surface));
    color: var(--hdc-primary-hover);
}

.hdc-cart-trust-item__icon .hdc-icon {
    display: block;
    width: 20px;
    height: 20px;
    margin: auto;
}

.hdc-cart-trust-item__copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.hdc-cart-trust-item__copy strong,
.hdc-cart-trust-item__copy small {
    display: block;
    margin: 0;
}

.hdc-cart-trust-item__copy-short {
    display: none;
}

.hdc-cart-trust-item__copy strong {
    color: var(--hdc-text);
    font-size: .76rem;
    line-height: 1.25;
}

.hdc-cart-trust-item__copy small {
    color: var(--hdc-muted-text);
    font-size: .67rem;
    line-height: 1.35;
}

/* Non-sticky totals sidebar. */
.hdc-cart-totals {
    position: static;
    width: 100%;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--hdc-flat-border);
    border-radius: var(--hdc-cart-radius);
    background: var(--hdc-surface);
}

.hdc-cart-totals > h2 {
    margin: 0 0 13px;
    color: var(--hdc-text);
    font-family: var(--hdc-font-heading);
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.3;
}

.hdc-cart-totals__rows {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--hdc-border);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 4px));
}

.hdc-cart-totals__row {
    display: grid;
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    margin: 0;
    border-top: 1px solid var(--hdc-border);
}

.hdc-cart-totals__row:first-child {
    border-top: 0;
}

.hdc-cart-totals__row dt,
.hdc-cart-totals__row dd {
    margin: 0;
    padding: 11px 12px;
    font-family: var(--hdc-font-ui);
    font-size: .74rem;
    line-height: 1.4;
}

.hdc-cart-totals__row dt {
    background: color-mix(in srgb, var(--hdc-subtle) 62%, var(--hdc-surface));
    color: var(--hdc-muted-text);
    font-weight: 700;
}

.hdc-cart-totals__row dd {
    color: var(--hdc-text);
    text-align: end;
}

.hdc-cart-totals__row--total dt,
.hdc-cart-totals__row--total dd {
    color: var(--hdc-text);
    font-family: var(--hdc-font-heading);
    font-size: .9rem;
    font-weight: 700;
}

.hdc-cart-checkout {
    margin: 0;
    padding: 0;
}

.hdc-cart-checkout .checkout-button {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    min-height: var(--hdc-cart-action-height);
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 11px 16px;
    border: 1px solid var(--hdc-primary-hover);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 3px));
    background: var(--hdc-primary);
    color: var(--hdc-button-text);
    font-family: var(--hdc-font-ui);
    font-size: .81rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.hdc-cart-checkout .checkout-button:hover,
.hdc-cart-checkout .checkout-button:focus-visible {
    border-color: var(--hdc-primary-hover);
    background: var(--hdc-primary-hover);
    color: var(--hdc-button-text);
}

.hdc-cart-after-totals {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.hdc-cart-secure-note {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--hdc-border);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 4px));
    background: var(--hdc-subtle);
}

.hdc-cart-secure-note > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--hdc-primary) 30%, var(--hdc-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--hdc-primary) 7%, var(--hdc-surface));
    color: var(--hdc-primary-hover);
}

.hdc-cart-secure-note .hdc-icon {
    width: 18px;
    height: 18px;
}

.hdc-cart-secure-note p,
.hdc-cart-secure-note strong,
.hdc-cart-secure-note small {
    display: block;
    margin: 0;
}

.hdc-cart-secure-note strong {
    color: var(--hdc-text);
    font-size: .73rem;
}

.hdc-cart-secure-note small {
    margin-top: 2px;
    color: var(--hdc-muted-text);
    font-size: .65rem;
    line-height: 1.35;
}

.hdc-cart-after-totals .hdc-whatsapp-button,
.hdc-cart-after-totals .hdc-whatsapp-button:visited,
.hdc-cart-after-totals .hdc-whatsapp-button:hover,
.hdc-cart-after-totals .hdc-whatsapp-button:focus-visible {
    width: 100%;
    justify-content: center;
    color: var(--hdc-whatsapp-text);
    text-align: center;
}

.hdc-cart-after-totals .hdc-whatsapp-button__label,
.hdc-cart-after-totals .hdc-whatsapp-button__icon {
    width: auto;
    flex: 0 0 auto;
    color: inherit;
}

/* Recommendation section stays under the products column and outside the totals-sidebar width. */
.hdc-cart-recommendations {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin-top: 14px;
    padding: 18px 0;
    border: 1px solid var(--hdc-flat-border);
    border-radius: var(--hdc-cart-radius);
    background: var(--hdc-surface);
}

.hdc-cart-recommendations > h2 {
    margin: 0 0 16px;
    padding-inline: 18px;
    color: var(--hdc-text);
    font-family: var(--hdc-font-heading);
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.3;
}

.hdc-cart-recommendations__grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    align-items: stretch;
    gap: 0;
    padding: 0;
}

.hdc-cart-recommendations__grid > .hdc-product-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Empty Cart */
.hdc-cart-page--empty {
    display: grid;
    gap: var(--hdc-cart-section-gap);
}

.hdc-cart-empty {
    display: grid;
    width: min(100%, 760px);
    justify-items: center;
    gap: 10px;
    margin-inline: auto;
    padding: 38px 24px;
    border: 1px solid var(--hdc-flat-border);
    border-radius: var(--hdc-cart-radius);
    background: var(--hdc-surface);
    text-align: center;
}

.hdc-cart-empty__icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--hdc-primary) 38%, var(--hdc-border));
    border-radius: 50%;
    background: color-mix(in srgb, var(--hdc-primary) 7%, var(--hdc-surface));
    color: var(--hdc-primary-hover);
}

.hdc-cart-empty__icon .hdc-icon {
    width: 26px;
    height: 26px;
}

.hdc-cart-empty h2,
.hdc-cart-empty p {
    margin: 0;
}

.hdc-cart-empty h2 {
    color: var(--hdc-text);
    font-family: var(--hdc-font-heading);
}

.hdc-cart-empty p {
    color: var(--hdc-muted-text);
    font-family: var(--hdc-font-ui);
    font-size: .84rem;
}

.hdc-cart-empty__button {
    display: inline-flex;
    min-height: var(--hdc-cart-action-height);
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    padding: 10px 18px;
    border: 1px solid var(--hdc-primary-hover);
    border-radius: max(9px, calc(var(--hdc-cart-radius) - 3px));
    background: var(--hdc-primary);
    color: var(--hdc-button-text);
    font-family: var(--hdc-font-ui);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1180px) {
    /* Match the canonical homepage Product Showcase tablet interaction: 2.5 visible cards,
     * native horizontal swipe, no visible scrollbar or secondary scroll controls. */
    .hdc-cart-recommendations__grid {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
        padding: 0;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .hdc-cart-recommendations__grid::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .hdc-cart-recommendations__grid > .hdc-product-card {
        flex: 0 0 calc(100% / 2.5);
        max-width: calc(100% / 2.5);
        min-width: calc(100% / 2.5);
        scroll-snap-align: start;
    }
}

@media (max-width: 1120px) {
    .hdc-cart-product-head,
    .hdc-cart-product-row {
        grid-template-columns: minmax(260px, 1fr) 90px 84px 100px 40px;
        column-gap: 10px;
    }
}

@media (max-width: 980px) {
    .hdc-cart-main {
        grid-template-columns: 1fr;
    }

    .hdc-cart-products,
    .hdc-cart-summary,
    .hdc-cart-recommendations {
        grid-column: 1;
        grid-row: auto;
    }

    .hdc-cart-summary {
        width: 100%;
    }

    .hdc-cart-product-head {
        display: none;
    }

    /* Tablet/mobile Cart card: image + title stay together on top; the next row is
     * exactly Price / Quantity / Total from left to right. No DOM relocation script. */
    .hdc-cart-product-row {
        position: relative;
        display: grid;
        min-height: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas:
            "product product product"
            "price quantity subtotal";
        align-items: start;
        gap: 12px 10px;
        padding: 14px;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__product {
        grid-area: product;
        grid-column: 1 / -1;
        min-width: 0;
        padding-inline-end: 42px;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__price,
    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity,
    body.hdc-commerce-cart-page .hdc-cart-product-row__subtotal {
        display: grid;
        min-width: 0;
        width: 100%;
        gap: 5px;
        align-content: start;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__price {
        grid-area: price;
        grid-column: 1;
        justify-items: start;
        text-align: start;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity {
        grid-area: quantity;
        grid-column: 2;
        justify-items: center;
        text-align: center;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__subtotal {
        grid-area: subtotal;
        grid-column: 3;
        justify-items: end;
        text-align: end;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__price::before,
    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity::before,
    body.hdc-commerce-cart-page .hdc-cart-product-row__subtotal::before {
        content: attr(data-title);
        color: var(--hdc-muted-text);
        font-family: var(--hdc-font-ui);
        font-size: .64rem;
        font-weight: 700;
        letter-spacing: .04em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity .qty {
        width: 64px;
        min-height: 38px;
        padding: 6px 8px;
    }

    .hdc-cart-product-row__remove {
        position: absolute;
        top: 14px;
        inset-inline-end: 14px;
    }

    .hdc-cart-actions__row {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .hdc-cart-coupon {
        width: auto;
        max-width: none;
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .hdc-cart-update {
        width: auto;
        flex: 0 0 auto;
        margin-inline-start: auto;
    }

    /* Trust stays one row / three columns at tablet and mobile widths. Each badge
     * stacks its icon above one compact two-word assurance label on a single line. */
    .hdc-cart-trust-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hdc-cart-trust-item {
        min-height: 70px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: center;
        justify-items: center;
        gap: 6px;
        padding: 8px 4px;
        text-align: center;
    }

    .hdc-cart-trust-item + .hdc-cart-trust-item {
        border-inline-start: 1px solid var(--hdc-border);
        border-top: 0;
    }

    .hdc-cart-trust-item__icon {
        width: 30px;
        height: 30px;
        margin: 0;
        border-radius: 8px;
    }

    .hdc-cart-trust-item__icon .hdc-icon {
        width: 17px;
        height: 17px;
    }

    .hdc-cart-trust-item__copy {
        display: block;
        width: 100%;
        min-width: 0;
        text-align: center;
    }

    .hdc-cart-trust-item__copy-full,
    .hdc-cart-trust-item__copy small {
        display: none;
    }

    .hdc-cart-trust-item__copy-short {
        display: block;
        width: 100%;
        overflow: hidden;
        color: var(--hdc-text);
        font-size: .64rem;
        font-weight: 700;
        line-height: 1.15;
        text-align: center;
        text-overflow: clip;
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .hdc-cart-page-hero {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .hdc-cart-continue {
        width: 100%;
    }
}

@media (max-width: 680px) {
    /* Match the canonical homepage Product Showcase mobile interaction: 1.5 visible cards. */
    .hdc-cart-recommendations {
        padding-inline: 0;
    }

    .hdc-cart-recommendations > h2 {
        padding-inline: 14px;
    }

    .hdc-cart-recommendations__grid > .hdc-product-card {
        flex-basis: calc(100% / 1.5);
        max-width: calc(100% / 1.5);
        min-width: calc(100% / 1.5);
    }

    .hdc-cart-product-row {
        gap: 10px 8px;
        padding: 13px;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__product {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding-inline-end: 38px;
    }

    .hdc-cart-product-row__media {
        width: 72px;
        height: 72px;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row a.hdc-cart-product-row__title {
        font-size: .84rem;
        line-height: 1.35;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__price,
    body.hdc-commerce-cart-page .hdc-cart-product-row__subtotal {
        font-size: .76rem;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__price::before,
    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity::before,
    body.hdc-commerce-cart-page .hdc-cart-product-row__subtotal::before {
        font-size: .6rem;
    }

    body.hdc-commerce-cart-page .hdc-cart-product-row__quantity .qty {
        width: 58px;
        min-height: 36px;
        padding: 5px 6px;
        font-size: .78rem;
    }

    .hdc-cart-product-row__remove {
        top: 12px;
        inset-inline-end: 12px;
    }

    .hdc-cart-trust-item {
        min-height: 64px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 5px;
        padding: 7px 2px;
    }

    .hdc-cart-trust-item__icon {
        width: 27px;
        height: 27px;
    }

    .hdc-cart-trust-item__icon .hdc-icon {
        width: 15px;
        height: 15px;
    }

    .hdc-cart-trust-item__copy-short {
        font-size: .58rem;
        letter-spacing: -.01em;
    }
}

@media (max-width: 560px) {
    .hdc-cart-actions {
        padding-inline: 10px;
    }

    .hdc-cart-actions__row {
        gap: 5px;
    }

    .hdc-cart-coupon {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px;
    }

    .hdc-cart-actions__row .hdc-cart-action-button {
        min-height: 38px;
        padding-inline: 8px;
        font-size: .66rem;
    }

    .hdc-cart-coupon .input-text {
        min-width: 0;
        min-height: 38px;
        padding-inline: 8px;
        font-size: .72rem;
    }
}

.hdc-cart-extension-collaterals {
    margin-top: var(--hdc-cart-section-gap);
}
