.woocommerce table.woocommerce-orders-table {
    --gh-green: #0f532b;
    --gh-green-dark: #0a3a1e;
    --gh-cream: #fdfbf4;
    --gh-border: #e2e3d5;
    --gh-text: #293e30;

    width: 100% !important;
    margin: 0 0 24px !important;
    border: 1px solid var(--gh-border) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--gh-text) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    box-shadow: 0 6px 24px rgb(15 83 43 / 6%) !important;
}

.woocommerce table.woocommerce-orders-table,
.woocommerce table.woocommerce-orders-table * {
    box-sizing: border-box !important;
}

/* Table headings */
.woocommerce table.woocommerce-orders-table thead th {
    padding: 18px 16px !important;
    background: var(--gh-green) !important;
    color: #ffffff !important;
    border: 0 !important;
    border-bottom: 3px solid #d48b00 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.woocommerce table.woocommerce-orders-table thead th:first-child {
    border-top-left-radius: 13px !important;
}

.woocommerce table.woocommerce-orders-table thead th:last-child {
    border-top-right-radius: 13px !important;
}

/* Order rows, including the Order number TH */
.woocommerce table.woocommerce-orders-table tbody th,
.woocommerce table.woocommerce-orders-table tbody td {
    padding: 18px 16px !important;
    background: #ffffff !important;
    color: var(--gh-text) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--gh-border) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
    text-align: left !important;
    vertical-align: middle !important;
    overflow-wrap: anywhere !important;
}

.woocommerce table.woocommerce-orders-table tbody tr:nth-child(even)>* {
    background: var(--gh-cream) !important;
}

.woocommerce table.woocommerce-orders-table tbody tr:last-child>* {
    border-bottom: 0 !important;
}

.woocommerce table.woocommerce-orders-table tbody tr:last-child> :first-child {
    border-bottom-left-radius: 13px !important;
}

.woocommerce table.woocommerce-orders-table tbody tr:last-child> :last-child {
    border-bottom-right-radius: 13px !important;
}

/* Order number */
.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-number a {
    color: var(--gh-green) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    text-underline-offset: 3px !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-number a:hover {
    color: var(--gh-green-dark) !important;
    text-decoration: underline !important;
}

/* Amount */
.woocommerce table.woocommerce-orders-table .woocommerce-Price-amount {
    color: var(--gh-green) !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* Status colours based on WooCommerce row classes */
.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-status {
    font-weight: 700 !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status {
    color: #886000 !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status {
    color: #0f532b !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status,
.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status {
    color: #925000 !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
    color: #b42318 !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__row--status-refunded .woocommerce-orders-table__cell-order-status {
    color: #5b547d !important;
}

/* Action buttons */
.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    float: none !important;
    min-height: 42px !important;
    margin: 4px 4px 4px 0 !important;
    padding: 10px 18px !important;
    background: #fff;
    color: var(--gh-green) !important;
    border: 1px solid var(--gh-green) !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    text-transform: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
}

.woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions .button:hover {
    background: var(--gh-green-dark) !important;
    border-color: var(--gh-green-dark) !important;
    color: #ffffff !important;
}

/* View arrow — no icon font required */
.woocommerce table.woocommerce-orders-table .button.view::before {
    content: none !important;
}

.woocommerce table.woocommerce-orders-table .button.view::after {
    content: "\f061" !important;
    font-family: "Font Awesome 6 Free";
    display: inline-block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    font-family: font awamome 6 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    transform: none !important;
    transition: transform 0.2s ease !important;
}

.woocommerce table.woocommerce-orders-table .button.view:hover::after {
    transform: translateX(3px) !important;
}

.woocommerce table.woocommerce-orders-table a:focus-visible {
    outline: 2px solid #d48b00 !important;
    outline-offset: 4px !important;
}

/* Mobile order cards */
@media (max-width: 768px) {
    .woocommerce table.woocommerce-orders-table {
        display: block !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    /* Visually hide headings while retaining them for screen readers */
    .woocommerce table.woocommerce-orders-table thead {
        display: table-header-group !important;
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
    }

    .woocommerce table.woocommerce-orders-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .woocommerce table.woocommerce-orders-table tbody tr {
        display: block !important;
        width: 100% !important;
        margin: 0 0 18px !important;
        padding: 8px 16px !important;
        background: #ffffff !important;
        border: 1px solid var(--gh-border) !important;
        border-top: 3px solid #d48b00 !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 16px rgb(15 83 43 / 5%) !important;
    }

    .woocommerce table.woocommerce-orders-table tbody tr>th,
    .woocommerce table.woocommerce-orders-table tbody tr>td {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 13px 0 13px 38% !important;
        background: transparent !important;
        border: 0 !important;
        border-bottom: 1px solid var(--gh-border) !important;
        border-radius: 0 !important;
        text-align: right !important;
    }

    /* Include the Order number TH, which WooCommerce may hide */
    .woocommerce table.woocommerce-orders-table tbody tr>[data-title]::before {
        content: attr(data-title) !important;
        display: block !important;
        position: absolute !important;
        top: 13px !important;
        left: 0 !important;
        width: 34% !important;
        float: none !important;
        color: var(--gh-green) !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.65 !important;
        text-align: left !important;
    }

    .woocommerce table.woocommerce-orders-table tbody tr> :last-child {
        border-bottom: 0 !important;
    }

    .woocommerce table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions .button {
        margin: 3px 0 3px 6px !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    .woocommerce table.woocommerce-orders-table .button,
    .woocommerce table.woocommerce-orders-table .button.view::after {
        transition: none !important;
    }
}