@import '../../style/themes/index';
@import '../../style/mixins/index';

.@{mk-prefix}-row {
  &-rtl {
    direction: rtl;
  }
}

.@{mk-prefix}-col {
  &&-rtl {
    float: right;
  }
}

// mixin
.loop-grid-columns(@index, @class) when (@index > 0) {
  .@{mk-prefix}-col@{class}-push-@{index} {
    // reset property in RTL direction
    &.@{mk-prefix}-col-rtl {
      right: percentage((@index / @grid-columns));
      left: auto;
    }
  }

  .@{mk-prefix}-col@{class}-pull-@{index} {
    // reset property in RTL direction
    &.@{mk-prefix}-col-rtl {
      right: auto;
      left: percentage((@index / @grid-columns));
    }
  }

  .@{mk-prefix}-col@{class}-offset-@{index} {
    // reset property in RTL direction
    &.@{mk-prefix}-col-rtl {
      margin-right: percentage((@index / @grid-columns));
      margin-left: 0;
    }
  }
}

.loop-grid-columns(@index, @class) when (@index = 0) {
  .@{mk-prefix}-col-push-@{index} {
    // reset property in RTL direction
    &.@{mk-prefix}-col-rtl {
      right: auto;
    }
  }

  .@{mk-prefix}-col-pull-@{index} {
    &.@{mk-prefix}-col-rtl {
      left: auto;
    }
  }

  .@{mk-prefix}-col@{class}-push-@{index} {
    &.@{mk-prefix}-col-rtl {
      right: auto;
    }
  }

  .@{mk-prefix}-col@{class}-pull-@{index} {
    &.@{mk-prefix}-col-rtl {
      left: auto;
    }
  }

  .@{mk-prefix}-col@{class}-offset-@{index} {
    &.@{mk-prefix}-col-rtl {
      margin-right: 0;
    }
  }
}
