/* Styled Table */
.styled-table {
    --table-cell-padding: 1.5rem 2.5rem;
}

.styled-table,
.styled-table table {
    margin: var(--df-margin-unit) auto;
    background: var(--table-background-color);
    text-align: left;
    width: 100%;
    table-layout: fixed;
    line-height: 1.4;
    word-wrap: break-word;
    border-radius: var(--table-border-radius);
    box-shadow: 0 0.2rem 0.3rem rgba(0, 0, 0, 0.02);
    border: 1px solid var(--table-border-color);
}

.has-fixed-layout,
.has-fixed-layout table {
    table-layout: fixed !important;
}

figure.styled-table {
    display: block !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

figure.text-center table {
    text-align: center;
}

.styled-table tbody {
    vertical-align: middle;
}

.styled-table.table-layout-auto,
figure.styled-table.table-layout-auto table {
    table-layout: auto;
}

.styled-table tr {
    border-top: 1px solid var(--table-border-color);
}

.styled-table td,
.styled-table th {
    padding: var(--table-cell-padding);
    border: none;
    border-top: 1px solid var(--table-border-color);
    border-right: 1px solid var(--table-border-color);
}

.table-borderless th,
.table-borderless td,
.table-borderless tr {
    border: none !important;
}

.table-w-borderless th,
.table-w-borderless td,
.table-w-borderless tr {
    border-right: none !important;
}

.styled-table th,
.styled-table tr:first-child td {
    border-top: 0;
}

.styled-table tr td:last-child,
.styled-table tr th:last-child {
    border-right: none;
}

.styled-table th {
    font-weight: bold;
    color: var(--title-color);
    background: var(--table-background-color);
    border-bottom: 1px solid var(--table-border-color);
}

.styled-table.highlight-first-column tr td:nth-child(1),
.styled-table.highlight-first-column tr th:nth-child(1) {
    color: var(--highlight-color);
    font-weight: bold;
    line-height: 1.1;
}

.styled-table.striped tr td,
.wp-block-table.is-style-stripes tbody tr:nth-child(odd),
.wp-block-table.is-style-stripes td,
.wp-block-table.is-style-stripes th {
    background: transparent;
}

.styled-table.striped tr td,
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) td,
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) th {
    background: rgba(0, 0, 0, 0.02);
}

.styled-table.striped tr:nth-child(even) td {
    background: var(--table-background-color);
}

.styled-table td img {
    margin: 0;
    height: auto;
    max-width: 100%;
}

.styled-table td .icn-wrap {
    font-size: 0;
}

.styled-table td i {
    font-size: var(--body-font-size);
}

.styled-table td .fa-check {
    color: #73bd47;
}

.styled-table td .fa-times,
.styled-table td .fa-close {
    color: #e1555f;
}

.styled-table td .btn {
    width: 100%;
    min-height: 0;
    padding: 1.3rem 1rem;
}

.styled-table p {
    font-size: inherit;
    margin-bottom: 0;
    line-height: 1.3;
}

.styled-table p+p {
    margin-top: 1rem;
}

.table-label {
    color: var(--text-color);
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.2rem 0.5rem;
    border-radius: var(--df-border-radius);
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .styled-table td .btn {
        width: 100%;
        height: auto;
    }

    .extra-wide-sm table {
        min-width: 72rem !important;
    }
}

@media (max-width: 768px) {
    .styled-table {
        overflow-x: auto;
    }

    .show-thead-on-mobile thead {
        display: table-header-group;
    }

    .styled-table td img {
        width: 15rem;
    }

    .styled-table tr,
    .styled-table th,
    .styled-table td {
        border-top: none;
    }

    .styled-table tr {
        border-top: 1px solid var(--table-border-color);
    }

    .styled-table:not(.sticky-column-table) td {
        border-right: none;
    }

    .styled-table tr:first-child {
        border-top: none;
    }

    .table-label {
        display: block !important;
        visibility: visible;
        pointer-events: none;
    }
}

@media (max-width: 640px) {
    .styled-table {
        --table-cell-padding: 1.5rem;
    }
}

@media (max-width: 640px) {

    .styled-table {
        font-size: calc(var(--body-font-size) * 0.9);
    }

    .styled-table table,
    .styled-table th,
    .styled-table td {
        font-size: inherit;
    }
}

@media (max-width: 400px) {

    .styled-table {
        --table-cell-padding: .9rem;
    }

    .styled-table td .btn {
        font-size: inherit;
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 350px) {
    .styled-table {
        font-size: calc(var(--body-font-size) * 0.7);
        --table-cell-padding: 0.8rem 1rem;
    }
}

/* Compact */
.styled-table.compact {
    --table-cell-padding: 1rem;
}

/* Sticky Column Table */
.sticky-column-table-holder {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    white-space: nowrap;
    border: 1px solid var(--table-border-color);
    margin: var(--df-margin-unit) 0;
}

.sticky-column-table-holder:has(>.no-margin-top, >.no-mg-top) {
    margin-top: 0;
}

.sticky-column-table-holder .sticky-column-table,
.sticky-column-table-holder .sticky-column-table table {
    width: 100%;
    min-width: 100%;
    margin: -1px 0 0 0;
    border: none;
}

.sticky-column-table-holder .sticky-column-table .sticky {
    position: sticky;
    background: var(--table-background-color);
    top: -1px;
    left: -1px;
    box-shadow: inset -2px 0 0 0 var(--table-border-color);
    z-index: 1;
}

.sticky-column-table-holder tbody tr:nth-child(1) .sticky {
    z-index: 2;
}

.sticky-column-table-holder .sticky-column-table tr.first-row {
    border-top: none;
}

.sticky-column-table-holder .sticky-column-table.striped th.sticky {
    background: var(--table-background-color);
}

.sticky-inner-wrapper {
    white-space: normal;
    min-width: 6rem;
}

@media (min-width: 992px) {
    .sticky-column-table-holder .sticky-column-table {
        width: 100%;
    }

    .sticky-column-table thead tr:first-child {
        border-top: none;
    }

    .sticky-column-table-holder .sticky-column-table .sticky {
        border-right: none;
    }
}

@media (max-width: 992px) {
    .sticky-column-table-holder .sticky-column-table table {
        table-layout: auto;
    }

    .sticky-column-table-holder .sticky-column-table thead {
        display: table-header-group;
    }

    .sticky-column-table-holder .sticky-column-table td,
    .sticky-column-table-holder .sticky-column-table tr {
        display: table-cell;
        float: none !important;
        width: auto;
        height: auto;
        border-top: 1px solid var(--table-border-color);
    }

    .sticky-column-table-holder .sticky-column-table .sticky {
        border-right: none;
    }

    .sticky-inner-wrapper {
        min-width: 10rem;
    }

    .sticky-column-table-holder .sticky-column-table tr {
        display: table-row;
    }
}

/* Scrollable Table */
.scrollable-table-holder {
    --min-td-width: 12rem;

    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--table-border-color);
    margin: var(--df-margin-unit) 0;
}

.scrollable-table-holder .scrollable-table,
.scrollable-table-holder .scrollable-table table {
    width: auto;
    min-width: 100%;
    margin: 0;
    border: none;
}

.scrollable-table-holder .scrollable-table table {
    margin-top: -1px;
}

.scrollable-table-holder table th,
.scrollable-table-holder table td {
    min-width: var(--min-td-width);
}

.scrollable-table-holder .scrollable-table table {
    table-layout: auto;
}

.scrollable-table-holder .scrollable-table thead {
    display: table-header-group;
}

.scrollable-table-holder .scrollable-table td {
    border-right: 1px solid var(--table-border-color);
}

.scrollable-table-holder .scrollable-table td,
.scrollable-table-holder .scrollable-table tr {
    display: table-cell;
    float: none !important;
    width: auto;
    height: auto;
    border-top: none;
}

.scrollable-table-holder .scrollable-table .sticky {
    border-right: none;
}

.scrollable-table-holder .scrollable-table td,
.scrollable-table th {
    border-top: 1px solid var(--table-border-color);
}

.scrollable-table-holder .scrollable-table tr {
    display: table-row;
}

/* Table Caption */
table+figcaption {
    margin-top: 0;
    margin-bottom: var(--df-margin-unit);
    padding-top: var(--df-margin-unit);
    text-align: center;
    color: var(--text-light-color);
}

.scrollable-table-holder table+figcaption {
    border-top: 1px solid var(--table-border-color);
    margin-bottom: 1rem;
    padding-top: 1rem;
}

@media (max-width: 1100px) {
    table+figcaption {
        font-size: calc(var(--body-font-size) * 0.8);
    }
}