/*
 * [suppliers_list] table. Loaded only on pages that render the shortcode.
 * Inherits the site's Elementor global text colour and font; override the
 * custom properties below to restyle without touching this file.
 */
.suppliers-list {
    --suppliers-list-yes: #2e7d32;
    --suppliers-list-no: #c62828;
    --suppliers-list-muted: #777;
    --suppliers-list-head-border: rgba(0, 0, 0, 0.2);
    --suppliers-list-row-border: rgba(0, 0, 0, 0.08);

    /* Positioned so the absolutely-positioned screen-reader text stays inside
       the scroll box instead of widening the page on narrow screens. */
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--e-global-color-text, inherit);
    font-family: var(--e-global-typography-text-font-family, inherit);
}

.suppliers-list__table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    margin: 0;
}

.suppliers-list__table th,
.suppliers-list__table td {
    padding: 0.5rem;
    text-align: left;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid var(--suppliers-list-row-border);
    background: none;
}

.suppliers-list__table th {
    font-weight: 600;
    border-bottom-color: var(--suppliers-list-head-border);
}

.suppliers-list__col--gln,
.suppliers-list__col--direct_ordering {
    font-variant-numeric: tabular-nums;
}

.suppliers-list__icon {
    display: inline-flex;
    vertical-align: middle;
}

.suppliers-list__icon--yes {
    color: var(--suppliers-list-yes);
}

.suppliers-list__icon--no {
    color: var(--suppliers-list-no);
}

.suppliers-list__none {
    color: var(--suppliers-list-muted);
    font-style: italic;
}

.suppliers-list__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * Mobile (below Elementor's 768px tablet breakpoint): each supplier becomes a
 * stacked block, one "label — value" line per column, so nothing sits in a
 * hidden horizontal scroll. Labels come from each cell's data-label.
 */
@media (max-width: 767px) {
    .suppliers-list {
        overflow-x: visible;
    }

    /* Column headings: hidden visually, kept for screen readers. */
    .suppliers-list__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .suppliers-list__table,
    .suppliers-list__table tbody,
    .suppliers-list__table tr {
        display: block;
        width: 100%;
    }

    .suppliers-list__table tr {
        border-bottom: 1px solid var(--suppliers-list-head-border);
    }

    .suppliers-list__table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.25rem 0.5rem;
        border-bottom: 0;
        text-align: right;
    }

    .suppliers-list__table td::before {
        content: attr(data-label);
        /* Screen readers already get the column heading from the table roles. */
        content: attr(data-label) / "";
        font-weight: 600;
        text-align: left;
    }

    .suppliers-list__table td:first-child {
        padding-top: 0.75rem;
    }

    .suppliers-list__table td:last-child {
        padding-bottom: 0.75rem;
    }

    /* Supplier name is the block's heading line, without a label. */
    .suppliers-list__table td.suppliers-list__col--name {
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        font-weight: 600;
        text-align: left;
    }

    .suppliers-list__table td.suppliers-list__col--name::before {
        content: none;
    }
}
