.woocommerce-order-details {
    margin-bottom: 2rem;
    padding: 2rem; /* Adds breathing room inside the card */
    background-color: #ffffff; /* Ensures the shadow pops against the page background */
    border: 1px solid #eaeaea; /* A very faint border adds crispness */
    border-radius: 12px; /* Smooth, modern rounded corners */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06); /* Soft, diffused shadow */
}

/* =========================================================
   EVERYREP — MOBILE MY ACCOUNT ORDER CARDS
   CONSOLIDATED REPLACEMENT
   Delete the two earlier order-card sections and use only this.
   ========================================================= */

@media only screen and (max-width: 768px) {

    /* ---------- Order table wrapper ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table {
        display: block !important;
        width: 100% !important;
        margin: 22px 0 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table thead {
        display: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
    }

    /* ---------- Individual order card ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 24px !important;
        grid-template-areas:
            "order arrow"
            "date arrow"
            "status arrow"
            "total total"
            "action action" !important;
        align-items: start !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 17px 20px 16px !important;
        border: 1px solid rgba(20, 20, 20, 0.08) !important;
        border-radius: 20px !important;
        background: #fff !important;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.02),
            0 8px 24px rgba(0, 0, 0, 0.055) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Reset WooCommerce mobile table-cell formatting */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td {
        display: block !important;
        float: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    /* Remove WooCommerce-generated labels such as Order:, Date:, etc. */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td::before {
        display: none !important;
        content: none !important;
    }

    /* ---------- Order number ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-number {
        grid-area: order !important;
        padding-right: 18px !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-number
    > a {
        display: inline-block !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #111 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 17px !important;
        line-height: 1.25 !important;
        font-weight: 650 !important;
        letter-spacing: -0.015em !important;
        text-decoration: none !important;
    }

    /* ---------- Date ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-date {
        grid-area: date !important;
        margin-top: 5px !important;
        color: #666 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
        font-weight: 400 !important;
        letter-spacing: -0.005em !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-date
    time {
        color: inherit !important;
        font: inherit !important;
        letter-spacing: inherit !important;
    }

    /* ---------- Delivered status pill ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-status {
        position: relative !important;
        grid-area: status !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-self: start !important;
        width: fit-content !important;
        min-width: 0 !important;
        max-width: max-content !important;
        margin: 10px 0 0 !important;
        padding: 7px 12px 7px 34px !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: #edf7ef !important;
        color: #174c26 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 500 !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* Re-enable ::before only for the status check */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-status::before {
        content: "✓" !important;
        position: absolute !important;
        left: 11px !important;
        top: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        height: 16px !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: translateY(-50%) !important;
        border: 1.5px solid #2f8a47 !important;
        border-radius: 50% !important;
        color: #2f8a47 !important;
        background: transparent !important;
        font-family: Arial, sans-serif !important;
        font-size: 10px !important;
        line-height: 1 !important;
        font-weight: 700 !important;
        box-sizing: border-box !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-status::after {
        display: none !important;
        content: none !important;
    }

    /* ---------- Total and item count ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-total {
        grid-area: total !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        margin: 11px 0 0 !important;
        padding: 13px 0 0 !important;
        border-top: 1px solid rgba(20, 20, 20, 0.09) !important;
        color: #555 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        font-weight: 400 !important;
        letter-spacing: -0.005em !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-total
    .woocommerce-Price-amount {
        color: #111 !important;
        font-family: inherit !important;
        font-size: 18px !important;
        line-height: 1.3 !important;
        font-weight: 650 !important;
        letter-spacing: -0.01em !important;
    }

    /* ---------- View order action ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions {
        position: static !important;
        grid-area: action !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 21px !important;
        height: 21px !important;
        margin: 11px 0 0 !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions
    > a,
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions
    > a.button {
        position: absolute !important;
        inset: 0 !important;
        z-index: 20 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 20px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: transparent !important;
        font-size: 0 !important;
        line-height: 0 !important;
        text-decoration: none !important;
        text-transform: none !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions
    > a::before {
        content: "View order  →" !important;
        position: absolute !important;
        left: 20px !important;
        bottom: 16px !important;
        display: inline-block !important;
        color: #111 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        pointer-events: none !important;
    }


    /* ---------- Top-right chevron ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row::after {
        content: "›" !important;
        grid-area: arrow !important;
        align-self: start !important;
        justify-self: end !important;
        margin: 3px 0 0 !important;
        color: #111 !important;
        font-family: Arial, sans-serif !important;
        font-size: 34px !important;
        line-height: 0.72 !important;
        font-weight: 300 !important;
        pointer-events: none !important;
    }

    /* ---------- Interaction ---------- */

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row:hover {
        background: #fff !important;
        transform: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-number
    > a:active,
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions
    > a:active {
        opacity: 0.55 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row {
        cursor: pointer !important;
        transition: transform 120ms ease, opacity 120ms ease !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row:active {
        transform: scale(0.992) !important;
        opacity: 0.94 !important;
    }

}

/* =========================================================
   END EVERYREP — MOBILE MY ACCOUNT ORDER CARDS
   ========================================================= */

/* =========================================================
   EVERYREP — AJAX-SAFE MOBILE ORDERS VISIBILITY
   The WooCommerce table stays visible as a fallback.
   It is hidden only when the native PHP card list actually exists.
   ========================================================= */

@media only screen and (max-width: 768px) {

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-orders {
        display: grid !important;
    }

    /*
     * Modern-browser conditional:
     * Hide the standard table only when at least one native card is present.
     * If AJAX returns only the WooCommerce table, the table remains visible.
     */
    body.woocommerce-account
    .woocommerce-MyAccount-content:has(
        .everyrep-mobile-orders .everyrep-mobile-order-card
    )
    table.woocommerce-orders-table {
        display: none !important;
    }
}

@media only screen and (max-width: 768px) {


    /* Mobile card list */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-orders {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        margin: 22px 0 0 !important;
        padding: 0 !important;
    }

    /* Entire card is the native link */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 17px 20px 16px !important;
        border: 1px solid rgba(20, 20, 20, 0.08) !important;
        border-radius: 20px !important;
        background: #fff !important;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.02),
            0 8px 24px rgba(0, 0, 0, 0.055) !important;
        color: #111 !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: transform 120ms ease, opacity 120ms ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card:active {
        transform: scale(0.992) !important;
        opacity: 0.94 !important;
    }

    /* Top row */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__top {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 16px !important;
        width: 100% !important;
    }

    /* Order number */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__order-number {
        display: block !important;
        color: #111 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 17px !important;
        line-height: 1.25 !important;
        font-weight: 650 !important;
        letter-spacing: -0.015em !important;
    }

    /* Top-right chevron */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__chevron {
        display: block !important;
        margin-top: 1px !important;
        color: #111 !important;
        font-family: Arial, sans-serif !important;
        font-size: 34px !important;
        line-height: 0.72 !important;
        font-weight: 300 !important;
    }

    /* Date */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__date {
        display: block !important;
        margin-top: 5px !important;
        color: #666 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
        font-weight: 400 !important;
        letter-spacing: -0.005em !important;
    }

    /* Status pill */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__status {
        display: inline-flex !important;
        align-items: center !important;
        width: fit-content !important;
        margin-top: 10px !important;
        padding: 7px 12px 7px 10px !important;
        border-radius: 999px !important;
        background: #edf7ef !important;
        color: #174c26 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__status-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        height: 16px !important;
        margin-right: 7px !important;
        border: 1.5px solid #2f8a47 !important;
        border-radius: 50% !important;
        color: #2f8a47 !important;
        font-family: Arial, sans-serif !important;
        font-size: 10px !important;
        line-height: 1 !important;
        font-weight: 700 !important;
        box-sizing: border-box !important;
    }

    /* Total + item count */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__summary {
        display: flex !important;
        align-items: baseline !important;
        gap: 6px !important;
        width: 100% !important;
        margin-top: 14px !important;
        padding-top: 13px !important;
        border-top: 1px solid rgba(20, 20, 20, 0.09) !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__total {
        color: #111 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 18px !important;
        line-height: 1.3 !important;
        font-weight: 650 !important;
        letter-spacing: -0.01em !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__items {
        color: #555 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        font-weight: 400 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__items::before {
        content: "·" !important;
        margin-right: 6px !important;
    }

    /* View order */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__action {
        display: inline-flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: 11px !important;
        color: #111 !important;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        font-weight: 600 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-order-card__action-arrow {
        font-family: Arial, sans-serif !important;
        font-size: 20px !important;
        line-height: 1 !important;
        font-weight: 400 !important;
        transform: translateY(-1px) !important;
    }
}


/* Desktop safety: native mobile cards never replace the desktop orders table */
@media only screen and (min-width: 769px) {
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .everyrep-mobile-orders {
        display: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table {
        display: table !important;
    }
}


/* Final click-layer safeguard: the original View action owns the full card */
@media only screen and (max-width: 768px) {
    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td:not(.woocommerce-orders-table__cell-order-actions) {
        position: relative !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td:not(.woocommerce-orders-table__cell-order-actions)
    a {
        pointer-events: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    table.woocommerce-orders-table
    tbody
    tr.woocommerce-orders-table__row
    > td.woocommerce-orders-table__cell-order-actions
    > a.woocommerce-button.button.view {
        position: absolute !important;
        inset: 0 !important;
        z-index: 50 !important;
        pointer-events: auto !important;
    }
}

/* =========================================================
   MOBILE ORDER DETAILS — SUBTOTAL SPACE + SHIPPING ALIGNMENT
   ========================================================= */

@media only screen and (max-width: 768px) {

    /* Add a little breathing room between the product block and Subtotal */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:first-child th,
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:first-child td {
        padding-top: 16px !important;
    }

    /*
     * Shipping row:
     * Keep "Shipping:" and "$4.99" on the same horizontal line,
     * with the shipping method directly beneath the price.
     */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "label value" !important;
        align-items: start !important;
        column-gap: 16px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 0 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) th {
        grid-area: label !important;
        display: block !important;
        align-self: start !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: top !important;
        line-height: 1.25 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td {
        grid-area: value !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
        align-self: start !important;
        width: auto !important;
        min-width: max-content !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: top !important;
        text-align: right !important;
        line-height: 1.25 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td .woocommerce-Price-amount {
        display: block !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: right !important;
        line-height: 1.25 !important;
    }

    /* Remove WooCommerce's forced line break and default spacing */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td br {
        display: none !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td small,
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td .shipped_via {
        display: block !important;
        width: auto !important;
        margin: 1px 0 0 !important;
        padding: 0 !important;
        text-align: right !important;
        font-size: 13px !important;
        line-height: 1.1 !important;
        font-weight: 400 !important;
        white-space: nowrap !important;
    }
}

/* =========================================================
   MOBILE ORDER DETAILS — SHIPPING GAP FINAL FIX
   ========================================================= */

@media only screen and (max-width: 768px) {

/* Add space between the product section and Subtotal */
@media only screen and (max-width: 768px) {

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:first-child {
        margin-top: 18px !important;
        padding-top: 0 !important;
    }
}

    /* Keep Shipping label and price aligned at the top */
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) th,
    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td {
        vertical-align: top !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

/* Default shipping cell — preserves plain text such as “Free shipping” */
body.woocommerce-account
.woocommerce-MyAccount-content
.woocommerce-table--order-details
tfoot tr:nth-child(2) td {
    display: block !important;
    margin: 0 !important;
    text-align: right !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
}

/*
 * Only collapse the anonymous &nbsp; when the shipping cell
 * contains an actual monetary price.
 */
body.woocommerce-account
.woocommerce-MyAccount-content
.woocommerce-table--order-details
tfoot tr:nth-child(2) td:has(.woocommerce-Price-amount) {
    font-size: 0 !important;
    line-height: 0 !important;
}

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td .woocommerce-Price-amount {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: right !important;
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td .shipped_via {
        display: block !important;
        margin: 1px 0 0 !important;
        padding: 0 !important;
        text-align: right !important;
        font-size: 13px !important;
        line-height: 1.15 !important;
        font-weight: 400 !important;
        white-space: nowrap !important;
    }
}

/* Free shipping — match the lighter secondary-value styling */
@media only screen and (max-width: 768px) {

    body.woocommerce-account
    .woocommerce-MyAccount-content
    .woocommerce-table--order-details
    tfoot tr:nth-child(2) td:not(:has(.woocommerce-Price-amount)) {
        font-size: 15px !important;
        line-height: 1.25 !important;
        font-weight: 400 !important;
        color: #333 !important;
    }
}