

/* Table Wrap */

.table-wrap {
    overflow: scroll;

    &.align-top th,
    &.align-top td {
        vertical-align: top;
    }

    &:not(.table-inline) table {
        width: 100%;
    }

}



/* Table */

.table-wrap,
table {

    --table-padding-y: 0;
    --table-padding-x: 10px;
    --table-border-radius: 8px;
    --table-border-radius-left: var(--table-border-radius, 4px) 0 0 var(--table-border-radius, 4px);
    --table-border-radius-right: 0 var(--table-border-radius, 4px) var(--table-border-radius, 4px) 0;
    --table-border-radius-bottom: 0 0 var(--table-border-radius, 4px) var(--table-border-radius, 4px);
    --table-border-radius-top: var(--table-border-radius, 4px) var(--table-border-radius, 4px) 0 0;

}

table {

    th, td {
        padding-top: var(--table-padding-y);
        padding-bottom: var(--table-padding-y);
        padding-right: var(--table-padding-x);
        text-align: left;
    }

    th:first-child,
    td:first-child {
        padding-left: var(--table-padding-x);
    }

    th, strong, b {
        font-weight: 400;
    }

}



/* Table */
.table-striped > table,
table.striped {

    --table-padding-y: 12px;
    --table-padding-x: 16px;
    --table-striped-background: rgba(255, 255, 255, 0.5);


    .striped-lighter & {
        --table-striped-background: var(--theme-lighter);
    }


    th:first-child,
    td:first-child {
        border-radius: var(--table-border-radius-left);
    }

    th:last-child,
    td:last-child {
        border-radius: var(--table-border-radius-right);
    }

    tbody {
        tr:nth-child(odd) th,
        tr:nth-child(odd) td {
            background-color: var(--table-striped-background);
        }
    }

}




/* Table Prices */

.table-prices {

    table {
        --table-padding-y: 2px;
    }

    &.table-striped {
        table {
            --table-padding-y: 10px;
            --table-padding-x: 10px;
        }
    }

    table th:nth-child(n+2),
    table td:nth-child(n+2) {
        text-align: right;
    }

    table td.semibold,
    table td:last-child {
        font-weight: 400;
    }

    table thead th {
        border-bottom: 2px solid #000;
    }

}




/* Table Compare */

.table-compare > table,
table.compare {

    --table-compare-padding-x: 20px;
    --table-compare-padding-y: 10px;

    thead,
    tbody {

        tr th:nth-last-child(1),
        tr td:nth-last-child(1),
        tr th:nth-last-child(2),
        tr td:nth-last-child(2) {
            width: 100px;
            position: relative;
            text-align: center;
            white-space: nowrap;
            padding: var(--table-compare-padding-y) var(--table-compare-padding-x);
        }

        tr th:nth-last-child(2),
        tr td:nth-last-child(2) {
            background-color: rgba(255, 255, 255, 1);
        }

    }


    thead tr:first-child {
        th:nth-last-child(2),
        td:nth-last-child(2) {
            border-radius: var(--table-border-radius-top);
        }
    }


    tbody tr:last-child {
        th:nth-last-child(2),
        td:nth-last-child(2) {
            border-radius: var(--table-border-radius-bottom);
        }
    }


    .icon.status {
        border-radius: 999px;
        color: #fff;
    }


    tbody tr:not(:last-child) .icon.status {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
    }


    &.hover-effect {

        td > * {
            transition: opacity 0.2s;
        }

        tbody:hover tr:not(:hover) td > * {
            opacity: 0.325;
        }

        tbody:hover tr:hover td > .icon.status {
            transform: scale(1.25);
        }

        tbody:hover tr:not(:last-child):hover td > .icon.status {
            transform: translateX(-50%) translateY(-50%) scale(1.25);
        }

        tbody:hover tr:hover td > strong,
        tbody:hover tr:hover td > span {
            text-shadow: 0.01em 0.01em currentColor;
        }

    }

}





