/* vim: set ts=2 sw=2 sts=2 et: */

/**
 * Styles
 *
 * Copyright (c) 2001-present Qualiteam software Ltd. All rights reserved.
 * See https://www.x-cart.com/license-agreement.html for license details.
 */

//
// Tables
// --------------------------------------------------

// Baseline styles

.table {
  // Cells
  > thead,
  > tbody,
  > tfoot {
    > tr {
      > th,
      > td {
        border: 1px solid @table-border-color;
        font-size: @font-size-small;
      }
    }
  }
  // Bottom align for column headings
  > thead,
 > tbody,
 > tfoot {
    > tr > th {
        border-bottom: 1px solid @table-border-color;
        font-weight: normal;
        position: relative;
        #gradient > .vertical (@table-gradient-start-color, @table-gradient-end-color) !important;;
    }
    > tr > th:before {
        content: "";
        width: 100%;
        height: 1px;
        background: #ffffff;
        position: absolute;
        left: 0;
        top: 0;
    }
  }
  > tbody + tbody {
    border-top: 1px solid @table-border-color;
  }
}



// Bordered version
//
// Add borders all around the table and between all the columns.

.table-bordered {
  border: 1px solid @table-border-color;
  > thead,
  > tbody,
  > tfoot {
    > tr {
      > th,
      > td {
        border: 1px solid @table-border-color;
      }
    }
  }
  > thead > tr {
    > th,
    > td {
      border-bottom-width: 2px;
    }
  }
}


// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)

.table-striped {
  > tbody > tr:nth-child(odd) {
    > td,
    > th {
      background-color: @table-bg-accent;
    }
  }
}


// Hover effect
//
// Placed here since it has to come after the potential zebra striping

.table-hover {
  > tbody > tr:hover {
    > td,
    > th {
      background-color: @table-bg-hover;
    }
  }
}

// Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.

// Generate the contextual variants
.table-row-variant(active; @table-bg-active);
.table-row-variant(success; @state-success-bg);
.table-row-variant(info; @state-info-bg);
.table-row-variant(warning; @state-warning-bg);
.table-row-variant(danger; @state-danger-bg);
