@import "../../../../assets/scss/variables";
@import "../../../../assets/scss/mixins";

.ftm_table_cta {
  border-collapse: collapse;
  thead {
    tr {
      display: flex;
      th:nth-child(1) {
        flex-basis: 13.5%;
      }
      th:nth-child(2) {
        flex-basis: 40%;
      }
      th:nth-child(3) {
        flex-basis: 9.5%;
      }
    }
  }
  th {
    border-style: none;
    padding: 1em 2em 1em 1em;
    text-wrap: nowrap;
    background-color: var(--ftm-table-h-bg-color);
    color: var(--ftm-table-h-text-color);
    flex-grow: 1;
  }
  tr {
    > td:nth-child(1) {
      img {
        max-width: 100%;
        display: block;
        margin-left: auto;
        margin-right: auto;
      }
      strong {
        margin-left: 20px;
        margin-right: 20px;
        text-align: center;
      }
    }
  }
  tbody {
    > tr {
      position: relative;
      display: flex;
      &:hover {
        background: linear-gradient(
          70deg,
          var(--ftm-table-row-gradient-1) 0%,
          var(--ftm-table-row-gradient-2) 200%
        );
        td {
          a {
            button {
              color: var(--ftm-table-btn-txt-color-hv);
              background-color: var(--ftm-table-btn-bg-color-hv);
            }
          }
        }
      }
    }
    td {
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-self: stretch;
      ul {
        margin-top: 0.5em;
        margin-bottom: 0.5em;
      }
      a {
        button {
          color: var(--ftm-table-btn-txt-color);
          background-color: var(--ftm-table-btn-bg-color);
          border-radius: var(--ftm-table-btn-rad);
          padding: 15px;
          font-weight: bold;
          display: block;
          margin-left: auto;
          margin-right: auto;
          position: relative;
          &:hover {
            color: var(--ftm-table-btn-txt-color-hv);
            background-color: var(--ftm-table-btn-bg-color-hv);
          }
        }
      }
    }
  }

  tr:not(:first-child) {
    td:first-child {
      text-align: center;
    }
  }

  td:nth-child(1) {
    flex-basis: 13%;
  }

  td:nth-child(2) {
    flex-basis: 40%;
  }

  td:nth-child(3) {
    flex-basis: 9%;
  }

  td:nth-child(4) {
    padding: 0;
    border: 0px;
    position: absolute;
    left: 0;
    height: 100%;
    width: 100%;
    a {
      position: absolute;
      top: 0;
      width: 100%;
      height: 100%;
      &:hover {
        background: linear-gradient(
          70deg,
          var(--ftm-table-row-gradient-1) 0%,
          var(--ftm-table-row-gradient-2) 200%
        );
      }
    }
  }

  tr:not(:first-child) td:nth-child(2) ul {
    @media (max-width: $breakpoint-sm) {
      padding-left: 0%;
    }
  }

  @media (max-width: $breakpoint-sm) {
    tbody {
      > tr {
        flex-direction: column;
      }
    }

    td {
      display: block;

      &:last-child {
        margin-bottom: 3px;
        border-bottom: 2px solid #ccc;
      }
    }

    th:not(:first-child) {
      display: none;
    }
  }
}
